Blame SPECS/python3.spec

900f19
# ==================
900f19
# Top-level metadata
900f19
# ==================
900f19
900f19
Name: python3
900f19
Summary: Interpreter of the Python programming language
900f19
URL: https://www.python.org/
900f19
900f19
%global pybasever 3.6
900f19
900f19
# pybasever without the dot:
900f19
%global pyshortver 36
900f19
900f19
#  WARNING  When rebasing to a new Python version,
900f19
#           remember to update the python3-docs package as well
900f19
Version: %{pybasever}.8
115ea1
Release: 51%{?dist}
900f19
License: Python
900f19
900f19
900f19
# ==================================
900f19
# Conditionals controlling the build
900f19
# ==================================
900f19
900f19
# Note that the bcond macros are named for the CLI option they create.
900f19
# "%%bcond_without" means "ENABLE by default and create a --without option"
900f19
b7e076
# Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package
b7e076
# Uses upstream bundled prebuilt wheels otherwise
b7e076
%bcond_without rpmwheels
b7e076
900f19
# Expensive optimizations (mainly, profile-guided optimizations)
900f19
%bcond_without optimizations
900f19
900f19
# Run the test suite in %%check
900f19
%bcond_without tests
900f19
900f19
# Extra build for debugging the interpreter or C-API extensions
900f19
# (the -debug subpackages)
900f19
%bcond_without debug_build
900f19
900f19
# Support for the GDB debugger
900f19
%bcond_without gdb_hooks
900f19
900f19
# The dbm.gnu module (key-value database)
900f19
%bcond_without gdbm
900f19
900f19
# Main interpreter loop optimization
900f19
%bcond_without computed_gotos
900f19
900f19
# Support for the Valgrind debugger/profiler
900f19
%ifarch %{valgrind_arches}
900f19
%bcond_without valgrind
900f19
%else
900f19
# Some arches don't have valgrind, disable support for it there.
900f19
%bcond_with valgrind
900f19
%endif
900f19
fa50f4
# https://fedoraproject.org/wiki/Changes/Python_Upstream_Architecture_Names
fa50f4
# For a very long time we have converted "upstream architecture names" to "Fedora names".
fa50f4
# This made sense at the time, see https://github.com/pypa/manylinux/issues/687#issuecomment-666362947
fa50f4
# However, with manylinux wheels popularity growth, this is now a problem.
fa50f4
# Wheels built on a Linux that doesn't do this were not compatible with ours and vice versa.
fa50f4
# We now have a compatibility layer to workaround a problem,
fa50f4
# but we also no longer use the legacy arch names in Fedora 34+.
fa50f4
# This bcond controls the behavior. The defaults should be good for anybody.
fa50f4
%bcond_without legacy_archnames
900f19
900f19
# ==================================
900f19
# Notes from bootstraping Python 3.6
900f19
# ==================================
900f19
#
900f19
# New Python major version (3.X) break ABI and bytecode compatibility,
900f19
# so all packages depending on it need to be rebuilt.
900f19
#
900f19
# Due to a dependency cycle between Python, gdb, rpm, pip, setuptools, wheel,
900f19
# and other packages, this isn't straightforward.
900f19
# Build in the following order:
900f19
#
900f19
# 1. At the same time:
900f19
#     - gdb without python support (add %%global _without_python 1 on top of
900f19
#       gdb's SPEC file)
900f19
#     - python-rpm-generators with bootstrapping_python set to 1
900f19
#       (this can be done also during step 2., but should be done before 3.)
900f19
# 2. python3 without rewheel (use %%bcond_with rewheel instead of
900f19
#     %%bcond_without)
900f19
# 3. At the same time:
900f19
#     - gdb with python support (remove %%global _without_python 1 on top of
900f19
#       gdb's SPEC file)
900f19
#     - python-rpm-generators with bootstrapping_python set to 0
900f19
#       (this can be done at any later step without negative effects)
900f19
# 4. rpm
900f19
# 5. python-setuptools with bootstrap set to 1
900f19
# 6. python-pip with build_wheel set to 0
900f19
# 7. python-wheel with %%bcond_without bootstrap
900f19
# 8. python-setuptools with bootstrap set to 0 and also with_check set to 0
900f19
# 9. python-pip with build_wheel set to 1
900f19
# 10. pyparsing
900f19
# 11. python3 with rewheel
900f19
#
900f19
# Then the most important packages have to be built, in dependency order.
900f19
# These were:
900f19
#   python-sphinx, pytest, python-requests, cloud-init, dnf, anaconda, abrt
900f19
#
900f19
# After these have been built, a targeted rebuild should be done for the rest.
900f19
900f19
900f19
# =====================
900f19
# General global macros
900f19
# =====================
900f19
900f19
%global pylibdir %{_libdir}/python%{pybasever}
900f19
%global dynload_dir %{pylibdir}/lib-dynload
900f19
900f19
# ABIFLAGS, LDVERSION and SOABI are in the upstream configure.ac
900f19
# See PEP 3149 for some background: http://www.python.org/dev/peps/pep-3149/
900f19
%global ABIFLAGS_optimized m
900f19
%global ABIFLAGS_debug     dm
900f19
900f19
%global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized}
900f19
%global LDVERSION_debug     %{pybasever}%{ABIFLAGS_debug}
900f19
fa50f4
# When we use the upstream arch triplets, we convert them from the legacy ones
fa50f4
# This is reversed in prep when %%with legacy_archnames, so we keep both macros
fa50f4
%global platform_triplet_legacy %{_arch}-linux%{_gnu}
fa50f4
%global platform_triplet_upstream %{expand:%(echo %{platform_triplet_legacy} | sed -E \\
fa50f4
    -e 's/^arm(eb)?-linux-gnueabi$/arm\\1-linux-gnueabihf/' \\
fa50f4
    -e 's/^mips64(el)?-linux-gnu$/mips64\\1-linux-gnuabi64/' \\
fa50f4
    -e 's/^ppc(64)?(le)?-linux-gnu$/powerpc\\1\\2-linux-gnu/')}
fa50f4
%if %{with legacy_archnames}
fa50f4
%global platform_triplet %{platform_triplet_legacy}
fa50f4
%else
fa50f4
%global platform_triplet %{platform_triplet_upstream}
fa50f4
%endif
fa50f4
 
