]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | %bcond_without apidocs # Sphinx documentation | |
6 | %bcond_with tests # test suite (SLOOOOW) | |
7 | ||
8 | %define module Cython | |
9 | ||
10 | Summary: Language for writing Python Extension Modules (Python 2.x version) | |
11 | Summary(pl.UTF-8): Język służący do pisania modułów rozszerzających Pythona (wersja dla Pythona 2.x) | |
12 | Name: python-%{module} | |
13 | Version: 0.29.14 | |
14 | Release: 1 | |
15 | License: Apache v2.0 | |
16 | Group: Libraries/Python | |
17 | #Source0Download: https://pypi.org/simple/cython/ | |
18 | Source0: https://files.pythonhosted.org/packages/source/c/cython/%{module}-%{version}.tar.gz | |
19 | # Source0-md5: 6e2f139e30bb08d68366f9370d87964c | |
20 | URL: http://cython.org/ | |
21 | BuildRequires: rpmbuild(macros) >= 1.714 | |
22 | %if %{with python2} | |
23 | BuildRequires: python >= 1:2.6 | |
24 | BuildRequires: python-devel >= 1:2.6 | |
25 | BuildRequires: python-setuptools | |
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3 >= 1:3.3 | |
29 | BuildRequires: python3-devel >= 1:3.3 | |
30 | BuildRequires: python3-setuptools | |
31 | %endif | |
32 | BuildRequires: rpm-pythonprov | |
33 | %{?with_apidocs:BuildRequires: sphinx-pdg} | |
34 | Requires: python-devel >= 1:2.6 | |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %define _noautocompressdoc *.c | |
38 | ||
39 | %description | |
40 | Cython lets you write code that mixes Python and C data types any way | |
41 | you want, and compiles it into a C extension for Python. Cython is | |
42 | based on Pyrex. | |
43 | ||
44 | This package contains Cython module for Python 2.x. | |
45 | ||
46 | %description -l pl.UTF-8 | |
47 | Cython pozwala pisać kod zawierający dane Pythona i języka C połączone | |
48 | w jakikolwiek sposób i kompiluje to jako rozszerzenie C dla Pythona. | |
49 | Cython jest oparty na Pyreksie. | |
50 | ||
51 | Ten pakiet zawiera moduł Cython dla Pythona 2.x. | |
52 | ||
53 | %package -n python3-Cython | |
54 | Summary: Language for writing Python Extension Modules (Python 3.x version) | |
55 | Summary(pl.UTF-8): Język służący do pisania modułów rozszerzających Pythona (wersja dla Pythona 3.x) | |
56 | Group: Libraries/Python | |
57 | Requires: python3-devel >= 1:3.3 | |
58 | ||
59 | %description -n python3-Cython | |
60 | Cython lets you write code that mixes Python and C data types any way | |
61 | you want, and compiles it into a C extension for Python. Cython is | |
62 | based on Pyrex. | |
63 | ||
64 | This package contains Cython module for Python 3.x. | |
65 | ||
66 | %description -n python3-Cython -l pl.UTF-8 | |
67 | Pyrex pozwala pisać kod zawierający dane Pythona i języka C połączone | |
68 | w jakikolwiek sposób i kompiluje to jako rozszerzenie C dla Pythona. | |
69 | Cython jest oparty na Pyreksie. | |
70 | ||
71 | Ten pakiet zawiera moduł Cython dla Pythona 3.x. | |
72 | ||
73 | %package apidocs | |
74 | Summary: API documentation for Cython module | |
75 | Summary(pl.UTF-8): Dokumentacja API modułu Cython | |
76 | Group: Documentation | |
77 | ||
78 | %description apidocs | |
79 | API documentation for Cython module. | |
80 | ||
81 | %description apidocs -l pl.UTF-8 | |
82 | Dokumentacja API modułu Cython. | |
83 | ||
84 | %package examples | |
85 | Summary: Examples for Cython language | |
86 | Summary(pl.UTF-8): Przykłady programów w języku Cython | |
87 | Group: Libraries/Python | |
88 | Obsoletes: python3-Cython-examples | |
89 | ||
90 | %description examples | |
91 | This package contains example programs for Cython language. | |
92 | ||
93 | %description examples -l pl.UTF-8 | |
94 | Pakiet zawierający przykładowe programy napisane w języku Cython. | |
95 | ||
96 | %prep | |
97 | %setup -q -n %{module}-%{version} | |
98 | ||
99 | %build | |
100 | %if %{with python2} | |
101 | %py_build | |
102 | ||
103 | %if %{with tests} | |
104 | %{__python} runtests.py | |
105 | %endif | |
106 | %endif | |
107 | ||
108 | %if %{with python3} | |
109 | %py3_build | |
110 | ||
111 | %if %{with tests} | |
112 | %{__python3} runtests.py | |
113 | %endif | |
114 | %endif | |
115 | ||
116 | %if %{with apidocs} | |
117 | %{__make} -C docs html | |
118 | %endif | |
119 | ||
120 | %install | |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
123 | ||
124 | %if %{with python3} | |
125 | %py3_install | |
126 | ||
127 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/cython{,3} | |
128 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/cythonize{,3} | |
129 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/cygdb{,3} | |
130 | %endif | |
131 | ||
132 | %if %{with python2} | |
133 | %py_install | |
134 | ||
135 | find $RPM_BUILD_ROOT%{py_sitedir} -name "*.py" -a ! -name 'Lexicon.py' -exec rm -f {} \; | |
136 | %endif | |
137 | ||
138 | cp -a Demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
139 | ||
140 | %clean | |
141 | rm -rf $RPM_BUILD_ROOT | |
142 | ||
143 | %if %{with python2} | |
144 | %files | |
145 | %defattr(644,root,root,755) | |
146 | %doc CHANGES.rst COPYING.txt README.rst ToDo.txt USAGE.txt | |
147 | %attr(755,root,root) %{_bindir}/cython | |
148 | %attr(755,root,root) %{_bindir}/cythonize | |
149 | %attr(755,root,root) %{_bindir}/cygdb | |
150 | %{py_sitedir}/cython.py[co] | |
151 | %{py_sitedir}/Cython | |
152 | %{py_sitedir}/pyximport | |
153 | %{py_sitedir}/Cython-%{version}-py*.egg-info | |
154 | %endif | |
155 | ||
156 | %if %{with python3} | |
157 | %files -n python3-Cython | |
158 | %defattr(644,root,root,755) | |
159 | %doc CHANGES.rst COPYING.txt README.rst ToDo.txt USAGE.txt | |
160 | %attr(755,root,root) %{_bindir}/cython3 | |
161 | %attr(755,root,root) %{_bindir}/cythonize3 | |
162 | %attr(755,root,root) %{_bindir}/cygdb3 | |
163 | %{py3_sitedir}/cython.py | |
164 | %{py3_sitedir}/__pycache__/cython.* | |
165 | %{py3_sitedir}/Cython | |
166 | %{py3_sitedir}/pyximport | |
167 | %{py3_sitedir}/Cython-%{version}-py*.egg-info | |
168 | %endif | |
169 | ||
170 | %if %{with apidocs} | |
171 | %files apidocs | |
172 | %defattr(644,root,root,755) | |
173 | %doc docs/build/html/{_images,_static,src,*.html,*.js} | |
174 | %endif | |
175 | ||
176 | %files examples | |
177 | %defattr(644,root,root,755) | |
178 | %{_examplesdir}/%{name}-%{version} |