]>
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: | |
4f53d0c0 JB |
10 | %bcond_without tests # do not run tests |
11 | %bcond_with system_libev # build with system libev [test__core_stat.py test fails] | |
282f7bb0 | 12 | %bcond_without system_c_ares # build with system c_ares |
4f53d0c0 JB |
13 | %bcond_without python2 # CPython 2.x module |
14 | %bcond_without python3 # CPython 3.x module | |
11497ff2 | 15 | |
4f53d0c0 JB |
16 | %define module gevent |
17 | Summary: A coroutine-based Python 2 networking library | |
18 | Summary(pl.UTF-8): Biblioteka sieciowa dla Pythona 2 oparta na korutynach | |
78f066e6 | 19 | Name: python-%{module} |
4f53d0c0 | 20 | Version: 1.2.1 |
3b06763b | 21 | Release: 3 |
4fc6ecf8 | 22 | Epoch: 1 |
78f066e6 ER |
23 | License: MIT |
24 | Group: Development/Languages | |
4f53d0c0 JB |
25 | #Source0Download: https://pypi.python.org/simple/gevent |
26 | Source0: http://files.pythonhosted.org/packages/source/g/gevent/%{module}-%{version}.tar.gz | |
27 | # Source0-md5: 6700a2433c8e0635425e6798760efc81 | |
2fed4eba | 28 | Patch0: known_failures-pld.patch |
4f53d0c0 | 29 | Patch1: %{name}-tests.patch |
2fed4eba | 30 | URL: http://www.gevent.org/ |
140cee97 | 31 | %{?with_system_c_ares:BuildRequires: c-ares-devel >= 1.10.0} |
4f53d0c0 JB |
32 | %{?with_system_libev:BuildRequires: libev-devel >= 4.23} |
33 | # if cpython generated files need rebuild | |
34 | #BuildRequires: python-Cython >= 0.25.1 | |
06c1ffe6 | 35 | %if %{with python2} |
4f53d0c0 JB |
36 | BuildRequires: python-cffi >= 1.3.0 |
37 | BuildRequires: python-devel >= 1:2.7 | |
7c3f7ce6 | 38 | %if %{with tests} |
4f53d0c0 JB |
39 | BuildRequires: python-coverage >= 4.0 |
40 | BuildRequires: python-devel-src >= 1:2.7 | |
41 | BuildRequires: python-greenlet >= 0.4.10 | |
42 | BuildRequires: python-setuptools | |
73d3206b | 43 | BuildRequires: python-test |
06c1ffe6 AM |
44 | %endif |
45 | %endif | |
46 | %if %{with python3} | |
4f53d0c0 JB |
47 | BuildRequires: python3-cffi >= 1.3.0 |
48 | BuildRequires: python3-devel >= 1:3.3 | |
06c1ffe6 | 49 | %if %{with tests} |
4f53d0c0 JB |
50 | BuildRequires: python3-coverage >= 4.0 |
51 | BuildRequires: python3-greenlet >= 0.4.10 | |
52 | BuildRequires: python3-setuptools | |
06c1ffe6 AM |
53 | BuildRequires: python3-test |
54 | %endif | |
7c3f7ce6 | 55 | %endif |
78f066e6 | 56 | BuildRequires: rpm-pythonprov |
4f53d0c0 JB |
57 | BuildRequires: rpmbuild(macros) >= 1.714 |
58 | %{?with_system_libev:Requires: libev >= 4.23} | |
59 | Requires: python-greenlet >= 0.4.10 | |
78f066e6 | 60 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
71c03694 ER |
61 | |
62 | %description | |
4f53d0c0 JB |
63 | gevent is a coroutine-based Python networking library. Features |
64 | include: | |
06c1ffe6 AM |
65 | - Fast event loop based on libev. |
66 | - Lightweight execution units based on greenlet. | |
67 | - Familiar API that re-uses concepts from the Python standard library. | |
68 | - Cooperative sockets with SSL support. | |
69 | - DNS queries performed through c-ares or a threadpool. | |
70 | - Ability to use standard library and 3rd party modules written for | |
4f53d0c0 JB |
71 | standard blocking sockets. |
72 | ||
73 | %description -l pl.UTF-8 | |
74 | gevent to biblioteka sieciowa dla Pythona oparta na korutynach. Jej | |
75 | możliwości to m.in. | |
76 | - szybka pętla zdarzeń oparta na libev | |
77 | - lekkie jednostki wykonywania oparte na bibliotece greenlet | |
78 | - znajome API wykorzystujące koncepty biblioteki standardowej Pythona | |
79 | - gniazda kooperatywne z obsługą SSL | |
80 | - zapytania DNS wykonywane przez bibliotekę c-ares lub pulę wątków | |
81 | - możliwość wykorzystania biblioteki standardowej lub modułów innych | |
82 | producentów napisanych dla standardowych gniazd blokujących | |
06c1ffe6 AM |
83 | |
84 | %package -n python3-%{module} | |
4f53d0c0 JB |
85 | Summary: A coroutine-based Python 3 networking library |
86 | Summary(pl.UTF-8): Biblioteka sieciowa dla Pythona 3 oparta na korutynach | |
06c1ffe6 | 87 | Group: Libraries/Python |
4f53d0c0 JB |
88 | %{?with_system_libev:Requires: libev >= 4.23} |
89 | Requires: python-greenlet >= 0.4.10 | |
06c1ffe6 AM |
90 | |
91 | %description -n python3-%{module} | |
4f53d0c0 JB |
92 | gevent is a coroutine-based Python networking library. Features |
93 | include: | |
282f7bb0 JK |
94 | - Fast event loop based on libev. |
95 | - Lightweight execution units based on greenlet. | |
96 | - Familiar API that re-uses concepts from the Python standard library. | |
97 | - Cooperative sockets with SSL support. | |
98 | - DNS queries performed through c-ares or a threadpool. | |
99 | - Ability to use standard library and 3rd party modules written for | |
6c017ba8 | 100 | standard blocking sockets |
71c03694 | 101 | |
4f53d0c0 JB |
102 | %description -n python3-%{module} -l pl.UTF-8 |
103 | gevent to biblioteka sieciowa dla Pythona oparta na korutynach. Jej | |
104 | możliwości to m.in. | |
105 | - szybka pętla zdarzeń oparta na libev | |
106 | - lekkie jednostki wykonywania oparte na bibliotece greenlet | |
107 | - znajome API wykorzystujące koncepty biblioteki standardowej Pythona | |
108 | - gniazda kooperatywne z obsługą SSL | |
109 | - zapytania DNS wykonywane przez bibliotekę c-ares lub pulę wątków | |
110 | - możliwość wykorzystania biblioteki standardowej lub modułów innych | |
111 | producentów napisanych dla standardowych gniazd blokujących | |
112 | ||
71c03694 ER |
113 | %prep |
114 | %setup -q -n %{module}-%{version} | |
2fed4eba | 115 | %patch0 -p1 |
4f53d0c0 | 116 | %patch1 -p1 -b .orig |
11497ff2 | 117 | |
71c03694 | 118 | %build |
282f7bb0 JK |
119 | # when Cython-generated files are to be rebuilt |
120 | # (BR: python-Cython must be enabled then too) | |
121 | # ln -s Makefile.ext Makefile | |
122 | ||
4f53d0c0 JB |
123 | # must be exported to work (py*_build macro is not single invocation) |
124 | %{?with_system_libev:export LIBEV_EMBED=false} | |
125 | %{?with_system_c_ares:export CARES_EMBED=false} | |
126 | ||
06c1ffe6 | 127 | %if %{with python2} |
37c131a9 | 128 | %py_build |
71c03694 | 129 | |
31e6d75d | 130 | %if %{with tests} |
4f53d0c0 JB |
131 | PKGDIR=$(echo $PWD/build-2/lib.*) |
132 | cd src/greentest | |
133 | PYTHONPATH=$PKGDIR %{__python} testrunner.py --config known_failures.py | |
134 | cd ../.. | |
31e6d75d | 135 | %endif |
06c1ffe6 AM |
136 | %endif |
137 | ||
138 | %if %{with python3} | |
37c131a9 | 139 | %py3_build |
06c1ffe6 AM |
140 | |
141 | %if %{with tests} | |
4f53d0c0 JB |
142 | PKGDIR=$(echo $PWD/build-3/lib.*) |
143 | cd src/greentest | |
144 | PYTHONPATH=$PKGDIR %{__python3} testrunner.py --config known_failures.py | |
145 | cd ../.. | |
06c1ffe6 AM |
146 | %endif |
147 | %endif | |
31e6d75d | 148 | |
71c03694 ER |
149 | %install |
150 | rm -rf $RPM_BUILD_ROOT | |
282f7bb0 | 151 | |
4f53d0c0 JB |
152 | %{?with_system_libev:export LIBEV_EMBED=false} |
153 | %{?with_system_c_ares:export CARES_EMBED=false} | |
154 | ||
06c1ffe6 | 155 | %if %{with python2} |
37c131a9 | 156 | %py_install |
71c03694 ER |
157 | |
158 | %py_postclean | |
4f53d0c0 JB |
159 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/gevent/*.{c,h,pyx} |
160 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/gevent/libev/*.{c,h,pyx,ppyx} | |
06c1ffe6 AM |
161 | %endif |
162 | ||
163 | %if %{with python3} | |
37c131a9 | 164 | %py3_install |
4f53d0c0 JB |
165 | |
166 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/gevent/*.{c,h,pyx} | |
167 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/gevent/libev/*.{c,h,pyx,ppyx} | |
06c1ffe6 | 168 | %endif |
71c03694 ER |
169 | |
170 | %clean | |
171 | rm -rf $RPM_BUILD_ROOT | |
172 | ||
06c1ffe6 | 173 | %if %{with python2} |
71c03694 ER |
174 | %files |
175 | %defattr(644,root,root,755) | |
4f53d0c0 JB |
176 | %doc AUTHORS LICENSE NOTICE README.rst TODO |
177 | %dir %{py_sitedir}/gevent | |
178 | %attr(755,root,root) %{py_sitedir}/gevent/_semaphore.so | |
179 | %attr(755,root,root) %{py_sitedir}/gevent/ares.so | |
180 | %{py_sitedir}/gevent/*.pxd | |
181 | %{py_sitedir}/gevent/*.py[co] | |
182 | %dir %{py_sitedir}/gevent/libev | |
183 | %attr(755,root,root) %{py_sitedir}/gevent/libev/_corecffi.so | |
184 | %attr(755,root,root) %{py_sitedir}/gevent/libev/corecext.so | |
185 | %{py_sitedir}/gevent/libev/libev.pxd | |
186 | %{py_sitedir}/gevent/libev/*.py[co] | |
187 | %{py_sitedir}/gevent-%{version}-py%{py_ver}.egg-info | |
06c1ffe6 AM |
188 | %endif |
189 | ||
190 | %if %{with python3} | |
191 | %files -n python3-%{module} | |
192 | %defattr(644,root,root,755) | |
4f53d0c0 JB |
193 | %doc AUTHORS LICENSE NOTICE README.rst TODO |
194 | %dir %{py3_sitedir}/gevent | |
195 | %attr(755,root,root) %{py3_sitedir}/gevent/_semaphore.cpython-*.so | |
196 | %attr(755,root,root) %{py3_sitedir}/gevent/ares.cpython-*.so | |
197 | %{py3_sitedir}/gevent/__pycache__ | |
198 | %{py3_sitedir}/gevent/*.pxd | |
199 | %{py3_sitedir}/gevent/*.py | |
200 | %dir %{py3_sitedir}/gevent/libev | |
25ec3431 | 201 | %attr(755,root,root) %{py3_sitedir}/gevent/libev/_corecffi.abi3.so |
3b06763b JR |
202 | %attr(755,root,root) %{py3_sitedir}/gevent/libev/corecext.cpython-36m-*.so |
203 | ||
4f53d0c0 JB |
204 | %{py3_sitedir}/gevent/libev/__pycache__ |
205 | %{py3_sitedir}/gevent/libev/libev.pxd | |
206 | %{py3_sitedir}/gevent/libev/*.py | |
207 | %{py3_sitedir}/gevent-%{version}-py*.egg-info | |
06c1ffe6 | 208 | %endif |