]> git.pld-linux.org Git - packages/python-gevent.git/blob - python-gevent.spec
27dd2544a20a96e72f1914a5de6d9381a56269a7
[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.8.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:  cd15fb75e67892514fbba2111af5cd50
29 Patch0:         known_failures-pld.patch
30 URL:            http://www.gevent.org/
31 %{?with_system_c_ares:BuildRequires:    c-ares-devel >= 1.10.0}
32 %{?with_system_libev:BuildRequires:     libev-devel >= 4.23}
33 %if %{with python2}
34 BuildRequires:  python-Cython >= 0.29
35 BuildRequires:  python-cffi >= 1.11.5
36 BuildRequires:  python-devel >= 1:2.7
37 BuildRequires:  python-greenlet-devel >= 0.4.15
38 %if %{with tests}
39 BuildRequires:  python-coverage >= 4.0
40 BuildRequires:  python-devel-src >= 1:2.7
41 BuildRequires:  python-dns
42 BuildRequires:  python-futures
43 BuildRequires:  python-greenlet >= 0.4.15
44 BuildRequires:  python-mock
45 BuildRequires:  python-objgraph
46 BuildRequires:  python-psutil
47 BuildRequires:  python-requests
48 BuildRequires:  python-setuptools >= 1:24.2.0
49 BuildRequires:  python-test
50 BuildRequires:  python-zope.event
51 BuildRequires:  python-zope.interface
52 %endif
53 %endif
54 %if %{with python3}
55 BuildRequires:  python3-Cython >= 0.29
56 BuildRequires:  python3-cffi >= 1.11.5
57 BuildRequires:  python3-devel >= 1:3.4
58 BuildRequires:  python3-greenlet-devel >= 0.4.15
59 %if %{with tests}
60 BuildRequires:  python3-coverage >= 4.0
61 BuildRequires:  python3-dns
62 BuildRequires:  python3-greenlet >= 0.4.15
63 BuildRequires:  python3-objgraph
64 BuildRequires:  python3-psutil
65 BuildRequires:  python3-requests
66 BuildRequires:  python3-setuptools >= 1:24.2.0
67 BuildRequires:  python3-test
68 BuildRequires:  python3-zope.event
69 BuildRequires:  python3-zope.interface
70 %endif
71 %endif
72 BuildRequires:  rpm-pythonprov
73 BuildRequires:  rpmbuild(macros) >= 1.714
74 %if %{with doc}
75 BuildRequires:  python3-repoze.sphinx.autointerface
76 BuildRequires:  python3-sphinxcontrib-programoutput
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
149 find . -type f -name '*.orig' | xargs -r %{__rm}
150
151 # force rebuild of Cython-generated files
152 # they depend on specific deps (e.g. greenlet) versions
153 %{__rm} src/gevent/{*.c,resolver/cares.c}
154
155 %build
156 # must be exported to work (py*_build macro is not single invocation)
157 %{?with_system_libev:export LIBEV_EMBED=false}
158 %{?with_system_c_ares:export CARES_EMBED=false}
159
160 %if %{with python2}
161 %py_build
162
163 %if %{with tests}
164 PYTHONPATH=$(echo $PWD/build-2/lib.*) \
165 %{__python} -m gevent.tests
166 %endif
167 %endif
168
169 %if %{with python3}
170 %py3_build
171
172 %if %{with tests}
173 PYTHONPATH=$(echo $PWD/build-3/lib.*) \
174 %{__python3} -m gevent.tests
175 %endif
176 %endif
177
178 %if %{with doc}
179 PYTHONPATH=$(echo $PWD/build-3/lib.*) \
180 %{__make} -C docs html \
181         SPHINXBUILD=sphinx-build-3
182 %endif
183
184 %install
185 rm -rf $RPM_BUILD_ROOT
186
187 %{?with_system_libev:export LIBEV_EMBED=false}
188 %{?with_system_c_ares:export CARES_EMBED=false}
189
190 %if %{with python2}
191 %py_install
192
193 %py_postclean
194 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/gevent/{testing,tests}
195 %endif
196
197 %if %{with python3}
198 %py3_install
199
200 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/gevent/{testing,tests}
201 %endif
202
203 %clean
204 rm -rf $RPM_BUILD_ROOT
205
206 %if %{with python2}
207 %files
208 %defattr(644,root,root,755)
209 %doc AUTHORS CHANGES.rst LICENSE NOTICE README.rst TODO
210 %dir %{py_sitedir}/gevent
211 %attr(755,root,root) %{py_sitedir}/gevent/*.so
212 %{py_sitedir}/gevent/*.py[co]
213 %dir %{py_sitedir}/gevent/_ffi
214 %{py_sitedir}/gevent/_ffi/*.py[co]
215 %dir %{py_sitedir}/gevent/libev
216 %attr(755,root,root) %{py_sitedir}/gevent/libev/_corecffi.so
217 %attr(755,root,root) %{py_sitedir}/gevent/libev/corecext.so
218 %{py_sitedir}/gevent/libev/*.py[co]
219 %dir %{py_sitedir}/gevent/libuv
220 %{py_sitedir}/gevent/libuv/*.py[co]
221 %attr(755,root,root) %{py_sitedir}/gevent/libuv/_corecffi.so
222 %dir %{py_sitedir}/gevent/resolver
223 %{py_sitedir}/gevent/resolver/*.py[co]
224 %attr(755,root,root) %{py_sitedir}/gevent/resolver/cares.so
225 %{py_sitedir}/gevent-%{version}-py%{py_ver}.egg-info
226 %endif
227
228 %if %{with python3}
229 %files -n python3-%{module}
230 %defattr(644,root,root,755)
231 %doc AUTHORS CHANGES.rst LICENSE NOTICE README.rst TODO
232 %dir %{py3_sitedir}/gevent
233 %attr(755,root,root) %{py3_sitedir}/gevent/*.cpython-*.so
234 %{py3_sitedir}/gevent/__pycache__
235 %{py3_sitedir}/gevent/*.py
236 %dir %{py3_sitedir}/gevent/_ffi
237 %{py3_sitedir}/gevent/_ffi/__pycache__
238 %{py3_sitedir}/gevent/_ffi/*.py
239 %dir %{py3_sitedir}/gevent/libuv
240 %{py3_sitedir}/gevent/libuv/__pycache__
241 %{py3_sitedir}/gevent/libuv/*.py
242 %attr(755,root,root) %{py3_sitedir}/gevent/libuv/_corecffi.*.so
243 %dir %{py3_sitedir}/gevent/libev
244 %attr(755,root,root) %{py3_sitedir}/gevent/libev/_corecffi.abi3.so
245 %attr(755,root,root) %{py3_sitedir}/gevent/libev/corecext.cpython-*.so
246 %{py3_sitedir}/gevent/libev/__pycache__
247 %{py3_sitedir}/gevent/libev/*.py
248 %dir %{py3_sitedir}/gevent/resolver
249 %{py3_sitedir}/gevent/resolver/__pycache__
250 %{py3_sitedir}/gevent/resolver/*.py
251 %attr(755,root,root) %{py3_sitedir}/gevent/resolver/cares.*.so
252 %{py3_sitedir}/gevent-%{version}-py*.egg-info
253 %endif
254
255 %if %{with doc}
256 %files apidocs
257 %defattr(644,root,root,755)
258 %doc docs/_build/html/{_modules,_static,api,examples,*.html,*.js}
259 %endif
This page took 0.409251 seconds and 2 git commands to generate.