]>
Commit | Line | Data |
---|---|---|
f77466f5 | 1 | # |
595a528f ER |
2 | # Conditional build: |
3 | %bcond_without tests # do not perform "make test" | |
f818725e JK |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
6 | %bcond_without python2_tests # CPython 2.x module tests | |
7 | ||
8 | %if %{without tests} | |
9 | %undefine with_python2_tests | |
10 | %endif | |
595a528f ER |
11 | |
12 | %define module greenlet | |
13 | Summary: Lightweight in-process concurrent programming | |
f77466f5 | 14 | Summary(pl.UTF-8): Lekkie programowanie równoległe wewnątrz procesu |
595a528f | 15 | Name: python-%{module} |
0ecf5f31 | 16 | Version: 0.4.9 |
42d1cc4c | 17 | Release: 3 |
f77466f5 | 18 | License: MIT, PSF (Stackless Python parts) |
f818725e | 19 | Group: Libraries/Python |
f77466f5 JB |
20 | #Source0Download: https://pypi.python.org/simple/greenlet/ |
21 | Source0: https://pypi.python.org/packages/source/g/greenlet/%{module}-%{version}.zip | |
0ecf5f31 | 22 | # Source0-md5: c6659cdb2a5e591723e629d2eef22e82 |
f77466f5 | 23 | URL: https://pypi.python.org/pypi/greenlet |
670ee388 | 24 | BuildRequires: rpm-pythonprov |
f77466f5 | 25 | BuildRequires: rpmbuild(macros) >= 1.714 |
f818725e | 26 | %if %{with python2} |
f77466f5 | 27 | BuildRequires: python-devel >= 1:2.4 |
595a528f | 28 | BuildRequires: python-setuptools |
f818725e JK |
29 | %endif |
30 | %if %{with python3} | |
f77466f5 JB |
31 | BuildRequires: python3-2to3 >= 1:3.2 |
32 | BuildRequires: python3-devel >= 1:3.2 | |
0960fc6e | 33 | BuildRequires: python3-setuptools |
f77466f5 | 34 | BuildRequires: python3-modules >= 1:3.2 |
f818725e | 35 | %endif |
f77466f5 | 36 | Requires: python-modules >= 1:2.4 |
595a528f ER |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
38 | ||
670ee388 | 39 | # -fno-tree-dominator-opts because https://bugzilla.opensuse.org/show_bug.cgi?id=902146 |
2a720b56 MK |
40 | %define specflags_x32 -fno-tree-dominator-opts |
41 | ||
595a528f ER |
42 | %description |
43 | The greenlet package is a spin-off of Stackless, a version of CPython | |
44 | that supports micro-threads called "tasklets". Tasklets run | |
45 | pseudo-concurrently (typically in a single or a few OS-level threads) | |
46 | and are synchronized with data exchanges on "channels". | |
47 | ||
f77466f5 JB |
48 | %description -l pl.UTF-8 |
49 | Pakiet greenlet to odprysk projektu Stackless - wersji CPythona | |
50 | obsługującej mikrowątki zwane "taskletami". Tasklety działają | |
51 | pseudorównolegle (zwykle w jednym lub kilku wątkach na poziomie | |
52 | systemu operacyjnego) i są synchronizowane przy wymianie danych | |
53 | poprzez "kanały". | |
54 | ||
595a528f | 55 | %package devel |
f77466f5 JB |
56 | Summary: C development headers for Python 2 greenlet module |
57 | Summary(pl.UTF-8): Pliki nagłówkowe C dla modułu Pythona 2 greenlet | |
595a528f ER |
58 | Group: Development/Libraries |
59 | Requires: %{name} = %{version}-%{release} | |
f77466f5 | 60 | Requires: python-devel >= 1:2.4 |
595a528f ER |
61 | |
62 | %description devel | |
63 | This package contains header files required for C modules development. | |
64 | ||
f77466f5 JB |
65 | %description devel -l pl.UTF-8 |
66 | Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia modułów w | |
67 | C. | |
68 | ||
f818725e JK |
69 | %package -n python3-%{module} |
70 | Summary: Lightweight in-process concurrent programming | |
f77466f5 | 71 | Summary(pl.UTF-8): Lekkie programowanie równoległe wewnątrz procesu |
f818725e | 72 | Group: Libraries/Python |
f77466f5 | 73 | Requires: python3-modules >= 1:3.2 |
f818725e JK |
74 | |
75 | %description -n python3-%{module} | |
76 | The greenlet package is a spin-off of Stackless, a version of CPython | |
77 | that supports micro-threads called "tasklets". Tasklets run | |
78 | pseudo-concurrently (typically in a single or a few OS-level threads) | |
79 | and are synchronized with data exchanges on "channels". | |
80 | ||
f77466f5 JB |
81 | %description -n python3-%{module} -l pl.UTF-8 |
82 | Pakiet greenlet to odprysk projektu Stackless - wersji CPythona | |
83 | obsługującej mikrowątki zwane "taskletami". Tasklety działają | |
84 | pseudorównolegle (zwykle w jednym lub kilku wątkach na poziomie | |
85 | systemu operacyjnego) i są synchronizowane przy wymianie danych | |
86 | poprzez "kanały". | |
87 | ||
f818725e | 88 | %package -n python3-%{module}-devel |
f77466f5 JB |
89 | Summary: C development headers for Python 3 greenlet module |
90 | Summary(pl.UTF-8): Pliki nagłówkowe C dla modułu Pythona 3 greenlet | |
f818725e JK |
91 | Group: Development/Libraries |
92 | Requires: python3-%{module} = %{version}-%{release} | |
f77466f5 | 93 | Requires: python3-devel >= 1:3.2 |
f818725e JK |
94 | |
95 | %description -n python3-%{module}-devel | |
96 | This package contains header files required for C modules development. | |
97 | ||
f77466f5 JB |
98 | %description -n python3-%{module}-devel -l pl.UTF-8 |
99 | Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia modułów w | |
100 | C. | |
101 | ||
595a528f ER |
102 | %prep |
103 | %setup -q -n greenlet-%{version} | |
595a528f ER |
104 | |
105 | %build | |
f818725e | 106 | %if %{with python2} |
595a528f | 107 | CC="%{__cc}" \ |
2a720b56 | 108 | CFLAGS="%{rpmcflags} " \ |
f77466f5 | 109 | %py_build %{?with_python2_tests:test} |
595a528f | 110 | |
f818725e | 111 | %if %{with python2_tests} |
595a528f | 112 | # Run the upstream benchmarking suite to further exercise the code: |
f77466f5 | 113 | PYTHONPATH=$(echo $(pwd)/build-2/lib.*-2.?) %{__python} benchmarks/chain.py |
f818725e JK |
114 | %endif |
115 | %endif | |
116 | ||
117 | %if %{with python3} | |
5c11c3f5 | 118 | %py3_build %{?with_tests:test} |
f818725e JK |
119 | |
120 | %if %{with tests} | |
121 | # Run the upstream benchmarking suite to further exercise the code: | |
122 | mkdir -p benchmarks-3 | |
b5e21f14 | 123 | 2to3-%{py3_ver} -o benchmarks-3 -n -w --no-diffs benchmarks |
f77466f5 | 124 | PYTHONPATH=$(echo $(pwd)/build-3/lib.*-3.?) %{__python3} benchmarks-3/chain.py |
595a528f ER |
125 | %endif |
126 | %endif | |
127 | ||
128 | %install | |
670ee388 | 129 | rm -rf $RPM_BUILD_ROOT |
f818725e | 130 | %if %{with python2} |
5c11c3f5 | 131 | %py_install |
595a528f ER |
132 | |
133 | %py_postclean | |
f818725e JK |
134 | %endif |
135 | ||
136 | %if %{with python3} | |
5c11c3f5 | 137 | %py3_install |
f818725e | 138 | %endif |
595a528f ER |
139 | |
140 | %clean | |
141 | rm -rf $RPM_BUILD_ROOT | |
142 | ||
f77466f5 | 143 | %if %{with python2} |
595a528f ER |
144 | %files |
145 | %defattr(644,root,root,755) | |
f77466f5 JB |
146 | %doc AUTHORS LICENSE NEWS README.rst doc/greenlet.txt benchmarks |
147 | %attr(755,root,root) %{py_sitedir}/greenlet.so | |
148 | %{py_sitedir}/greenlet-%{version}-py*.egg-info | |
595a528f ER |
149 | |
150 | %files devel | |
151 | %defattr(644,root,root,755) | |
152 | %{_includedir}/python%{py_ver}/greenlet | |
f77466f5 | 153 | %endif |
f818725e | 154 | |
f77466f5 | 155 | %if %{with python3} |
f818725e JK |
156 | %files -n python3-%{module} |
157 | %defattr(644,root,root,755) | |
f77466f5 JB |
158 | %doc AUTHORS LICENSE NEWS README.rst doc/greenlet.txt benchmarks-3 |
159 | %attr(755,root,root) %{py3_sitedir}/greenlet.cpython-*.so | |
160 | %{py3_sitedir}/greenlet-%{version}-py*.egg-info | |
f818725e JK |
161 | |
162 | %files -n python3-%{module}-devel | |
163 | %defattr(644,root,root,755) | |
164 | %{_includedir}/python%{py3_ver}*/greenlet | |
f77466f5 | 165 | %endif |