]> git.pld-linux.org Git - packages/python-gevent.git/blob - python-gevent.spec
479996bfde5ec9e618edfc6ff28d99159bd645f4
[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_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
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:        1.4.0
22 Release:        1
23 Epoch:          1
24 License:        MIT
25 Group:          Development/Languages
26 #Source0Download: https://pypi.org/simple/gevent/
27 Source0:        https://files.pythonhosted.org/packages/source/g/gevent/%{module}-%{version}.tar.gz
28 # Source0-md5:  6b9dd98917061803d9158e5258b8f412
29 Patch0:         known_failures-pld.patch
30 Patch1:         %{name}-py3.8.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.11.5
37 BuildRequires:  python-devel >= 1:2.7
38 BuildRequires:  python-greenlet-devel >= 0.4.15
39 %if %{with tests}
40 BuildRequires:  python-coverage >= 4.0
41 BuildRequires:  python-devel-src >= 1:2.7
42 BuildRequires:  python-dns
43 BuildRequires:  python-futures
44 BuildRequires:  python-greenlet >= 0.4.15
45 BuildRequires:  python-mock
46 BuildRequires:  python-objgraph
47 BuildRequires:  python-psutil
48 BuildRequires:  python-requests
49 BuildRequires:  python-setuptools >= 1:24.2.0
50 BuildRequires:  python-test
51 BuildRequires:  python-zope.event
52 BuildRequires:  python-zope.interface
53 %endif
54 %endif
55 %if %{with python3}
56 BuildRequires:  python3-Cython >= 0.29
57 BuildRequires:  python3-cffi >= 1.11.5
58 BuildRequires:  python3-devel >= 1:3.4
59 BuildRequires:  python3-greenlet-devel >= 0.4.15
60 %if %{with tests}
61 BuildRequires:  python3-coverage >= 4.0
62 BuildRequires:  python3-dns
63 BuildRequires:  python3-greenlet >= 0.4.15
64 BuildRequires:  python3-objgraph
65 BuildRequires:  python3-psutil
66 BuildRequires:  python3-requests
67 BuildRequires:  python3-setuptools >= 1:24.2.0
68 BuildRequires:  python3-test
69 BuildRequires:  python3-zope.event
70 BuildRequires:  python3-zope.interface
71 %endif
72 %endif
73 BuildRequires:  rpm-pythonprov
74 BuildRequires:  rpmbuild(macros) >= 1.714
75 %if %{with doc}
76 BuildRequires:  python3-repoze.sphinx.autointerface
77 BuildRequires:  sphinx-pdg-3
78 %endif
79 %{?with_system_libev:Requires:  libev >= 4.23}
80 Requires:       python-greenlet >= 0.4.15
81 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
82
83 %description
84 gevent is a coroutine-based Python networking library. Features
85 include:
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
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
104
105 %package -n python3-%{module}
106 Summary:        A coroutine-based Python 3 networking library
107 Summary(pl.UTF-8):      Biblioteka sieciowa dla Pythona 3 oparta na korutynach
108 Group:          Libraries/Python
109 %{?with_system_libev:Requires:  libev >= 4.23}
110 Requires:       python-greenlet >= 0.4.15
111
112 %description -n python3-%{module}
113 gevent is a coroutine-based Python networking library. Features
114 include:
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
121   standard blocking sockets
122
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
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
145 %prep
146 %setup -q -n %{module}-%{version}
147 %patch0 -p1
148 %patch1 -p1
149
150 find . -type f -name '*.orig' | xargs -r %{__rm}
151
152 # force rebuild of Cython-generated files
153 # they depend on specific deps (e.g. greenlet) versions
154 %{__rm} src/gevent/{*.c,resolver/cares.c}
155
156 %build
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
161 %if %{with python2}
162 %py_build
163
164 %if %{with tests}
165 PYTHONPATH=$(echo $PWD/build-2/lib.*) \
166 %{__python} -m gevent.tests
167 %endif
168 %endif
169
170 %if %{with python3}
171 %py3_build
172
173 %if %{with tests}
174 PYTHONPATH=$(echo $PWD/build-3/lib.*) \
175 %{__python3} -m gevent.tests
176 %endif
177 %endif
178
179 %if %{with doc}
180 PYTHONPATH=$(echo $PWD/build-3/lib.*) \
181 %{__make} -C doc html \
182         SPHINXBUILD=sphinx-build-3
183 %endif
184
185 %install
186 rm -rf $RPM_BUILD_ROOT
187
188 %{?with_system_libev:export LIBEV_EMBED=false}
189 %{?with_system_c_ares:export CARES_EMBED=false}
190
191 %if %{with python2}
192 %py_install
193
194 %py_postclean
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}
198 %endif
199
200 %if %{with python3}
201 %py3_install
202
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}
206 %endif
207
208 %clean
209 rm -rf $RPM_BUILD_ROOT
210
211 %if %{with python2}
212 %files
213 %defattr(644,root,root,755)
214 %doc AUTHORS CHANGES.rst LICENSE NOTICE README.rst TODO
215 %dir %{py_sitedir}/gevent
216 %attr(755,root,root) %{py_sitedir}/gevent/*.so
217 %{py_sitedir}/gevent/*.pxd
218 %{py_sitedir}/gevent/*.py[co]
219 %dir %{py_sitedir}/gevent/_ffi
220 %{py_sitedir}/gevent/_ffi/*.py[co]
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]
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
233 %{py_sitedir}/gevent-%{version}-py%{py_ver}.egg-info
234 %endif
235
236 %if %{with python3}
237 %files -n python3-%{module}
238 %defattr(644,root,root,755)
239 %doc AUTHORS CHANGES.rst LICENSE NOTICE README.rst TODO
240 %dir %{py3_sitedir}/gevent
241 %attr(755,root,root) %{py3_sitedir}/gevent/*.cpython-*.so
242 %{py3_sitedir}/gevent/__pycache__
243 %{py3_sitedir}/gevent/*.pxd
244 %{py3_sitedir}/gevent/*.py
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
252 %dir %{py3_sitedir}/gevent/libev
253 %attr(755,root,root) %{py3_sitedir}/gevent/libev/_corecffi.abi3.so
254 %attr(755,root,root) %{py3_sitedir}/gevent/libev/corecext.cpython-*.so
255 %{py3_sitedir}/gevent/libev/__pycache__
256 %{py3_sitedir}/gevent/libev/libev.pxd
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 %{py3_sitedir}/gevent/resolver/libcares.pxd
262 %attr(755,root,root) %{py3_sitedir}/gevent/resolver/cares.*.so
263 %{py3_sitedir}/gevent-%{version}-py*.egg-info
264 %endif
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
This page took 0.088308 seconds and 2 git commands to generate.