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