2 %bcond_without tests # do not perform "make test"
3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without python2_tests # CPython 2.x module tests
8 %undefine with_python2_tests
11 %define module greenlet
12 Summary: Lightweight in-process concurrent programming
13 Name: python-%{module}
17 Group: Libraries/Python
18 Source0: http://pypi.python.org/packages/source/g/greenlet/%{module}-%{version}.zip
19 # Source0-md5: ce383f6475e6311cf8932ea779938703
20 URL: http://pypi.python.org/pypi/greenlet
21 BuildRequires: rpm-pythonprov
22 BuildRequires: rpmbuild(macros) >= 1.219
24 BuildRequires: python-devel
25 BuildRequires: python-setuptools
28 BuildRequires: python3-2to3
29 BuildRequires: python3-devel
30 BuildRequires: python3-distribute
31 BuildRequires: python3-modules
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 # -fno-tree-dominator-opts because https://bugzilla.opensuse.org/show_bug.cgi?id=902146
36 %define specflags_x32 -fno-tree-dominator-opts
39 The greenlet package is a spin-off of Stackless, a version of CPython
40 that supports micro-threads called "tasklets". Tasklets run
41 pseudo-concurrently (typically in a single or a few OS-level threads)
42 and are synchronized with data exchanges on "channels".
45 Summary: C development headers for python-greenlet
46 Group: Development/Libraries
47 Requires: %{name} = %{version}-%{release}
50 This package contains header files required for C modules development.
52 %package -n python3-%{module}
53 Summary: Lightweight in-process concurrent programming
54 Group: Libraries/Python
56 %description -n python3-%{module}
57 The greenlet package is a spin-off of Stackless, a version of CPython
58 that supports micro-threads called "tasklets". Tasklets run
59 pseudo-concurrently (typically in a single or a few OS-level threads)
60 and are synchronized with data exchanges on "channels".
62 %package -n python3-%{module}-devel
63 Summary: C development headers for python3-greenlet
64 Group: Development/Libraries
65 Requires: python3-%{module} = %{version}-%{release}
67 %description -n python3-%{module}-devel
68 This package contains header files required for C modules development.
71 %setup -q -n greenlet-%{version}
76 CFLAGS="%{rpmcflags} " \
77 %{__python} setup.py build
79 %if %{with python2_tests}
80 %{__python} setup.py test
82 # Run the upstream benchmarking suite to further exercise the code:
83 PYTHONPATH=$(echo $(pwd)/build/lib.*-2.?) %{__python} benchmarks/chain.py
89 CFLAGS="%{rpmcflags}" \
90 %{__python3} setup.py build %{?with_tests:test}
93 # Run the upstream benchmarking suite to further exercise the code:
95 2to3-3.4 -o benchmarks-3 -n -w --no-diffs benchmarks
96 PYTHONPATH=$(echo $(pwd)/build/lib.*-3.?) %{__python3} benchmarks-3/chain.py
101 rm -rf $RPM_BUILD_ROOT
103 %{__python} setup.py \
104 install --skip-build \
106 --root=$RPM_BUILD_ROOT
112 %{__python3} setup.py \
113 install --skip-build \
115 --root=$RPM_BUILD_ROOT
119 rm -rf $RPM_BUILD_ROOT
122 %defattr(644,root,root,755)
123 %doc doc/greenlet.txt README.rst benchmarks AUTHORS NEWS LICENSE
124 %attr(755,root,root) %{py_sitedir}/%{module}.so
125 %{py_sitedir}/%{module}*.egg-info
128 %defattr(644,root,root,755)
129 %{_includedir}/python%{py_ver}/greenlet
131 %files -n python3-%{module}
132 %defattr(644,root,root,755)
133 %doc doc/greenlet.txt README.rst benchmarks AUTHORS NEWS LICENSE
134 %attr(755,root,root) %{py3_sitedir}/%{module}.*.so
135 %{py3_sitedir}/%{module}*.egg-info
137 %files -n python3-%{module}-devel
138 %defattr(644,root,root,755)
139 %{_includedir}/python%{py3_ver}*/greenlet