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