]>
Commit | Line | Data |
---|---|---|
11497ff2 JK |
1 | |
2 | # TODO: | |
19395fb4 JK |
3 | # - test__core_stat.py fails on 32-bit builds with system libev |
4 | # investigate/fix that and enable system libev | |
5 | # | |
6 | # - investigate some other failing tests | |
5a77c3db | 7 | # (now excluded via known_failures-pld.patch) |
11497ff2 JK |
8 | |
9 | # Conditional build: | |
5a03dc88 JB |
10 | %bcond_without doc # Sphinx documentation |
11 | %bcond_without tests # testing | |
12 | %bcond_with system_libev # system libev [test__core_stat.py test fails] | |
13 | %bcond_without system_c_ares # system c_ares | |
4f53d0c0 JB |
14 | %bcond_without python2 # CPython 2.x module |
15 | %bcond_without python3 # CPython 3.x module | |
11497ff2 | 16 | |
4f53d0c0 JB |
17 | %define module gevent |
18 | Summary: A coroutine-based Python 2 networking library | |
19 | Summary(pl.UTF-8): Biblioteka sieciowa dla Pythona 2 oparta na korutynach | |
78f066e6 | 20 | Name: python-%{module} |
5a03dc88 JB |
21 | Version: 1.4.0 |
22 | Release: 1 | |
4fc6ecf8 | 23 | Epoch: 1 |
78f066e6 ER |
24 | License: MIT |
25 | Group: Development/Languages | |
5a03dc88 | 26 | #Source0Download: https://pypi.org/simple/gevent/ |
b845a2a9 | 27 | Source0: https://files.pythonhosted.org/packages/source/g/gevent/%{module}-%{version}.tar.gz |
5a03dc88 | 28 | # Source0-md5: 6b9dd98917061803d9158e5258b8f412 |
2fed4eba | 29 | Patch0: known_failures-pld.patch |
5a03dc88 | 30 | Patch1: %{name}-py3.8.patch |
2fed4eba | 31 | URL: http://www.gevent.org/ |
140cee97 | 32 | %{?with_system_c_ares:BuildRequires: c-ares-devel >= 1.10.0} |
4f53d0c0 | 33 | %{?with_system_libev:BuildRequires: libev-devel >= 4.23} |
06c1ffe6 | 34 | %if %{with python2} |
5a03dc88 JB |
35 | BuildRequires: python-Cython >= 0.29 |
36 | BuildRequires: python-cffi >= 1.11.5 | |
4f53d0c0 | 37 | BuildRequires: python-devel >= 1:2.7 |
a412afa7 | 38 | BuildRequires: python-greenlet-devel >= 0.4.15 |
7c3f7ce6 | 39 | %if %{with tests} |
4f53d0c0 JB |
40 | BuildRequires: python-coverage >= 4.0 |
41 | BuildRequires: python-devel-src >= 1:2.7 | |
5a03dc88 JB |
42 | BuildRequires: python-dns |
43 | BuildRequires: python-futures | |
a412afa7 | 44 | BuildRequires: python-greenlet >= 0.4.15 |
5a03dc88 | 45 | BuildRequires: python-mock |
cf0d448b | 46 | BuildRequires: python-objgraph |
5a03dc88 JB |
47 | BuildRequires: python-psutil |
48 | BuildRequires: python-requests | |
49 | BuildRequires: python-setuptools >= 1:24.2.0 | |
73d3206b | 50 | BuildRequires: python-test |
5a03dc88 JB |
51 | BuildRequires: python-zope.event |
52 | BuildRequires: python-zope.interface | |
06c1ffe6 AM |
53 | %endif |
54 | %endif | |
55 | %if %{with python3} | |
5a03dc88 JB |
56 | BuildRequires: python3-Cython >= 0.29 |
57 | BuildRequires: python3-cffi >= 1.11.5 | |
58 | BuildRequires: python3-devel >= 1:3.4 | |
a412afa7 | 59 | BuildRequires: python3-greenlet-devel >= 0.4.15 |
06c1ffe6 | 60 | %if %{with tests} |
4f53d0c0 | 61 | BuildRequires: python3-coverage >= 4.0 |
5a03dc88 JB |
62 | BuildRequires: python3-dns |
63 | BuildRequires: python3-greenlet >= 0.4.15 | |
cf0d448b | 64 | BuildRequires: python3-objgraph |
5a03dc88 JB |
65 | BuildRequires: python3-psutil |
66 | BuildRequires: python3-requests | |
67 | BuildRequires: python3-setuptools >= 1:24.2.0 | |
06c1ffe6 | 68 | BuildRequires: python3-test |
5a03dc88 JB |
69 | BuildRequires: python3-zope.event |
70 | BuildRequires: python3-zope.interface | |
06c1ffe6 | 71 | %endif |
7c3f7ce6 | 72 | %endif |
78f066e6 | 73 | BuildRequires: rpm-pythonprov |
4f53d0c0 | 74 | BuildRequires: rpmbuild(macros) >= 1.714 |
5a03dc88 JB |
75 | %if %{with doc} |
76 | BuildRequires: python3-repoze.sphinx.autointerface | |
77 | BuildRequires: sphinx-pdg | |
78 | %endif | |
4f53d0c0 | 79 | %{?with_system_libev:Requires: libev >= 4.23} |
a412afa7 | 80 | Requires: python-greenlet >= 0.4.15 |
78f066e6 | 81 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
71c03694 ER |
82 | |
83 | %description | |
4f53d0c0 JB |
84 | gevent is a coroutine-based Python networking library. Features |
85 | include: | |
06c1ffe6 AM |
86 | - Fast event loop based on libev. |
87 | - Lightweight execution units based on greenlet. | |
88 | - Familiar API that re-uses concepts from the Python standard library. | |
89 | - Cooperative sockets with SSL support. | |
90 | - DNS queries performed through c-ares or a threadpool. | |
91 | - Ability to use standard library and 3rd party modules written for | |
4f53d0c0 JB |
92 | standard blocking sockets. |
93 | ||
94 | %description -l pl.UTF-8 | |
95 | gevent to biblioteka sieciowa dla Pythona oparta na korutynach. Jej | |
96 | możliwości to m.in. | |
97 | - szybka pętla zdarzeń oparta na libev | |
98 | - lekkie jednostki wykonywania oparte na bibliotece greenlet | |
99 | - znajome API wykorzystujące koncepty biblioteki standardowej Pythona | |
100 | - gniazda kooperatywne z obsługą SSL | |
101 | - zapytania DNS wykonywane przez bibliotekę c-ares lub pulę wątków | |
102 | - możliwość wykorzystania biblioteki standardowej lub modułów innych | |
103 | producentów napisanych dla standardowych gniazd blokujących | |
06c1ffe6 AM |
104 | |
105 | %package -n python3-%{module} | |
4f53d0c0 JB |
106 | Summary: A coroutine-based Python 3 networking library |
107 | Summary(pl.UTF-8): Biblioteka sieciowa dla Pythona 3 oparta na korutynach | |
06c1ffe6 | 108 | Group: Libraries/Python |
4f53d0c0 | 109 | %{?with_system_libev:Requires: libev >= 4.23} |
a412afa7 | 110 | Requires: python-greenlet >= 0.4.15 |
06c1ffe6 AM |
111 | |
112 | %description -n python3-%{module} | |
4f53d0c0 JB |
113 | gevent is a coroutine-based Python networking library. Features |
114 | include: | |
282f7bb0 JK |
115 | - Fast event loop based on libev. |
116 | - Lightweight execution units based on greenlet. | |
117 | - Familiar API that re-uses concepts from the Python standard library. | |
118 | - Cooperative sockets with SSL support. | |
119 | - DNS queries performed through c-ares or a threadpool. | |
120 | - Ability to use standard library and 3rd party modules written for | |
6c017ba8 | 121 | standard blocking sockets |
71c03694 | 122 | |
4f53d0c0 JB |
123 | %description -n python3-%{module} -l pl.UTF-8 |
124 | gevent to biblioteka sieciowa dla Pythona oparta na korutynach. Jej | |
125 | możliwości to m.in. | |
126 | - szybka pętla zdarzeń oparta na libev | |
127 | - lekkie jednostki wykonywania oparte na bibliotece greenlet | |
128 | - znajome API wykorzystujące koncepty biblioteki standardowej Pythona | |
129 | - gniazda kooperatywne z obsługą SSL | |
130 | - zapytania DNS wykonywane przez bibliotekę c-ares lub pulę wątków | |
131 | - możliwość wykorzystania biblioteki standardowej lub modułów innych | |
132 | producentów napisanych dla standardowych gniazd blokujących | |
133 | ||
5a03dc88 JB |
134 | %package apidocs |
135 | Summary: API documentation for Python gevent module | |
136 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona gevent | |
137 | Group: Documentation | |
138 | ||
139 | %description apidocs | |
140 | API documentation for Python gevent module. | |
141 | ||
142 | %description apidocs -l pl.UTF-8 | |
143 | Dokumentacja API modułu Pythona gevent. | |
144 | ||
71c03694 ER |
145 | %prep |
146 | %setup -q -n %{module}-%{version} | |
2fed4eba | 147 | %patch0 -p1 |
5a03dc88 | 148 | %patch1 -p1 |
11497ff2 | 149 | |
5a03dc88 | 150 | find . -type f -name '*.orig' | xargs -r %{__rm} |
a412afa7 JK |
151 | |
152 | # force rebuild of Cython-generated files | |
153 | # they depend on specific deps (e.g. greenlet) versions | |
5a03dc88 | 154 | %{__rm} src/gevent/{*.c,resolver/cares.c} |
282f7bb0 | 155 | |
5a03dc88 | 156 | %build |
4f53d0c0 JB |
157 | # must be exported to work (py*_build macro is not single invocation) |
158 | %{?with_system_libev:export LIBEV_EMBED=false} | |
159 | %{?with_system_c_ares:export CARES_EMBED=false} | |
160 | ||
06c1ffe6 | 161 | %if %{with python2} |
37c131a9 | 162 | %py_build |
71c03694 | 163 | |
31e6d75d | 164 | %if %{with tests} |
5a03dc88 JB |
165 | PYTHONPATH=$(echo $PWD/build-2/lib.*) \ |
166 | %{__python} -m gevent.tests | |
31e6d75d | 167 | %endif |
06c1ffe6 AM |
168 | %endif |
169 | ||
170 | %if %{with python3} | |
37c131a9 | 171 | %py3_build |
06c1ffe6 AM |
172 | |
173 | %if %{with tests} | |
5a03dc88 JB |
174 | PYTHONPATH=$(echo $PWD/build-3/lib.*) \ |
175 | %{__python3} -m gevent.tests | |
06c1ffe6 AM |
176 | %endif |
177 | %endif | |
31e6d75d | 178 | |
5a03dc88 JB |
179 | %if %{with doc} |
180 | PYTHONPATH=$(echo $PWD/build-2/lib.*) \ | |
181 | %{__make} -C doc html \ | |
182 | SPHINXBUILD=sphinx-build-2 | |
183 | %endif | |
184 | ||
71c03694 ER |
185 | %install |
186 | rm -rf $RPM_BUILD_ROOT | |
282f7bb0 | 187 | |
4f53d0c0 JB |
188 | %{?with_system_libev:export LIBEV_EMBED=false} |
189 | %{?with_system_c_ares:export CARES_EMBED=false} | |
190 | ||
06c1ffe6 | 191 | %if %{with python2} |
37c131a9 | 192 | %py_install |
71c03694 ER |
193 | |
194 | %py_postclean | |
5a03dc88 JB |
195 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/gevent/*.{c,html} |
196 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/gevent/*/*.{c,h,html,pyx} | |
197 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/gevent/{testing,tests} | |
06c1ffe6 AM |
198 | %endif |
199 | ||
200 | %if %{with python3} | |
37c131a9 | 201 | %py3_install |
4f53d0c0 | 202 | |
5a03dc88 JB |
203 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/gevent/*.{c,html} |
204 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/gevent/*/*.{c,h,html,pyx} | |
205 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/gevent/{testing,tests} | |
06c1ffe6 | 206 | %endif |
71c03694 ER |
207 | |
208 | %clean | |
209 | rm -rf $RPM_BUILD_ROOT | |
210 | ||
06c1ffe6 | 211 | %if %{with python2} |
71c03694 ER |
212 | %files |
213 | %defattr(644,root,root,755) | |
5a03dc88 | 214 | %doc AUTHORS CHANGES.rst LICENSE NOTICE README.rst TODO |
4f53d0c0 | 215 | %dir %{py_sitedir}/gevent |
cf0d448b | 216 | %attr(755,root,root) %{py_sitedir}/gevent/*.so |
4f53d0c0 JB |
217 | %{py_sitedir}/gevent/*.pxd |
218 | %{py_sitedir}/gevent/*.py[co] | |
cf0d448b AM |
219 | %dir %{py_sitedir}/gevent/_ffi |
220 | %{py_sitedir}/gevent/_ffi/*.py[co] | |
4f53d0c0 JB |
221 | %dir %{py_sitedir}/gevent/libev |
222 | %attr(755,root,root) %{py_sitedir}/gevent/libev/_corecffi.so | |
223 | %attr(755,root,root) %{py_sitedir}/gevent/libev/corecext.so | |
224 | %{py_sitedir}/gevent/libev/libev.pxd | |
225 | %{py_sitedir}/gevent/libev/*.py[co] | |
cf0d448b AM |
226 | %dir %{py_sitedir}/gevent/libuv |
227 | %{py_sitedir}/gevent/libuv/*.py[co] | |
228 | %attr(755,root,root) %{py_sitedir}/gevent/libuv/_corecffi.so | |
229 | %dir %{py_sitedir}/gevent/resolver | |
230 | %{py_sitedir}/gevent/resolver/libcares.pxd | |
231 | %{py_sitedir}/gevent/resolver/*.py[co] | |
232 | %attr(755,root,root) %{py_sitedir}/gevent/resolver/cares.so | |
4f53d0c0 | 233 | %{py_sitedir}/gevent-%{version}-py%{py_ver}.egg-info |
06c1ffe6 AM |
234 | %endif |
235 | ||
236 | %if %{with python3} | |
237 | %files -n python3-%{module} | |
238 | %defattr(644,root,root,755) | |
5a03dc88 | 239 | %doc AUTHORS CHANGES.rst LICENSE NOTICE README.rst TODO |
4f53d0c0 | 240 | %dir %{py3_sitedir}/gevent |
cf0d448b | 241 | %attr(755,root,root) %{py3_sitedir}/gevent/*.cpython-*.so |
4f53d0c0 JB |
242 | %{py3_sitedir}/gevent/__pycache__ |
243 | %{py3_sitedir}/gevent/*.pxd | |
244 | %{py3_sitedir}/gevent/*.py | |
cf0d448b AM |
245 | %dir %{py3_sitedir}/gevent/_ffi |
246 | %{py3_sitedir}/gevent/_ffi/__pycache__ | |
247 | %{py3_sitedir}/gevent/_ffi/*.py | |
248 | %dir %{py3_sitedir}/gevent/libuv | |
249 | %{py3_sitedir}/gevent/libuv/__pycache__ | |
250 | %{py3_sitedir}/gevent/libuv/*.py | |
251 | %attr(755,root,root) %{py3_sitedir}/gevent/libuv/_corecffi.*.so | |
4f53d0c0 | 252 | %dir %{py3_sitedir}/gevent/libev |
25ec3431 | 253 | %attr(755,root,root) %{py3_sitedir}/gevent/libev/_corecffi.abi3.so |
e2766a93 | 254 | %attr(755,root,root) %{py3_sitedir}/gevent/libev/corecext.cpython-*.so |
4f53d0c0 JB |
255 | %{py3_sitedir}/gevent/libev/__pycache__ |
256 | %{py3_sitedir}/gevent/libev/libev.pxd | |
257 | %{py3_sitedir}/gevent/libev/*.py | |
cf0d448b AM |
258 | %dir %{py3_sitedir}/gevent/resolver |
259 | %{py3_sitedir}/gevent/resolver/__pycache__ | |
260 | %{py3_sitedir}/gevent/resolver/*.py | |
261 | %{py3_sitedir}/gevent/resolver/libcares.pxd | |
262 | %attr(755,root,root) %{py3_sitedir}/gevent/resolver/cares.*.so | |
4f53d0c0 | 263 | %{py3_sitedir}/gevent-%{version}-py*.egg-info |
06c1ffe6 | 264 | %endif |
5a03dc88 JB |
265 | |
266 | %if %{with doc} | |
267 | %files apidocs | |
268 | %defattr(644,root,root,755) | |
269 | %doc doc/_build/html/{_modules,_static,api,examples,*.html,*.js} | |
270 | %endif |