]> git.pld-linux.org Git - packages/python-gevent.git/blob - python-gevent.spec
ab0312551f8c1970caf0480be554fd9887a8848f
[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  tests   # do not run tests
11 %bcond_with     system_libev    # build with system libev (more tests will fail)
12 %bcond_without  system_c_ares   # build with system c_ares
13 %bcond_without  python2 # CPython 2.x module
14 %bcond_without  python3 # CPython 3.x module
15
16 %define     module  gevent
17 Summary:        A coroutine-based Python networking library
18 Name:           python-%{module}
19 Version:        1.1.0
20 Release:        2
21 Epoch:          1
22 License:        MIT
23 Group:          Development/Languages
24 Source0:        http://pypi.python.org/packages/source/g/gevent/%{module}-%{version}.tar.gz
25 # Source0-md5:  24b3e44134fbff250526f3b949763f99
26 Patch0:         known_failures-pld.patch
27 URL:            http://www.gevent.org/
28 %{?with_system_c_ares:BuildRequires:    c-ares-devel >= 1.10.0}
29 %{?with_system_libev:BuildRequires:     libev-devel >= 4.11}
30 #BuildRequires: python-Cython
31 %if %{with python2}
32 BuildRequires:  python-devel
33 %if %{with tests}
34 BuildRequires:  python-devel-src
35 BuildRequires:  python-greenlet >= 0.3.2
36 BuildRequires:  python-test
37 %endif
38 %endif
39 %if %{with python3}
40 BuildRequires:  python3-devel
41 %if %{with tests}
42 BuildRequires:  python3-greenlet >= 0.3.2
43 BuildRequires:  python3-test
44 %endif
45 %endif
46 BuildRequires:  rpm-pythonprov
47 BuildRequires:  rpmbuild(macros) >= 1.710
48 Requires:       python-greenlet >= 0.3.2
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51 %description
52 gevent is a coroutine-based Python networking library.
53
54 Features include:
55
56 - Fast event loop based on libev.
57 - Lightweight execution units based on greenlet.
58 - Familiar API that re-uses concepts from the Python standard library.
59 - Cooperative sockets with SSL support.
60 - DNS queries performed through c-ares or a threadpool.
61 - Ability to use standard library and 3rd party modules written for
62   standard blocking sockets
63
64 %package -n python3-%{module}
65 Summary:        A coroutine-based Python networking library
66 Group:          Libraries/Python
67 Requires:       python-greenlet >= 0.3.2
68
69 %description -n python3-%{module}
70 gevent is a coroutine-based Python networking library.
71
72 Features include:
73
74 - Fast event loop based on libev.
75 - Lightweight execution units based on greenlet.
76 - Familiar API that re-uses concepts from the Python standard library.
77 - Cooperative sockets with SSL support.
78 - DNS queries performed through c-ares or a threadpool.
79 - Ability to use standard library and 3rd party modules written for
80   standard blocking sockets
81
82 %prep
83 %setup -q -n %{module}-%{version}
84 %patch0 -p1
85
86 %build
87 # when Cython-generated files are to be rebuilt
88 # (BR: python-Cython must be enabled then too)
89 # ln -s Makefile.ext Makefile
90
91 %if %{with python2}
92 CC="%{__cc}" \
93 CFLAGS="%{rpmcflags}" \
94 %{?with_system_libev:LIBEV_EMBED=false} \
95 %{?with_system_c_ares:CARES_EMBED=false} \
96 %py_build
97
98 %if %{with tests}
99 cd greentest
100 PYTHONPATH=$PWD/$(ls -1d ../build-2/lib.*) %{__python} testrunner.py --config ../known_failures.py
101 cd ..
102 %endif
103 %endif
104
105 %if %{with python3}
106 CC="%{__cc}" \
107 CFLAGS="%{rpmcflags}" \
108 %{?with_system_libev:LIBEV_EMBED=false} \
109 %{?with_system_c_ares:CARES_EMBED=false} \
110 %py3_build
111
112 %if %{with tests}
113 cd greentest
114 PYTHONPATH=$PWD/$(ls -1d ../build-3/lib.*) %{__python3} testrunner.py --config ../known_failures.py
115 cd ..
116 %endif
117 %endif
118
119 %install
120 rm -rf $RPM_BUILD_ROOT
121
122 %if %{with python2}
123 %{?with_system_libev:LIBEV_EMBED=false} \
124 %{?with_system_c_ares:CARES_EMBED=false} \
125 %py_install
126
127 %py_postclean
128 %endif
129
130 %if %{with python3}
131 %{?with_system_libev:LIBEV_EMBED=false} \
132 %{?with_system_c_ares:CARES_EMBED=false} \
133 %py3_install
134 %endif
135
136 %clean
137 rm -rf $RPM_BUILD_ROOT
138
139 %if %{with python2}
140 %files
141 %defattr(644,root,root,755)
142 %doc LICENSE README.rst
143 %dir %{py_sitedir}/%{module}
144 %{py_sitedir}/%{module}/*.py[co]
145 %attr(755,root,root) %{py_sitedir}/%{module}/_semaphore.so
146 %attr(755,root,root) %{py_sitedir}/%{module}/ares.so
147 %attr(755,root,root) %{py_sitedir}/%{module}/corecext.so
148 %if "%{py_ver}" > "2.4"
149 %{py_sitedir}/%{module}-%{version}-py%{py_ver}.egg-info
150 %endif
151 %endif
152
153 %if %{with python3}
154 %files -n python3-%{module}
155 %defattr(644,root,root,755)
156 %doc LICENSE README.rst
157 %dir %{py3_sitedir}/%{module}
158 %{py3_sitedir}/%{module}/__pycache__
159 %{py3_sitedir}/%{module}/*.py*
160 %attr(755,root,root) %{py3_sitedir}/%{module}/_semaphore*.so
161 %attr(755,root,root) %{py3_sitedir}/%{module}/ares*.so
162 %attr(755,root,root) %{py3_sitedir}/%{module}/corecext*.so
163 %{py3_sitedir}/%{module}-%{version}-py*.egg-info
164 %endif
This page took 0.187995 seconds and 2 git commands to generate.