1 |
# NOTES ON BOOTSTRAPING PYTHON 3.x: |
2 |
# |
3 |
# Due to a dependency cycle between Python, rpm, pip, setuptools, wheel, |
4 |
# and other packages, in order to rebase Python 3 one has to build in the |
5 |
# following order: |
6 |
# |
7 |
# 1. gdb %%bcond_with python |
8 |
# 2. gtk-doc %%bcond_without bootstrap |
9 |
# 3. rpm-mageia-setup %%bcond_without bootstrap |
10 |
# 4. python-rpm-generators %%bcond_without bootstrap |
11 |
# 5. pyproject-rpm-macros %%bcond_without bootstrap %%bcond_with tests |
12 |
# 6. python3 (if python3 is build to core/udpates_testing there's no need to use %bcond_with rpmwheels) |
13 |
# 7. python-rpm-macros (update __default_python3_version) |
14 |
# 8. python-setuptools %%bcond_without bootstrap |
15 |
# 9. python-flit-core %%bcond_without bootstrap |
16 |
# 10. python-packaging %%bcond_without bootstrap |
17 |
# 11. python-wheel %%bcond_without bootstrap |
18 |
# 12. python-pip %%bcond_with doc |
19 |
# 13. python-rpm-generators %%bcond_with bootstrap |
20 |
# 15. python-setuptools %%bcond_with bootstrap |
21 |
# 16. python-wheel %%bcond_with bootstrap |
22 |
# 17. rpm |
23 |
# 18. python-packaging %%bcond_with bootstrap |
24 |
# 18. pyproject-rpm-macros %%bcond_with bootstrap |
25 |
# 19. python-cython |
26 |
# 20. python-numpy |
27 |
# 21. boost |
28 |
# 22. meson |
29 |
# 23. ninja |
30 |
# 24. x11-proto-devel |
31 |
# 25. gdb %%bcond_without python |
32 |
# 26. python-coverage |
33 |
# 27. python-nose |
34 |
# 28. python-yaml |
35 |
# 29. python-markdown |
36 |
# 30. python-markupsafe |
37 |
# 31. python-beaker |
38 |
# 32. python-typing-extensions |
39 |
# 33. python-setuptools-scm |
40 |
# 34. python-tomli |
41 |
# 35. python-six |
42 |
# 36. python-dateutil |
43 |
# 37. python-pbr |
44 |
# 38. python-linecache2 |
45 |
# 39. python-funcsigs |
46 |
# 40. python-mock |
47 |
# 41. python-mako |
48 |
# 42. python-pygments |
49 |
# 43. python-charset-normalizer %%bcond_with test |
50 |
# 44. python-idna |
51 |
# 45. python-urllib3 %%bcond_with check |
52 |
# 46. python-requests |
53 |
# 47. python-chardet |
54 |
# 48. python-docutils |
55 |
# 49. gobject-introspection |
56 |
# 50. python-enchant |
57 |
# 51. file |
58 |
# 52. rpmlint |
59 |
# 53. rpm-mageia-setup %%bcond_with bootstrap |
60 |
# 54. gobject-introspection (again with rpm-mageia-setup) |
61 |
# 55. bm |
62 |
# 56. python-httplib2 |
63 |
# 57. python-pyparsing |
64 |
# 58. mgarepo |
65 |
|
66 |
# Then the most important packages have to be built, starting from their |
67 |
# various leaf dependencies recursively. After these have been built, a |
68 |
# targeted rebuild should be requested for the rest. |
69 |
# |
70 |
# Currently these packages are recommended to have been built before a targeted |
71 |
# rebuild after a python abi change: |
72 |
# 1. python-pluggy |
73 |
# 2. python-editables |
74 |
# 3. python-pathspec |
75 |
# 4. python-calver |
76 |
# 5. python-trove-classifiers |
77 |
# 6. python-hatchling |
78 |
# 7. python-hatch-vcs |
79 |
# 8. python-hatch-fancy-pypi-readme |
80 |
# 9. python-attrs |
81 |
# 10. python-py |
82 |
# 11. python-iniconfig |
83 |
# 12. python-pytest |
84 |
# |
85 |
# 13. python-sphinx-rtd-theme |
86 |
# 14. python-sphinx-theme-alabaster |
87 |
# 15. python-pytz |
88 |
# 16. python-babel |
89 |
# 17. python-imagesize |
90 |
# 18. python-jinja2 |
91 |
# 19. python-snowballstemmer |
92 |
# 20. python-sphinxcontrib-applehelp |
93 |
# 21. python-sphinxcontrib-devhelp |
94 |
# 22. python-sphinxcontrib-htmlhelp |
95 |
# 23. python-sphinxcontrib-jsmath |
96 |
# 24. python-sphinxcontrib-qthelp |
97 |
# 25. python-sphinxcontrib-serializinghtml |
98 |
# 26. python-sphinxcontrib-websupport |
99 |
# 27. python-sphinx |
100 |
|
101 |
# version |
102 |
%global oversion 3.12.2 |
103 |
%global docver 3.12.2 |
104 |
|
105 |
%global pybasever %(echo %{oversion} | cut -d. -f1,2) |
106 |
%global familyver %(echo %{oversion} | cut -d. -f1) |
107 |
|
108 |
# pybasever without the dot: |
109 |
%global pyshortver %(echo %{pybasever} | tr -d '.') |
110 |
|
111 |
# comment out if not prerel |
112 |
#global prerel rc1 |
113 |
|
114 |
# rel for bumping |
115 |
%global rel 5 |
116 |
|
117 |
# filter out bogus requires on python(abi) = 3.6 for testsuite |
118 |
%global __requires_exclude_from %{?__requires_exclude_from:%__requires_exclude_from|}^%{_libdir}/python%{pybasever}/test/test_importlib/data |
119 |
|
120 |
# For bootstrapping python3.x to python3.y |
121 |
%bcond_with bootstrap |
122 |
|
123 |
%bcond_with dtrace |
124 |
|
125 |
# Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package |
126 |
# Uses upstream bundled prebuilt wheels otherwise |
127 |
%bcond_without rpmwheels |
128 |
# If the rpmwheels condition is disabled, we use the bundled wheel packages |
129 |
# from Python with the versions below. |
130 |
# This needs to be manually updated when we update Python. |
131 |
%global pip_version 24.0 |
132 |
%global setuptools_version 67.6.1 |
133 |
%global wheel_version 0.40.0 |
134 |
|
135 |
# Expensive optimizations (mainly, profile-guided optimizations) |
136 |
%bcond_without optimizations |
137 |
|
138 |
# Run the test suite in %%check |
139 |
%bcond_without check |
140 |
|
141 |
# Support for the GDB debugger |
142 |
%bcond_with gdb_hooks |
143 |
|
144 |
# The dbm.gnu module (key-value database) |
145 |
%bcond_without gdbm |
146 |
|
147 |
# Main interpreter loop optimization |
148 |
%bcond_without computed_gotos |
149 |
|
150 |
# Support for the Valgrind debugger/profiler |
151 |
#%%ifarch %%{valgrind_arches} |
152 |
%ifarch %ix86 x86_64 %arm64 |
153 |
%bcond_without valgrind |
154 |
%else |
155 |
%bcond_with valgrind |
156 |
%endif |
157 |
|
158 |
# ===================== |
159 |
# General global macros |
160 |
# ===================== |
161 |
|
162 |
%global pylibdir %{_libdir}/python%{pybasever} |
163 |
%global dynload_dir %{pylibdir}/lib-dynload |
164 |
|
165 |
# ABIFLAGS, LDVERSION and SOABI are in the upstream configure.ac |
166 |
# See PEP 3149 for some background: https://www.python.org/dev/peps/pep-3149/ |
167 |
%global ABIFLAGS_optimized %{nil} |
168 |
|
169 |
%global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized} |
170 |
|
171 |
# We use the upstream arch triplets, we convert them from %%{_arch}-linux%%{_gnu} |
172 |
%global platform_triplet %{expand:%(echo %{_arch}-linux%{_gnu} | sed -E \\ |
173 |
-e 's/^arm(eb)?-linux-gnu(eabi)?$/arm\\1-linux-gnueabihf/')} |
174 |
|
175 |
%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{platform_triplet} |
176 |
|
177 |
# All bytecode files are in a __pycache__ subdirectory, with a name |
178 |
# reflecting the version of the bytecode. |
179 |
# See PEP 3147: https://www.python.org/dev/peps/pep-3147/ |
180 |
# For example, |
181 |
# foo/bar.py |
182 |
# has bytecode at: |
183 |
# foo/__pycache__/bar.cpython-%%{pyshortver}.pyc |
184 |
# foo/__pycache__/bar.cpython-%%{pyshortver}.opt-1.pyc |
185 |
# foo/__pycache__/bar.cpython-%%{pyshortver}.opt-2.pyc |
186 |
%global bytecode_suffixes .cpython-%{pyshortver}*.pyc |
187 |
|
188 |
# Disable automatic bytecompilation. The python3 binary is not yet be |
189 |
# available in /usr/bin when Python is built. Also, the bytecompilation fails |
190 |
# on files that test invalid syntax. |
191 |
%global __brp_python_bytecompile %nil |
192 |
|
193 |
%define lib_major %{pybasever} |
194 |
%define lib_name_orig libpython%{familyver} |
195 |
%define lib_name %mklibname python %{lib_major} |
196 |
%define develname %mklibname python3 -d |
197 |
|
198 |
Summary: An interpreted, interactive object-oriented programming language |
199 |
Name: python3 |
200 |
Version: %{oversion} |
201 |
Release: %mkrel %{?prerel:0.%prerel.}%{rel} |
202 |
License: Modified CNRI Open Source License |
203 |
Group: Development/Python |
204 |
|
205 |
BuildRequires: autoconf-archive |
206 |
BuildRequires: automake |
207 |
BuildRequires: gcc-c++ |
208 |
BuildRequires: blt |
209 |
BuildRequires: pkgconfig(bluez) |
210 |
BuildRequires: db-devel |
211 |
BuildRequires: pkgconfig(expat) |
212 |
BuildRequires: gdbm-devel |
213 |
BuildRequires: gmp-devel |
214 |
BuildRequires: pkgconfig(libffi) |
215 |
BuildRequires: pkgconfig(libnsl) |
216 |
BuildRequires: pkgconfig(ncursesw) |
217 |
BuildRequires: mpdecimal-devel |
218 |
BuildRequires: pkgconfig(openssl) >= 1.1 |
219 |
BuildRequires: libtirpc-devel |
220 |
BuildRequires: readline-devel |
221 |
BuildRequires: termcap-devel |
222 |
BuildRequires: tcl |
223 |
BuildRequires: pkgconfig(tcl) |
224 |
BuildRequires: tk |
225 |
BuildRequires: pkgconfig(tk) |
226 |
BuildRequires: autoconf |
227 |
BuildRequires: pkgconfig(bzip2) |
228 |
BuildRequires: pkgconfig(sqlite3) |
229 |
BuildRequires: pkgconfig(liblzma) |
230 |
# uncomment once the emacs part no longer conflict with python 2.X |
231 |
#BuildRequires: emacs |
232 |
#BuildRequires: emacs-bin |
233 |
%if %{with valgrind} |
234 |
BuildRequires: pkgconfig(valgrind) |
235 |
%endif |
236 |
|
237 |
%if %{with dtrace} |
238 |
BuildRequires: systemtap-sdt-devel |
239 |
%endif |
240 |
|
241 |
%if %{with rpmwheels} |
242 |
BuildRequires: python-setuptools-wheel >= %{setuptools_version} |
243 |
BuildRequires: python-pip-wheel >= %{pip_version} |
244 |
%endif |
245 |
|
246 |
%if %{without bootstrap} |
247 |
# for make regen-all and distutils.tests.test_bdist_rpm |
248 |
BuildRequires: python%{familyver} |
249 |
# for proper automatic provides |
250 |
BuildRequires: python3-rpm-generators |
251 |
%endif |
252 |
|
253 |
Source0: https://www.python.org/ftp/python/%{oversion}/Python-%{oversion}%{?prerel}.tar.xz |
254 |
Source1: https://docs.python.org/%{pybasever}/archives/python-%{docver}%{?prerel}-docs-html.tar.bz2 |
255 |
|
256 |
# A simple script to check timestamps of bytecode files |
257 |
# Run in check section with Python that is currently being built |
258 |
# Originally written by bkabrda |
259 |
Source8: check-pyc-timestamps.py |
260 |
|
261 |
# |
262 |
# Upstream patches |
263 |
# |
264 |
Patch001: 0001-3.12-gh-115133-Fix-tests-for-XMLPullParser-with-Expa.patch |
265 |
|
266 |
# (Patches taken from github.com/fedora-python/cpython) |
267 |
|
268 |
# 00251 # cae5a6abc5df08239c85b83e4e250b6f2702e4f5 |
269 |
# Change user install location |
270 |
# |
271 |
# Set values of base and platbase in sysconfig from /usr |
272 |
# to /usr/local when RPM build is not detected |
273 |
# to make pip and similar tools install into separate location. |
274 |
# |
275 |
# Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe |
276 |
# Downstream only. |
277 |
# |
278 |
# We've tried to rework in Fedora 36/Python 3.10 to follow https://bugs.python.org/issue43976 |
279 |
# but we have identified serious problems with that approach, |
280 |
# see https://bugzilla.redhat.com/2026979 or https://bugzilla.redhat.com/2097183 |
281 |
# |
282 |
# pypa/distutils integration: https://github.com/pypa/distutils/pull/70 |
283 |
Patch251: 00251-change-user-install-location.patch |
284 |
|
285 |
# 00371 # d917a50238c94c652bc30ae9061d65f60cc8accd |
286 |
# Revert "bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549) (GH-28589)" |
287 |
# |
288 |
# This reverts commit 38c67738c64304928c68d5c2bd78bbb01d979b94. It |
289 |
# introduced regression causing FreeIPA's tests to fail. |
290 |
# |
291 |
# For more info see: |
292 |
# https://bodhi.fedoraproject.org/updates/FEDORA-2021-e152ce5f31 |
293 |
# https://github.com/GrahamDumpleton/mod_wsgi/issues/730 |
294 |
Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch |
295 |
|
296 |
# 00415 # 5b830b814be638d1a167802780b5f498a4a5e97c |
297 |
# [CVE-2023-27043] gh-102988: Reject malformed addresses in email.parseaddr() (#111116) |
298 |
# |
299 |
# Detect email address parsing errors and return empty tuple to |
300 |
# indicate the parsing error (old API). Add an optional 'strict' |
301 |
# parameter to getaddresses() and parseaddr() functions. Patch by |
302 |
# Thomas Dwyer. |
303 |
Patch415: 00415-cve-2023-27043-gh-102988-reject-malformed-addresses-in-email-parseaddr-111116.patch |
304 |
|
305 |
# 00418 # 153905265371131e1227ace0dfef34a5c5efde59 |
306 |
# Don't generate sbom in make regen-all |
307 |
# |
308 |
# The script and make target, added in Python 3.12.2, assumes a fixed |
309 |
# location of pip wheel and other bundled libraries, resulting in an |
310 |
# error and failed build when not found. |
311 |
# Reported upstream: https://github.com/python/cpython/issues/114240 |
312 |
# and https://github.com/python/cpython/issues/114244 |
313 |
Patch418: 00418-don-t-generate-sbom-in-make-regen-all.patch |
314 |
|
315 |
# (New patches go here ^^^) |
316 |
# |
317 |
# Mageia patches |
318 |
# |
319 |
#Patch501: python3-3.5.2-skip-distutils-tests-that-fail-in-rpmbuild.patch |
320 |
Patch502: python3-3.7.1-uid-gid-overflows.patch |
321 |
Patch503: python3-3.5.2-dont-raise-from-py_compile.patch |
322 |
Patch506: python3-3.6.2-python3-config-LIBPLUSED-cmp0004-error.patch |
323 |
#Patch507: link-C-modules-with-libpython.patch |
324 |
#Patch508: 0001-Fix-_statistics-module-linking.patch |
325 |
|
326 |
Provides: python%{pybasever} = %{version}-%{release} |
327 |
Provides: python(abi) = %{pybasever} |
328 |
Provides: /usr/bin/python%{LDVERSION_optimized} |
329 |
Provides: /usr/bin/python%{pybasever} |
330 |
Requires: python-rpm-macros >= 3-8 |
331 |
Requires: python3-rpm-macros >= 3-8 |
332 |
|
333 |
Requires: %{lib_name} = %{version}-%{release} |
334 |
|
335 |
%description |
336 |
Python is an interpreted, interactive, object-oriented programming |
337 |
language often compared to Tcl, Perl, Scheme or Java. Python includes |
338 |
modules, classes, exceptions, very high level dynamic data types and |
339 |
dynamic typing. Python supports interfaces to many system calls and |
340 |
libraries, as well as to various windowing systems (X11, Motif, Tk, |
341 |
Mac and MFC). |
342 |
|
343 |
Programmers can write new built-in modules for Python in C or C++. |
344 |
Python can be used as an extension language for applications that |
345 |
need a programmable interface. This package contains most of the |
346 |
standard Python modules, as well as modules for interfacing to the |
347 |
Tix widget set for Tk and RPM. |
348 |
|
349 |
Note that documentation for Python is provided in the python-docs |
350 |
package. |
351 |
|
352 |
%package -n %{lib_name} |
353 |
Summary: Shared libraries for Python %{version} |
354 |
Group: System/Libraries |
355 |
Requires: %{lib_name}-stdlib = %{version}-%{release} |
356 |
|
357 |
%description -n %{lib_name} |
358 |
This packages contains Python shared object library. Python is an |
359 |
interpreted, interactive, object-oriented programming language often |
360 |
compared to Tcl, Perl, Scheme or Java. |
361 |
|
362 |
%package -n %{lib_name}-stdlib |
363 |
Summary: Python %{version} standard library |
364 |
Group: Development/Python |
365 |
%if %{with rpmwheels} |
366 |
Requires: python-setuptools-wheel |
367 |
Requires: python-pip-wheel |
368 |
%else |
369 |
Provides: bundled(python3-pip) = %{pip_version} |
370 |
Provides: bundled(python3-setuptools) = %{setuptools_version} |
371 |
%endif |
372 |
Obsoletes: python3-typing < %{version}-%{release} |
373 |
Provides: python%{python3_pkgversion}dist(typing) = %{version} |
374 |
Provides: python%{python3_version}dist(typing) = %{version} |
375 |
|
376 |
%description -n %{lib_name}-stdlib |
377 |
This package contains Python 3's standard library. |
378 |
It is normally not used on its own, but as a dependency of Python %{version}. |
379 |
|
380 |
%package -n %{lib_name}-testsuite |
381 |
Summary: Testsuite for the Python %{version} standard library |
382 |
Group: Development/Python |
383 |
Provides: python3-testsuite = %{version}-%{release} |
384 |
Requires: %{lib_name}-stdlib = %{version}-%{release} |
385 |
Requires: %{lib_name} = %{version}-%{release} |
386 |
Recommends: tkinter3 |
387 |
|
388 |
%description -n %{lib_name}-testsuite |
389 |
The complete testsuite for the Python standard library. |
390 |
It is normally not used on its own, but as a dependency of Python %{version}. |
391 |
|
392 |
%package -n %{develname} |
393 |
Summary: The libraries and header files needed for Python development |
394 |
Group: Development/Python |
395 |
Requires: %{name} = %{version}-%{release} |
396 |
Requires: %{lib_name} = %{version}-%{release} |
397 |
Provides: %{name}-devel = %{version}-%{release} |
398 |
Provides: python%{pybasever}-devel = %{version}-%{release} |
399 |
Provides: %{lib_name_orig}-devel = %{version}-%{release} |
400 |
Recommends: %{lib_name}-testsuite |
401 |
Recommends: %{name}-docs |
402 |
|
403 |
%description -n %{develname} |
404 |
The Python programming language's interpreter can be extended with |
405 |
dynamically loaded extensions and can be embedded in other programs. |
406 |
This package contains the header files and libraries needed to do |
407 |
these types of tasks. |
408 |
|
409 |
Install %{develname} if you want to develop Python extensions. The |
410 |
python package will also need to be installed. You'll probably also |
411 |
want to install the python-docs package, which contains Python |
412 |
documentation. |
413 |
|
414 |
%package docs |
415 |
Summary: Documentation for the Python programming language |
416 |
Version: %{docver} |
417 |
Requires: %{name} >= %{version} |
418 |
Requires: xdg-utils |
419 |
Group: Development/Python |
420 |
BuildArch: noarch |
421 |
|
422 |
%description docs |
423 |
The python-docs package contains documentation on the Python |
424 |
programming language and interpreter. The documentation is provided |
425 |
in ASCII text files and in LaTeX source files. |
426 |
|
427 |
Install the python-docs package if you'd like to use the documentation |
428 |
for the Python language. |
429 |
|
430 |
%package -n tkinter3 |
431 |
Summary: A graphical user interface for the Python scripting language |
432 |
Version: %{oversion} |
433 |
Group: Development/Python |
434 |
Requires: %{name} = %{version}-%{release} |
435 |
Requires: tcl tk |
436 |
Provides: python3-tkinter |
437 |
|
438 |
%description -n tkinter3 |
439 |
The Tkinter (Tk interface) program is an graphical user interface for |
440 |
the Python scripting language. |
441 |
|
442 |
You should install the tkinter package if you'd like to use a graphical |
443 |
user interface for Python programming. |
444 |
|
445 |
%package -n tkinter3-apps |
446 |
Summary: Various applications written using tkinter |
447 |
Group: Development/Python |
448 |
Requires: tkinter3 |
449 |
|
450 |
%description -n tkinter3-apps |
451 |
Various applications written using tkinter |
452 |
|
453 |
%prep |
454 |
%autosetup -p1 -n Python-%{version}%{?prerel} -a1 |
455 |
|
456 |
%if %{with rpmwheels} |
457 |
rm Lib/ensurepip/_bundled/pip-%{pip_version}-py3-none-any.whl |
458 |
rm Lib/test/wheeldata/setuptools-%{setuptools_version}-py3-none-any.whl |
459 |
rm Lib/test/wheeldata/wheel-%{wheel_version}-py3-none-any.whl |
460 |
%endif |
461 |
|
462 |
# Remove all exe files to ensure we are not shipping prebuilt binaries |
463 |
# note that those are only used to create Microsoft Windows installers |
464 |
# and that functionality is broken on Linux anyway |
465 |
find -name '*.exe' -print -delete |
466 |
|
467 |
# Remove all exe files to ensure we are not shipping prebuilt binaries |
468 |
# note that those are only used to create Microsoft Windows installers |
469 |
# and that functionality is broken on Linux anyway |
470 |
find -name '*.exe' -print -delete |
471 |
|
472 |
# Remove bundled libraries to ensure that we're using the system copy. |
473 |
rm -r Modules/expat |
474 |
rm -r Modules/_decimal/libmpdec |
475 |
|
476 |
# Remove files that should be generated by the build |
477 |
# (This is after patching, so that we can use patches directly from upstream) |
478 |
rm configure pyconfig.h.in |
479 |
|
480 |
# drop Autoconf version requirement |
481 |
sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac |
482 |
|
483 |
# fix doc index.html title |
484 |
sed -i -e 's/\(<title>\)\([3-9]\(\.[0-9]\+\)\+\sDocumentation<\/title>\)/\1Python \2/' python-*-docs-html/index.html |
485 |
|
486 |
find . -type f -print0 | xargs -0 perl -p -i -e 's@/usr/local/bin/python@/usr/bin/python3@' |
487 |
|
488 |
%build |
489 |
# The build process embeds version info extracted from the Git repository |
490 |
# into the Py_GetBuildInfo and sys.version strings. |
491 |
# Our Git repository is artificial, so we don't want that. |
492 |
# Tell configure to not use git. |
493 |
export HAS_GIT=not-found |
494 |
|
495 |
autoreconf -vfi |
496 |
|
497 |
# Get proper option names from bconds |
498 |
%if %{with computed_gotos} |
499 |
%global computed_gotos_flag yes |
500 |
%else |
501 |
%global computed_gotos_flag no |
502 |
%endif |
503 |
|
504 |
%if %{with optimizations} |
505 |
%global optimizations_flag "--enable-optimizations" |
506 |
%else |
507 |
%global optimizations_flag "--disable-optimizations" |
508 |
%endif |
509 |
|
510 |
%global _disable_ld_no_undefined 1 |
511 |
|
512 |
export CFLAGS=" " |
513 |
export CFLAGS_NODIST="%{build_cflags} -D_GNU_SOURCE -fPIC -fwrapv" |
514 |
export CXXFLAGS=" " |
515 |
export OPT=" " |
516 |
export LINKCC="gcc" |
517 |
export LDFLAGS=" " |
518 |
export LDFLAGS_NODIST="%{build_ldflags} $(pkg-config --libs-only-L openssl)" |
519 |
|
520 |
%configure \ |
521 |
--with-platlibdir=%{_lib} \ |
522 |
--enable-ipv6 \ |
523 |
--enable-shared \ |
524 |
--with-computed-gotos=%{computed_gotos_flag} \ |
525 |
--with-dbmliborder=gdbm:ndbm:bdb \ |
526 |
--with-system-expat \ |
527 |
--with-system-ffi \ |
528 |
--with-system-libmpdec \ |
529 |
--enable-loadable-sqlite-extensions \ |
530 |
%if %{with dtrace} |
531 |
--with-dtrace \ |
532 |
%endif |
533 |
--with-lto \ |
534 |
--with-ssl-default-suites=openssl \ |
535 |
--without-static-libpython \ |
536 |
%if %{with rpmwheels} |
537 |
--with-wheel-pkg-dir=%{python_wheel_dir} \ |
538 |
%endif |
539 |
%if %{with valgrind} |
540 |
--with-valgrind \ |
541 |
%endif |
542 |
--with-threads \ |
543 |
--without-ensurepip \ |
544 |
%{optimizations_flag} |
545 |
|
546 |
%if %{without bootstrap} |
547 |
# Regenerate generated files (needs python3) |
548 |
%make_build regen-all PYTHON_FOR_REGEN="python%{pybasever}" |
549 |
%endif |
550 |
|
551 |
# Invoke the build |
552 |
%make_build |
553 |
|
554 |
%install |
555 |
|
556 |
%if %{with gdb_hooks} |
557 |
DirHoldingGdbPy=%{_usr}/lib/debug/%{_libdir} |
558 |
mkdir -p %{buildroot}$DirHoldingGdbPy |
559 |
%endif # with gdb_hooks |
560 |
|
561 |
# When the actual %%{dynload_dir} exists (it does when python3.X is installed for regen-all) |
562 |
# %%{buildroot}%%{dynload_dir} is not created by make install and the extension modules are missing |
563 |
# Reported upstream as https://github.com/python/cpython/issues/98782 |
564 |
# A workaround is to create the directory before running make install |
565 |
mkdir -p %{buildroot}%{dynload_dir} |
566 |
|
567 |
%make_install |
568 |
|
569 |
%if %{with gdb_hooks} |
570 |
# See comment on $DirHoldingGdbPy above |
571 |
PathOfGdbPy=$DirHoldingGdbPy/libpython%{pybasever}%{ABIFLAGS_optimized}-%{version}-%{release}.%{_arch}.debug-gdb.py |
572 |
cp Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy |
573 |
%endif # with gdb_hooks |
574 |
|
575 |
# Install directories for additional packages |
576 |
install -d -m 0755 %{buildroot}%{pylibdir}/site-packages/__pycache__ |
577 |
%if "%{_lib}" == "lib64" |
578 |
# The 64-bit version needs to create "site-packages" in /usr/lib/ (for |
579 |
# pure-Python modules) as well as in /usr/lib64/ (for packages with extension |
580 |
# modules). |
581 |
# Note that rpmlint will complain about hardcoded library path; |
582 |
# this is intentional. |
583 |
install -d -m 0755 %{buildroot}%{_prefix}/lib/python%{pybasever}/site-packages/__pycache__ |
584 |
%endif |
585 |
|
586 |
# overwrite the copied binary with a link |
587 |
pushd %{buildroot}%{_bindir} |
588 |
#ln -sf python%{LDVERSION_optimized} python%{pybasever} |
589 |
ln -sf python%{pybasever} python%{familyver} |
590 |
popd |
591 |
|
592 |
pushd %{buildroot}%{_libdir} |
593 |
ln -sf $(ls libpython%{lib_major}*.so.*) libpython%{lib_major}.so |
594 |
popd |
595 |
|
596 |
# make python3 as default one |
597 |
ln -s ./python%{pybasever} %{buildroot}%{_bindir}/python |
598 |
ln -s ./pydoc%{pybasever} %{buildroot}%{_bindir}/pydoc |
599 |
ln -s ./pygettext%{pybasever}.py %{buildroot}%{_bindir}/pygettext.py |
600 |
ln -s ./msgfmt%{pybasever}.py %{buildroot}%{_bindir}/msgfmt.py |
601 |
ln -s ./python%{pybasever}-config %{buildroot}%{_bindir}/python-config |
602 |
ln -s ./python%{pybasever}.1 %{buildroot}%{_mandir}/man1/python.1 |
603 |
ln -s ./python-%{pybasever}.pc %{buildroot}%{_libdir}/pkgconfig/python.pc |
604 |
ln -s ./python-%{pybasever}-embed.pc %{buildroot}%{_libdir}/pkgconfig/python-embed.pc |
605 |
|
606 |
chmod 755 %{buildroot}%{_bindir}/idle3 |
607 |
|
608 |
%if %{with valgrind} |
609 |
install Misc/valgrind-python.supp -D %{buildroot}%{_libdir}/valgrind/valgrind-python3.supp |
610 |
%endif |
611 |
|
612 |
mkdir -p %{buildroot}%{_datadir}/applications |
613 |
cat > %{buildroot}%{_datadir}/applications/%{_real_vendor}-tkinter3.desktop << EOF |
614 |
[Desktop Entry] |
615 |
Name=IDLE |
616 |
Comment=IDE for Python3 |
617 |
Exec=%{_bindir}/idle3 |
618 |
Icon=development_environment_section |
619 |
Terminal=false |
620 |
Type=Application |
621 |
Categories=Development;IDE; |
622 |
EOF |
623 |
|
624 |
cat > %{buildroot}%{_datadir}/applications/%{_real_vendor}-%{name}-docs.desktop << EOF |
625 |
[Desktop Entry] |
626 |
Name=Python %{docver} documentation |
627 |
Comment=Python %{docver} complete reference |
628 |
Exec=%{_bindir}/xdg-open %{_docdir}/%{name}-docs/index.html |
629 |
Icon=documentation_section |
630 |
Terminal=false |
631 |
Type=Application |
632 |
Categories=Documentation; |
633 |
EOF |
634 |
|
635 |
# fix non real scripts |
636 |
#chmod 644 %{buildroot}%{_libdir}/python*/test/test_{binascii,grp,htmlparser}.py* |
637 |
find %{buildroot} -type f \( -name "test_binascii.py*" -o -name "test_grp.py*" -o -name "test_htmlparser.py*" \) -exec chmod 644 {} \; |
638 |
|
639 |
# fix python library not stripped |
640 |
chmod u+w %{buildroot}%{_libdir}/libpython%{lib_major}*.so.1.0 $RPM_BUILD_ROOT%{_libdir}/libpython3.so |
641 |
|
642 |
# Make python3-devel multilib-ready |
643 |
mv %{buildroot}%{_includedir}/python%{LDVERSION_optimized}/pyconfig.h \ |
644 |
%{buildroot}%{_includedir}/python%{LDVERSION_optimized}/pyconfig-%{__isa_bits}.h |
645 |
cat > %{buildroot}%{_includedir}/python%{LDVERSION_optimized}/pyconfig.h << EOF |
646 |
#include <bits/wordsize.h> |
647 |
|
648 |
#if __WORDSIZE == 32 |
649 |
#include "pyconfig-32.h" |
650 |
#elif __WORDSIZE == 64 |
651 |
#include "pyconfig-64.h" |
652 |
#else |
653 |
#error "Unknown word size" |
654 |
#endif |
655 |
EOF |
656 |
|
657 |
# Make sure distutils looks at the right pyconfig.h file |
658 |
# See https://bugzilla.redhat.com/show_bug.cgi?id=201434 |
659 |
# Similar for sysconfig: sysconfig.get_config_h_filename tries to locate |
660 |
# pyconfig.h so it can be parsed, and needs to do this at runtime in site.py |
661 |
# when python starts up (see https://bugzilla.redhat.com/show_bug.cgi?id=653058) |
662 |
# |
663 |
# Split this out so it goes directly to the pyconfig-32.h/pyconfig-64.h |
664 |
# variants: |
665 |
sed -i -e "s/'pyconfig.h'/'pyconfig-%{__isa_bits}.h'/" \ |
666 |
%{buildroot}%{pylibdir}/sysconfig.py |
667 |
|
668 |
# Install i18n tools to bindir |
669 |
# They are also in python2, so we version them |
670 |
# https://bugzilla.redhat.com/show_bug.cgi?id=1571474 |
671 |
for tool in pygettext msgfmt; do |
672 |
cp -p Tools/i18n/${tool}.py %{buildroot}%{_bindir}/${tool}%{pybasever}.py |
673 |
ln -s ${tool}%{pybasever}.py %{buildroot}%{_bindir}/${tool}3.py |
674 |
done |
675 |
|
676 |
# Switch all shebangs to refer to the specific Python version. |
677 |
# This currently only covers files matching ^[a-zA-Z0-9_]+\.py$, |
678 |
# so handle files named using other naming scheme separately. |
679 |
LD_LIBRARY_PATH=./ ./python \ |
680 |
%{_rpmconfigdir}/redhat/pathfix.py \ |
681 |
-i "%{_bindir}/python%{pybasever}" -pn \ |
682 |
%{buildroot} \ |
683 |
%{buildroot}%{_bindir}/*%{pybasever}.py \ |
684 |
%{?with_gdb_hooks:%{buildroot}$DirHoldingGdbPy/*.py} |
685 |
|
686 |
# Remove shebang lines from .py files that aren't executable, and |
687 |
# remove executability from .py files that don't have a shebang line: |
688 |
find %{buildroot} -name \*.py \ |
689 |
\( \( \! -perm /u+x,g+x,o+x -exec sed -e '/^#!/Q 0' -e 'Q 1' {} \; \ |
690 |
-print -exec sed -i '1d' {} \; \) -o \( \ |
691 |
-perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \ |
692 |
-exec chmod a-x {} \; \) \) |
693 |
|
694 |
# Get rid of DOS batch files: |
695 |
find %{buildroot} -name \*.bat -exec rm {} \; |
696 |
|
697 |
# Get rid of backup files: |
698 |
find %{buildroot}/ -name "*~" -exec rm -f {} \; |
699 |
find . -name "*~" -exec rm -f {} \; |
700 |
|
701 |
# Do bytecompilation with the newly installed interpreter. |
702 |
# This is similar to the script in macros.pybytecompile |
703 |
# compile *.pyc |
704 |
# Python CMD line options: |
705 |
# -s - don't add user site directory to sys.path |
706 |
# -B - don't write .pyc files on import |
707 |
# compileall CMD line options: |
708 |
# -f - force rebuild even if timestamps are up to date |
709 |
# -o - optimization levels to run compilation with |
710 |
# -s - part of path to left-strip from path to source file (buildroot) |
711 |
# -p - path to add as prefix to path to source file (/ to make it absolute) |
712 |
# --hardlink-dupes - hardlink different optimization level pycs together if identical (saves space) |
713 |
# --invalidation-mode - we prefer the timestamp invalidation mode for performance reasons |
714 |
# -x - skip test modules with SyntaxErrors (taken from the Makefile) |
715 |
LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \ |
716 |
%{buildroot}%{_bindir}/python%{pybasever} -s -B -m compileall \ |
717 |
-f %{_smp_mflags} -o 0 -o 1 -o 2 -s %{buildroot} -p / %{buildroot} --hardlink-dupes --invalidation-mode=timestamp \ |
718 |
-x 'bad_coding|badsyntax|site-packages|test/test_lib2to3/data' |
719 |
|
720 |
# Turn this BRP off, it is done by compileall2 --hardlink-dupes above |
721 |
%global __brp_python_hardlink %{nil} |
722 |
|
723 |
# Since we have *.py files in bindir, this is created, but we don't want it |
724 |
rm -rf %{buildroot}%{_bindir}/__pycache__ |
725 |
|
726 |
# Fixup permissions for shared libraries from non-standard 555 to standard 755: |
727 |
find %{buildroot} -perm 555 -exec chmod 755 {} \; |
728 |
|
729 |
# make man python3.Xm work https://bugzilla.redhat.com/show_bug.cgi?id=1612241 |
730 |
ln -s ./python%{pybasever}.1 %{buildroot}%{_mandir}/man1/python%{pybasever}m.1 |
731 |
|
732 |
%if %{with check} |
733 |
%check |
734 |
# Exclude some tests that hangs on the BS |
735 |
EXCLUDE="test_ssl test_socket test_epoll" |
736 |
%if %{with bootstrap} |
737 |
EXCLUDE="$EXCLUDE test_distutils" |
738 |
%endif |
739 |
%ifarch x86_64 |
740 |
EXCLUDE="$EXCLUDE test_faulthandler" |
741 |
%endif |
742 |
%ifarch %arm |
743 |
EXCLUDE="$EXCLUDE test_float test_asyncio test_cmath" |
744 |
%endif |
745 |
# Local aarch64 tests succeeds, but fails on BS |
746 |
%ifarch aarch64 |
747 |
EXCLUDE="$EXCLUDE test_posix test_asyncio test_openpty test_os test_pty test_readline" |
748 |
%endif |
749 |
# json test pass on local build but fail on BS |
750 |
EXCLUDE="$EXCLUDE test_json" |
751 |
# to investigate why it fails on local build |
752 |
EXCLUDE="$EXCLUDE test_site" |
753 |
# why this fails? |
754 |
EXCLUDE="$EXCLUDE test_distutils test_peg_generator" |
755 |
# failing with 3.8RC1: |
756 |
EXCLUDE="$EXCLUDE test___all__ test_embed test_mmap test_os" |
757 |
# failed because of expat, https://bugs.python.org/issue46794 |
758 |
EXCLUDE="$EXCLUDE test_xml_etree test_minidom" |
759 |
# failing dtrace test |
760 |
#EXCLUDE="$EXCLUDE test_dtrace" |
761 |
# all tests must pass |
762 |
# but we disable network on BS |
763 |
WITHIN_PYTHON_RPM_BUILD= \ |
764 |
make test TESTOPTS="-wW --slowest -j0 -u none -x $EXCLUDE" |
765 |
# consider use network on local build |
766 |
#EXCLUDE="" |
767 |
#WITHIN_PYTHON_RPM_BUILD= make test TESTOPTS="-u network -x $EXCLUDE" |
768 |
|
769 |
%endif |
770 |
|
771 |
%files |
772 |
%{_bindir}/pydoc |
773 |
%{_bindir}/pydoc%{familyver} |
774 |
%{_bindir}/pydoc%{pybasever} |
775 |
%{_bindir}/python |
776 |
%{_bindir}/python%{familyver} |
777 |
%{_bindir}/python%{pybasever} |
778 |
%{_bindir}/python%{LDVERSION_optimized} |
779 |
%{_bindir}/2to3 |
780 |
%{_bindir}/2to3-%{pybasever} |
781 |
%{_mandir}/man*/* |
782 |
|
783 |
%files -n %{lib_name}-stdlib |
784 |
%license LICENSE |
785 |
%doc README.rst |
786 |
%{_includedir}/python%{LDVERSION_optimized}/pyconfig-%{__isa_bits}.h |
787 |
%{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/Makefile |
788 |
|
789 |
%dir %{pylibdir} |
790 |
%dir %{dynload_dir} |
791 |
|
792 |
%license %{pylibdir}/LICENSE.txt |
793 |
|
794 |
%{pylibdir}/lib2to3 |
795 |
|
796 |
%dir %{pylibdir}/unittest/ |
797 |
%dir %{pylibdir}/unittest/__pycache__/ |
798 |
%{pylibdir}/unittest/*.py |
799 |
%{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes} |
800 |
|
801 |
%dir %{pylibdir}/asyncio/ |
802 |
%dir %{pylibdir}/asyncio/__pycache__/ |
803 |
%{pylibdir}/asyncio/*.py |
804 |
%{pylibdir}/asyncio/__pycache__/*%{bytecode_suffixes} |
805 |
|
806 |
%dir %{pylibdir}/venv/ |
807 |
%dir %{pylibdir}/venv/__pycache__/ |
808 |
%{pylibdir}/venv/*.py |
809 |
%{pylibdir}/venv/__pycache__/*%{bytecode_suffixes} |
810 |
%{pylibdir}/venv/scripts |
811 |
|
812 |
%{pylibdir}/wsgiref |
813 |
%{pylibdir}/xmlrpc |
814 |
|
815 |
%dir %{pylibdir}/ensurepip/ |
816 |
%dir %{pylibdir}/ensurepip/__pycache__/ |
817 |
%{pylibdir}/ensurepip/*.py |
818 |
%{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes} |
819 |
|
820 |
%if %{with rpmwheels} |
821 |
%exclude %{pylibdir}/ensurepip/_bundled |
822 |
%else |
823 |
%dir %{pylibdir}/ensurepip/_bundled |
824 |
%{pylibdir}/ensurepip/_bundled/pip-%{pip_version}-py3-none-any.whl |
825 |
%endif |
826 |
|
827 |
%dir %{pylibdir}/concurrent/ |
828 |
%dir %{pylibdir}/concurrent/__pycache__/ |
829 |
%{pylibdir}/concurrent/*.py |
830 |
%{pylibdir}/concurrent/__pycache__/*%{bytecode_suffixes} |
831 |
|
832 |
%dir %{pylibdir}/concurrent/futures/ |
833 |
%dir %{pylibdir}/concurrent/futures/__pycache__/ |
834 |
%{pylibdir}/concurrent/futures/*.py |
835 |
%{pylibdir}/concurrent/futures/__pycache__/*%{bytecode_suffixes} |
836 |
|
837 |
%{pylibdir}/pydoc_data |
838 |
|
839 |
%{dynload_dir}/_blake2.%{SOABI_optimized}.so |
840 |
%{dynload_dir}/_md5.%{SOABI_optimized}.so |
841 |
%{dynload_dir}/_sha1.%{SOABI_optimized}.so |
842 |
%{dynload_dir}/_sha2.%{SOABI_optimized}.so |
843 |
%{dynload_dir}/_sha3.%{SOABI_optimized}.so |
844 |
|
845 |
%{dynload_dir}/_asyncio.%{SOABI_optimized}.so |
846 |
%{dynload_dir}/_bisect.%{SOABI_optimized}.so |
847 |
%{dynload_dir}/_bz2.%{SOABI_optimized}.so |
848 |
%{dynload_dir}/_codecs_cn.%{SOABI_optimized}.so |
849 |
%{dynload_dir}/_codecs_hk.%{SOABI_optimized}.so |
850 |
%{dynload_dir}/_codecs_iso2022.%{SOABI_optimized}.so |
851 |
%{dynload_dir}/_codecs_jp.%{SOABI_optimized}.so |
852 |
%{dynload_dir}/_codecs_kr.%{SOABI_optimized}.so |
853 |
%{dynload_dir}/_codecs_tw.%{SOABI_optimized}.so |
854 |
%{dynload_dir}/_contextvars.%{SOABI_optimized}.so |
855 |
%{dynload_dir}/_crypt.%{SOABI_optimized}.so |
856 |
%{dynload_dir}/_csv.%{SOABI_optimized}.so |
857 |
%{dynload_dir}/_ctypes.%{SOABI_optimized}.so |
858 |
%{dynload_dir}/_curses.%{SOABI_optimized}.so |
859 |
%{dynload_dir}/_curses_panel.%{SOABI_optimized}.so |
860 |
%{dynload_dir}/_dbm.%{SOABI_optimized}.so |
861 |
%{dynload_dir}/_decimal.%{SOABI_optimized}.so |
862 |
%{dynload_dir}/_elementtree.%{SOABI_optimized}.so |
863 |
%if %{with gdbm} |
864 |
%{dynload_dir}/_gdbm.%{SOABI_optimized}.so |
865 |
%endif |
866 |
%{dynload_dir}/_hashlib.%{SOABI_optimized}.so |
867 |
%{dynload_dir}/_heapq.%{SOABI_optimized}.so |
868 |
%{dynload_dir}/_json.%{SOABI_optimized}.so |
869 |
%{dynload_dir}/_lsprof.%{SOABI_optimized}.so |
870 |
%{dynload_dir}/_lzma.%{SOABI_optimized}.so |
871 |
%{dynload_dir}/_multibytecodec.%{SOABI_optimized}.so |
872 |
%{dynload_dir}/_multiprocessing.%{SOABI_optimized}.so |
873 |
%{dynload_dir}/_opcode.%{SOABI_optimized}.so |
874 |
%{dynload_dir}/_pickle.%{SOABI_optimized}.so |
875 |
%{dynload_dir}/_posixsubprocess.%{SOABI_optimized}.so |
876 |
%{dynload_dir}/_queue.%{SOABI_optimized}.so |
877 |
%{dynload_dir}/_random.%{SOABI_optimized}.so |
878 |
%{dynload_dir}/_socket.%{SOABI_optimized}.so |
879 |
%{dynload_dir}/_sqlite3.%{SOABI_optimized}.so |
880 |
%{dynload_dir}/_ssl.%{SOABI_optimized}.so |
881 |
%{dynload_dir}/_statistics.%{SOABI_optimized}.so |
882 |
%{dynload_dir}/_struct.%{SOABI_optimized}.so |
883 |
%{dynload_dir}/array.%{SOABI_optimized}.so |
884 |
%{dynload_dir}/audioop.%{SOABI_optimized}.so |
885 |
%{dynload_dir}/binascii.%{SOABI_optimized}.so |
886 |
%{dynload_dir}/cmath.%{SOABI_optimized}.so |
887 |
%{dynload_dir}/_datetime.%{SOABI_optimized}.so |
888 |
%{dynload_dir}/fcntl.%{SOABI_optimized}.so |
889 |
%{dynload_dir}/grp.%{SOABI_optimized}.so |
890 |
%{dynload_dir}/math.%{SOABI_optimized}.so |
891 |
%{dynload_dir}/mmap.%{SOABI_optimized}.so |
892 |
%{dynload_dir}/nis.%{SOABI_optimized}.so |
893 |
%{dynload_dir}/ossaudiodev.%{SOABI_optimized}.so |
894 |
%{dynload_dir}/_posixshmem.%{SOABI_optimized}.so |
895 |
%{dynload_dir}/pyexpat.%{SOABI_optimized}.so |
896 |
%{dynload_dir}/readline.%{SOABI_optimized}.so |
897 |
%{dynload_dir}/resource.%{SOABI_optimized}.so |
898 |
%{dynload_dir}/select.%{SOABI_optimized}.so |
899 |
%{dynload_dir}/spwd.%{SOABI_optimized}.so |
900 |
%{dynload_dir}/syslog.%{SOABI_optimized}.so |
901 |
%{dynload_dir}/termios.%{SOABI_optimized}.so |
902 |
%{dynload_dir}/unicodedata.%{SOABI_optimized}.so |
903 |
%{dynload_dir}/_uuid.%{SOABI_optimized}.so |
904 |
%{dynload_dir}/xxlimited.%{SOABI_optimized}.so |
905 |
%{dynload_dir}/xxlimited_35.%{SOABI_optimized}.so |
906 |
%{dynload_dir}/_xxsubinterpreters.%{SOABI_optimized}.so |
907 |
%{dynload_dir}/xxsubtype.%{SOABI_optimized}.so |
908 |
%{dynload_dir}/zlib.%{SOABI_optimized}.so |
909 |
%{dynload_dir}/_zoneinfo.%{SOABI_optimized}.so |
910 |
|
911 |
%dir %{pylibdir}/site-packages/ |
912 |
%dir %{pylibdir}/site-packages/__pycache__/ |
913 |
%{pylibdir}/site-packages/README.txt |
914 |
%{pylibdir}/*.py |
915 |
%dir %{pylibdir}/__pycache__/ |
916 |
%{pylibdir}/__pycache__/*%{bytecode_suffixes} |
917 |
|
918 |
%dir %{pylibdir}/collections/ |
919 |
%dir %{pylibdir}/collections/__pycache__/ |
920 |
%{pylibdir}/collections/*.py |
921 |
%{pylibdir}/collections/__pycache__/*%{bytecode_suffixes} |
922 |
|
923 |
%dir %{pylibdir}/ctypes/ |
924 |
%dir %{pylibdir}/ctypes/__pycache__/ |
925 |
%{pylibdir}/ctypes/*.py |
926 |
%{pylibdir}/ctypes/__pycache__/*%{bytecode_suffixes} |
927 |
%{pylibdir}/ctypes/macholib |
928 |
|
929 |
%{pylibdir}/curses |
930 |
|
931 |
%dir %{pylibdir}/dbm/ |
932 |
%dir %{pylibdir}/dbm/__pycache__/ |
933 |
%{pylibdir}/dbm/*.py |
934 |
%{pylibdir}/dbm/__pycache__/*%{bytecode_suffixes} |
935 |
|
936 |
%dir %{pylibdir}/email/ |
937 |
%dir %{pylibdir}/email/__pycache__/ |
938 |
%{pylibdir}/email/*.py |
939 |
%{pylibdir}/email/__pycache__/*%{bytecode_suffixes} |
940 |
%{pylibdir}/email/mime |
941 |
%doc %{pylibdir}/email/architecture.rst |
942 |
|
943 |
%{pylibdir}/encodings |
944 |
|
945 |
%{pylibdir}/html |
946 |
%{pylibdir}/http |
947 |
|
948 |
%dir %{pylibdir}/importlib/ |
949 |
%dir %{pylibdir}/importlib/__pycache__/ |
950 |
%{pylibdir}/importlib/*.py |
951 |
%{pylibdir}/importlib/__pycache__/*%{bytecode_suffixes} |
952 |
|
953 |
%dir %{pylibdir}/importlib/metadata/ |
954 |
%dir %{pylibdir}/importlib/metadata/__pycache__/ |
955 |
%{pylibdir}/importlib/metadata/*.py |
956 |
%{pylibdir}/importlib/metadata/__pycache__/*%{bytecode_suffixes} |
957 |
|
958 |
%dir %{pylibdir}/importlib/resources/ |
959 |
%dir %{pylibdir}/importlib/resources/__pycache__/ |
960 |
%{pylibdir}/importlib/resources/*.py |
961 |
%{pylibdir}/importlib/resources/__pycache__/*%{bytecode_suffixes} |
962 |
|
963 |
%dir %{pylibdir}/json/ |
964 |
%dir %{pylibdir}/json/__pycache__/ |
965 |
%{pylibdir}/json/*.py |
966 |
%{pylibdir}/json/__pycache__/*%{bytecode_suffixes} |
967 |
|
968 |
%{pylibdir}/logging |
969 |
%{pylibdir}/multiprocessing |
970 |
|
971 |
%dir %{pylibdir}/re/ |
972 |
%{pylibdir}/re/*.py |
973 |
%{pylibdir}/re/__pycache__/*%{bytecode_suffixes} |
974 |
|
975 |
%dir %{pylibdir}/sqlite3/ |
976 |
%dir %{pylibdir}/sqlite3/__pycache__/ |
977 |
%{pylibdir}/sqlite3/*.py |
978 |
%{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes} |
979 |
|
980 |
%dir %{pylibdir}/tomllib/ |
981 |
%{pylibdir}/tomllib/*.py |
982 |
%{pylibdir}/tomllib/__pycache__/*%{bytecode_suffixes} |
983 |
%exclude %{pylibdir}/turtle.py |
984 |
%exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} |
985 |
|
986 |
%{pylibdir}/urllib |
987 |
%{pylibdir}/xml |
988 |
|
989 |
%dir %{pylibdir}/zipfile/ |
990 |
%{pylibdir}/zipfile/*.py |
991 |
%{pylibdir}/zipfile/__pycache__/*%{bytecode_suffixes} |
992 |
%{pylibdir}/zipfile/_path/*.py |
993 |
%{pylibdir}/zipfile/_path/__pycache__/*%{bytecode_suffixes} |
994 |
|
995 |
%{pylibdir}/zoneinfo |
996 |
|
997 |
%dir %{pylibdir}/__phello__ |
998 |
%{pylibdir}/__phello__/__init__.py |
999 |
%{pylibdir}/__phello__/spam.py |
1000 |
%{pylibdir}/__phello__/__pycache__/*%{bytecode_suffixes} |
1001 |
|
1002 |
%if "%{_lib}" == "lib64" |
1003 |
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever} |
1004 |
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages |
1005 |
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages/__pycache__/ |
1006 |
%endif |
1007 |
|
1008 |
%files -n %{lib_name}-testsuite |
1009 |
%{pylibdir}/test/ |
1010 |
# These two are shipped in the main subpackage: |
1011 |
%exclude %{pylibdir}/test/test_support.py* |
1012 |
%exclude %{pylibdir}/test/__init__.py* |
1013 |
%{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so |
1014 |
%{dynload_dir}/_testbuffer.%{SOABI_optimized}.so |
1015 |
%{dynload_dir}/_testcapi.%{SOABI_optimized}.so |
1016 |
%{dynload_dir}/_testclinic.%{SOABI_optimized}.so |
1017 |
%{dynload_dir}/_testimportmultiple.%{SOABI_optimized}.so |
1018 |
%{dynload_dir}/_testinternalcapi.%{SOABI_optimized}.so |
1019 |
%{dynload_dir}/_testmultiphase.%{SOABI_optimized}.so |
1020 |
%{dynload_dir}/_testsinglephase.%{SOABI_optimized}.so |
1021 |
%{dynload_dir}/_xxinterpchannels.%{SOABI_optimized}.so |
1022 |
%{dynload_dir}/_xxtestfuzz.%{SOABI_optimized}.so |
1023 |
|
1024 |
%files -n %{lib_name} |
1025 |
%{_libdir}/libpython%{LDVERSION_optimized}.so.1* |
1026 |
|
1027 |
%files -n %{develname} |
1028 |
%{_bindir}/pygettext.py |
1029 |
%{_bindir}/pygettext%{familyver}*.py |
1030 |
|
1031 |
%{_bindir}/msgfmt.py |
1032 |
%{_bindir}/msgfmt%{familyver}*.py |
1033 |
|
1034 |
%{_bindir}/python-config |
1035 |
%{_bindir}/python%{pybasever}-config |
1036 |
%{_bindir}/python%{LDVERSION_optimized}-config |
1037 |
%{_bindir}/python%{familyver}-config |
1038 |
|
1039 |
%{_libdir}/libpython%{LDVERSION_optimized}.so |
1040 |
%{_libdir}/libpython%{pybasever}.so |
1041 |
%{_libdir}/libpython%{familyver}.so |
1042 |
%{_includedir}/python%{LDVERSION_optimized} |
1043 |
%exclude %{_includedir}/python%{LDVERSION_optimized}/pyconfig-%{__isa_bits}.h |
1044 |
%{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet} |
1045 |
%{_libdir}/pkgconfig/python{,-embed}.pc |
1046 |
%{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc |
1047 |
%{_libdir}/pkgconfig/python-%{pybasever}{,-embed}.pc |
1048 |
%{_libdir}/pkgconfig/python%{familyver}{,-embed}.pc |
1049 |
|
1050 |
%exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/Makefile |
1051 |
%if %{with valgrind} |
1052 |
%{_libdir}/valgrind/valgrind-python3.supp |
1053 |
%endif |
1054 |
|
1055 |
%files docs |
1056 |
%doc python-*-docs-html/* |
1057 |
%{_datadir}/applications/%{_real_vendor}-%{name}-docs.desktop |
1058 |
|
1059 |
%files -n tkinter3 |
1060 |
%{pylibdir}/idlelib |
1061 |
%{pylibdir}/tkinter |
1062 |
%{dynload_dir}/_tkinter.%{SOABI_optimized}.so |
1063 |
%{pylibdir}/turtle.py |
1064 |
%{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} |
1065 |
%dir %{pylibdir}/turtledemo |
1066 |
%{pylibdir}/turtledemo/*.py |
1067 |
%{pylibdir}/turtledemo/*.cfg |
1068 |
%dir %{pylibdir}/turtledemo/__pycache__/ |
1069 |
%{pylibdir}/turtledemo/__pycache__/*%{bytecode_suffixes} |
1070 |
|
1071 |
%files -n tkinter3-apps |
1072 |
%{_bindir}/idle%{familyver} |
1073 |
%{_bindir}/idle%{pybasever} |
1074 |
%{_datadir}/applications/%{_real_vendor}-tkinter3.desktop |
1075 |
|
1076 |
# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from ldconfig |
1077 |
# See https://bugzilla.redhat.com/show_bug.cgi?id=562980 |
1078 |
# |
1079 |
# The /usr/lib/rpm/redhat/macros defines %%__debug_package to use |
1080 |
# debugfiles.list, and it appears that everything below /usr/lib/debug and |
1081 |
# (/usr/src/debug) gets added to this file (via LISTFILES) in |
1082 |
# /usr/lib/rpm/find-debuginfo.sh |
1083 |
# |
1084 |
# Hence by installing it below /usr/lib/debug we ensure it is added to the |
1085 |
# -debuginfo subpackage |
1086 |
# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py |
1087 |
# payload file would be unpackaged) |
1088 |
|
1089 |
# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1476593 |
1090 |
%undefine _debuginfo_subpackages |