3 # one of two happens when building 'with python2_tests':
4 # - FAIL: test_threaded_adv_leak (tests.test_leaks.ArgRefcountTests)
6 # - PYTHONPATH=/home/users/jajcus/rpm/BUILD/greenlet-0.4.2/build/lib.linux-i686-2.7 /usr/bin/python benchmarks/chain.py
7 # python: Objects/object.c:2453: _PyTrash_thread_deposit_object: Assertion `((((((((PyObject*)(op))->ob_type)))->tp_flags & ((1L<<14))) != 0) && ((((PyObject*)(op))->ob_type)->tp_is_gc == ((void *)0) || (((PyObject*)(op))->ob_type)->tp_is_gc(op)))' failed.
11 %bcond_without tests # do not perform "make test"
12 %bcond_without python2 # CPython 2.x module
13 %bcond_without python3 # CPython 3.x module
14 %bcond_without python2_tests # CPython 2.x module tests
17 %undefine with_python2_tests
20 %define module greenlet
21 Summary: Lightweight in-process concurrent programming
22 Name: python-%{module}
26 Group: Libraries/Python
27 URL: http://pypi.python.org/pypi/greenlet
28 Source0: http://pypi.python.org/packages/source/g/greenlet/%{module}-%{version}.zip
29 # Source0-md5: 580a8a5e833351f7abdaedb1a877f7ac
31 BuildRequires: python-devel
32 BuildRequires: python-setuptools
35 BuildRequires: python3-2to3
36 BuildRequires: python3-devel
37 BuildRequires: python3-distribute
38 BuildRequires: python3-modules
40 BuildRequires: rpmbuild(macros) >= 1.219
41 BuildRequires: rpm-pythonprov
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 The greenlet package is a spin-off of Stackless, a version of CPython
46 that supports micro-threads called "tasklets". Tasklets run
47 pseudo-concurrently (typically in a single or a few OS-level threads)
48 and are synchronized with data exchanges on "channels".
51 Summary: C development headers for python-greenlet
52 Group: Development/Libraries
53 Requires: %{name} = %{version}-%{release}
56 This package contains header files required for C modules development.
58 %package -n python3-%{module}
59 Summary: Lightweight in-process concurrent programming
60 Group: Libraries/Python
62 %description -n python3-%{module}
63 The greenlet package is a spin-off of Stackless, a version of CPython
64 that supports micro-threads called "tasklets". Tasklets run
65 pseudo-concurrently (typically in a single or a few OS-level threads)
66 and are synchronized with data exchanges on "channels".
68 %package -n python3-%{module}-devel
69 Summary: C development headers for python3-greenlet
70 Group: Development/Libraries
71 Requires: python3-%{module} = %{version}-%{release}
73 %description -n python3-%{module}-devel
74 This package contains header files required for C modules development.
77 %setup -q -n greenlet-%{version}
82 CFLAGS="%{rpmcflags}" \
83 %{__python} setup.py build
85 %if %{with python2_tests}
86 %{__python} setup.py test
88 # Run the upstream benchmarking suite to further exercise the code:
89 PYTHONPATH=$(echo $(pwd)/build/lib.*-2.?) %{__python} benchmarks/chain.py
94 # CC/CFLAGS is only for arch packages - remove on noarch packages
96 CFLAGS="%{rpmcflags}" \
97 %{__python3} setup.py build %{?with_tests:test}
100 # Run the upstream benchmarking suite to further exercise the code:
101 mkdir -p benchmarks-3
102 2to3-3.3 -o benchmarks-3 -n -w --no-diffs benchmarks
103 PYTHONPATH=$(echo $(pwd)/build/lib.*-3.?) %{__python3} benchmarks-3/chain.py
109 %{__python} setup.py \
110 install --skip-build \
112 --root=$RPM_BUILD_ROOT
118 %{__python3} setup.py \
119 install --skip-build \
121 --root=$RPM_BUILD_ROOT
125 rm -rf $RPM_BUILD_ROOT
128 %defattr(644,root,root,755)
129 %doc doc/greenlet.txt README.rst benchmarks AUTHORS NEWS LICENSE
130 %attr(755,root,root) %{py_sitedir}/%{module}.so
131 %{py_sitedir}/%{module}*.egg-info
134 %defattr(644,root,root,755)
135 %{_includedir}/python%{py_ver}/greenlet
137 %files -n python3-%{module}
138 %defattr(644,root,root,755)
139 %doc doc/greenlet.txt README.rst benchmarks AUTHORS NEWS LICENSE
140 %attr(755,root,root) %{py3_sitedir}/%{module}.*.so
141 %{py3_sitedir}/%{module}*.egg-info
143 %files -n python3-%{module}-devel
144 %defattr(644,root,root,755)
145 %{_includedir}/python%{py3_ver}*/greenlet