]>
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 | |
11497ff2 JK |
7 | # (now excluded via known_failures-pld.txt) |
8 | ||
9 | # Conditional build: | |
10 | %bcond_without tests # do not run tests | |
19395fb4 | 11 | %bcond_with system_libev # build with system libev (more tests will fail) |
282f7bb0 | 12 | %bcond_without system_c_ares # build with system c_ares |
11497ff2 | 13 | |
71c03694 | 14 | %define module gevent |
78f066e6 ER |
15 | Summary: A coroutine-based Python networking library |
16 | Name: python-%{module} | |
3cc54920 | 17 | Version: 1.0 |
282f7bb0 | 18 | Release: 2 |
78f066e6 ER |
19 | License: MIT |
20 | Group: Development/Languages | |
21 | URL: http://www.gevent.org/ | |
22 | Source0: http://pypi.python.org/packages/source/g/gevent/%{module}-%{version}.tar.gz | |
3cc54920 | 23 | # Source0-md5: 33aef51a06268f5903fea378e1388e4d |
11497ff2 | 24 | Source1: known_failures-pld.txt |
282f7bb0 JK |
25 | %{?with_system_libev:BuildRequires: c-ares-devel >= 1.10.0} |
26 | %{?with_system_c_ares:BuildRequires: libev-devel >= 4.11} | |
27 | #BuildRequires: python-Cython | |
78f066e6 | 28 | BuildRequires: python-devel |
7c3f7ce6 | 29 | %if %{with tests} |
282f7bb0 | 30 | BuildRequires: python-devel-src |
73d3206b JK |
31 | BuildRequires: python-greenlet >= 0.3.2 |
32 | BuildRequires: python-test | |
282f7bb0 | 33 | BuildRequires: rpmbuild(macros) >= 1.688 |
7c3f7ce6 | 34 | %endif |
78f066e6 | 35 | BuildRequires: rpm-pythonprov |
27ee9f05 | 36 | Requires: python-greenlet >= 0.3.2 |
78f066e6 | 37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
71c03694 ER |
38 | |
39 | %description | |
282f7bb0 | 40 | gevent is a coroutine-based Python networking library. |
71c03694 ER |
41 | |
42 | Features include: | |
282f7bb0 JK |
43 | |
44 | - Fast event loop based on libev. | |
45 | - Lightweight execution units based on greenlet. | |
46 | - Familiar API that re-uses concepts from the Python standard library. | |
47 | - Cooperative sockets with SSL support. | |
48 | - DNS queries performed through c-ares or a threadpool. | |
49 | - Ability to use standard library and 3rd party modules written for | |
50 | standard blo cking sockets | |
71c03694 ER |
51 | |
52 | %prep | |
53 | %setup -q -n %{module}-%{version} | |
54 | ||
11497ff2 JK |
55 | cat known_failures.txt %{SOURCE1} > known_failures-merged.txt |
56 | ||
71c03694 | 57 | %build |
282f7bb0 JK |
58 | # when Cython-generated files are to be rebuilt |
59 | # (BR: python-Cython must be enabled then too) | |
60 | # ln -s Makefile.ext Makefile | |
61 | ||
71c03694 ER |
62 | CC="%{__cc}" \ |
63 | CFLAGS="%{rpmcflags}" \ | |
282f7bb0 JK |
64 | %{?with_system_libev:LIBEV_EMBED=false} \ |
65 | %{?with_system_c_ares:CARES_EMBED=false} \ | |
71c03694 ER |
66 | %{__python} setup.py build |
67 | ||
31e6d75d JK |
68 | %if %{with tests} |
69 | cd greentest | |
70 | PYTHONPATH=.. python testrunner.py --expected ../known_failures-merged.txt | |
71 | cd .. | |
72 | %endif | |
73 | ||
71c03694 ER |
74 | %install |
75 | rm -rf $RPM_BUILD_ROOT | |
282f7bb0 JK |
76 | |
77 | %{?with_system_libev:LIBEV_EMBED=false} \ | |
78 | %{?with_system_c_ares:CARES_EMBED=false} \ | |
71c03694 ER |
79 | %{__python} setup.py install \ |
80 | --skip-build \ | |
81 | --optimize=2 \ | |
82 | --root=$RPM_BUILD_ROOT | |
83 | ||
84 | %py_postclean | |
85 | ||
86 | %clean | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
89 | %files | |
90 | %defattr(644,root,root,755) | |
91 | %doc LICENSE README.rst | |
78f066e6 | 92 | %dir %{py_sitedir}/%{module} |
71c03694 | 93 | %{py_sitedir}/%{module}/*.py[co] |
0f612c0f JK |
94 | %attr(755,root,root) %{py_sitedir}/%{module}/_semaphore.so |
95 | %attr(755,root,root) %{py_sitedir}/%{module}/_util.so | |
96 | %attr(755,root,root) %{py_sitedir}/%{module}/ares.so | |
71c03694 ER |
97 | %attr(755,root,root) %{py_sitedir}/%{module}/core.so |
98 | %if "%{py_ver}" > "2.4" | |
99 | %{py_sitedir}/%{module}-%{version}-py%{py_ver}.egg-info | |
100 | %endif |