]> git.pld-linux.org Git - packages/python-greenlet.git/blob - python-greenlet.spec
rebuild with python 3.10
[packages/python-greenlet.git] / python-greenlet.spec
1 #
2 # Conditional build:
3 %bcond_without  python2         # CPython 2.x module
4 %bcond_without  python3         # CPython 3.x module
5 %bcond_without  doc             # Sphinx documentation
6 %bcond_without  tests           # unit tests and benchmarks (any)
7 %bcond_without  tests_py2       # CPython 2.x module tests
8
9 %if %{without tests}
10 %undefine       with_tests_py2
11 %endif
12
13 %define         module  greenlet
14 Summary:        Lightweight in-process concurrent programming
15 Summary(pl.UTF-8):      Lekkie programowanie równoległe wewnątrz procesu
16 Name:           python-%{module}
17 Version:        1.1.2
18 Release:        3
19 License:        MIT, PSF (Stackless Python parts)
20 Group:          Libraries/Python
21 #Source0Download: https://pypi.org/simple/greenlet/
22 Source0:        https://files.pythonhosted.org/packages/source/g/greenlet/%{module}-%{version}.tar.gz
23 # Source0-md5:  f424fbd9afeed575dd2ba5f0ac66e30b
24 Patch0:         %{name}-py3.8.patch
25 URL:            https://pypi.org/project/greenlet/
26 BuildRequires:  rpm-pythonprov
27 BuildRequires:  rpmbuild(macros) >= 1.714
28 %if %{with python2}
29 BuildRequires:  python-devel >= 1:2.7
30 BuildRequires:  python-setuptools
31 %endif
32 %if %{with python3}
33 BuildRequires:  python3-2to3 >= 1:3.5
34 BuildRequires:  python3-devel >= 1:3.5
35 BuildRequires:  python3-setuptools
36 BuildRequires:  python3-modules >= 1:3.5
37 %endif
38 %if %{with doc}
39 BuildRequires:  sphinx-pdg-3
40 %endif
41 Requires:       python-modules >= 1:2.7
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44 # -fno-tree-dominator-opts because https://bugzilla.opensuse.org/show_bug.cgi?id=902146
45 %define         specflags_x32   -fno-tree-dominator-opts
46
47 %description
48 The greenlet package is a spin-off of Stackless, a version of CPython
49 that supports micro-threads called "tasklets". Tasklets run
50 pseudo-concurrently (typically in a single or a few OS-level threads)
51 and are synchronized with data exchanges on "channels".
52
53 %description -l pl.UTF-8
54 Pakiet greenlet to odprysk projektu Stackless - wersji CPythona
55 obsługującej mikrowątki zwane "taskletami". Tasklety działają
56 pseudorównolegle (zwykle w jednym lub kilku wątkach na poziomie
57 systemu operacyjnego) i są synchronizowane przy wymianie danych
58 poprzez "kanały".
59
60 %package devel
61 Summary:        C development headers for Python 2 greenlet module
62 Summary(pl.UTF-8):      Pliki nagłówkowe C dla modułu Pythona 2 greenlet
63 Group:          Development/Libraries
64 Requires:       %{name} = %{version}-%{release}
65 Requires:       python-devel >= 1:2.7
66
67 %description devel
68 This package contains header files required for C modules development.
69
70 %description devel -l pl.UTF-8
71 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia modułów w
72 C.
73
74 %package -n python3-%{module}
75 Summary:        Lightweight in-process concurrent programming
76 Summary(pl.UTF-8):      Lekkie programowanie równoległe wewnątrz procesu
77 Group:          Libraries/Python
78 Requires:       python3-modules >= 1:3.5
79
80 %description -n python3-%{module}
81 The greenlet package is a spin-off of Stackless, a version of CPython
82 that supports micro-threads called "tasklets". Tasklets run
83 pseudo-concurrently (typically in a single or a few OS-level threads)
84 and are synchronized with data exchanges on "channels".
85
86 %description -n python3-%{module} -l pl.UTF-8
87 Pakiet greenlet to odprysk projektu Stackless - wersji CPythona
88 obsługującej mikrowątki zwane "taskletami". Tasklety działają
89 pseudorównolegle (zwykle w jednym lub kilku wątkach na poziomie
90 systemu operacyjnego) i są synchronizowane przy wymianie danych
91 poprzez "kanały".
92
93 %package -n python3-%{module}-devel
94 Summary:        C development headers for Python 3 greenlet module
95 Summary(pl.UTF-8):      Pliki nagłówkowe C dla modułu Pythona 3 greenlet
96 Group:          Development/Libraries
97 Requires:       python3-%{module} = %{version}-%{release}
98 Requires:       python3-devel >= 1:3.5
99
100 %description -n python3-%{module}-devel
101 This package contains header files required for C modules development.
102
103 %description -n python3-%{module}-devel -l pl.UTF-8
104 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia modułów w
105 C.
106
107 %package apidocs
108 Summary:        API documentation for Python greenlet module
109 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona greenlet
110 Group:          Documentation
111
112 %description apidocs
113 API documentation for Python greenlet module.
114
115 %description apidocs -l pl.UTF-8
116 Dokumentacja API modułu Pythona greenlet.
117
118 %prep
119 %setup -q -n greenlet-%{version}
120 %patch0 -p1
121
122 %build
123 %if %{with python2}
124 %py_build
125
126 %if %{with tests_py2}
127 BUILDDIR=$(echo $(pwd)/build-2/lib.linux-*)
128 PYTHONPATH="$BUILDDIR" \
129 %{__python} -m unittest discover greenlet.tests
130
131 # Run the upstream benchmarking suite to further exercise the code:
132 PYTHONPATH="$BUILDDIR" \
133 %{__python} benchmarks/chain.py
134 %endif
135 %endif
136
137 %if %{with python3}
138 %py3_build
139
140 %if %{with tests}
141 BUILDDIR=$(echo $(pwd)/build-3/lib.linux-*)
142 PYTHONPATH="$BUILDDIR" \
143 %{__python3} -m unittest discover greenlet.tests
144
145 # Run the upstream benchmarking suite to further exercise the code:
146 mkdir -p benchmarks-3
147 2to3-%{py3_ver} -o benchmarks-3 -n -w --no-diffs benchmarks
148 PYTHONPATH="$BUILDDIR" \
149 %{__python3} benchmarks-3/chain.py
150 %endif
151 %endif
152
153 %if %{with doc}
154 PYTHONPATH=$(echo $(pwd)/build-3/lib.linux-*) \
155 %{__make} -C docs html \
156         SPHINXBUILD=sphinx-build-3
157 %endif
158
159 %install
160 rm -rf $RPM_BUILD_ROOT
161
162 %if %{with python2}
163 %py_install
164
165 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/greenlet/*.[ch]
166 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/greenlet/{platform,tests}
167 %py_postclean
168 %endif
169
170 %if %{with python3}
171 %py3_install
172
173 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/greenlet/*.[ch]
174 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/greenlet/{platform,tests}
175 %endif
176
177 %clean
178 rm -rf $RPM_BUILD_ROOT
179
180 %if %{with python2}
181 %files
182 %defattr(644,root,root,755)
183 %doc AUTHORS CHANGES.rst LICENSE README.rst benchmarks
184 %dir %{py_sitedir}/greenlet
185 %attr(755,root,root) %{py_sitedir}/greenlet/_greenlet.so
186 %{py_sitedir}/greenlet/*.py[co]
187 %{py_sitedir}/greenlet-%{version}-py*.egg-info
188
189 %files devel
190 %defattr(644,root,root,755)
191 %{_includedir}/python%{py_ver}/greenlet
192 %endif
193
194 %if %{with python3}
195 %files -n python3-%{module}
196 %defattr(644,root,root,755)
197 %doc AUTHORS CHANGES.rst LICENSE README.rst %{?with_tests:benchmarks-3}
198 %dir %{py3_sitedir}/greenlet
199 %attr(755,root,root) %{py3_sitedir}/greenlet/_greenlet.cpython-*.so
200 %{py3_sitedir}/greenlet/*.py
201 %{py3_sitedir}/greenlet/__pycache__
202 %{py3_sitedir}/greenlet-%{version}-py*.egg-info
203
204 %files -n python3-%{module}-devel
205 %defattr(644,root,root,755)
206 %{_includedir}/python%{py3_ver}*/greenlet
207 %endif
208
209 %if %{with doc}
210 %files apidocs
211 %defattr(644,root,root,755)
212 %doc docs/_build/html/{_modules,_static,*.html,*.js}
213 %endif
This page took 0.135968 seconds and 3 git commands to generate.