3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without doc # Sphinx documentation
6 %bcond_without tests # unit tests and benchmarks (any)
7 %bcond_without tests_py2 # CPython 2.x module tests
10 %undefine with_tests_py2
13 %define module greenlet
14 Summary: Lightweight in-process concurrent programming
15 Summary(pl.UTF-8): Lekkie programowanie równoległe wewnątrz procesu
16 Name: python-%{module}
19 License: MIT, PSF (Stackless Python parts)
20 Group: Libraries/Python
21 #Source0Download: https://pypi.org/simple/greenlet/
22 Source0: https://files.pythonhosted.org/packages/source/g/greenlet/%{module}-%{version}.tar.gz
23 # Source0-md5: 4b8954da74881abb5f8129f94aa8219f
24 Patch0: %{name}-py3.8.patch
25 URL: https://pypi.org/project/greenlet/
26 BuildRequires: rpm-build >= 4.6
27 BuildRequires: rpm-pythonprov
28 BuildRequires: rpmbuild(macros) >= 1.714
30 BuildRequires: python-devel >= 1:2.7
31 BuildRequires: python-setuptools
34 BuildRequires: python3-2to3 >= 1:3.5
35 BuildRequires: python3-devel >= 1:3.5
36 BuildRequires: python3-setuptools
37 BuildRequires: python3-modules >= 1:3.5
41 BuildRequires: python3-greenlet
42 BuildRequires: sphinx-pdg-3
44 Requires: python-modules >= 1:2.7
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 # -fno-tree-dominator-opts because https://bugzilla.opensuse.org/show_bug.cgi?id=902146
48 %define specflags_x32 -fno-tree-dominator-opts
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".
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
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
66 Group: Development/Libraries
67 Requires: %{name} = %{version}-%{release}
68 Requires: python-devel >= 1:2.7
71 This package contains header files required for C modules development.
73 %description devel -l pl.UTF-8
74 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia modułów w
77 %package -n python3-%{module}
78 Summary: Lightweight in-process concurrent programming
79 Summary(pl.UTF-8): Lekkie programowanie równoległe wewnątrz procesu
80 Group: Libraries/Python
81 Requires: python3-modules >= 1:3.5
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".
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
96 %package -n python3-%{module}-devel
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
99 Group: Development/Libraries
100 Requires: python3-%{module} = %{version}-%{release}
101 Requires: python3-devel >= 1:3.5
103 %description -n python3-%{module}-devel
104 This package contains header files required for C modules development.
106 %description -n python3-%{module}-devel -l pl.UTF-8
107 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia modułów w
111 Summary: API documentation for Python greenlet module
112 Summary(pl.UTF-8): Dokumentacja API modułu Pythona greenlet
117 API documentation for Python greenlet module.
119 %description apidocs -l pl.UTF-8
120 Dokumentacja API modułu Pythona greenlet.
123 %setup -q -n greenlet-%{version}
130 %if %{with tests_py2}
131 BUILDDIR=$(echo $(pwd)/build-2/lib.linux-*)
132 PYTHONPATH="$BUILDDIR" \
133 %{__python} -m unittest discover greenlet.tests
135 # Run the upstream benchmarking suite to further exercise the code:
136 PYTHONPATH="$BUILDDIR" \
137 %{__python} benchmarks/chain.py
145 BUILDDIR=$(echo $(pwd)/build-3/lib.linux-*)
146 PYTHONPATH="$BUILDDIR" \
147 %{__python3} -m unittest discover greenlet.tests
149 # Run the upstream benchmarking suite to further exercise the code:
150 mkdir -p benchmarks-3
151 2to3-%{py3_ver} -o benchmarks-3 -n -w --no-diffs benchmarks
152 PYTHONPATH="$BUILDDIR" \
153 %{__python3} benchmarks-3/chain.py
158 PYTHONPATH=$(echo $(pwd)/build-3/lib.linux-*) \
159 %{__make} -C docs html \
160 SPHINXBUILD=sphinx-build-3
164 rm -rf $RPM_BUILD_ROOT
169 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/greenlet/*.[ch]
170 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/greenlet/{platform,tests}
177 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/greenlet/*.[ch]
178 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/greenlet/{platform,tests}
182 rm -rf $RPM_BUILD_ROOT
186 %defattr(644,root,root,755)
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]
191 %{py_sitedir}/greenlet-%{version}-py*.egg-info
194 %defattr(644,root,root,755)
195 %{_includedir}/python%{py_ver}/greenlet
199 %files -n python3-%{module}
200 %defattr(644,root,root,755)
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__
206 %{py3_sitedir}/greenlet-%{version}-py*.egg-info
208 %files -n python3-%{module}-devel
209 %defattr(644,root,root,755)
210 %{_includedir}/python%{py3_ver}*/greenlet
215 %defattr(644,root,root,755)
216 %doc docs/_build/html/{_modules,_static,*.html,*.js}