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