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