]> git.pld-linux.org Git - packages/python-greenlet.git/blame - python-greenlet.spec
Fix crash in benchmarks/chain.py due to GC assert
[packages/python-greenlet.git] / python-greenlet.spec
CommitLineData
f818725e
JK
1
2# TODO:
3# one of two happens when building 'with python2_tests':
4# - FAIL: test_threaded_adv_leak (tests.test_leaks.ArgRefcountTests)
5# or:
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.
8# Result:Aborted
9
595a528f
ER
10# Conditional build:
11%bcond_without tests # do not perform "make test"
f818725e
JK
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
15
16%if %{without tests}
17%undefine with_python2_tests
18%endif
595a528f
ER
19
20%define module greenlet
21Summary: Lightweight in-process concurrent programming
22Name: python-%{module}
f818725e 23Version: 0.4.2
c12edfc0 24Release: 1
f818725e
JK
25License: MIT & PSF
26Group: Libraries/Python
595a528f 27URL: http://pypi.python.org/pypi/greenlet
f818725e
JK
28Source0: http://pypi.python.org/packages/source/g/greenlet/%{module}-%{version}.zip
29# Source0-md5: 580a8a5e833351f7abdaedb1a877f7ac
c12edfc0 30Patch0: %{name}-gc_assertion_error.patch
f818725e 31%if %{with python2}
595a528f
ER
32BuildRequires: python-devel
33BuildRequires: python-setuptools
f818725e
JK
34%endif
35%if %{with python3}
36BuildRequires: python3-2to3
37BuildRequires: python3-devel
38BuildRequires: python3-distribute
39BuildRequires: python3-modules
40%endif
41BuildRequires: rpmbuild(macros) >= 1.219
595a528f
ER
42BuildRequires: rpm-pythonprov
43BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45%description
46The greenlet package is a spin-off of Stackless, a version of CPython
47that supports micro-threads called "tasklets". Tasklets run
48pseudo-concurrently (typically in a single or a few OS-level threads)
49and are synchronized with data exchanges on "channels".
50
51%package devel
52Summary: C development headers for python-greenlet
53Group: Development/Libraries
54Requires: %{name} = %{version}-%{release}
55
56%description devel
57This package contains header files required for C modules development.
58
f818725e
JK
59%package -n python3-%{module}
60Summary: Lightweight in-process concurrent programming
61Group: Libraries/Python
62
63%description -n python3-%{module}
64The greenlet package is a spin-off of Stackless, a version of CPython
65that supports micro-threads called "tasklets". Tasklets run
66pseudo-concurrently (typically in a single or a few OS-level threads)
67and are synchronized with data exchanges on "channels".
68
69%package -n python3-%{module}-devel
70Summary: C development headers for python3-greenlet
71Group: Development/Libraries
72Requires: python3-%{module} = %{version}-%{release}
73
74%description -n python3-%{module}-devel
75This package contains header files required for C modules development.
76
595a528f
ER
77%prep
78%setup -q -n greenlet-%{version}
c12edfc0 79%patch0 -p1
595a528f
ER
80
81%build
f818725e 82%if %{with python2}
595a528f
ER
83CC="%{__cc}" \
84CFLAGS="%{rpmcflags}" \
85%{__python} setup.py build
86
f818725e 87%if %{with python2_tests}
595a528f
ER
88%{__python} setup.py test
89
90# Run the upstream benchmarking suite to further exercise the code:
f818725e
JK
91PYTHONPATH=$(echo $(pwd)/build/lib.*-2.?) %{__python} benchmarks/chain.py
92%endif
93%endif
94
95%if %{with python3}
96# CC/CFLAGS is only for arch packages - remove on noarch packages
97CC="%{__cc}" \
98CFLAGS="%{rpmcflags}" \
99%{__python3} setup.py build %{?with_tests:test}
100
101%if %{with tests}
102# Run the upstream benchmarking suite to further exercise the code:
103mkdir -p benchmarks-3
1042to3-3.3 -o benchmarks-3 -n -w --no-diffs benchmarks
105PYTHONPATH=$(echo $(pwd)/build/lib.*-3.?) %{__python3} benchmarks-3/chain.py
595a528f
ER
106%endif
107%endif
108
109%install
f818725e
JK
110%if %{with python2}
111%{__python} setup.py \
112 install --skip-build \
595a528f
ER
113 --optimize=2 \
114 --root=$RPM_BUILD_ROOT
115
116%py_postclean
f818725e
JK
117%endif
118
119%if %{with python3}
120%{__python3} setup.py \
121 install --skip-build \
122 --optimize=2 \
123 --root=$RPM_BUILD_ROOT
124%endif
595a528f
ER
125
126%clean
127rm -rf $RPM_BUILD_ROOT
128
129%files
130%defattr(644,root,root,755)
f818725e 131%doc doc/greenlet.txt README.rst benchmarks AUTHORS NEWS LICENSE
595a528f
ER
132%attr(755,root,root) %{py_sitedir}/%{module}.so
133%{py_sitedir}/%{module}*.egg-info
134
135%files devel
136%defattr(644,root,root,755)
137%{_includedir}/python%{py_ver}/greenlet
f818725e
JK
138
139%files -n python3-%{module}
140%defattr(644,root,root,755)
141%doc doc/greenlet.txt README.rst benchmarks AUTHORS NEWS LICENSE
142%attr(755,root,root) %{py3_sitedir}/%{module}.*.so
143%{py3_sitedir}/%{module}*.egg-info
144
145%files -n python3-%{module}-devel
146%defattr(644,root,root,755)
147%{_includedir}/python%{py3_ver}*/greenlet
This page took 0.096438 seconds and 4 git commands to generate.