]> git.pld-linux.org Git - packages/python-gevent.git/blob - python-gevent.spec
rebuild with tests and docs
[packages/python-gevent.git] / python-gevent.spec
1
2 # TODO:
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
7 #         (now excluded via known_failures-pld.patch)
8
9 # Conditional build:
10 %bcond_without  doc             # Sphinx documentation
11 %bcond_with     tests           # testing
12 %bcond_with     system_libev    # system libev [test__core_stat.py test fails]
13 %bcond_without  system_c_ares   # system c_ares
14 %bcond_without  python2         # CPython 2.x module
15 %bcond_without  python3         # CPython 3.x module
16
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
20 Name:           python-%{module}
21 Version:        21.12.0
22 Release:        4
23 Epoch:          1
24 License:        MIT
25 Group:          Libraries/Python
26 #Source0Download: https://pypi.org/simple/gevent/
27 Source0:        https://files.pythonhosted.org/packages/source/g/gevent/%{module}-%{version}.tar.gz
28 # Source0-md5:  84014946a25407706cbe9ecb088f1e9c
29 Patch0:         %{name}-sphinx-python3.patch
30 Patch1:         known_failures-pld.patch
31 URL:            http://www.gevent.org/
32 %{?with_system_c_ares:BuildRequires:    c-ares-devel >= 1.10.0}
33 %{?with_system_libev:BuildRequires:     libev-devel >= 4.23}
34 %if %{with python2}
35 BuildRequires:  python-Cython >= 0.29
36 BuildRequires:  python-cffi >= 1.12.2
37 BuildRequires:  python-devel >= 1:2.7
38 BuildRequires:  python-greenlet-devel >= 1.1.0
39 BuildRequires:  python-greenlet-devel < 2
40 BuildRequires:  python-setuptools >= 1:24.2.0
41 %if %{with tests}
42 BuildRequires:  python-coverage >= 4.0
43 BuildRequires:  python-devel-src >= 1:2.7
44 BuildRequires:  python-dns >= 1.16.0
45 BuildRequires:  python-dns < 2
46 BuildRequires:  python-futures
47 BuildRequires:  python-greenlet >= 1.1.0
48 BuildRequires:  python-greenlet < 2
49 BuildRequires:  python-idna
50 BuildRequires:  python-mock
51 BuildRequires:  python-objgraph
52 BuildRequires:  python-psutil >= 5.7.0
53 BuildRequires:  python-requests
54 BuildRequires:  python-test
55 BuildRequires:  python-zope.event
56 BuildRequires:  python-zope.interface
57 %endif
58 %endif
59 %if %{with python3}
60 BuildRequires:  python3-Cython >= 0.29
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
66 %if %{with tests}
67 BuildRequires:  python3-coverage >= 4.0
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
73 BuildRequires:  python3-objgraph
74 BuildRequires:  python3-psutil >= 5.7.0
75 BuildRequires:  python3-requests
76 BuildRequires:  python3-test
77 BuildRequires:  python3-zope.event
78 BuildRequires:  python3-zope.interface
79 %endif
80 %endif
81 BuildRequires:  rpm-pythonprov
82 BuildRequires:  rpmbuild(macros) >= 1.714
83 %if %{with doc}
84 BuildRequires:  python3-repoze.sphinx.autointerface
85 BuildRequires:  python3-sphinxcontrib-programoutput
86 BuildRequires:  sphinx-pdg-3
87 %endif
88 %{?with_system_libev:Requires:  libev >= 4.23}
89 Requires:       python-greenlet >= 1.1.0
90 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
91
92 %description
93 gevent is a coroutine-based Python networking library. Features
94 include:
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
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
113
114 %package -n python3-%{module}
115 Summary:        A coroutine-based Python 3 networking library
116 Summary(pl.UTF-8):      Biblioteka sieciowa dla Pythona 3 oparta na korutynach
117 Group:          Libraries/Python
118 %{?with_system_libev:Requires:  libev >= 4.23}
119 Requires:       python-greenlet >= 1.1.0
120
121 %description -n python3-%{module}
122 gevent is a coroutine-based Python networking library. Features
123 include:
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
130   standard blocking sockets
131
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
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
154 %prep
155 %setup -q -n %{module}-%{version}
156 %patch0 -p1
157 #%patch1 -p1
158
159 find . -type f -name '*.orig' | xargs -r %{__rm}
160
161 # force rebuild of Cython-generated files
162 # they depend on specific deps (e.g. greenlet) versions
163 %{__rm} src/gevent/{*.c,resolver/cares.c}
164
165 %build
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
170 %if %{with python2}
171 %py_build
172
173 %if %{with tests}
174 PYTHONPATH=$(echo $PWD/build-2/lib.*) \
175 %{__python} -m gevent.tests
176 %endif
177 %endif
178
179 %if %{with python3}
180 %py3_build
181
182 %if %{with tests}
183 PYTHONPATH=$(echo $PWD/build-3/lib.*) \
184 %{__python3} -m gevent.tests
185 %endif
186 %endif
187
188 %if %{with doc}
189 PYTHONPATH=$(echo $PWD/build-3/lib.*) \
190 %{__make} -C docs html \
191         SPHINXBUILD=sphinx-build-3
192 %endif
193
194 %install
195 rm -rf $RPM_BUILD_ROOT
196
197 %{?with_system_libev:export LIBEV_EMBED=false}
198 %{?with_system_c_ares:export CARES_EMBED=false}
199
200 %if %{with python2}
201 %py_install
202
203 %py_postclean
204 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/gevent/{testing,tests}
205 %endif
206
207 %if %{with python3}
208 %py3_install
209
210 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/gevent/{testing,tests}
211 %endif
212
213 %clean
214 rm -rf $RPM_BUILD_ROOT
215
216 %if %{with python2}
217 %files
218 %defattr(644,root,root,755)
219 %doc AUTHORS CHANGES.rst LICENSE NOTICE README.rst TODO
220 %dir %{py_sitedir}/gevent
221 %attr(755,root,root) %{py_sitedir}/gevent/*.so
222 %{py_sitedir}/gevent/*.py[co]
223 %dir %{py_sitedir}/gevent/_ffi
224 %{py_sitedir}/gevent/_ffi/*.py[co]
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
228 %{py_sitedir}/gevent/libev/*.py[co]
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
233 %{py_sitedir}/gevent/resolver/*.py[co]
234 %attr(755,root,root) %{py_sitedir}/gevent/resolver/cares.so
235 %{py_sitedir}/gevent-%{version}-py%{py_ver}.egg-info
236 %endif
237
238 %if %{with python3}
239 %files -n python3-%{module}
240 %defattr(644,root,root,755)
241 %doc AUTHORS CHANGES.rst LICENSE NOTICE README.rst TODO
242 %dir %{py3_sitedir}/gevent
243 %attr(755,root,root) %{py3_sitedir}/gevent/*.cpython-*.so
244 %{py3_sitedir}/gevent/__pycache__
245 %{py3_sitedir}/gevent/*.py
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
253 %dir %{py3_sitedir}/gevent/libev
254 %attr(755,root,root) %{py3_sitedir}/gevent/libev/_corecffi.abi3.so
255 %attr(755,root,root) %{py3_sitedir}/gevent/libev/corecext.cpython-*.so
256 %{py3_sitedir}/gevent/libev/__pycache__
257 %{py3_sitedir}/gevent/libev/*.py
258 %dir %{py3_sitedir}/gevent/resolver
259 %{py3_sitedir}/gevent/resolver/__pycache__
260 %{py3_sitedir}/gevent/resolver/*.py
261 %attr(755,root,root) %{py3_sitedir}/gevent/resolver/cares.*.so
262 %{py3_sitedir}/gevent-%{version}-py*.egg-info
263 %endif
264
265 %if %{with doc}
266 %files apidocs
267 %defattr(644,root,root,755)
268 %doc docs/_build/html/{_modules,_static,api,development,examples,*.html,*.js}
269 %endif
This page took 0.11504 seconds and 4 git commands to generate.