fa50f4
%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{platform_triplet}
fa50f4
%global SOABI_debug     cpython-%{pyshortver}%{ABIFLAGS_debug}-%{platform_triplet}
900f19
900f19
# All bytecode files are in a __pycache__ subdirectory, with a name
900f19
# reflecting the version of the bytecode.
900f19
# See PEP 3147: http://www.python.org/dev/peps/pep-3147/
900f19
# For example,
900f19
#   foo/bar.py
900f19
# has bytecode at:
900f19
#   foo/__pycache__/bar.cpython-%%{pyshortver}.pyc
900f19
#   foo/__pycache__/bar.cpython-%%{pyshortver}.opt-1.pyc
900f19
#   foo/__pycache__/bar.cpython-%%{pyshortver}.opt-2.pyc
900f19
%global bytecode_suffixes .cpython-%{pyshortver}*.pyc
900f19
900f19
# Python's configure script defines SOVERSION, and this is used in the Makefile
900f19
# to determine INSTSONAME, the name of the libpython DSO:
900f19
#   LDLIBRARY='libpython$(VERSION).so'
900f19
#   INSTSONAME="$LDLIBRARY".$SOVERSION
900f19
# We mirror this here in order to make it easier to add the -gdb.py hooks.
900f19
# (if these get out of sync, the payload of the libs subpackage will fail
900f19
# and halt the build)
900f19
%global py_SOVERSION 1.0
900f19
%global py_INSTSONAME_optimized libpython%{LDVERSION_optimized}.so.%{py_SOVERSION}
900f19
%global py_INSTSONAME_debug     libpython%{LDVERSION_debug}.so.%{py_SOVERSION}
900f19
900f19
# Disable automatic bytecompilation. The python3 binary is not yet be
900f19
# available in /usr/bin when Python is built. Also, the bytecompilation fails
900f19
# on files that test invalid syntax.
900f19
%undefine py_auto_byte_compile
900f19
900f19
# For multilib support, files that are different between 32- and 64-bit arches
900f19
# need different filenames. Use "64" or "32" according to the word size.
900f19
# Currently, the best way to determine an architecture's word size happens to
900f19
# be checking %%{_lib}.
900f19
%if "%{_lib}" == "lib64"
900f19
%global wordsize 64
900f19
%else
900f19
%global wordsize 32
900f19
%endif
900f19
900f19
900f19
# =======================
900f19
# Build-time requirements
900f19
# =======================
900f19
900f19
# (keep this list alphabetized)
900f19
900f19
BuildRequires: autoconf
900f19
BuildRequires: bluez-libs-devel
900f19
BuildRequires: bzip2
900f19
BuildRequires: bzip2-devel
900f19
BuildRequires: desktop-file-utils
900f19
BuildRequires: expat-devel
900f19
900f19
BuildRequires: findutils
900f19
BuildRequires: gcc-c++
900f19
%if %{with gdbm}
900f19
BuildRequires: gdbm-devel >= 1:1.13
900f19
%endif
d43968
BuildRequires: git-core
900f19
BuildRequires: glibc-devel
900f19
BuildRequires: gmp-devel
900f19
BuildRequires: libappstream-glib
900f19
BuildRequires: libffi-devel
900f19
BuildRequires: libnsl2-devel
900f19
BuildRequires: libtirpc-devel
900f19
BuildRequires: libGL-devel
900f19
BuildRequires: libX11-devel
900f19
BuildRequires: ncurses-devel
900f19
900f19
BuildRequires: openssl-devel
900f19
BuildRequires: pkgconfig
900f19
BuildRequires: readline-devel
900f19
BuildRequires: redhat-rpm-config >= 118
900f19
BuildRequires: sqlite-devel
900f19
BuildRequires: gdb
900f19
900f19
BuildRequires: tar
900f19
BuildRequires: tcl-devel
900f19
BuildRequires: tix-devel
900f19
BuildRequires: tk-devel
900f19
900f19
%if %{with valgrind}
900f19
BuildRequires: valgrind-devel
900f19
%endif
900f19
900f19
BuildRequires: xz-devel
900f19
BuildRequires: zlib-devel
900f19
900f19
BuildRequires: /usr/bin/dtrace
900f19
900f19
# workaround http://bugs.python.org/issue19804 (test_uuid requires ifconfig)
900f19
BuildRequires: /usr/sbin/ifconfig
900f19
b7e076
%if %{with rpmwheels}
b7e076
BuildRequires: python3-setuptools-wheel
b7e076
BuildRequires: python3-pip-wheel
900f19
900f19
# Verify that the BuildRoot includes python36.
900f19
# Not actually needed for build.
900f19
BuildRequires: python36-devel
900f19
%endif
900f19
900f19
900f19
# =======================
900f19
# Source code and patches
900f19
# =======================
900f19
900f19
# The upstream tarball includes questionable executable files for Windows,
900f19
# which we should not ship even in the SRPM.
900f19
# Run the "get-source.sh" with the version as argument to download the upstream
900f19
# tarball and generate a version with the .exe files removed. For example:
900f19
# $ ./get-source.sh 3.7.0
900f19
900f19
Source: Python-%{version}-noexe.tar.xz
900f19
900f19
# A script to remove .exe files from the source distribution
900f19
Source1: get-source.sh
900f19
900f19
# A simple script to check timestamps of bytecode files
900f19
# Run in check section with Python that is currently being built
900f19
# Written by bkabrda
900f19
Source8: check-pyc-and-pyo-timestamps.py
900f19
900f19
# Desktop menu entry for idle3
900f19
Source10: idle3.desktop
900f19
900f19
# AppData file for idle3
900f19
Source11: idle3.appdata.xml
900f19
900f19
# unversioned-python script
900f19
Source12: no-python
900f19
900f19
# unversioned-python man page
900f19
Source13: unversioned-python.1
900f19
900f19
# 00001 #
900f19
# Fixup distutils/unixccompiler.py to remove standard library path from rpath:
900f19
# Was Patch0 in ivazquez' python3000 specfile:
900f19
Patch1:         00001-rpath.patch
900f19
900f19
# 00102 #
900f19
# Change the various install paths to use /usr/lib64/ instead or /usr/lib
900f19
# Only used when "%%{_lib}" == "lib64"
900f19
# Not yet sent upstream.
900f19
Patch102: 00102-lib64.patch
900f19
900f19
# 00111 #
900f19
# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
900f19
# a libpythonMAJOR.MINOR.a
900f19
# See https://bugzilla.redhat.com/show_bug.cgi?id=556092
900f19
# Downstream only: not appropriate for upstream
900f19
Patch111: 00111-no-static-lib.patch
900f19
900f19
# 00132 #
900f19
# Add non-standard hooks to unittest for use in the "check" phase below, when
900f19
# running selftests within the build:
900f19
#   @unittest._skipInRpmBuild(reason)
900f19
# for tests that hang or fail intermittently within the build environment, and:
900f19
#   @unittest._expectedFailureInRpmBuild
900f19
# for tests that always fail within the build environment
900f19
#
900f19
# The hooks only take effect if WITHIN_PYTHON_RPM_BUILD is set in the
900f19
# environment, which we set manually in the appropriate portion of the "check"
900f19
# phase below (and which potentially other python-* rpms could set, to reuse
900f19
# these unittest hooks in their own "check" phases)
900f19
Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch
900f19
900f19
# 00155 #
900f19
# Avoid allocating thunks in ctypes unless absolutely necessary, to avoid
900f19
# generating SELinux denials on "import ctypes" and "import uuid" when
900f19
# embedding Python within httpd
900f19
# See https://bugzilla.redhat.com/show_bug.cgi?id=814391
900f19
Patch155: 00155-avoid-ctypes-thunks.patch
900f19
900f19
# 00160 #
900f19
# Python 3.3 added os.SEEK_DATA and os.SEEK_HOLE, which may be present in the
900f19
# header files in the build chroot, but may not be supported in the running
900f19
# kernel, hence we disable this test in an rpm build.
900f19
# Adding these was upstream issue http://bugs.python.org/issue10142
900f19
# Not yet sent upstream
900f19
Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch
900f19
900f19
# 00163 #
900f19
# Some tests within test_socket fail intermittently when run inside Koji;
900f19
# disable them using unittest._skipInRpmBuild
900f19
# Not yet sent upstream
900f19
Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch
900f19
900f19
# 00170 #
900f19
# In debug builds, try to print repr() when a C-level assert fails in the
900f19
# garbage collector (typically indicating a reference-counting error
900f19
# somewhere else e.g in an extension module)
900f19
# The new macros/functions within gcmodule.c are hidden to avoid exposing
900f19
# them within the extension API.
900f19
# Sent upstream: http://bugs.python.org/issue9263
900f19
# See https://bugzilla.redhat.com/show_bug.cgi?id=614680
900f19
Patch170: 00170-gc-assertions.patch
900f19
900f19
# 00189 #
b7e076
# Instead of bundled wheels, use our RPM packaged wheels from
b7e076
# /usr/share/python3-wheels
b7e076
Patch189: 00189-use-rpm-wheels.patch
900f19
900f19
# 00251
900f19
# Set values of prefix and exec_prefix in distutils install command
900f19
# to /usr/local if executable is /usr/bin/python* and RPM build
900f19
# is not detected to make pip and distutils install into separate location
900f19
# Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
900f19
Patch251: 00251-change-user-install-location.patch
900f19
43e83c
# 00257 #
43e83c
# Use the monotonic clock for threading.Condition.wait() as to not be affected by
43e83c
# the system clock changes.
43e83c
# This patch works around the issue.
43e83c
# Implemented by backporting the respective python2 code:
43e83c
# https://github.com/python/cpython/blob/v2.7.18/Lib/threading.py#L331
43e83c
# along with our downstream patch for python2 fixing the same issue.
43e83c
# Downstream only.
43e83c
Patch257: 00257-threading-condition-wait.patch
43e83c
900f19
# 00262 #
900f19
# Backport of PEP 538: Coercing the legacy C locale to a UTF-8 based locale
900f19
# https://www.python.org/dev/peps/pep-0538/
900f19
# Fedora Change: https://fedoraproject.org/wiki/Changes/python3_c.utf-8_locale
900f19
# Original proposal: https://bugzilla.redhat.com/show_bug.cgi?id=1404918
900f19
Patch262: 00262-pep538_coerce_legacy_c_locale.patch
900f19
900f19
# 00294 #
900f19
# Define TLS cipher suite on build time depending
900f19
# on the OpenSSL default cipher suite selection.
900f19
# Fixed upstream on CPython's 3.7 branch:
900f19
# https://bugs.python.org/issue31429
900f19
# See also: https://bugzilla.redhat.com/show_bug.cgi?id=1489816
900f19
Patch294: 00294-define-TLS-cipher-suite-on-build-time.patch
900f19
b7e076
# 00316 #
b7e076
# We remove the exe files from distutil's bdist_wininst
b7e076
# So we mark the command as unsupported - and the tests are skipped
b7e076
# Fixed upstream and backported from the 3.7 branch: https://bugs.python.org/issue10945
b7e076
# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1754040
b7e076
Patch316: 00316-mark-bdist_wininst-unsupported.patch
b7e076
900f19
# 00317 #
900f19
# Security fix for CVE-2019-5010: Fix segfault in ssl's cert parser
900f19
# https://bugzilla.redhat.com/show_bug.cgi?id=1666789
900f19
# Fixed upstream: https://bugs.python.org/issue35746
900f19
Patch317: 00317-CVE-2019-5010.patch
900f19
900f19
# 00318 #
b7e076
# Various fixes for TLS 1.3 and OpenSSL 1.1.1
900f19
# https://bugzilla.redhat.com/show_bug.cgi?id=1639531
b7e076
b7e076
# test_ssl fixes for TLS 1.3 and OpenSSL 1.1.1
900f19
# https://bugs.python.org/issue32947#msg333990
900f19
# https://github.com/python/cpython/pull/11612
b7e076
b7e076
# Encrypt private key test files with AES256
b7e076
# https://bugs.python.org/issue38271
b7e076
# https://github.com/python/cpython/pull/16396
b7e076
b7e076
# Prefer PROTOCOL_TLS_CLIENT/SERVER (partial backport)
b7e076
# https://bugs.python.org/issue31346
b7e076
# https://github.com/python/cpython/pull/3058
b7e076
b7e076
# Enable TLS 1.3 in tests (partial backport)
b7e076
# https://bugs.python.org/issue33618
b7e076
# https://github.com/python/cpython/pull/7082
b7e076
b7e076
# OpenSSL 1.1.1-pre1 / TLS 1.3 fixes (partial backport)
b7e076
# https://bugs.python.org/issue32947
b7e076
# https://github.com/python/cpython/pull/5923
b7e076
Patch318: 00318-fixes-for-tls-13.patch
900f19
900f19
# 00319 #
900f19
# Fix test_tarfile on ppc64
900f19
# https://bugzilla.redhat.com/show_bug.cgi?id=1639490
900f19
# https://bugs.python.org/issue35772
900f19
Patch319: 00319-test_tarfile_ppc64.patch
900f19
900f19
# 00320 #
b7e076
# Security fix for CVE-2019-9636 and CVE-2019-10160: Information Disclosure due to urlsplit improper NFKC normalization
900f19
# Fixed upstream: https://bugs.python.org/issue36216 and https://bugs.python.org/issue36742
900f19
# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689318
b7e076
Patch320: 00320-CVE-2019-9636-and-CVE-2019-10160.patch
900f19
900f19
# 00324 #
900f19
# Disallow control chars in http URLs
900f19
# Security fix for CVE-2019-9740 and CVE-2019-9947
900f19
# Fixed upstream: https://bugs.python.org/issue30458
900f19
# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1704365
900f19
# and https://bugzilla.redhat.com/show_bug.cgi?id=1703531
900f19
Patch324: 00324-disallow-control-chars-in-http-urls.patch
900f19
900f19
# 00325 #
900f19
# Unnecessary URL scheme exists to allow local_file:// reading file  in urllib
900f19
# Security fix for CVE-2019-9948
900f19
# Fixed upstream: https://bugs.python.org/issue35907
900f19
# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1714643
900f19
Patch325: 00325-CVE-2019-9948.patch
900f19
b7e076
# 00326 #
b7e076
# Don't set the post-handshake authentication verify flag on client side
b7e076
# on TLS 1.3, as it also implicitly enables cert chain validation and an
b7e076
# SSL/TLS connection will fail when verify mode is set to CERT_NONE.
b7e076
# Fixed upstream: https://bugs.python.org/issue37428
b7e076
# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1725721
b7e076
Patch326: 00326-do-not-set-PHA-verify-flag-on-client-side.patch
b7e076
b7e076
# 00327 #
b7e076
# Enable TLS 1.3 post-handshake authentication in http.client for default
b7e076
# context or if a cert_file is passed to HTTPSConnection
b7e076
# Fixed upstream: https://bugs.python.org/issue37440
b7e076
# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1671353
b7e076
Patch327: 00327-enable-tls-1.3-PHA-in-http.client.patch
b7e076
b7e076
# 00329 #
b7e076
# Support OpenSSL FIPS mode
b7e076
# - Fallback implementations md5, sha1, sha256, sha512 are removed in favor of OpenSSL wrappers
b7e076
# - In FIPS mode, OpenSSL wrappers are always used in hashlib
b7e076
# - add a new "usedforsecurity" keyword argument to the various digest
b7e076
#   algorithms in hashlib so that you can whitelist a callsite with
b7e076
#   "usedforsecurity=False"
b7e076
#   The change has been implemented upstream since Python 3.9:
b7e076
#   https://bugs.python.org/issue9216
b7e076
# - OpenSSL wrappers for the hashes blake2{b512,s256},
b7e076
#     sha3_{224,256,384,512}, shake_{128,256} are now exported from _hashlib
b7e076
# - In FIPS mode, the blake2, sha3 and shake hashes use OpenSSL wrappers
b7e076
#   and do not offer extended functionality (keys, tree hashing, custom digest size)
b7e076
# - In FIPS mode, hmac.HMAC can only be instantiated with an OpenSSL wrapper
b7e076
#   or an string with OpenSSL hash name as the "digestmod" argument.
b7e076
#   The argument must be specified (instead of defaulting to ‘md5’).
b7e076
#
b7e076
# - Also while in FIPS mode, we utilize OpenSSL's DRBG and disable the
b7e076
#   os.getrandom() function.
b7e076
#
b7e076
#   Upstream changes that have also been backported with this patch
b7e076
#   to allow tests to pass on stricter environments:
b7e076
#
b7e076
#   Avoid MD5 or check for MD5 availablity
b7e076
#   https://bugs.python.org/issue38270
b7e076
#   https://github.com/python/cpython/pull/16393
b7e076
#   https://github.com/python/cpython/pull/16437
b7e076
#   https://github.com/python/cpython/pull/17446
b7e076
#
b7e076
#   add usedforsecurity to hashlib constructors (partial backport for fixing a uuid test)
b7e076
#   https://github.com/python/cpython/pull/16044
b7e076
# Resolves: rhbz#1731424
b7e076
Patch329: 00329-fips.patch
b7e076
b7e076
# 00330 #
b7e076
# Fix CVE-2018-20852: cookie domain check returning incorrect results
b7e076
# Fixed upstream: https://bugs.python.org/issue35121
b7e076
# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1741553
b7e076
Patch330: 00330-CVE-2018-20852.patch
b7e076
b7e076
# 00332 #
b7e076
# Fix CVE-2019-16056: Don't parse email addresses containing
b7e076
# multiple '@' characters.
b7e076
# Fixed upstream: https://bugs.python.org/issue34155
b7e076
# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1750776
b7e076
Patch332: 00332-CVE-2019-16056.patch
b7e076
b7e076
# 00333 #
b7e076
# Reduce the number of tests run during the profile guided optimizations build,
b7e076
# as running the whole test suite during profiling increases the build time
b7e076
# substantially, with negligible performance gain.
b7e076
# Fixed upstream and backported from the 3.8 branch:
b7e076
# https://bugs.python.org/issue36044
b7e076
# https://bugs.python.org/issue37667
b7e076
# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1749576
b7e076
Patch333: 00333-reduce-pgo-tests.patch
b7e076
3d909f
# 00338 #
3d909f
# Fix test_gdb for when compiling python with Link Time Optimizations
3d909f
# Fixed upstream: https://bugs.python.org/issue38239
3d909f
Patch338: 00338-fix-test_gdb-for-LTO.patch
3d909f
3d909f
# 00344 #
3d909f
# Fix CVE-2019-16935: XSS vulnerability in the ocumentation XML-RPC server in server_title field
3d909f
# Fixed upstream: https://bugs.python.org/issue38243
3d909f
# Resolves: https://bugzilla.redhat.com/how_bug.cgi?id=1798001
3d909f
Patch344: 00344-CVE-2019-16935.patch
3d909f
3d909f
# 00345 #
3d909f
# Skip from test_site the test_startup_imports case if a path of sys.path
3d909f
# contains a .pth file
3d909f
# Fixed upstream: https://bugs.python.org/issue27807
3d909f
# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1814392
3d909f
Patch345: 00345-fix-test_site-with-extra-pth-files.patch
3d909f
3d909f
# 00346 #
3d909f
# Fix CVE-2020-8492: wrong backtracking in urllib.request.AbstractBasicAuthHandler allows for a ReDoS
3d909f
# Fixed upstream: https://bugs.python.org/issue39503
3d909f
# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1810618
3d909f
Patch346: 00346-CVE-2020-8492.patch
3d909f
d43968
# 00351 #
d43968
# Avoid infinite loop when reading specially crafted TAR files using the tarfile module
d43968
# (CVE-2019-20907).
d43968
# See: https://bugs.python.org/issue39017
d43968
Patch351: 00351-avoid-infinite-loop-in-the-tarfile-module.patch
d43968
d43968
# 00352 # 5253c417a23b3658fa115d2c72fa54b20293a31c
d43968
# Resolve hash collisions for IPv4Interface and IPv6Interface
d43968
#
d43968
# CVE-2020-14422
d43968
# The hash() methods of classes IPv4Interface and IPv6Interface had issue
d43968
# of generating constant hash values of 32 and 128 respectively causing hash collisions.
d43968
# The fix uses the hash() function to generate hash values for the objects
d43968
# instead of XOR operation.
d43968
# Fixed upstream: https://bugs.python.org/issue41004
d43968
Patch352: 00352-resolve-hash-collisions-for-ipv4interface-and-ipv6interface.patch
d43968
fa50f4
# 00353 #
fa50f4
# Original names for architectures with different names downstream
fa50f4
#
fa50f4
# https://fedoraproject.org/wiki/Changes/Python_Upstream_Architecture_Names
fa50f4
#
fa50f4
# Pythons in RHEL/Fedora used different names for some architectures
fa50f4
# than upstream and other distros (for example ppc64 vs. powerpc64).
fa50f4
# This was patched in patch 274, now it is sedded if %%with legacy_archnames.
fa50f4
#
fa50f4
# That meant that an extension built with the default upstream settings
fa50f4
# (on other distro or as an manylinux wheel) could not been found by Python
fa50f4
# on RHEL/Fedora because it had a different suffix.
fa50f4
# This patch adds the legacy names to importlib so Python is able
fa50f4
# to import extensions with a legacy architecture name in its
fa50f4
# file name.
fa50f4
# It work both ways, so it support both %%with and %%without legacy_archnames.
fa50f4
#
fa50f4
# WARNING: This patch has no effect on Python built with bootstrap
fa50f4
# enabled because Python/importlib_external.h is not regenerated
fa50f4
# and therefore Python during bootstrap contains importlib from
fa50f4
# upstream without this feature. It's possible to include
fa50f4
# Python/importlib_external.h to this patch but it'd make rebasing
fa50f4
# a nightmare because it's basically a binary file.
fa50f4
Patch353: 00353-architecture-names-upstream-downstream.patch
fa50f4
be5967
# 00354 #
be5967
# Reject control chars in HTTP method in http.client to prevent
be5967
# HTTP header injection
be5967
# Fixed ustream: https://bugs.python.org/issue39603
be5967
Patch354: 00354-cve-2020-26116-http-request-method-crlf-injection-in-httplib.patch
be5967
3ca59d
# 00355 #
3ca59d
# No longer call eval() on content received via HTTP in the CJK codec tests
3ca59d
# Fixed upstream: https://bugs.python.org/issue41944
3ca59d
Patch355: 00355-CVE-2020-27619.patch
3ca59d
b3527f
# 00356 #
b3527f
# options -a and -k for pathfix.py used in %%py3_shebang_fix
b3527f
# Upstream: https://github.com/python/cpython/commit/c71c54c62600fd721baed3c96709e3d6e9c33817
b3527f
Patch356: 00356-k_and_a_options_for_pathfix.patch
b3527f
b3527f
# 00357 #
b3527f
# CVE-2021-3177 stack-based buffer overflow in PyCArg_repr in _ctypes/callproc.c
b3527f
# Upstream: https://bugs.python.org/issue42938
b3527f
# Main BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1918168
b3527f
Patch357: 00357-CVE-2021-3177.patch
b3527f
0f0bda
# 00359 #
0f0bda
# CVE-2021-23336 python: Web Cache Poisoning via urllib.parse.parse_qsl and
0f0bda
# urllib.parse.parse_qs by using a semicolon in query parameters
0f0bda
# Upstream: https://bugs.python.org/issue42967
0f0bda
# Main BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1928904
0f0bda
Patch359: 00359-CVE-2021-23336.patch
0f0bda
ba8dbd
# 00360 #
ba8dbd
# CVE-2021-3426: information disclosure via pydoc
ba8dbd
# Upstream: https://bugs.python.org/issue42988
ba8dbd
# Main BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1935913
ba8dbd
Patch360: 00360-CVE-2021-3426.patch
ba8dbd
d7a225
# 00362 #
d7a225
# The threading.enumerate() function now uses a reentrant lock to
d7a225
# prevent a hang on reentrant call.
d7a225
# Upstream: https://bugs.python.org/issue44422
d7a225
# Main BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1959459
d7a225
Patch362: 00362-threading-enumerate-rlock.patch
d7a225
d7a225
# 00364 #
d7a225
# Don't call PyThread_exit_thread() explicitly.
d7a225
# Upstream: https://bugs.python.org/issue44434
d7a225
# Main BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1972293
d7a225
Patch364: 00364-thread-exit.patch
d7a225
dd3e76
# 00366 #
dd3e76
# CVE-2021-3733: Denial of service when identifying crafted invalid RFCs
dd3e76
# Upstream: https://bugs.python.org/issue43075
dd3e76
# Tracking bug: https://bugzilla.redhat.com/show_bug.cgi?id=1995234
dd3e76
Patch366: 00366-CVE-2021-3733.patch
dd3e76
81fea5
# 00368 #
81fea5
# CVE-2021-3737: client can enter an infinite loop on a 100 Continue response from the server
81fea5
# Upstream: https://bugs.python.org/issue44022
81fea5
# Tracking bug: https://bugzilla.redhat.com/show_bug.cgi?id=1995162
81fea5
Patch368: 00368-CVE-2021-3737.patch
81fea5
14ec2c
# 00369 #
14ec2c
# Change shouldRollover() methods of logging.handlers to only rollover regular files and not devices
14ec2c
# Upstream: https://bugs.python.org/issue45401
14ec2c
# Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2009200
14ec2c
Patch369: 00369-rollover-only-regular-files-in-logging-handlers.patch
14ec2c
43e83c
# 00370 #
43e83c
# Utilize the monotonic clock for the global interpreter lock instead of the real-time clock
43e83c
# to avoid issues when the system time changes
43e83c
# Upstream: https://bugs.python.org/issue12822
43e83c
# Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2003758
43e83c
Patch370: 00370-GIL-monotonic-clock.patch
43e83c
67e492
# 00372 #
67e492
# CVE-2021-4189: ftplib should not use the host from the PASV response
67e492
# Upstream: https://bugs.python.org/issue43285
67e492
# Tracking bug: https://bugzilla.redhat.com/show_bug.cgi?id=2036020
67e492
Patch372: 00372-CVE-2021-4189.patch
67e492
91f5cf
# 00377 #
91f5cf
# CVE-2022-0391: urlparse does not sanitize URLs containing ASCII newline and tabs
91f5cf
#
91f5cf
# ASCII newline and tab characters are stripped from the URL.
91f5cf
#
91f5cf
# Upstream: https://bugs.python.org/issue43882
91f5cf
# Tracking bug: https://bugzilla.redhat.com/show_bug.cgi?id=2047376
91f5cf
Patch377: 00377-CVE-2022-0391.patch
91f5cf
91f5cf
# 00378 #
91f5cf
# Support expat 2.4.5
91f5cf
#
91f5cf
# Curly brackets were never allowed in namespace URIs
91f5cf
# according to RFC 3986, and so-called namespace-validating
91f5cf
# XML parsers have the right to reject them a invalid URIs.
91f5cf
#
91f5cf
# libexpat >=2.4.5 has become strcter in that regard due to
91f5cf
# related security issues; with ET.XML instantiating a
91f5cf
# namespace-aware parser under the hood, this test has no
91f5cf
# future in CPython.
91f5cf
#
91f5cf
# References:
91f5cf
# - https://datatracker.ietf.org/doc/html/rfc3968
91f5cf
# - https://www.w3.org/TR/xml-names/
91f5cf
#
91f5cf
# Also, test_minidom.py: Support Expat >=2.4.5
91f5cf
#
91f5cf
# The patch has diverged from upstream as the python test
91f5cf
# suite was relying on checking the expat version, whereas
91f5cf
# in RHEL fixes get backported instead of rebasing packages.
91f5cf
# 
91f5cf
# Upstream: https://bugs.python.org/issue46811
91f5cf
Patch378: 00378-support-expat-2-4-5.patch
91f5cf
c66a3a
# 00382 #
c66a3a
# CVE-2015-20107
c66a3a
#
c66a3a
# Make mailcap refuse to match unsafe filenames/types/params (GH-91993)
c66a3a
#
c66a3a
# Upstream: https://github.com/python/cpython/issues/68966
c66a3a
#
c66a3a
# Tracker bug: https://bugzilla.redhat.com/show_bug.cgi?id=2075390
c66a3a
Patch382: 00382-cve-2015-20107.patch
c66a3a
8c28fd
# 00386 #
8c28fd
# CVE-2021-28861
8c28fd
#
8c28fd
# Fix an open redirection vulnerability in the `http.server` module when
8c28fd
# an URI path starts with `//` that could produce a 301 Location header
8c28fd
# with a misleading target.  Vulnerability discovered, and logic fix
8c28fd
# proposed, by Hamza Avvan (@hamzaavvan).
8c28fd
#
8c28fd
# Test and comments authored by Gregory P. Smith [Google].
8c28fd
#
8c28fd
# Upstream: https://github.com/python/cpython/pull/93879
8c28fd
# Tracking bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2120642
8c28fd
Patch386: 00386-cve-2021-28861.patch
8c28fd
8c28fd
# 00387 #
8c28fd
# CVE-2020-10735: Prevent DoS by very large int()
8c28fd
#
8c28fd
# gh-95778: CVE-2020-10735: Prevent DoS by very large int() (GH-96504)
8c28fd
#
8c28fd
# Converting between `int` and `str` in bases other than 2
8c28fd
# (binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10 (decimal) now
8c28fd
# raises a `ValueError` if the number of digits in string form is above a
8c28fd
# limit to avoid potential denial of service attacks due to the algorithmic
8c28fd
# complexity. This is a mitigation for CVE-2020-10735
8c28fd
# (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10735).
8c28fd
#
8c28fd
# This new limit can be configured or disabled by environment variable, command
8c28fd
# line flag, or :mod:`sys` APIs. See the `Integer String Conversion Length
8c28fd
# Limitation` documentation.  The default limit is 4300
8c28fd
# digits in string form.
8c28fd
#
8c28fd
# Patch by Gregory P. Smith [Google] and Christian Heimes [Red Hat] with feedback
8c28fd
# from Victor Stinner, Thomas Wouters, Steve Dower, Ned Deily, and Mark Dickinson.
8c28fd
#
8c28fd
# Notes on the backport to Python 3.6 in RHEL:
8c28fd
#
8c28fd
# * Use "Python 3.6.8-48" version in the documentation, whereas this
8c28fd
#   version will never be released
8c28fd
# * Only add _Py_global_config_int_max_str_digits global variable:
8c28fd
#   Python 3.6 doesn't have PyConfig API (PEP 597) nor _PyRuntime.
8c28fd
# * sys.flags.int_max_str_digits cannot be -1 on Python 3.6: it is
8c28fd
#   set to the default limit. Adapt test_int_max_str_digits() for that.
8c28fd
# * Declare _PY_LONG_DEFAULT_MAX_STR_DIGITS and
8c28fd
#   _PY_LONG_MAX_STR_DIGITS_THRESHOLD macros in longobject.h but only
8c28fd
#   if the Py_BUILD_CORE macro is defined.
8c28fd
# * Declare _Py_global_config_int_max_str_digits in pydebug.h.
8c28fd
#
8c28fd
#
8c28fd
# gh-95778: Mention sys.set_int_max_str_digits() in error message (#96874)
8c28fd
#
8c28fd
# When ValueError is raised if an integer is larger than the limit,
8c28fd
# mention sys.set_int_max_str_digits() in the error message.
8c28fd
#
8c28fd
#
8c28fd
# gh-96848: Fix -X int_max_str_digits option parsing (#96988)
8c28fd
#
8c28fd
# Fix command line parsing: reject "-X int_max_str_digits" option with
8c28fd
# no value (invalid) when the PYTHONINTMAXSTRDIGITS environment
8c28fd
# variable is set to a valid limit.
8c28fd
Patch387: 00387-cve-2020-10735-prevent-dos-by-very-large-int.patch
8c28fd
653c23
# 00394 #
653c23
# CVE-2022-45061: CPU denial of service via inefficient IDNA decoder
653c23
#
653c23
# gh-98433: Fix quadratic time idna decoding.
653c23
#
653c23
# There was an unnecessary quadratic loop in idna decoding. This restores
653c23
# the behavior to linear.
653c23
Patch394: 00394-cve-2022-45061-cpu-denial-of-service-via-inefficient-idna-decoder.patch
653c23
900f19
# (New patches go here ^^^)
900f19
#
900f19
# When adding new patches to "python" and "python3" in Fedora, EL, etc.,
900f19
# please try to keep the patch numbers in-sync between all specfiles.
900f19
#
900f19
# More information, and a patch number catalog, is at:
900f19
#
900f19
#     https://fedoraproject.org/wiki/SIGs/Python/PythonPatches
900f19
900f19
900f19
# ==========================================
900f19
# Descriptions, and metadata for subpackages
900f19
# ==========================================
900f19
900f19
%package -n platform-python
900f19
Summary: Internal interpreter of the Python programming language
900f19
900f19
Conflicts: python3 < 3.6.6-13
900f19
900f19
# Packages with Python modules in standard locations automatically
900f19
# depend on python(abi). Provide that here.
900f19
Provides: python(abi) = %{pybasever}
900f19
900f19
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
900f19
b7e076
%if %{with rpmwheels}
b7e076
b7e076
# RHEL8 was forked from F28 and thus required python3-setuptools here
b7e076
# for the rewheel module to work. We've since backported the use of RPM
b7e076
# prepared wheels from F29+ into RHEL8, and thus this dependency isn't
b7e076
# strictly needed.
b7e076
# However, it is possible, that some packages in BaseOS actually depend on
b7e076
# setuptools without declaring the dependency in their spec file. Thus
b7e076
# we're keeping this dependency here to avoid the possibility of breaking
b7e076
# them.
900f19
Requires: platform-python-setuptools
b7e076
# For python3-pip the Requires has been reduced to Recommends, as there are
b7e076
# generally less packages that depend on pip than packages that depend on
b7e076
# setuptools at runtime, and thus there's less chance of breakage.
b7e076
# (rhbz#1756217).
b7e076
Recommends: platform-python-pip
b7e076
b7e076
Requires: python3-setuptools-wheel
b7e076
Requires: python3-pip-wheel
900f19
%endif
900f19
59bbcc
# Require alternatives version that implements the --keep-foreign flag
59bbcc
Requires:         alternatives >= 1.19.1-1
59bbcc
Requires(post):   alternatives >= 1.19.1-1
59bbcc
Requires(postun): alternatives >= 1.19.1-1
900f19
900f19
# This prevents ALL subpackages built from this spec to require
900f19
# /usr/bin/python3*. Granularity per subpackage is impossible.
900f19
# It's intended for the libs package not to drag in the interpreter, see
900f19
# https://bugzilla.redhat.com/show_bug.cgi?id=1547131
900f19
# All others require %%{name} anyway.
900f19
%global __requires_exclude ^/usr/bin/python3
900f19
900f19
900f19
# The description is the same for the SRPM and the main `platform-python` subpackage:
900f19
%description
900f19
This is the internal interpreter of the Python language for the system.
900f19
To use Python yourself, please install one of the available Python 3 packages,
900f19
for example python36.
900f19
900f19
900f19
# The description is the same for the SRPM and the main `platform-python` subpackage:
900f19
%description -n platform-python
900f19
This is the internal interpreter of the Python language for the system.
900f19
To use Python yourself, please install one of the available Python 3 packages,
900f19
for example python36.
900f19
900f19
900f19
%package libs
900f19
Summary:        Python runtime libraries
900f19
900f19
# The "enum" module is included in the standard library.
900f19
# Provide an upgrade path from the external library.
900f19
Provides: python3-enum34 = 1.0.4-5%{?dist}
900f19
Obsoletes: python3-enum34 < 1.0.4-5%{?dist}
900f19
900f19
# Python 3 built with glibc >= 2.24.90-26 needs to require it
900f19
# See https://bugzilla.redhat.com/show_bug.cgi?id=1410644
900f19
Requires: glibc%{?_isa} >= 2.24.90-26
900f19
900f19
Requires: chkconfig
900f19
900f19
%if %{with gdbm}
900f19
# When built with this (as guarded by the BuildRequires above), require it
900f19
Requires: gdbm%{?_isa} >= 1:1.13
900f19
%endif
900f19
b7e076
%if %{with rpmwheels}
b7e076
Requires: python3-setuptools-wheel
b7e076
Requires: python3-pip-wheel
b7e076
%else
b7e076
Provides: bundled(python3-pip) = 18.1
b7e076
Provides: bundled(python3-setuptools) = 40.6.2
b7e076
%endif
b7e076
900f19
# There are files in the standard library that have python shebang.
900f19
# We've filtered the automatic requirement out so libs are installable without
900f19
# the main package. This however makes it pulled in by default.
900f19
# See https://bugzilla.redhat.com/show_bug.cgi?id=1547131
900f19
Recommends: platform-python%{?_isa} = %{version}-%{release}
900f19
900f19
%description libs
900f19
This package contains runtime libraries for use by Python:
900f19
- the majority of the Python standard library
900f19
- a dynamically linked library for use by applications that embed Python as
900f19
  a scripting language, and by the main "python3" executable
