]> git.pld-linux.org Git - packages/python-greenlet.git/blob - python-greenlet.spec
ae71875824c062a70e13008503ce590a97fab79d
[packages/python-greenlet.git] / python-greenlet.spec
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
10 # Conditional build:
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
15
16 %if %{without tests}
17 %undefine       with_python2_tests
18 %endif
19
20 %define         module  greenlet
21 Summary:        Lightweight in-process concurrent programming
22 Name:           python-%{module}
23 Version:        0.4.2
24 Release:        0.1
25 License:        MIT & PSF
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
30 %if %{with python2}
31 BuildRequires:  python-devel
32 BuildRequires:  python-setuptools
33 %endif
34 %if %{with python3}
35 BuildRequires:  python3-2to3
36 BuildRequires:  python3-devel
37 BuildRequires:  python3-distribute
38 BuildRequires:  python3-modules
39 %endif
40 BuildRequires:  rpmbuild(macros) >= 1.219
41 BuildRequires:  rpm-pythonprov
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44 %description
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".
49
50 %package devel
51 Summary:        C development headers for python-greenlet
52 Group:          Development/Libraries
53 Requires:       %{name} = %{version}-%{release}
54
55 %description devel
56 This package contains header files required for C modules development.
57
58 %package -n python3-%{module}
59 Summary:        Lightweight in-process concurrent programming
60 Group:          Libraries/Python
61
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".
67
68 %package -n python3-%{module}-devel
69 Summary:        C development headers for python3-greenlet
70 Group:          Development/Libraries
71 Requires:       python3-%{module} = %{version}-%{release}
72
73 %description -n python3-%{module}-devel
74 This package contains header files required for C modules development.
75
76 %prep
77 %setup -q -n greenlet-%{version}
78
79 %build
80 %if %{with python2}
81 CC="%{__cc}" \
82 CFLAGS="%{rpmcflags}" \
83 %{__python} setup.py build
84
85 %if %{with python2_tests}
86 %{__python} setup.py test
87
88 # Run the upstream benchmarking suite to further exercise the code:
89 PYTHONPATH=$(echo $(pwd)/build/lib.*-2.?) %{__python} benchmarks/chain.py
90 %endif
91 %endif
92
93 %if %{with python3}
94 # CC/CFLAGS is only for arch packages - remove on noarch packages
95 CC="%{__cc}" \
96 CFLAGS="%{rpmcflags}" \
97 %{__python3} setup.py build %{?with_tests:test}
98
99 %if %{with tests}
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
104 %endif
105 %endif
106
107 %install
108 %if %{with python2}
109 %{__python} setup.py \
110         install --skip-build \
111         --optimize=2 \
112         --root=$RPM_BUILD_ROOT
113
114 %py_postclean
115 %endif
116
117 %if %{with python3}
118 %{__python3} setup.py \
119         install --skip-build \
120         --optimize=2 \
121         --root=$RPM_BUILD_ROOT
122 %endif
123
124 %clean
125 rm -rf $RPM_BUILD_ROOT
126
127 %files
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
132
133 %files devel
134 %defattr(644,root,root,755)
135 %{_includedir}/python%{py_ver}/greenlet
136
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
142
143 %files -n python3-%{module}-devel
144 %defattr(644,root,root,755)
145 %{_includedir}/python%{py3_ver}*/greenlet
This page took 0.060289 seconds and 2 git commands to generate.