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