900f19
900f19
900f19
# The contents of this package were moved into the `platform-python-devel` subpackage.
900f19
# See a comment above the definition of that subpackage for details.
900f19
%package devel
900f19
Summary: Libraries and header files needed for Python development
900f19
Requires: platform-python-devel%{?_isa} = %{version}-%{release}
900f19
Requires: platform-python = %{version}-%{release}
900f19
Requires: python36-devel
900f19
900f19
%description devel
900f19
This package contains the header files and configuration needed to compile
900f19
Python extension modules (typically written in C or C++), to embed Python
900f19
into other programs, and to make binary distributions for Python libraries.
900f19
900f19
It also contains the necessary macros to build RPM packages with Python modules
900f19
and 2to3 tool, an automatic source converter from Python 2.X.
900f19
900f19
It also makes the "python3" and "python3-config" commands available
900f19
for compatibility with some build systems.
900f19
When building packages, prefer requiring platform-python-devel and using
900f19
the %%{__python3} macro instead, if possible.
900f19
900f19
900f19
900f19
# The `platform-python-devel` (previously python3-libs-devel)
900f19
# subpackage was created because the `python3-devel` subpackage needs
900f19
# to pull into the buildroot the /usr/bin/python3{,-config} symlinks (for old
900f19
# buildsystems that are hard to switch to platform-python). But these symlinks
900f19
# cannot be shipped in RHEL8 to customers. Therefore we'll ship only
900f19
# `platform-python-devel` and have the `python3-devel` package require it in
900f19
# the buildroot, as well as pull in the symlinks.
900f19
%package -n platform-python-devel
900f19
Summary: Libraries and header files needed for Python development
900f19
Provides: %{name}-libs-devel = %{version}-%{release}
900f19
Provides: %{name}-libs-devel%{?_isa} = %{version}-%{release}
900f19
Obsoletes: %{name}-libs-devel < 3.6.6-12
900f19
Requires: platform-python = %{version}-%{release}
900f19
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
900f19
BuildRequires: python-rpm-macros
900f19
Requires: python-rpm-macros
900f19
Requires: python3-rpm-macros
900f19
Requires: python3-rpm-generators
900f19
b7e076
# This is not "API" (packages that need setuptools should still BuildRequire it)
b7e076
# However some packages apparently can build both with and without setuptools
b7e076
# producing egg-info as file or directory (depending on setuptools presence).
b7e076
# Directory-to-file updates are problematic in RPM, so we ensure setuptools is
b7e076
# installed when -devel is required.
b7e076
# See https://bugzilla.redhat.com/show_bug.cgi?id=1623914
b7e076
# See https://fedoraproject.org/wiki/Packaging:Directory_Replacement
b7e076
Requires: platform-python-setuptools
b7e076
900f19
Provides: %{name}-2to3 = %{version}-%{release}
900f19
Provides: 2to3 = %{version}-%{release}
900f19
900f19
Conflicts: platform-python < %{version}-%{release}
900f19
Conflicts: python3 < 3.6.6-9
900f19
900f19
%description -n platform-python-devel
900f19
This package contains the header files and configuration needed to compile
900f19
Python extension modules (typically written in C or C++), to embed Python
900f19
into other programs, and to make binary distributions for Python libraries.
900f19
900f19
It also contains the necessary macros to build RPM packages with Python modules
900f19
and 2to3 tool, an automatic source converter from Python 2.X.
900f19
900f19
900f19
%package idle
900f19
Summary: A basic graphical development environment for Python
900f19
Requires: platform-python = %{version}-%{release}
900f19
Requires: %{name}-tkinter = %{version}-%{release}
900f19
900f19
Provides: idle3 = %{version}-%{release}
900f19
900f19
Provides: %{name}-tools = %{version}-%{release}
900f19
Provides: %{name}-tools%{?_isa} = %{version}-%{release}
900f19
Obsoletes: %{name}-tools < %{version}-%{release}
900f19
59bbcc
59bbcc
# Require alternatives version that implements the --keep-foreign flag
59bbcc
Requires(postun): alternatives >= 1.19.1-1
900f19
# python36 installs the alternatives master symlink to which we attach a slave
900f19
Requires: python36
900f19
Requires(post): python36
900f19
Requires(postun): python36
900f19
900f19
%description idle
900f19
IDLE is Python’s Integrated Development and Learning Environment.
900f19
900f19
IDLE has the following features: Python shell window (interactive
900f19
interpreter) with colorizing of code input, output, and error messages;
900f19
multi-window text editor with multiple undo, Python colorizing,
900f19
smart indent, call tips, auto completion, and other features;
900f19
search within any window, replace within editor windows, and
900f19
search through multiple files (grep); debugger with persistent
900f19
breakpoints, stepping, and viewing of global and local namespaces;
900f19
configuration, browsers, and other dialogs.
900f19
900f19
900f19
%package tkinter
900f19
Summary: A GUI toolkit for Python
900f19
Requires: platform-python = %{version}-%{release}
900f19
900f19
%description tkinter
900f19
The Tkinter (Tk interface) library is a graphical user interface toolkit for
900f19
the Python programming language.
900f19
900f19
900f19
%package test
900f19
Summary: The self-test suite for the main python3 package
900f19
Requires: platform-python = %{version}-%{release}
900f19
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
900f19
900f19
%description test
900f19
The self-test suite for the Python interpreter.
900f19
900f19
This is only useful to test Python itself. For testing general Python code,
900f19
you should use the unittest module from %{name}-libs, or a library such as
900f19
%{name}-pytest or %{name}-nose.
900f19
900f19
900f19
%if %{with debug_build}
900f19
%package -n platform-python-debug
900f19
Conflicts: python3-debug < 3.6.6-13
900f19
Summary: Debug version of the Python runtime
900f19
900f19
# The debug build is an all-in-one package version of the regular build, and
900f19
# shares the same .py/.pyc files and directories as the regular build. Hence
900f19
# we depend on all of the subpackages of the regular build:
900f19
Requires: platform-python%{?_isa} = %{version}-%{release}
900f19
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
900f19
Requires: platform-python-devel%{?_isa} = %{version}-%{release}
900f19
Requires: %{name}-test%{?_isa} = %{version}-%{release}
900f19
Requires: %{name}-tkinter%{?_isa} = %{version}-%{release}
900f19
Requires: %{name}-idle%{?_isa} = %{version}-%{release}
900f19
900f19
%description -n platform-python-debug
900f19
python3-debug provides a version of the Python runtime with numerous debugging
900f19
features enabled, aimed at advanced Python users such as developers of Python
900f19
extension modules.
900f19
900f19
This version uses more memory and will be slower than the regular Python build,
900f19
but is useful for tracking down reference-counting issues and other bugs.
900f19
900f19
The bytecode format is unchanged, so that .pyc files are compatible between
900f19
this and the standard version of Python, but the debugging features mean that
900f19
C/C++ extension modules are ABI-incompatible and must be built for each version
900f19
separately.
900f19
900f19
The debug build shares installation directories with the standard Python
900f19
runtime, so that .py and .pyc files can be shared.
900f19
Compiled extension modules use a special ABI flag ("d") in the filename,
900f19
so extensions for both versions can co-exist in the same directory.
900f19
%endif # with debug_build
900f19
900f19
900f19
# ======================================================
900f19
# The prep phase of the build:
900f19
# ======================================================
900f19
900f19
%prep
900f19
%setup -q -n Python-%{version}%{?prerel}
900f19
900f19
# Remove bundled libraries to ensure that we're using the system copy.
900f19
rm -r Modules/expat
900f19
rm -r Modules/zlib
900f19
900f19
#
900f19
# Apply patches:
900f19
#
900f19
%patch1 -p1
900f19
900f19
%if "%{_lib}" == "lib64"
900f19
%patch102 -p1
900f19
%endif
900f19
%patch111 -p1
900f19
%patch132 -p1
900f19
%patch155 -p1
900f19
%patch160 -p1
900f19
%patch163 -p1
900f19
%patch170 -p1
900f19
b7e076
%if %{with rpmwheels}
900f19
%patch189 -p1
b7e076
rm Lib/ensurepip/_bundled/*.whl
900f19
%endif
900f19
900f19
%patch251 -p1
43e83c
%patch257 -p1
900f19
%patch262 -p1
900f19
%patch294 -p1
b7e076
%patch316 -p1
900f19
%patch317 -p1
900f19
%patch318 -p1
900f19
%patch319 -p1
900f19
%patch320 -p1
900f19
%patch324 -p1
900f19
%patch325 -p1
b7e076
%patch326 -p1
b7e076
%patch327 -p1
b7e076
%patch329 -p1
b7e076
%patch330 -p1
b7e076
%patch332 -p1
b7e076
%patch333 -p1
3d909f
%patch338 -p1
3d909f
%patch344 -p1
3d909f
%patch345 -p1
3d909f
%patch346 -p1
900f19
d43968
# Patch 351 adds binary file for testing. We need to apply it using Git.
d43968
git apply %{PATCH351}
d43968
d43968
%patch352 -p1
3ca59d
%patch353 -p1
3ca59d
%patch354 -p1
3ca59d
%patch355 -p1
b3527f
%patch356 -p1
b3527f
%patch357 -p1
0f0bda
%patch359 -p1
ba8dbd
%patch360 -p1
d7a225
%patch362 -p1
d7a225
%patch364 -p1
dd3e76
%patch366 -p1
81fea5
%patch368 -p1
14ec2c
%patch369 -p1
43e83c
%patch370 -p1
67e492
%patch372 -p1
91f5cf
%patch377 -p1
91f5cf
%patch378 -p1
c66a3a
%patch382 -p1
8c28fd
%patch386 -p1
8c28fd
%patch387 -p1
653c23
%patch394 -p1
900f19
900f19
# Remove files that should be generated by the build
900f19
# (This is after patching, so that we can use patches directly from upstream)
900f19
rm configure pyconfig.h.in
900f19
fa50f4
# When we use the legacy arch names, we need to change them in configure.ac
fa50f4
%if %{with legacy_archnames}
fa50f4
sed -i configure.ac \
fa50f4
    -e 's/\b%{platform_triplet_upstream}\b/%{platform_triplet_legacy}/'
fa50f4
%endif
fa50f4
900f19
900f19
# ======================================================
900f19
# Configuring and building the code:
900f19
# ======================================================
900f19
900f19
%build
900f19
900f19
# Regenerate the configure script and pyconfig.h.in
900f19
autoconf
900f19
autoheader
900f19
900f19
# Remember the current directory (which has sources and the configure script),
900f19
# so we can refer to it after we "cd" elsewhere.
900f19
topdir=$(pwd)
900f19
900f19
# Get proper option names from bconds
900f19
%if %{with computed_gotos}
900f19
%global computed_gotos_flag yes
900f19
%else
900f19
%global computed_gotos_flag no
900f19
%endif
900f19
900f19
%if %{with optimizations}
900f19
%global optimizations_flag "--enable-optimizations"
900f19
%else
900f19
%global optimizations_flag "--disable-optimizations"
900f19
%endif
900f19
900f19
# Set common compiler/linker flags
900f19
# We utilize the %%extension_...flags macros here so users building C/C++
900f19
# extensions with our python won't get all the compiler/linker flags used
900f19
# in RHEL RPMs.
900f19
# Standard library built here will still use the %%build_...flags,
900f19
# RHEL packages utilizing %%py3_build will use them as well
900f19
# https://fedoraproject.org/wiki/Changes/Python_Extension_Flags
900f19
export CFLAGS="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
3d909f
export CFLAGS_NODIST="%{build_cflags} -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition"
900f19
export CXXFLAGS="%{extension_cxxflags} -D_GNU_SOURCE -fPIC -fwrapv"
900f19
export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
900f19
export OPT="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
900f19
export LINKCC="gcc"
900f19
export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
900f19
export LDFLAGS="%{extension_ldflags} -g $(pkg-config --libs-only-L openssl)"
3d909f
export LDFLAGS_NODIST="%{build_ldflags} -fno-semantic-interposition -g $(pkg-config --libs-only-L openssl)"
900f19
900f19
# We can build several different configurations of Python: regular and debug.
900f19
# Define a common function that does one build:
900f19
BuildPython() {
900f19
  ConfName=$1
900f19
  ExtraConfigArgs=$2
900f19
  MoreCFlags=$3
900f19
900f19
  # Each build is done in its own directory
900f19
  ConfDir=build/$ConfName
900f19
  echo STARTING: BUILD OF PYTHON FOR CONFIGURATION: $ConfName
900f19
  mkdir -p $ConfDir
900f19
  pushd $ConfDir
900f19
900f19
  # Normally, %%configure looks for the "configure" script in the current
900f19
  # directory.
900f19
  # Since we changed directories, we need to tell %%configure where to look.
900f19
  %global _configure $topdir/configure
900f19
900f19
%configure \
900f19
  --enable-ipv6 \
900f19
  --enable-shared \
900f19
  --with-computed-gotos=%{computed_gotos_flag} \
900f19
  --with-dbmliborder=gdbm:ndbm:bdb \
900f19
  --with-system-expat \
900f19
  --with-system-ffi \
900f19
  --enable-loadable-sqlite-extensions \
900f19
  --with-dtrace \
900f19
  --with-lto \
900f19
  --with-ssl-default-suites=openssl \
900f19
%if %{with valgrind}
900f19
  --with-valgrind \
900f19
%endif
900f19
  $ExtraConfigArgs \
900f19
  %{nil}
900f19
fa50f4
  # Regenerate generated importlib frozen modules (see patch 353)
fa50f4
  %make_build CFLAGS_NODIST="$CFLAGS_NODIST $MoreCFlags" regen-importlib
fa50f4
900f19
  # Invoke the build
b7e076
  %make_build CFLAGS_NODIST="$CFLAGS_NODIST $MoreCFlags"
900f19
900f19
  popd
900f19
  echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfName
900f19
}
900f19
900f19
# Call the above to build each configuration.
900f19
900f19
%if %{with debug_build}
900f19
BuildPython debug \
900f19
  "--without-ensurepip --with-pydebug" \
900f19
  "-Og"
900f19
%endif # with debug_build
900f19
900f19
BuildPython optimized \
900f19
  "--without-ensurepip %{optimizations_flag}" \
900f19
  ""
900f19
900f19
# ======================================================
900f19
# Installing the built code:
900f19
# ======================================================
900f19
900f19
%install
900f19
900f19
# As in %%build, remember the current directory
900f19
topdir=$(pwd)
900f19
900f19
# We install a collection of hooks for gdb that make it easier to debug
900f19
# executables linked against libpython3* (such as /usr/bin/python3 itself)
900f19
#
900f19
# These hooks are implemented in Python itself (though they are for the version
900f19
# of python that gdb is linked with)
900f19
#
900f19
# gdb-archer looks for them in the same path as the ELF file or its .debug
900f19
# file, with a -gdb.py suffix.
900f19
# We put them next to the debug file, because ldconfig would complain if
900f19
# it found non-library files directly in /usr/lib/
900f19
# (see https://bugzilla.redhat.com/show_bug.cgi?id=562980)
900f19
#
900f19
# We'll put these files in the debuginfo package by installing them to e.g.:
900f19
#  /usr/lib/debug/usr/lib/libpython3.2.so.1.0.debug-gdb.py
900f19
# (note that the debug path is /usr/lib/debug for both 32/64 bit)
900f19
#
900f19
# See https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more
900f19
# information
900f19
900f19
%if %{with gdb_hooks}
900f19
DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
900f19
mkdir -p %{buildroot}$DirHoldingGdbPy
900f19
%endif # with gdb_hooks
900f19
900f19
# Multilib support for pyconfig.h
900f19
# 32- and 64-bit versions of pyconfig.h are different. For multilib support
900f19
# (making it possible to install 32- and 64-bit versions simultaneously),
900f19
# we need to install them under different filenames, and to make the common
900f19
# "pyconfig.h" include the right file based on architecture.
900f19
# See https://bugzilla.redhat.com/show_bug.cgi?id=192747
900f19
# Filanames are defined here:
900f19
%global _pyconfig32_h pyconfig-32.h
900f19
%global _pyconfig64_h pyconfig-64.h
900f19
%global _pyconfig_h pyconfig-%{wordsize}.h
900f19
653c23
900f19
# Use a common function to do an install for all our configurations:
900f19
InstallPython() {
900f19
900f19
  ConfName=$1
900f19
  PyInstSoName=$2
900f19
  MoreCFlags=$3
900f19
  LDVersion=$4
900f19
900f19
  # Switch to the directory with this configuration's built files
900f19
  ConfDir=build/$ConfName
900f19
  echo STARTING: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName
900f19
  mkdir -p $ConfDir
900f19
  pushd $ConfDir
900f19
900f19
  make \
900f19
    DESTDIR=%{buildroot} \
900f19
    INSTALL="install -p" \
900f19
    EXTRA_CFLAGS="$MoreCFlags" \
900f19
    install
900f19
900f19
  popd
900f19
900f19
%if %{with gdb_hooks}
900f19
  # See comment on $DirHoldingGdbPy above
900f19
  PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName-%{version}-%{release}.%{_arch}.debug-gdb.py
900f19
  cp Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy
900f19
%endif # with gdb_hooks
900f19
900f19
  # Rename the -devel script that differs on different arches to arch specific name
900f19
  mv %{buildroot}%{_bindir}/python${LDVersion}-{,`uname -m`-}config
900f19
  echo -e '#!/bin/sh\nexec %{_libexecdir}/platform-python'${LDVersion}'-`uname -m`-config "$@"' > \
900f19
    %{buildroot}%{_bindir}/python${LDVersion}-config
900f19
  echo '[ $? -eq 127 ] && echo "Could not find %{_libexecdir}/platform-python'${LDVersion}'-`uname -m`-config. Look around to see available arches." >&2' >> \
900f19
    %{buildroot}%{_bindir}/python${LDVersion}-config
900f19
    chmod +x %{buildroot}%{_bindir}/python${LDVersion}-config
900f19
900f19
  # Platform Python: Move the python*-config to libexec
900f19
  mkdir -p %{buildroot}%{_libexecdir}
900f19
  mv %{buildroot}%{_bindir}/python${LDVersion}-config %{buildroot}%{_libexecdir}/platform-python${LDVersion}-config
900f19
  ln -s %{_libexecdir}/platform-python${LDVersion}-config %{buildroot}%{_bindir}/python${LDVersion}-config
900f19
  mv %{buildroot}%{_bindir}/python${LDVersion}-`uname -m`-config %{buildroot}%{_libexecdir}/platform-python${LDVersion}-`uname -m`-config
900f19
  ln -s %{_libexecdir}/platform-python${LDVersion}-`uname -m`-config %{buildroot}%{_bindir}/python${LDVersion}-`uname -m`-config
900f19
900f19
  # Platform Python: Move optimized and debug executables
900f19
  mv %{buildroot}%{_bindir}/python${LDVersion} %{buildroot}%{_libexecdir}/platform-python${LDVersion}
900f19
  ln -s %{_libexecdir}/platform-python${LDVersion} %{buildroot}%{_bindir}/python${LDVersion}
900f19
900f19
  # Make python3-devel multilib-ready
900f19
  mv %{buildroot}%{_includedir}/python${LDVersion}/pyconfig.h \
900f19
     %{buildroot}%{_includedir}/python${LDVersion}/%{_pyconfig_h}
900f19
  cat > %{buildroot}%{_includedir}/python${LDVersion}/pyconfig.h << EOF
900f19
#include <bits/wordsize.h>
900f19
900f19
#if __WORDSIZE == 32
900f19
#include "%{_pyconfig32_h}"
900f19
#elif __WORDSIZE == 64
900f19
#include "%{_pyconfig64_h}"
900f19
#else
900f19
#error "Unknown word size"
900f19
#endif
900f19
EOF
900f19
900f19
  echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName
900f19
}
900f19
900f19
# Install the "debug" build first; any common files will be overridden with
900f19
# later builds
900f19
%if %{with debug_build}
900f19
InstallPython debug \
900f19
  %{py_INSTSONAME_debug} \
900f19
  -O0 \
900f19
  %{LDVERSION_debug}
900f19
%endif # with debug_build
900f19
900f19
# Now the optimized build:
900f19
InstallPython optimized \
900f19
  %{py_INSTSONAME_optimized} \
900f19
  "" \
900f19
  %{LDVERSION_optimized}
900f19
900f19
# Install directories for additional packages
900f19
install -d -m 0755 %{buildroot}%{pylibdir}/site-packages/__pycache__
900f19
%if "%{_lib}" == "lib64"
900f19
# The 64-bit version needs to create "site-packages" in /usr/lib/ (for
900f19
# pure-Python modules) as well as in /usr/lib64/ (for packages with extension
900f19
# modules).
900f19
# Note that rpmlint will complain about hardcoded library path;
900f19
# this is intentional.
900f19
install -d -m 0755 %{buildroot}%{_prefix}/lib/python%{pybasever}/site-packages/__pycache__
900f19
%endif
900f19
900f19
# add idle3 to menu
900f19
install -D -m 0644 Lib/idlelib/Icons/idle_16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/idle3.png
900f19
install -D -m 0644 Lib/idlelib/Icons/idle_32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/idle3.png
900f19
install -D -m 0644 Lib/idlelib/Icons/idle_48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/idle3.png
900f19
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE10}
900f19
900f19
# Install and validate appdata file
900f19
mkdir -p %{buildroot}%{_metainfodir}
900f19
cp -a %{SOURCE11} %{buildroot}%{_metainfodir}
900f19
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/idle3.appdata.xml
900f19
900f19
# Make sure distutils looks at the right pyconfig.h file
900f19
# See https://bugzilla.redhat.com/show_bug.cgi?id=201434
900f19
# Similar for sysconfig: sysconfig.get_config_h_filename tries to locate
900f19
# pyconfig.h so it can be parsed, and needs to do this at runtime in site.py
900f19
# when python starts up (see https://bugzilla.redhat.com/show_bug.cgi?id=653058)
900f19
#
900f19
# Split this out so it goes directly to the pyconfig-32.h/pyconfig-64.h
900f19
# variants:
900f19
sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \
900f19
  %{buildroot}%{pylibdir}/distutils/sysconfig.py \
900f19
  %{buildroot}%{pylibdir}/sysconfig.py
900f19
900f19
# Install pathfix.py to bindir
900f19
# See https://github.com/fedora-python/python-rpm-porting/issues/24
900f19
cp -p Tools/scripts/pathfix.py %{buildroot}%{_bindir}/
900f19
900f19
# Switch all shebangs to refer to the specific Python version.
900f19
# This currently only covers files matching ^[a-zA-Z0-9_]+\.py$,
900f19
# so handle files named using other naming scheme separately.
900f19
# - Files in /usr/bin/ (without .py) are listed manually
900f19
LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \
900f19
  Tools/scripts/pathfix.py \
900f19
  -i "%{_libexecdir}/platform-python" -pn \
900f19
  %{buildroot} \
900f19
  %{?with_gdb_hooks:%{buildroot}$DirHoldingGdbPy/*.py} \
900f19
  %{buildroot}%{_bindir}/{idle,pydoc,pyvenv-,2to3-}%{pybasever}
900f19
900f19
# The python-config.py files need to be shebanged with the given LDVERSION'ed
900f19
# executable
900f19
for LDVersion in %{LDVERSION_optimized} %{LDVERSION_debug}
900f19
do
900f19
  LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \
900f19
    Tools/scripts/pathfix.py \
900f19
    -i "%{_libexecdir}/platform-python${LDVersion}" -pn \
fa50f4
    %{buildroot}%{pylibdir}/config-${LDVersion}-%{platform_triplet}/python-config.py
900f19
done
900f19
900f19
# Remove tests for python3-tools which was removed in
900f19
# https://bugzilla.redhat.com/show_bug.cgi?id=1312030
900f19
rm -rf %{buildroot}%{pylibdir}/test/test_tools
900f19
900f19
# Remove shebang lines from .py files that aren't executable, and
900f19
# remove executability from .py files that don't have a shebang line:
900f19
find %{buildroot} -name \*.py \
900f19
  \( \( \! -perm /u+x,g+x,o+x -exec sed -e '/^#!/Q 0' -e 'Q 1' {} \; \
900f19
  -print -exec sed -i '1d' {} \; \) -o \( \
900f19
  -perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \
900f19
  -exec chmod a-x {} \; \) \)
900f19
900f19
# Get rid of DOS batch files:
900f19
find %{buildroot} -name \*.bat -exec rm {} \;
900f19
900f19
# Get rid of backup files:
900f19
find %{buildroot}/ -name "*~" -exec rm -f {} \;
900f19
find . -name "*~" -exec rm -f {} \;
900f19
900f19
# Get rid of a stray copy of the license:
900f19
rm %{buildroot}%{pylibdir}/LICENSE.txt
900f19
900f19
# Do bytecompilation with the newly installed interpreter.
900f19
# This is similar to the script in macros.pybytecompile
900f19
# compile *.pyc
900f19
find %{buildroot} -type f -a -name "*.py" -print0 | \
900f19
    LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
900f19
    PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
900f19
    xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2], optimize=opt) for opt in range(3) for f in sys.argv[1:]]' || :
900f19
900f19
# Since we have pathfix.py in bindir, this is created, but we don't want it
900f19
rm -rf %{buildroot}%{_bindir}/__pycache__
900f19
900f19
# Fixup permissions for shared libraries from non-standard 555 to standard 755:
900f19
find %{buildroot} -perm 555 -exec chmod 755 {} \;
900f19
900f19
# Install macros for rpm:
900f19
mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/
900f19
900f19
# Create "/usr/bin/python3-debug" (and /usr/libexec/platform-python-debug),
900f19
# a symlink to the python3 debug binary, to
900f19
# avoid the user having to know the precise version and ABI flags.
900f19
# See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=676748
900f19
%if %{with debug_build}
900f19
ln -s \
900f19
  %{_bindir}/python%{LDVERSION_debug} \
900f19
  %{buildroot}%{_bindir}/python3-debug
900f19
ln -s \
900f19
  %{_libexecdir}/platform-python%{LDVERSION_debug} \
900f19
  %{buildroot}%{_libexecdir}/platform-python-debug
900f19
%endif
900f19
900f19
900f19
# Platform Python: Move the executable to libexec & provide a symlink from bindir
900f19
# (this symlink will be moved to the python36 module)
900f19
mkdir -p %{buildroot}%{_libexecdir}
900f19
mv %{buildroot}%{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/platform-python%{pybasever}
900f19
ln -s %{_libexecdir}/platform-python%{pybasever} %{buildroot}%{_bindir}/python%{pybasever}
900f19
ln -s ./platform-python%{pybasever} %{buildroot}%{_libexecdir}/platform-python
900f19
900f19
# Platform Python: Add symlink from platform-python-config
900f19
ln -s ./platform-python%{LDVERSION_optimized}-config %{buildroot}%{_libexecdir}/platform-python%{pybasever}-config
900f19
ln -s ./platform-python%{pybasever}-config %{buildroot}%{_libexecdir}/platform-python-config
900f19
900f19
# Remove symlinks <name>3 > <name>3.6 for pydoc, idle, manpage
900f19
rm %{buildroot}%{_bindir}/pydoc3
900f19
rm %{buildroot}%{_bindir}/idle3
900f19
rm %{buildroot}%{_mandir}/man1/python3.1
900f19
900f19
# Install the unversioned-python script and its man page
900f19
install -m 755 %{SOURCE12} %{buildroot}%{_libexecdir}/no-python
900f19
install -m 644 %{SOURCE13} %{buildroot}%{_mandir}/man1/unversioned-python.1
900f19
# Touch the files that are controlled by `alternatives` so we can declare them
900f19
# as ghosts in the files section
900f19
touch %{buildroot}%{_bindir}/unversioned-python
900f19
touch %{buildroot}%{_bindir}/idle3
900f19
touch %{buildroot}%{_mandir}/man1/python.1.gz
900f19
115ea1
# Strip the LTO bytecode from python.o
115ea1
# Based on the fedora brp-strip-lto scriptlet
115ea1
# https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/9dd5528cf9805ebfe31cff04fe7828ad06a6023f/f/brp-strip-lto
115ea1
find %{buildroot} -type f -name 'python.o' -print0 | xargs -0 \
115ea1
bash -c "strip -p -R .gnu.lto_* -R .gnu.debuglto_* -N __gnu_lto_v1 \"\$@\"" ARG0
900f19
900f19
# ======================================================
900f19
# Checks for packaging issues
900f19
# ======================================================
900f19
900f19
%check
900f19
# first of all, check timestamps of bytecode files
900f19
find %{buildroot} -type f -a -name "*.py" -print0 | \
900f19
    LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
900f19
    PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
900f19
    xargs -0 %{buildroot}%{_libexecdir}/platform-python %{SOURCE8}
900f19
900f19
# Ensure that the curses module was linked against libncursesw.so, rather than
900f19
# libncurses.so
900f19
# See https://bugzilla.redhat.com/show_bug.cgi?id=539917
900f19
ldd %{buildroot}/%{dynload_dir}/_curses*.so \
900f19
    | grep curses \
900f19
    | grep libncurses.so && (echo "_curses.so linked against libncurses.so" ; exit 1)
900f19
900f19
# Ensure that the debug modules are linked against the debug libpython, and
900f19
# likewise for the optimized modules and libpython:
900f19
for Module in %{buildroot}/%{dynload_dir}/*.so ; do
900f19
    case $Module in
900f19
    *.%{SOABI_debug})
900f19
        ldd $Module | grep %{py_INSTSONAME_optimized} &&
900f19
            (echo Debug module $Module linked against optimized %{py_INSTSONAME_optimized} ; exit 1)
900f19
900f19
        ;;
900f19
    *.%{SOABI_optimized})
900f19
        ldd $Module | grep %{py_INSTSONAME_debug} &&
900f19
            (echo Optimized module $Module linked against debug %{py_INSTSONAME_debug} ; exit 1)
900f19
        ;;
900f19
    esac
900f19
done
900f19
900f19
# ======================================================
900f19
# Running the upstream test suite
900f19
# ======================================================
900f19
900f19
topdir=$(pwd)
900f19
CheckPython() {
900f19
  ConfName=$1
900f19
  ConfDir=$(pwd)/build/$ConfName
900f19
900f19
  export OPENSSL_CONF=/non-existing-file
900f19
900f19
  echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
900f19
900f19
  # Note that we're running the tests using the version of the code in the
900f19
  # builddir, not in the buildroot.
900f19
900f19
  # Run the upstream test suite, setting "WITHIN_PYTHON_RPM_BUILD" so that the
900f19
  # our non-standard decorators take effect on the relevant tests:
900f19
  #   @unittest._skipInRpmBuild(reason)
900f19
  #   @unittest._expectedFailureInRpmBuild
900f19
  # test_faulthandler.test_register_chain currently fails on ppc64le and
900f19
  #   aarch64, see upstream bug http://bugs.python.org/issue21131
900f19
  WITHIN_PYTHON_RPM_BUILD= \
900f19
  LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \
900f19
    -wW --slowest --findleaks \
900f19
    -x test_bdist_rpm \
900f19
    %ifarch %{mips64}
900f19
    -x test_ctypes \
900f19
    %endif
900f19
900f19
  echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
900f19
900f19
}
900f19
900f19
%if %{with tests}
900f19
900f19
# Check each of the configurations:
900f19
%if %{with debug_build}
900f19
CheckPython debug
900f19
%endif # with debug_build
900f19
CheckPython optimized
900f19
900f19
%endif # with tests
900f19
900f19
900f19
%post -n platform-python
900f19
# Default with no /usr/bin/python symlink
900f19
alternatives --install %{_bindir}/unversioned-python \
900f19
                       python \
900f19
                       %{_libexecdir}/no-python \
900f19
                       404 \
900f19
             --slave   %{_mandir}/man1/python.1.gz \
900f19
                       unversioned-python-man \
900f19
                       %{_mandir}/man1/unversioned-python.1.gz
900f19
900f19
%postun -n platform-python
900f19
# Do this only during uninstall process (not during update)
900f19
if [ $1 -eq 0 ]; then
59bbcc
    alternatives --keep-foreign --remove python \
900f19
                          %{_libexecdir}/no-python
900f19
900f19
fi
900f19
900f19
900f19
%post -n python3-idle
900f19
alternatives --add-slave python3 %{_bindir}/python3.6 \
900f19
    %{_bindir}/idle3 \
900f19
    idle3 \
900f19
    %{_bindir}/idle3.6
900f19
900f19
%postun -n python3-idle
900f19
# Do this only during uninstall process (not during update)
900f19
if [ $1 -eq 0 ]; then
59bbcc
    alternatives --keep-foreign --remove-slave python3 %{_bindir}/python3.6 \
900f19
       idle3
900f19
fi
900f19
900f19
900f19
%files -n platform-python
900f19
%license LICENSE
900f19
%doc README.rst
900f19
%{_bindir}/pydoc*
900f19
900f19
%exclude %{_bindir}/python3
900f19
%exclude %{_bindir}/python%{pybasever}
900f19
%exclude %{_bindir}/python%{LDVERSION_optimized}
900f19
%{_libexecdir}/platform-python
900f19
%{_libexecdir}/platform-python%{pybasever}
900f19
%{_libexecdir}/platform-python%{LDVERSION_optimized}
900f19
%{_libexecdir}/no-python
900f19
%ghost %{_bindir}/unversioned-python
900f19
%ghost %{_mandir}/man1/python.1.gz
900f19
900f19
%exclude %{_bindir}/pyvenv
900f19
%{_bindir}/pyvenv-%{pybasever}
b7e076
b7e076
%{_mandir}/man1/python3.6.1*
b7e076
%{_mandir}/man1/unversioned-python.1*
900f19
900f19
%files libs
900f19
%license LICENSE
900f19
%doc README.rst
900f19
900f19
%dir %{pylibdir}
900f19
%dir %{dynload_dir}
900f19
900f19
%{pylibdir}/lib2to3
900f19
%exclude %{pylibdir}/lib2to3/tests
900f19
900f19
%dir %{pylibdir}/unittest/
900f19
%dir %{pylibdir}/unittest/__pycache__/
900f19
%{pylibdir}/unittest/*.py
900f19
%{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes}
900f19
900f19
%dir %{pylibdir}/asyncio/
900f19
%dir %{pylibdir}/asyncio/__pycache__/
900f19
%{pylibdir}/asyncio/*.py
900f19
%{pylibdir}/asyncio/__pycache__/*%{bytecode_suffixes}
900f19
900f19
%dir %{pylibdir}/venv/
900f19
%dir %{pylibdir}/venv/__pycache__/
900f19
%{pylibdir}/venv/*.py
900f19
%{pylibdir}/venv/__pycache__/*%{bytecode_suffixes}
900f19
%{pylibdir}/venv/scripts
900f19
900f19
%{pylibdir}/wsgiref
900f19
%{pylibdir}/xmlrpc
900f19
900f19
%dir %{pylibdir}/ensurepip/
900f19
%dir %{pylibdir}/ensurepip/__pycache__/
900f19
%{pylibdir}/ensurepip/*.py
900f19
%{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes}
b7e076
%if %{with rpmwheels}
900f19
%exclude %{pylibdir}/ensurepip/_bundled
b7e076
%else
b7e076
%dir %{pylibdir}/ensurepip/_bundled
b7e076
%{pylibdir}/ensurepip/_bundled/*.whl
900f19
%endif
900f19
900f19
# The majority of the test module lives in the test subpackage
900f19
# However test.support is in libs - it contains stuff used when testing your code
900f19
# https://bugzilla.redhat.com/show_bug.cgi?id=1651215
900f19
%dir %{pylibdir}/test/
900f19
%dir %{pylibdir}/test/__pycache__/
900f19
%dir %{pylibdir}/test/support/
900f19
%dir %{pylibdir}/test/support/__pycache__/
900f19
%{pylibdir}/test/__init__.py
900f19
%{pylibdir}/test/__pycache__/__init__%{bytecode_suffixes}
900f19
%{pylibdir}/test/support/*.py
900f19
%{pylibdir}/test/support/__pycache__/*%{bytecode_suffixes}
900f19
900f19
%dir %{pylibdir}/concurrent/
900f19
%dir %{pylibdir}/concurrent/__pycache__/
900f19
%{pylibdir}/concurrent/*.py
900f19
%{pylibdir}/concurrent/__pycache__/*%{bytecode_suffixes}
900f19
900f19
%dir %{pylibdir}/concurrent/futures/
900f19
%dir %{pylibdir}/concurrent/futures/__pycache__/
900f19
%{pylibdir}/concurrent/futures/*.py
900f19
%{pylibdir}/concurrent/futures/__pycache__/*%{bytecode_suffixes}
900f19
900f19
%{pylibdir}/pydoc_data
900f19
900f19
%{dynload_dir}/_blake2.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_sha3.%{SOABI_optimized}.so
b7e076
%{dynload_dir}/_hmacopenssl.%{SOABI_optimized}.so
900f19
900f19
%{dynload_dir}/_asyncio.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_bisect.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_bz2.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_codecs_cn.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_codecs_hk.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_codecs_iso2022.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_codecs_jp.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_codecs_kr.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_codecs_tw.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_crypt.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_csv.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_ctypes.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_curses.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_curses_panel.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_dbm.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_decimal.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_elementtree.%{SOABI_optimized}.so
900f19
%if %{with gdbm}
900f19
%{dynload_dir}/_gdbm.%{SOABI_optimized}.so
900f19
%endif
900f19
%{dynload_dir}/_hashlib.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_heapq.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_json.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_lsprof.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_lzma.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_multibytecodec.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_multiprocessing.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_opcode.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_pickle.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_posixsubprocess.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_random.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_socket.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_sqlite3.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_ssl.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_struct.%{SOABI_optimized}.so
900f19
%{dynload_dir}/array.%{SOABI_optimized}.so
900f19
%{dynload_dir}/audioop.%{SOABI_optimized}.so
900f19
%{dynload_dir}/binascii.%{SOABI_optimized}.so
900f19
%{dynload_dir}/cmath.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_datetime.%{SOABI_optimized}.so
900f19
%{dynload_dir}/fcntl.%{SOABI_optimized}.so
900f19
%{dynload_dir}/grp.%{SOABI_optimized}.so
900f19
%{dynload_dir}/math.%{SOABI_optimized}.so
900f19
%{dynload_dir}/mmap.%{SOABI_optimized}.so
900f19
%{dynload_dir}/nis.%{SOABI_optimized}.so
900f19
%{dynload_dir}/ossaudiodev.%{SOABI_optimized}.so
900f19
%{dynload_dir}/parser.%{SOABI_optimized}.so
900f19
%{dynload_dir}/pyexpat.%{SOABI_optimized}.so
900f19
%{dynload_dir}/readline.%{SOABI_optimized}.so
900f19
%{dynload_dir}/resource.%{SOABI_optimized}.so
900f19
%{dynload_dir}/select.%{SOABI_optimized}.so
900f19
%{dynload_dir}/spwd.%{SOABI_optimized}.so
900f19
%{dynload_dir}/syslog.%{SOABI_optimized}.so
900f19
%{dynload_dir}/termios.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_testmultiphase.%{SOABI_optimized}.so
900f19
%{dynload_dir}/unicodedata.%{SOABI_optimized}.so
900f19
%{dynload_dir}/xxlimited.%{SOABI_optimized}.so
900f19
%{dynload_dir}/zlib.%{SOABI_optimized}.so
900f19
900f19
%dir %{pylibdir}/site-packages/
900f19
%dir %{pylibdir}/site-packages/__pycache__/
900f19
%{pylibdir}/site-packages/README.txt
900f19
%{pylibdir}/*.py
900f19
%dir %{pylibdir}/__pycache__/
900f19
%{pylibdir}/__pycache__/*%{bytecode_suffixes}
900f19
900f19
%dir %{pylibdir}/collections/
900f19
%dir %{pylibdir}/collections/__pycache__/
900f19
%{pylibdir}/collections/*.py
900f19
%{pylibdir}/collections/__pycache__/*%{bytecode_suffixes}
900f19
900f19
%dir %{pylibdir}/ctypes/
900f19
%dir %{pylibdir}/ctypes/__pycache__/
900f19
%{pylibdir}/ctypes/*.py
900f19
%{pylibdir}/ctypes/__pycache__/*%{bytecode_suffixes}
900f19
%{pylibdir}/ctypes/macholib
900f19
900f19
%{pylibdir}/curses
900f19
900f19
%dir %{pylibdir}/dbm/
900f19
%dir %{pylibdir}/dbm/__pycache__/
900f19
%{pylibdir}/dbm/*.py
900f19
%{pylibdir}/dbm/__pycache__/*%{bytecode_suffixes}
900f19
900f19
%dir %{pylibdir}/distutils/
900f19
%dir %{pylibdir}/distutils/__pycache__/
900f19
%{pylibdir}/distutils/*.py
900f19
%{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes}
900f19
%{pylibdir}/distutils/README
900f19
%{pylibdir}/distutils/command
900f19
%exclude %{pylibdir}/distutils/command/wininst-*.exe
900f19
900f19
%dir %{pylibdir}/email/
900f19
%dir %{pylibdir}/email/__pycache__/
900f19
%{pylibdir}/email/*.py
900f19
%{pylibdir}/email/__pycache__/*%{bytecode_suffixes}
900f19
%{pylibdir}/email/mime
900f19
%doc %{pylibdir}/email/architecture.rst
900f19
900f19
%{pylibdir}/encodings
900f19
900f19
%{pylibdir}/html
900f19
%{pylibdir}/http
900f19
900f19
%dir %{pylibdir}/importlib/
900f19
%dir %{pylibdir}/importlib/__pycache__/
900f19
%{pylibdir}/importlib/*.py
900f19
%{pylibdir}/importlib/__pycache__/*%{bytecode_suffixes}
900f19
900f19
%dir %{pylibdir}/json/
900f19
%dir %{pylibdir}/json/__pycache__/
900f19
%{pylibdir}/json/*.py
900f19
%{pylibdir}/json/__pycache__/*%{bytecode_suffixes}
900f19
900f19
%{pylibdir}/logging
900f19
%{pylibdir}/multiprocessing
900f19
900f19
%dir %{pylibdir}/sqlite3/
900f19
%dir %{pylibdir}/sqlite3/__pycache__/
900f19
%{pylibdir}/sqlite3/*.py
900f19
%{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes}
900f19
900f19
%exclude %{pylibdir}/turtle.py
900f19
%exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes}
900f19
900f19
%{pylibdir}/urllib
900f19
%{pylibdir}/xml
900f19
900f19
%if "%{_lib}" == "lib64"
900f19
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}
900f19
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages
900f19
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages/__pycache__/
900f19
%endif
900f19
900f19
# "Makefile" and the config-32/64.h file are needed by
900f19
# distutils/sysconfig.py:_init_posix(), so we include them in the core
900f19
# package, along with their parent directories (bug 531901):
fa50f4
%dir %{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/
fa50f4
%{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/Makefile
900f19
%dir %{_includedir}/python%{LDVERSION_optimized}/
900f19
%{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h}
900f19
900f19
%{_libdir}/%{py_INSTSONAME_optimized}
900f19
%{_libdir}/libpython3.so
900f19
900f19
%files devel
900f19
900f19
900f19
%files -n platform-python-devel
900f19
%{_bindir}/2to3
900f19
# TODO: Remove 2to3-3.7 once rebased to 3.7
900f19
%{_bindir}/2to3-%{pybasever}
fa50f4
%{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/*
fa50f4
%exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/Makefile
900f19
%exclude %{pylibdir}/distutils/command/wininst-*.exe
900f19
%{_includedir}/python%{LDVERSION_optimized}/*.h
900f19
%exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h}
900f19
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
900f19
900f19
%exclude %{_bindir}/python3-config
900f19
%exclude %{_bindir}/python%{pybasever}-config
900f19
%exclude %{_bindir}/python%{LDVERSION_optimized}-config
900f19
%exclude %{_bindir}/python%{LDVERSION_optimized}-*-config
900f19
%{_libexecdir}/platform-python-config
900f19
%{_libexecdir}/platform-python%{pybasever}-config
900f19
%{_libexecdir}/platform-python%{LDVERSION_optimized}-config
900f19
%{_libexecdir}/platform-python%{LDVERSION_optimized}-*-config
900f19
900f19
%{_bindir}/pathfix.py
900f19
%{_libdir}/libpython%{LDVERSION_optimized}.so
900f19
%{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc
900f19
%{_libdir}/pkgconfig/python-%{pybasever}.pc
900f19
%{_libdir}/pkgconfig/python3.pc
900f19
900f19
%files idle
900f19
%{_bindir}/idle%{pybasever}
900f19
%{pylibdir}/idlelib
900f19
%{_metainfodir}/idle3.appdata.xml
900f19
%{_datadir}/applications/idle3.desktop
900f19
%{_datadir}/icons/hicolor/*/apps/idle3.*
900f19
%ghost %{_bindir}/idle3
900f19
900f19
%files tkinter
900f19
%{pylibdir}/tkinter
900f19
%exclude %{pylibdir}/tkinter/test
900f19
%{dynload_dir}/_tkinter.%{SOABI_optimized}.so
900f19
%{pylibdir}/turtle.py
900f19
%{pylibdir}/__pycache__/turtle*%{bytecode_suffixes}
900f19
%dir %{pylibdir}/turtledemo
900f19
%{pylibdir}/turtledemo/*.py
900f19
%{pylibdir}/turtledemo/*.cfg
900f19
%dir %{pylibdir}/turtledemo/__pycache__/
900f19
%{pylibdir}/turtledemo/__pycache__/*%{bytecode_suffixes}
900f19
900f19
%files test
900f19
%{pylibdir}/ctypes/test
900f19
%{pylibdir}/distutils/tests
900f19
%{pylibdir}/sqlite3/test
900f19
%{pylibdir}/test
900f19
%{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_testbuffer.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_testcapi.%{SOABI_optimized}.so
900f19
%{dynload_dir}/_testimportmultiple.%{SOABI_optimized}.so
900f19
%{pylibdir}/lib2to3/tests
900f19
%{pylibdir}/tkinter/test
900f19
%{pylibdir}/unittest/test
900f19
900f19
# stuff already owned by the libs subpackage
900f19
# test requires libs, so we are safe not owning those dirs
900f19
%exclude %dir %{pylibdir}/test/
900f19
%exclude %dir %{pylibdir}/test/__pycache__/
900f19
%exclude %{pylibdir}/test/__init__.py
900f19
%exclude %{pylibdir}/test/__pycache__/__init__%{bytecode_suffixes}
900f19
%exclude %{pylibdir}/test/support/
900f19
900f19
# We don't bother splitting the debug build out into further subpackages:
900f19
# if you need it, you're probably a developer.
900f19
900f19
# Hence the manifest is the combination of analogous files in the manifests of
900f19
# all of the other subpackages
900f19
900f19
%if %{with debug_build}
900f19
%files -n platform-python-debug
900f19
# Analog of the core subpackage's files:
900f19
%exclude %{_bindir}/python%{LDVERSION_debug}
900f19
%{_libexecdir}/platform-python%{LDVERSION_debug}
900f19
%exclude %{_bindir}/python3-debug
900f19
%{_libexecdir}/platform-python-debug
900f19
900f19
# Analog of the -libs subpackage's files:
900f19
# ...with debug builds of the built-in "extension" modules:
900f19
900f19
%{dynload_dir}/_blake2.%{SOABI_debug}.so
900f19
%{dynload_dir}/_sha3.%{SOABI_debug}.so
b7e076
%{dynload_dir}/_hmacopenssl.%{SOABI_debug}.so
900f19
900f19
%{dynload_dir}/_asyncio.%{SOABI_debug}.so
900f19
%{dynload_dir}/_bisect.%{SOABI_debug}.so
900f19
%{dynload_dir}/_bz2.%{SOABI_debug}.so
900f19
%{dynload_dir}/_codecs_cn.%{SOABI_debug}.so
900f19
%{dynload_dir}/_codecs_hk.%{SOABI_debug}.so
900f19
%{dynload_dir}/_codecs_iso2022.%{SOABI_debug}.so
900f19
%{dynload_dir}/_codecs_jp.%{SOABI_debug}.so
900f19
%{dynload_dir}/_codecs_kr.%{SOABI_debug}.so
900f19
%{dynload_dir}/_codecs_tw.%{SOABI_debug}.so
900f19
%{dynload_dir}/_crypt.%{SOABI_debug}.so
900f19
%{dynload_dir}/_csv.%{SOABI_debug}.so
900f19
%{dynload_dir}/_ctypes.%{SOABI_debug}.so
900f19
%{dynload_dir}/_curses.%{SOABI_debug}.so
900f19
%{dynload_dir}/_curses_panel.%{SOABI_debug}.so
900f19
%{dynload_dir}/_dbm.%{SOABI_debug}.so
900f19
%{dynload_dir}/_decimal.%{SOABI_debug}.so
900f19
%{dynload_dir}/_elementtree.%{SOABI_debug}.so
900f19
%if %{with gdbm}
900f19
%{dynload_dir}/_gdbm.%{SOABI_debug}.so
900f19
%endif
900f19
%{dynload_dir}/_hashlib.%{SOABI_debug}.so
900f19
%{dynload_dir}/_heapq.%{SOABI_debug}.so
900f19
%{dynload_dir}/_json.%{SOABI_debug}.so
900f19
%{dynload_dir}/_lsprof.%{SOABI_debug}.so
900f19
%{dynload_dir}/_lzma.%{SOABI_debug}.so
900f19
%{dynload_dir}/_multibytecodec.%{SOABI_debug}.so
900f19
%{dynload_dir}/_multiprocessing.%{SOABI_debug}.so
900f19
%{dynload_dir}/_opcode.%{SOABI_debug}.so
900f19
%{dynload_dir}/_pickle.%{SOABI_debug}.so
900f19
%{dynload_dir}/_posixsubprocess.%{SOABI_debug}.so
900f19
%{dynload_dir}/_random.%{SOABI_debug}.so
900f19
%{dynload_dir}/_socket.%{SOABI_debug}.so
900f19
%{dynload_dir}/_sqlite3.%{SOABI_debug}.so
900f19
%{dynload_dir}/_ssl.%{SOABI_debug}.so
900f19
%{dynload_dir}/_struct.%{SOABI_debug}.so
900f19
%{dynload_dir}/array.%{SOABI_debug}.so
900f19
%{dynload_dir}/audioop.%{SOABI_debug}.so
900f19
%{dynload_dir}/binascii.%{SOABI_debug}.so
900f19
%{dynload_dir}/cmath.%{SOABI_debug}.so
900f19
%{dynload_dir}/_datetime.%{SOABI_debug}.so
900f19
%{dynload_dir}/fcntl.%{SOABI_debug}.so
900f19
%{dynload_dir}/grp.%{SOABI_debug}.so
900f19
%{dynload_dir}/math.%{SOABI_debug}.so
900f19
%{dynload_dir}/mmap.%{SOABI_debug}.so
900f19
%{dynload_dir}/nis.%{SOABI_debug}.so
900f19
%{dynload_dir}/ossaudiodev.%{SOABI_debug}.so
900f19
%{dynload_dir}/parser.%{SOABI_debug}.so
900f19
%{dynload_dir}/pyexpat.%{SOABI_debug}.so
900f19
%{dynload_dir}/readline.%{SOABI_debug}.so
900f19
%{dynload_dir}/resource.%{SOABI_debug}.so
900f19
%{dynload_dir}/select.%{SOABI_debug}.so
900f19
%{dynload_dir}/spwd.%{SOABI_debug}.so
900f19
%{dynload_dir}/syslog.%{SOABI_debug}.so
900f19
%{dynload_dir}/termios.%{SOABI_debug}.so
900f19
%{dynload_dir}/_testmultiphase.%{SOABI_debug}.so
900f19
%{dynload_dir}/unicodedata.%{SOABI_debug}.so
900f19
%{dynload_dir}/zlib.%{SOABI_debug}.so
900f19
900f19
# No need to split things out the "Makefile" and the config-32/64.h file as we
900f19
# do for the regular build above (bug 531901), since they're all in one package
900f19
# now; they're listed below, under "-devel":
900f19
900f19
%{_libdir}/%{py_INSTSONAME_debug}
900f19
900f19
# Analog of the -devel subpackage's files:
fa50f4
%{pylibdir}/config-%{LDVERSION_debug}-%{platform_triplet}
900f19
%{_includedir}/python%{LDVERSION_debug}
900f19
900f19
%exclude %{_bindir}/python%{LDVERSION_debug}-config
900f19
%exclude %{_bindir}/python%{LDVERSION_debug}-*-config
900f19
%{_libexecdir}/platform-python%{LDVERSION_debug}-config
900f19
%{_libexecdir}/platform-python%{LDVERSION_debug}-*-config
900f19
900f19
%{_libdir}/libpython%{LDVERSION_debug}.so
900f19
%{_libdir}/libpython%{LDVERSION_debug}.so.1.0
900f19
%{_libdir}/pkgconfig/python-%{LDVERSION_debug}.pc
900f19
900f19
# Analog of the -tools subpackage's files:
900f19
#  None for now; we could build precanned versions that have the appropriate
900f19
# shebang if needed
900f19
900f19
# Analog  of the tkinter subpackage's files:
900f19
%{dynload_dir}/_tkinter.%{SOABI_debug}.so
900f19
900f19
# Analog  of the -test subpackage's files: