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