]>
Commit | Line | Data |
---|---|---|
f77466f5 | 1 | # |
595a528f | 2 | # Conditional build: |
d74d10e7 JB |
3 | %bcond_without python2 # CPython 2.x module |
4 | %bcond_without python3 # CPython 3.x module | |
4d60538c | 5 | %bcond_without doc # Sphinx documentation |
d74d10e7 JB |
6 | %bcond_without tests # unit tests and benchmarks (any) |
7 | %bcond_without tests_py2 # CPython 2.x module tests | |
f818725e JK |
8 | |
9 | %if %{without tests} | |
d74d10e7 | 10 | %undefine with_tests_py2 |
f818725e | 11 | %endif |
595a528f ER |
12 | |
13 | %define module greenlet | |
14 | Summary: Lightweight in-process concurrent programming | |
f77466f5 | 15 | Summary(pl.UTF-8): Lekkie programowanie równoległe wewnątrz procesu |
595a528f | 16 | Name: python-%{module} |
00329535 | 17 | Version: 0.4.15 |
4d60538c | 18 | Release: 4 |
f77466f5 | 19 | License: MIT, PSF (Stackless Python parts) |
f818725e | 20 | Group: Libraries/Python |
6fa6396c | 21 | #Source0Download: https://pypi.org/simple/greenlet/ |
d74d10e7 | 22 | Source0: https://files.pythonhosted.org/packages/source/g/greenlet/%{module}-%{version}.tar.gz |
00329535 | 23 | # Source0-md5: 10fa304f673fc18b28fa6d8c6658cb80 |
4d60538c | 24 | Patch0: %{name}-py3.8.patch |
6fa6396c | 25 | URL: https://pypi.org/project/greenlet/ |
670ee388 | 26 | BuildRequires: rpm-pythonprov |
f77466f5 | 27 | BuildRequires: rpmbuild(macros) >= 1.714 |
f818725e | 28 | %if %{with python2} |
f77466f5 | 29 | BuildRequires: python-devel >= 1:2.4 |
595a528f | 30 | BuildRequires: python-setuptools |
f818725e JK |
31 | %endif |
32 | %if %{with python3} | |
f77466f5 JB |
33 | BuildRequires: python3-2to3 >= 1:3.2 |
34 | BuildRequires: python3-devel >= 1:3.2 | |
0960fc6e | 35 | BuildRequires: python3-setuptools |
f77466f5 | 36 | BuildRequires: python3-modules >= 1:3.2 |
f818725e | 37 | %endif |
4d60538c JB |
38 | %if %{with doc} |
39 | BuildRequires: sphinx-pdg | |
40 | %endif | |
f77466f5 | 41 | Requires: python-modules >= 1:2.4 |
595a528f ER |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
43 | ||
670ee388 | 44 | # -fno-tree-dominator-opts because https://bugzilla.opensuse.org/show_bug.cgi?id=902146 |
2a720b56 MK |
45 | %define specflags_x32 -fno-tree-dominator-opts |
46 | ||
595a528f ER |
47 | %description |
48 | The greenlet package is a spin-off of Stackless, a version of CPython | |
49 | that supports micro-threads called "tasklets". Tasklets run | |
50 | pseudo-concurrently (typically in a single or a few OS-level threads) | |
51 | and are synchronized with data exchanges on "channels". | |
52 | ||
f77466f5 JB |
53 | %description -l pl.UTF-8 |
54 | Pakiet greenlet to odprysk projektu Stackless - wersji CPythona | |
55 | obsługującej mikrowątki zwane "taskletami". Tasklety działają | |
56 | pseudorównolegle (zwykle w jednym lub kilku wątkach na poziomie | |
57 | systemu operacyjnego) i są synchronizowane przy wymianie danych | |
58 | poprzez "kanały". | |
59 | ||
595a528f | 60 | %package devel |
f77466f5 JB |
61 | Summary: C development headers for Python 2 greenlet module |
62 | Summary(pl.UTF-8): Pliki nagłówkowe C dla modułu Pythona 2 greenlet | |
595a528f ER |
63 | Group: Development/Libraries |
64 | Requires: %{name} = %{version}-%{release} | |
f77466f5 | 65 | Requires: python-devel >= 1:2.4 |
595a528f ER |
66 | |
67 | %description devel | |
68 | This package contains header files required for C modules development. | |
69 | ||
f77466f5 JB |
70 | %description devel -l pl.UTF-8 |
71 | Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia modułów w | |
72 | C. | |
73 | ||
f818725e JK |
74 | %package -n python3-%{module} |
75 | Summary: Lightweight in-process concurrent programming | |
f77466f5 | 76 | Summary(pl.UTF-8): Lekkie programowanie równoległe wewnątrz procesu |
f818725e | 77 | Group: Libraries/Python |
f77466f5 | 78 | Requires: python3-modules >= 1:3.2 |
f818725e JK |
79 | |
80 | %description -n python3-%{module} | |
81 | The greenlet package is a spin-off of Stackless, a version of CPython | |
82 | that supports micro-threads called "tasklets". Tasklets run | |
83 | pseudo-concurrently (typically in a single or a few OS-level threads) | |
84 | and are synchronized with data exchanges on "channels". | |
85 | ||
f77466f5 JB |
86 | %description -n python3-%{module} -l pl.UTF-8 |
87 | Pakiet greenlet to odprysk projektu Stackless - wersji CPythona | |
88 | obsługującej mikrowątki zwane "taskletami". Tasklety działają | |
89 | pseudorównolegle (zwykle w jednym lub kilku wątkach na poziomie | |
90 | systemu operacyjnego) i są synchronizowane przy wymianie danych | |
91 | poprzez "kanały". | |
92 | ||
f818725e | 93 | %package -n python3-%{module}-devel |
f77466f5 JB |
94 | Summary: C development headers for Python 3 greenlet module |
95 | Summary(pl.UTF-8): Pliki nagłówkowe C dla modułu Pythona 3 greenlet | |
f818725e JK |
96 | Group: Development/Libraries |
97 | Requires: python3-%{module} = %{version}-%{release} | |
f77466f5 | 98 | Requires: python3-devel >= 1:3.2 |
f818725e JK |
99 | |
100 | %description -n python3-%{module}-devel | |
101 | This package contains header files required for C modules development. | |
102 | ||
f77466f5 JB |
103 | %description -n python3-%{module}-devel -l pl.UTF-8 |
104 | Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia modułów w | |
105 | C. | |
106 | ||
4d60538c JB |
107 | %package apidocs |
108 | Summary: API documentation for Python greenlet module | |
109 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona greenlet | |
110 | Group: Documentation | |
111 | ||
112 | %description apidocs | |
113 | API documentation for Python greenlet module. | |
114 | ||
115 | %description apidocs -l pl.UTF-8 | |
116 | Dokumentacja API modułu Pythona greenlet. | |
117 | ||
595a528f ER |
118 | %prep |
119 | %setup -q -n greenlet-%{version} | |
4d60538c | 120 | %patch0 -p1 |
595a528f ER |
121 | |
122 | %build | |
f818725e | 123 | %if %{with python2} |
4d60538c | 124 | %py_build |
595a528f | 125 | |
d74d10e7 | 126 | %if %{with tests_py2} |
4d60538c JB |
127 | BUILDDIR=$(echo $(pwd)/build-2/lib.linux-*) |
128 | PYTHONPATH="$BUILDDIR" \ | |
129 | %{__python} run-tests.py -n -b build-2/tests | |
00329535 | 130 | |
4d60538c JB |
131 | # Run the upstream benchmarking suite to further exercise the code: |
132 | PYTHONPATH="$BUILDDIR" \ | |
133 | %{__python} benchmarks/chain.py | |
f818725e JK |
134 | %endif |
135 | %endif | |
136 | ||
137 | %if %{with python3} | |
4d60538c | 138 | %py3_build |
f818725e JK |
139 | |
140 | %if %{with tests} | |
4d60538c JB |
141 | BUILDDIR=$(echo $(pwd)/build-3/lib.linux-*) |
142 | PYTHONPATH="$BUILDDIR" \ | |
143 | %{__python3} run-tests.py -n -b build-3/tests | |
144 | ||
f818725e JK |
145 | # Run the upstream benchmarking suite to further exercise the code: |
146 | mkdir -p benchmarks-3 | |
b5e21f14 | 147 | 2to3-%{py3_ver} -o benchmarks-3 -n -w --no-diffs benchmarks |
4d60538c JB |
148 | PYTHONPATH="$BUILDDIR" \ |
149 | %{__python3} benchmarks-3/chain.py | |
150 | %endif | |
595a528f | 151 | %endif |
4d60538c JB |
152 | |
153 | %if %{with doc} | |
154 | %{__make} -C doc html | |
595a528f ER |
155 | %endif |
156 | ||
157 | %install | |
670ee388 | 158 | rm -rf $RPM_BUILD_ROOT |
d74d10e7 | 159 | |
f818725e | 160 | %if %{with python2} |
5c11c3f5 | 161 | %py_install |
595a528f ER |
162 | |
163 | %py_postclean | |
f818725e JK |
164 | %endif |
165 | ||
166 | %if %{with python3} | |
5c11c3f5 | 167 | %py3_install |
f818725e | 168 | %endif |
595a528f ER |
169 | |
170 | %clean | |
171 | rm -rf $RPM_BUILD_ROOT | |
172 | ||
f77466f5 | 173 | %if %{with python2} |
595a528f ER |
174 | %files |
175 | %defattr(644,root,root,755) | |
4d60538c | 176 | %doc AUTHORS LICENSE NEWS README.rst benchmarks |
f77466f5 JB |
177 | %attr(755,root,root) %{py_sitedir}/greenlet.so |
178 | %{py_sitedir}/greenlet-%{version}-py*.egg-info | |
595a528f ER |
179 | |
180 | %files devel | |
181 | %defattr(644,root,root,755) | |
182 | %{_includedir}/python%{py_ver}/greenlet | |
f77466f5 | 183 | %endif |
f818725e | 184 | |
f77466f5 | 185 | %if %{with python3} |
f818725e JK |
186 | %files -n python3-%{module} |
187 | %defattr(644,root,root,755) | |
4d60538c | 188 | %doc AUTHORS LICENSE NEWS README.rst %{?with_tests:benchmarks-3} |
f77466f5 JB |
189 | %attr(755,root,root) %{py3_sitedir}/greenlet.cpython-*.so |
190 | %{py3_sitedir}/greenlet-%{version}-py*.egg-info | |
f818725e JK |
191 | |
192 | %files -n python3-%{module}-devel | |
193 | %defattr(644,root,root,755) | |
194 | %{_includedir}/python%{py3_ver}*/greenlet | |
f77466f5 | 195 | %endif |
4d60538c JB |
196 | |
197 | %if %{with doc} | |
198 | %files apidocs | |
199 | %defattr(644,root,root,755) | |
200 | %doc doc/_build/html/{_static,*.html,*.js} | |
201 | %endif |