3 %bcond_without tests # do not perform "make test"
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
6 %bcond_without python2_tests # CPython 2.x module tests
9 %undefine with_python2_tests
12 %define module greenlet
13 Summary: Lightweight in-process concurrent programming
14 Summary(pl.UTF-8): Lekkie programowanie równoległe wewnątrz procesu
15 Name: python-%{module}
18 License: MIT, PSF (Stackless Python parts)
19 Group: Libraries/Python
20 #Source0Download: https://pypi.python.org/simple/greenlet/
21 Source0: https://pypi.python.org/packages/source/g/greenlet/%{module}-%{version}.zip
22 # Source0-md5: c6659cdb2a5e591723e629d2eef22e82
23 URL: https://pypi.python.org/pypi/greenlet
24 BuildRequires: rpm-pythonprov
25 BuildRequires: rpmbuild(macros) >= 1.714
27 BuildRequires: python-devel >= 1:2.4
28 BuildRequires: python-setuptools
31 BuildRequires: python3-2to3 >= 1:3.2
32 BuildRequires: python3-devel >= 1:3.2
33 BuildRequires: python3-setuptools
34 BuildRequires: python3-modules >= 1:3.2
36 Requires: python-modules >= 1:2.4
37 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 # -fno-tree-dominator-opts because https://bugzilla.opensuse.org/show_bug.cgi?id=902146
40 %define specflags_x32 -fno-tree-dominator-opts
43 The greenlet package is a spin-off of Stackless, a version of CPython
44 that supports micro-threads called "tasklets". Tasklets run
45 pseudo-concurrently (typically in a single or a few OS-level threads)
46 and are synchronized with data exchanges on "channels".
48 %description -l pl.UTF-8
49 Pakiet greenlet to odprysk projektu Stackless - wersji CPythona
50 obsługującej mikrowątki zwane "taskletami". Tasklety działają
51 pseudorównolegle (zwykle w jednym lub kilku wątkach na poziomie
52 systemu operacyjnego) i są synchronizowane przy wymianie danych
56 Summary: C development headers for Python 2 greenlet module
57 Summary(pl.UTF-8): Pliki nagłówkowe C dla modułu Pythona 2 greenlet
58 Group: Development/Libraries
59 Requires: %{name} = %{version}-%{release}
60 Requires: python-devel >= 1:2.4
63 This package contains header files required for C modules development.
65 %description devel -l pl.UTF-8
66 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia modułów w
69 %package -n python3-%{module}
70 Summary: Lightweight in-process concurrent programming
71 Summary(pl.UTF-8): Lekkie programowanie równoległe wewnątrz procesu
72 Group: Libraries/Python
73 Requires: python3-modules >= 1:3.2
75 %description -n python3-%{module}
76 The greenlet package is a spin-off of Stackless, a version of CPython
77 that supports micro-threads called "tasklets". Tasklets run
78 pseudo-concurrently (typically in a single or a few OS-level threads)
79 and are synchronized with data exchanges on "channels".
81 %description -n python3-%{module} -l pl.UTF-8
82 Pakiet greenlet to odprysk projektu Stackless - wersji CPythona
83 obsługującej mikrowątki zwane "taskletami". Tasklety działają
84 pseudorównolegle (zwykle w jednym lub kilku wątkach na poziomie
85 systemu operacyjnego) i są synchronizowane przy wymianie danych
88 %package -n python3-%{module}-devel
89 Summary: C development headers for Python 3 greenlet module
90 Summary(pl.UTF-8): Pliki nagłówkowe C dla modułu Pythona 3 greenlet
91 Group: Development/Libraries
92 Requires: python3-%{module} = %{version}-%{release}
93 Requires: python3-devel >= 1:3.2
95 %description -n python3-%{module}-devel
96 This package contains header files required for C modules development.
98 %description -n python3-%{module}-devel -l pl.UTF-8
99 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia modułów w
103 %setup -q -n greenlet-%{version}
108 CFLAGS="%{rpmcflags} " \
109 %py_build %{?with_python2_tests:test}
111 %if %{with python2_tests}
112 # Run the upstream benchmarking suite to further exercise the code:
113 PYTHONPATH=$(echo $(pwd)/build-2/lib.*-2.?) %{__python} benchmarks/chain.py
118 %py3_build %{?with_tests:test}
121 # Run the upstream benchmarking suite to further exercise the code:
122 mkdir -p benchmarks-3
123 2to3-%{py3_ver} -o benchmarks-3 -n -w --no-diffs benchmarks
124 PYTHONPATH=$(echo $(pwd)/build-3/lib.*-3.?) %{__python3} benchmarks-3/chain.py
129 rm -rf $RPM_BUILD_ROOT
141 rm -rf $RPM_BUILD_ROOT
145 %defattr(644,root,root,755)
146 %doc AUTHORS LICENSE NEWS README.rst doc/greenlet.txt benchmarks
147 %attr(755,root,root) %{py_sitedir}/greenlet.so
148 %{py_sitedir}/greenlet-%{version}-py*.egg-info
151 %defattr(644,root,root,755)
152 %{_includedir}/python%{py_ver}/greenlet
156 %files -n python3-%{module}
157 %defattr(644,root,root,755)
158 %doc AUTHORS LICENSE NEWS README.rst doc/greenlet.txt benchmarks-3
159 %attr(755,root,root) %{py3_sitedir}/greenlet.cpython-*.so
160 %{py3_sitedir}/greenlet-%{version}-py*.egg-info
162 %files -n python3-%{module}-devel
163 %defattr(644,root,root,755)
164 %{_includedir}/python%{py3_ver}*/greenlet