]>
Commit | Line | Data |
---|---|---|
595a528f ER |
1 | # Conditional build: |
2 | %bcond_without tests # do not perform "make test" | |
f818725e JK |
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 | |
6 | ||
7 | %if %{without tests} | |
8 | %undefine with_python2_tests | |
9 | %endif | |
595a528f ER |
10 | |
11 | %define module greenlet | |
12 | Summary: Lightweight in-process concurrent programming | |
13 | Name: python-%{module} | |
0ecf5f31 | 14 | Version: 0.4.9 |
590e7407 | 15 | Release: 2 |
f818725e JK |
16 | License: MIT & PSF |
17 | Group: Libraries/Python | |
f818725e | 18 | Source0: http://pypi.python.org/packages/source/g/greenlet/%{module}-%{version}.zip |
0ecf5f31 | 19 | # Source0-md5: c6659cdb2a5e591723e629d2eef22e82 |
670ee388 ER |
20 | URL: http://pypi.python.org/pypi/greenlet |
21 | BuildRequires: rpm-pythonprov | |
22 | BuildRequires: rpmbuild(macros) >= 1.219 | |
f818725e | 23 | %if %{with python2} |
595a528f ER |
24 | BuildRequires: python-devel |
25 | BuildRequires: python-setuptools | |
f818725e JK |
26 | %endif |
27 | %if %{with python3} | |
b5e21f14 | 28 | BuildRequires: python3-2to3 |
f818725e | 29 | BuildRequires: python3-devel |
0960fc6e | 30 | BuildRequires: python3-setuptools |
f818725e JK |
31 | BuildRequires: python3-modules |
32 | %endif | |
595a528f ER |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
34 | ||
670ee388 | 35 | # -fno-tree-dominator-opts because https://bugzilla.opensuse.org/show_bug.cgi?id=902146 |
2a720b56 MK |
36 | %define specflags_x32 -fno-tree-dominator-opts |
37 | ||
595a528f ER |
38 | %description |
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". | |
43 | ||
44 | %package devel | |
45 | Summary: C development headers for python-greenlet | |
46 | Group: Development/Libraries | |
47 | Requires: %{name} = %{version}-%{release} | |
48 | ||
49 | %description devel | |
50 | This package contains header files required for C modules development. | |
51 | ||
f818725e JK |
52 | %package -n python3-%{module} |
53 | Summary: Lightweight in-process concurrent programming | |
54 | Group: Libraries/Python | |
55 | ||
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". | |
61 | ||
62 | %package -n python3-%{module}-devel | |
63 | Summary: C development headers for python3-greenlet | |
64 | Group: Development/Libraries | |
65 | Requires: python3-%{module} = %{version}-%{release} | |
66 | ||
67 | %description -n python3-%{module}-devel | |
68 | This package contains header files required for C modules development. | |
69 | ||
595a528f ER |
70 | %prep |
71 | %setup -q -n greenlet-%{version} | |
595a528f ER |
72 | |
73 | %build | |
f818725e | 74 | %if %{with python2} |
595a528f | 75 | CC="%{__cc}" \ |
2a720b56 | 76 | CFLAGS="%{rpmcflags} " \ |
5c11c3f5 | 77 | %py_build |
595a528f | 78 | |
f818725e | 79 | %if %{with python2_tests} |
595a528f ER |
80 | %{__python} setup.py test |
81 | ||
82 | # Run the upstream benchmarking suite to further exercise the code: | |
f818725e JK |
83 | PYTHONPATH=$(echo $(pwd)/build/lib.*-2.?) %{__python} benchmarks/chain.py |
84 | %endif | |
85 | %endif | |
86 | ||
87 | %if %{with python3} | |
5c11c3f5 | 88 | %py3_build %{?with_tests:test} |
f818725e JK |
89 | |
90 | %if %{with tests} | |
91 | # Run the upstream benchmarking suite to further exercise the code: | |
92 | mkdir -p benchmarks-3 | |
b5e21f14 | 93 | 2to3-%{py3_ver} -o benchmarks-3 -n -w --no-diffs benchmarks |
f818725e | 94 | PYTHONPATH=$(echo $(pwd)/build/lib.*-3.?) %{__python3} benchmarks-3/chain.py |
595a528f ER |
95 | %endif |
96 | %endif | |
97 | ||
98 | %install | |
670ee388 | 99 | rm -rf $RPM_BUILD_ROOT |
f818725e | 100 | %if %{with python2} |
5c11c3f5 | 101 | %py_install |
595a528f ER |
102 | |
103 | %py_postclean | |
f818725e JK |
104 | %endif |
105 | ||
106 | %if %{with python3} | |
5c11c3f5 | 107 | %py3_install |
f818725e | 108 | %endif |
595a528f ER |
109 | |
110 | %clean | |
111 | rm -rf $RPM_BUILD_ROOT | |
112 | ||
113 | %files | |
114 | %defattr(644,root,root,755) | |
f818725e | 115 | %doc doc/greenlet.txt README.rst benchmarks AUTHORS NEWS LICENSE |
595a528f ER |
116 | %attr(755,root,root) %{py_sitedir}/%{module}.so |
117 | %{py_sitedir}/%{module}*.egg-info | |
118 | ||
119 | %files devel | |
120 | %defattr(644,root,root,755) | |
121 | %{_includedir}/python%{py_ver}/greenlet | |
f818725e JK |
122 | |
123 | %files -n python3-%{module} | |
124 | %defattr(644,root,root,755) | |
125 | %doc doc/greenlet.txt README.rst benchmarks AUTHORS NEWS LICENSE | |
126 | %attr(755,root,root) %{py3_sitedir}/%{module}.*.so | |
127 | %{py3_sitedir}/%{module}*.egg-info | |
128 | ||
129 | %files -n python3-%{module}-devel | |
130 | %defattr(644,root,root,755) | |
131 | %{_includedir}/python%{py3_ver}*/greenlet |