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