Blame SPECS/python39.spec

93c559
# ==================
93c559
# Top-level metadata
93c559
# ==================
93c559
93c559
%global pybasever 3.9
93c559
93c559
# pybasever without the dot:
93c559
%global pyshortver 39
93c559
93c559
Name: python%{pyshortver}
93c559
Summary: Version %{pybasever} of the Python interpreter
93c559
URL: https://www.python.org/
93c559
93c559
#  WARNING  When rebasing to a new Python version,
93c559
#           remember to update the python3-docs package as well
1f0454
%global general_version %{pybasever}.16
93c559
#global prerel ...
93c559
%global upstream_version %{general_version}%{?prerel}
93c559
Version: %{general_version}%{?prerel:~%{prerel}}
bde3fd
Release: 1%{?dist}
93c559
License: Python
93c559
93c559
# Exclude i686 arch. Due to a modularity issue it's being added to the
93c559
# x86_64 compose of CRB, but we don't want to ship it at all.
93c559
# See: https://projects.engineering.redhat.com/browse/RCM-72605
93c559
ExcludeArch: i686
93c559
93c559
# ==================================
93c559
# Conditionals controlling the build
93c559
# ==================================
93c559
93c559
# Note that the bcond macros are named for the CLI option they create.
93c559
# "%%bcond_without" means "ENABLE by default and create a --without option"
93c559
93c559
# Main Python, i.e. whether this is the main Python version in the distribution
93c559
# that owns /usr/bin/python3 and other unique paths
93c559
# This also means the built subpackages are called python3 rather than python3X
93c559
# WARNING: This also influences the flatpackage bcond below.
93c559
# By default, this is determined by the %%__default_python3_pkgversion value
93c559
# RHEL: Disabled by default
93c559
%bcond_with main_python
93c559
93c559
# Flat package, i.e. no separate subpackages
93c559
# Default (in Fedora): if this is a main Python, it is not a flatpackage
93c559
# Not supported: Combination of flatpackage enabled and main_python enabled
93c559
# RHEL: Disabled by default
93c559
%bcond_with flatpackage
93c559
93c559
# When bootstrapping python3, we need to build setuptools.
93c559
# but setuptools BR python3-devel and that brings in python3-rpm-generators;
93c559
# python3-rpm-generators needs python3-setuptools, so we cannot have it yet.
93c559
#
93c559
# We also use the previous build of Python in "make regen-all"
93c559
# and in "distutils.tests.test_bdist_rpm".
93c559
#
93c559
# Procedure: https://fedoraproject.org/wiki/SIGs/Python/UpgradingPython
93c559
#
93c559
#   IMPORTANT: When bootstrapping, it's very likely the wheels for pip and
93c559
#   setuptools are not available. Turn off the rpmwheels bcond until
93c559
#   the two packages are built with wheels to get around the issue.
93c559
%bcond_with bootstrap
93c559
93c559
# Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package
93c559
# Uses upstream bundled prebuilt wheels otherwise
93c559
%bcond_without rpmwheels
93c559
93c559
# Expensive optimizations (mainly, profile-guided optimizations)
93c559
%bcond_without optimizations
93c559
93c559
# https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup
93c559
%bcond_without no_semantic_interposition
93c559
93c559
# Run the test suite in %%check
93c559
%bcond_without tests
93c559
93c559
# Extra build for debugging the interpreter or C-API extensions
93c559
# (the -debug subpackages)
93c559
%if %{with flatpackage}
93c559
%bcond_with debug_build
93c559
%else
93c559
%bcond_without debug_build
93c559
%endif
93c559
93c559
# Support for the GDB debugger
93c559
%bcond_without gdb_hooks
93c559
93c559
# The dbm.gnu module (key-value database)
93c559
%bcond_without gdbm
93c559
93c559
# Main interpreter loop optimization
93c559
%bcond_without computed_gotos
93c559
93c559
# Support for the Valgrind debugger/profiler
93c559
%ifarch %{valgrind_arches}
93c559
%bcond_without valgrind
93c559
%else
93c559
%bcond_with valgrind
93c559
%endif
93c559
93c559
# https://fedoraproject.org/wiki/Changes/Python_Upstream_Architecture_Names
93c559
# For a very long time we have converted "upstream architecture names" to "Fedora names".
93c559
# This made sense at the time, see https://github.com/pypa/manylinux/issues/687#issuecomment-666362947
93c559
# However, with manylinux wheels popularity growth, this is now a problem.
93c559
# Wheels built on a Linux that doesn't do this were not compatible with ours and vice versa.
93c559
# We now have a compatibility layer to workaround a problem,
93c559
# but we also no longer use the legacy arch names in Fedora 34+.
93c559
# This bcond controls the behavior. The defaults should be good for anybody.
93c559
# RHEL: Disabled by default
93c559
%bcond_with legacy_archnames
93c559
93c559
# In RHEL 9+, we obsolete/provide Platform Python from regular Python
93c559
# This is only appropriate for the main Python build
93c559
# RHEL: Disabled for python39 module
93c559
%bcond_with rhel8_compat_shims
93c559
93c559
93c559
# =====================
93c559
# General global macros
93c559
# =====================
93c559
93c559
%if %{with main_python}
93c559
%global pkgname python3
93c559
%global exename python3
93c559
%else
93c559
%global pkgname python%{pyshortver}
93c559
%global exename python%{pybasever}
93c559
%endif
93c559
93c559
%global pylibdir %{_libdir}/python%{pybasever}
93c559
%global dynload_dir %{pylibdir}/lib-dynload
93c559
93c559
# ABIFLAGS, LDVERSION and SOABI are in the upstream configure.ac
93c559
# See PEP 3149 for some background: http://www.python.org/dev/peps/pep-3149/
93c559
%global ABIFLAGS_optimized %{nil}
93c559
%global ABIFLAGS_debug     d
93c559
93c559
%global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized}
93c559
%global LDVERSION_debug     %{pybasever}%{ABIFLAGS_debug}
93c559
93c559
# When we use the upstream arch triplets, we convert them from the legacy ones
93c559
# This is reversed in prep when %%with legacy_archnames, so we keep both macros
93c559
%global platform_triplet_legacy %{_arch}-linux%{_gnu}
93c559
%global platform_triplet_upstream %{expand:%(echo %{platform_triplet_legacy} | sed -E \\
93c559
    -e 's/^arm(eb)?-linux-gnueabi$/arm\\1-linux-gnueabihf/' \\
93c559
    -e 's/^mips64(el)?-linux-gnu$/mips64\\1-linux-gnuabi64/' \\
93c559
    -e 's/^ppc(64)?(le)?-linux-gnu$/powerpc\\1\\2-linux-gnu/')}
93c559
%if %{with legacy_archnames}
93c559
%global platform_triplet %{platform_triplet_legacy}
93c559
%else
93c559
%global platform_triplet %{platform_triplet_upstream}
93c559
%endif
93c559
93c559
%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{platform_triplet}
93c559
%global SOABI_debug     cpython-%{pyshortver}%{ABIFLAGS_debug}-%{platform_triplet}
93c559
93c559
# All bytecode files are in a __pycache__ subdirectory, with a name
93c559
# reflecting the version of the bytecode.
93c559
# See PEP 3147: http://www.python.org/dev/peps/pep-3147/
93c559
# For example,
93c559
#   foo/bar.py
93c559
# has bytecode at:
93c559
#   foo/__pycache__/bar.cpython-%%{pyshortver}.pyc
93c559
#   foo/__pycache__/bar.cpython-%%{pyshortver}.opt-1.pyc
93c559
#   foo/__pycache__/bar.cpython-%%{pyshortver}.opt-2.pyc
93c559
%global bytecode_suffixes .cpython-%{pyshortver}*.pyc
93c559
b1014d
# libmpdec (mpdecimal package in Fedora) is tightly coupled with the
b1014d
# decimal module. We keep it bundled as to avoid incompatibilities
b1014d
# with the packaged version.
b1014d
# The version information can be found at Modules/_decimal/libmpdec/mpdecimal.h
b1014d
# defined as MPD_VERSION.
b1014d
%global libmpdec_version 2.5.0
b1014d
93c559
# Python's configure script defines SOVERSION, and this is used in the Makefile
93c559
# to determine INSTSONAME, the name of the libpython DSO:
93c559
#   LDLIBRARY='libpython$(VERSION).so'
93c559
#   INSTSONAME="$LDLIBRARY".$SOVERSION
93c559
# We mirror this here in order to make it easier to add the -gdb.py hooks.
93c559
# (if these get out of sync, the payload of the libs subpackage will fail
93c559
# and halt the build)
93c559
%global py_SOVERSION 1.0
93c559
%global py_INSTSONAME_optimized libpython%{LDVERSION_optimized}.so.%{py_SOVERSION}
93c559
%global py_INSTSONAME_debug     libpython%{LDVERSION_debug}.so.%{py_SOVERSION}
93c559
93c559
# Disable automatic bytecompilation. The python3 binary is not yet be
93c559
# available in /usr/bin when Python is built. Also, the bytecompilation fails
93c559
# on files that test invalid syntax.
93c559
%undefine py_auto_byte_compile
93c559
93c559
# When a main_python build is attempted despite the %%__default_python3_pkgversion value
93c559
# We undefine magic macros so the python3-... package does not provide wrong python3X-...
93c559
# RHEL: DISABLED, __default_python3_pkgversion is not implemented
93c559
# %%if %%{with main_python} && ("%%{?__default_python3_pkgversion}" != "%%{pybasever}")
93c559
# %%undefine __pythonname_provides
93c559
# %%{warn:Doing a main_python build with wrong %%%%__default_python3_pkgversion (0%%{?__default_python3_pkgversion}, but this is %%pyshortver)}
93c559
# %%endif
93c559
93c559
# RHEL: An example egg file is included among the python39-test files and due
93c559
# to a bug in python3-rpm-generator, mistaken Provides are generated. So we
93c559
# exclude them until the issue is properly addressed.
93c559
# See BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1916172
93c559
%global __provides_exclude_from ^%{pylibdir}/test/test_importlib/data/example-.*\.egg$
93c559
93c559
# =======================
93c559
# Build-time requirements
93c559
# =======================
93c559
93c559
# (keep this list alphabetized)
93c559
93c559
BuildRequires: autoconf
93c559
BuildRequires: bluez-libs-devel
93c559
BuildRequires: bzip2
93c559
BuildRequires: bzip2-devel
93c559
BuildRequires: desktop-file-utils
93c559
BuildRequires: expat-devel
93c559
93c559
BuildRequires: findutils
93c559
BuildRequires: gcc-c++
93c559
%if %{with gdbm}
93c559
BuildRequires: gdbm-devel
93c559
%endif
93c559
BuildRequires: git-core
93c559
BuildRequires: glibc-all-langpacks
93c559
BuildRequires: glibc-devel
93c559
BuildRequires: gmp-devel
93c559
BuildRequires: gnupg2
93c559
BuildRequires: libappstream-glib
93c559
BuildRequires: libffi-devel
93c559
BuildRequires: libnsl2-devel
93c559
BuildRequires: libtirpc-devel
93c559
BuildRequires: libGL-devel
93c559
BuildRequires: libuuid-devel
93c559
BuildRequires: libX11-devel
93c559
BuildRequires: make
93c559
BuildRequires: ncurses-devel
93c559
93c559
BuildRequires: openssl-devel
93c559
BuildRequires: pkgconfig
93c559
BuildRequires: readline-devel
93c559
BuildRequires: redhat-rpm-config
93c559
BuildRequires: sqlite-devel
93c559
BuildRequires: gdb
93c559
93c559
BuildRequires: tar
93c559
BuildRequires: tcl-devel
93c559
BuildRequires: tix-devel
93c559
BuildRequires: tk-devel
93c559
BuildRequires: tzdata
93c559
93c559
%if %{with valgrind}
93c559
BuildRequires: valgrind-devel
93c559
%endif
93c559
93c559
BuildRequires: xz-devel
93c559
BuildRequires: zlib-devel
93c559
93c559
BuildRequires: /usr/bin/dtrace
93c559
93c559
# workaround http://bugs.python.org/issue19804 (test_uuid requires ifconfig)
93c559
BuildRequires: /usr/sbin/ifconfig
93c559
93c559
%if %{with rpmwheels}
93c559
BuildRequires: python%{python3_pkgversion}-setuptools-wheel
93c559
BuildRequires: python%{python3_pkgversion}-pip-wheel
93c559
%endif
93c559
93c559
%if %{without bootstrap}
93c559
# for make regen-all and distutils.tests.test_bdist_rpm
93c559
BuildRequires: python%{pyshortver}
93c559
%endif
93c559
93c559
# Generators run on Python 3.6 so we can take this dependency out of the bootstrap loop
93c559
BuildRequires: python3-rpm-generators
93c559
93c559
# =======================
93c559
# Source code and patches
93c559
# =======================
93c559
93c559
Source0: %{url}ftp/python/%{general_version}/Python-%{upstream_version}.tar.xz
93c559
Source1: %{url}ftp/python/%{general_version}/Python-%{upstream_version}.tar.xz.asc
93c559
Source2: %{url}static/files/pubkeys.txt
93c559
Source3: macros.python39
93c559
93c559
# A simple script to check timestamps of bytecode files
93c559
# Run in check section with Python that is currently being built
93c559
# Originally written by bkabrda
93c559
Source8: check-pyc-timestamps.py
93c559
93c559
# Desktop menu entry for idle3
93c559
Source10: idle3.desktop
93c559
93c559
# AppData file for idle3
93c559
Source11: idle3.appdata.xml
93c559
93c559
# (Patches taken from github.com/fedora-python/cpython)
93c559
93c559
# 00001 # d06a8853cf4bae9e115f45e1d531d2dc152c5cc8
93c559
# Fixup distutils/unixccompiler.py to remove standard library path from rpath
93c559
# Was Patch0 in ivazquez' python3000 specfile
93c559
Patch1: 00001-rpath.patch
93c559
93c559
# 00111 # 93b40d73360053ca68b0aeec33b6a8ca167e33e2
93c559
# Don't try to build a libpythonMAJOR.MINOR.a
93c559
#
93c559
# Downstream only: not appropriate for upstream.
93c559
#
93c559
# See https://bugzilla.redhat.com/show_bug.cgi?id=556092
93c559
Patch111: 00111-no-static-lib.patch
93c559
b1014d
# 00189 # 4242864a6a12f1f4cf9fd63a6699a73f35261aa3
93c559
# Instead of bundled wheels, use our RPM packaged wheels
93c559
#
93c559
# We keep them in /usr/share/python-wheels
93c559
#
93c559
# Downstream only: upstream bundles
93c559
# We might eventually pursuit upstream support, but it's low prio
93c559
Patch189: 00189-use-rpm-wheels.patch
93c559
# The following versions of setuptools/pip are bundled when this patch is not applied.
93c559
# The versions are written in Lib/ensurepip/__init__.py, this patch removes them.
93c559
# When the bundled setuptools/pip wheel is updated, the patch no longer applies cleanly.
93c559
# In such cases, the patch needs to be amended and the versions updated here:
bde3fd
%global pip_version 21.2.3
bde3fd
%global setuptools_version 57.4.0
93c559
93c559
# 00251 # 2eabd04356402d488060bc8fe316ad13fc8a3356
93c559
# Change user install location
93c559
#
93c559
# Set values of prefix and exec_prefix in distutils install command
93c559
# to /usr/local if executable is /usr/bin/python* and RPM build
93c559
# is not detected to make pip and distutils install into separate location.
93c559
#
93c559
# Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
93c559
# Downstream only: Awaiting resources to work on upstream PEP
93c559
Patch251: 00251-change-user-install-location.patch
93c559
93c559
# 00328 # 367fdcb5a075f083aea83ac174999272a8faf75c
93c559
# Restore pyc to TIMESTAMP invalidation mode as default in rpmbuild
93c559
#
93c559
# Since Fedora 31, the $SOURCE_DATE_EPOCH is set in rpmbuild to the latest
93c559
# %%changelog date. This makes Python default to the CHECKED_HASH pyc
93c559
# invalidation mode, bringing more reproducible builds traded for an import
93c559
# performance decrease. To avoid that, we don't default to CHECKED_HASH
93c559
# when $RPM_BUILD_ROOT is set (i.e. when we are building RPM packages).
93c559
#
93c559
# See https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/57#comment-27426
93c559
# Downstream only: only used when building RPM packages
93c559
# Ideally, we should talk to upstream and explain why we don't want this
93c559
Patch328: 00328-pyc-timestamp-invalidation-mode.patch
93c559
93c559
# 00329 #
93c559
# Support OpenSSL FIPS mode
93c559
# - In FIPS mode, OpenSSL wrappers are always used in hashlib
93c559
# - The "usedforsecurity" keyword argument can be used to the various digest
93c559
#   algorithms in hashlib so that you can whitelist a callsite with
93c559
#   "usedforsecurity=False"
93c559
# - OpenSSL wrappers for the hashes blake2{b512,s256},
93c559
# - In FIPS mode, the blake2 hashes use OpenSSL wrappers
93c559
#   and do not offer extended functionality (keys, tree hashing, custom digest size)
93c559
# - In FIPS mode, hmac.HMAC can only be instantiated with an OpenSSL wrapper
93c559
#   or an string with OpenSSL hash name as the "digestmod" argument.
93c559
#   The argument must be specified (instead of defaulting to ‘md5’).
93c559
#
93c559
# - Also while in FIPS mode, we utilize OpenSSL's DRBG and disable the
93c559
#   os.getrandom() function.
93c559
#
93c559
Patch329: 00329-fips.patch
93c559
93c559
# 00353 # ab4cc97b643cfe99f567e3a03e5617b507183771
93c559
# Original names for architectures with different names downstream
93c559
#
93c559
# https://fedoraproject.org/wiki/Changes/Python_Upstream_Architecture_Names
93c559
#
93c559
# Pythons in RHEL/Fedora used different names for some architectures
93c559
# than upstream and other distros (for example ppc64 vs. powerpc64).
93c559
# This was patched in patch 274, now it is sedded if %%with legacy_archnames.
93c559
#
93c559
# That meant that an extension built with the default upstream settings
93c559
# (on other distro or as an manylinux wheel) could not been found by Python
93c559
# on RHEL/Fedora because it had a different suffix.
93c559
# This patch adds the legacy names to importlib so Python is able
93c559
# to import extensions with a legacy architecture name in its
93c559
# file name.
93c559
# It work both ways, so it support both %%with and %%without legacy_archnames.
93c559
#
93c559
# WARNING: This patch has no effect on Python built with bootstrap
93c559
# enabled because Python/importlib_external.h is not regenerated
93c559
# and therefore Python during bootstrap contains importlib from
93c559
# upstream without this feature. It's possible to include
93c559
# Python/importlib_external.h to this patch but it'd make rebasing
93c559
# a nightmare because it's basically a binary file.
93c559
Patch353: 00353-architecture-names-upstream-downstream.patch
93c559
8f0bcc
# 00378 #
8f0bcc
# Support expat 2.4.5
8f0bcc
#
8f0bcc
# Curly brackets were never allowed in namespace URIs
8f0bcc
# according to RFC 3986, and so-called namespace-validating
8f0bcc
# XML parsers have the right to reject them a invalid URIs.
8f0bcc
#
8f0bcc
# libexpat >=2.4.5 has become strcter in that regard due to
8f0bcc
# related security issues; with ET.XML instantiating a
8f0bcc
# namespace-aware parser under the hood, this test has no
8f0bcc
# future in CPython.
8f0bcc
#
8f0bcc
# References:
8f0bcc
# - https://datatracker.ietf.org/doc/html/rfc3968
8f0bcc
# - https://www.w3.org/TR/xml-names/
8f0bcc
#
8f0bcc
# Also, test_minidom.py: Support Expat >=2.4.5
8f0bcc
#
8f0bcc
# The patch has diverged from upstream as the python test
8f0bcc
# suite was relying on checking the expat version, whereas
8f0bcc
# in RHEL fixes get backported instead of rebasing packages.
8f0bcc
#
8f0bcc
# Upstream: https://bugs.python.org/issue46811
8f0bcc
Patch378: 00378-support-expat-2-4-5.patch
8f0bcc
93c559
# (New patches go here ^^^)
93c559
#
93c559
# When adding new patches to "python" and "python3" in Fedora, EL, etc.,
93c559
# please try to keep the patch numbers in-sync between all specfiles.
93c559
#
93c559
# More information, and a patch number catalog, is at:
93c559
#
93c559
#     https://fedoraproject.org/wiki/SIGs/Python/PythonPatches
93c559
#
93c559
# The patches are stored and rebased at:
93c559
#
93c559
#     https://github.com/fedora-python/cpython
93c559
93c559
93c559
# ==========================================
93c559
# Descriptions, and metadata for subpackages
93c559
# ==========================================
93c559
b1014d
# Require alternatives version that implements the --keep-foreign flag
b1014d
Requires:         alternatives >= 1.19.1-1
b1014d
Requires(post):   alternatives >= 1.19.1-1
b1014d
Requires(postun): alternatives >= 1.19.1-1
93c559
93c559
# When the user tries to `yum install python`, yum will list this package among
93c559
# the possible alternatives
93c559
Provides: alternative-for(python)
93c559
93c559
# this if branch is ~300 lines long and contains subpackages' definitions
93c559
%if %{without flatpackage}
93c559
%if %{with main_python}
93c559
# Description for the python3X SRPM only:
93c559
%description
93c559
Python %{pybasever} is an accessible, high-level, dynamically typed, interpreted
93c559
programming language, designed with an emphasis on code readability.
93c559
It includes an extensive standard library, and has a vast ecosystem of
93c559
third-party libraries.
93c559
93c559
%package -n %{pkgname}
93c559
Summary: Python %{pybasever} interpreter
93c559
93c559
# In order to support multiple Python interpreters for development purposes,
93c559
# packages with the naming scheme flatpackage (e.g. python3.5) exist for
93c559
# non-default versions of Python 3.
93c559
# For consistency, we provide python3.X from python3 as well.
93c559
Provides: python%{pybasever} = %{version}-%{release}
93c559
Provides: python%{pybasever}%{?_isa} = %{version}-%{release}
93c559
# To keep the upgrade path clean, we Obsolete python3.X.
93c559
# Note that using Obsoletes without package version is not standard practice.
93c559
# Here we assert that *any* version of the system's default interpreter is
93c559
# preferable to an "extra" interpreter. For example, python3-3.6.1 will
93c559
# replace python3.6-3.6.2.
93c559
Obsoletes: python%{pybasever}
93c559
93c559
# https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
93c559
# https://fedoraproject.org/wiki/Changes/Python_means_Python3
93c559
# We recommend /usr/bin/python so users get it by default
93c559
# Versioned recommends are problematic, and we know that the package requires
93c559
# python3 back with fixed version, so we just use the path here:
93c559
Recommends: %{_bindir}/python
93c559
%endif
93c559
93c559
%if %{with rhel8_compat_shims}
93c559
Provides:  platform-python = %{version}-%{release}
93c559
Provides:  platform-python%{?_isa} = %{version}-%{release}
93c559
Obsoletes: platform-python < %{pybasever}
93c559
%endif
93c559
93c559
# Python interpreter packages used to be named (or provide) name pythonXY (e.g.
93c559
# python39). However, to align it with the executable names and to prepare for
93c559
# Python 3.10, they were renamed to pythonX.Y (e.g. python3.9, python3.10). We
93c559
# provide and obsolete the previous names.
93c559
# - Here are the tags for the nonflat package, regardless if main_python (e.g.
93c559
#   python3) or not (e.g. python39). For the flat package, the provide is
93c559
#   repeated many lines later.
93c559
Provides: python%{pyshortver} = %{version}-%{release}
93c559
Obsoletes: python%{pyshortver} < %{version}-%{release}
93c559
# RHEL: The python39 rpm is named without the dot unlike in Fedora, so we need
93c559
# to also provide the name *with* the dot
93c559
Provides: python%{pybasever} = %{version}-%{release}
93c559
Provides: python%{pybasever}%{?_isa} = %{version}-%{release}
93c559
Obsoletes: python%{pybasever} < %{version}-%{release}
93c559
93c559
# Packages with Python modules in standard locations automatically
93c559
# depend on python(abi). Provide that here.
93c559
Provides: python(abi) = %{pybasever}
93c559
93c559
Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release}
93c559
93c559
# Previously, this was required for our rewheel patch to work.
93c559
# This is technically no longer needed, but we keep it recommended
93c559
# for the developer experience.
93c559
Recommends: %{pkgname}-setuptools
93c559
Recommends: %{pkgname}-pip
93c559
93c559
# This prevents ALL subpackages built from this spec to require
93c559
# /usr/bin/python3* or python(abi). Granularity per subpackage is impossible.
93c559
# It's intended for the libs package not to drag in the interpreter, see
93c559
# https://bugzilla.redhat.com/show_bug.cgi?id=1547131
93c559
# https://bugzilla.redhat.com/show_bug.cgi?id=1862082
93c559
# All other packages require %%{pkgname} explicitly.
93c559
%global __requires_exclude ^(/usr/bin/python3|python\\(abi\\))
93c559
93c559
%description -n %{pkgname}
93c559
Python %{pybasever} is an accessible, high-level, dynamically typed, interpreted
93c559
programming language, designed with an emphasis on code readability.
93c559
It includes an extensive standard library, and has a vast ecosystem of
93c559
third-party libraries.
93c559
93c559
The %{pkgname} package provides the "%{exename}" executable: the reference
93c559
interpreter for the Python language, version 3.
93c559
The majority of its standard library is provided in the %{pkgname}-libs package,
93c559
which should be installed automatically along with %{pkgname}.
93c559
The remaining parts of the Python standard library are broken out into the
93c559
%{pkgname}-tkinter and %{pkgname}-test packages, which may need to be installed
93c559
separately.
93c559
93c559
Documentation for Python is provided in the %{pkgname}-docs package.
93c559
93c559
Packages containing additional libraries for Python are generally named with
93c559
the "%{pkgname}-" prefix.
93c559
93c559
For the unversioned "python" executable, see manual page "unversioned-python".
93c559
93c559
93c559
%if %{with main_python}
93c559
# https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
93c559
# https://fedoraproject.org/wiki/Changes/Python_means_Python3
93c559
%package -n python-unversioned-command
93c559
Summary: The "python" command that runs Python 3
93c559
BuildArch: noarch
93c559
93c559
# In theory this could require any python3 version
93c559
Requires: python3 == %{version}-%{release}
93c559
# But since we want to provide versioned python, we require exact version
93c559
Provides: python = %{version}-%{release}
93c559
# This also save us an explicit conflict for older python3 builds
93c559
b1014d
# Also provide the name of the Ubuntu package with the same function,
b1014d
# to be nice to people who temporarily forgot which distro they're on.
b1014d
# C.f. https://packages.ubuntu.com/hirsute/all/python-is-python3/filelist
b1014d
Provides: python-is-python3 = %{version}-%{release}
b1014d
93c559
%description -n python-unversioned-command
93c559
This package contains /usr/bin/python - the "python" command that runs Python 3.
93c559
93c559
%endif # with main_python
93c559
93c559
93c559
%package -n %{pkgname}-libs
93c559
Summary:        Python runtime libraries
93c559
93c559
%if %{with rpmwheels}
93c559
Requires: python%{python3_pkgversion}-setuptools-wheel
93c559
Requires: python%{python3_pkgversion}-pip-wheel
93c559
%else
93c559
Provides: bundled(python3dist(pip)) = %{pip_version}
93c559
Provides: bundled(python3dist(setuptools)) = %{setuptools_version}
93c559
%endif
93c559
b1014d
# Provides for the bundled libmpdec
b1014d
Provides: bundled(mpdecimal) = %{libmpdec_version}
b1014d
Provides: bundled(libmpdec) = %{libmpdec_version}
b1014d
93c559
# There are files in the standard library that have python shebang.
93c559
# We've filtered the automatic requirement out so libs are installable without
93c559
# the main package. This however makes it pulled in by default.
93c559
# See https://bugzilla.redhat.com/show_bug.cgi?id=1547131
93c559
Recommends: %{pkgname}%{?_isa} = %{version}-%{release}
93c559
93c559
# tkinter is part of the standard library,
93c559
# but it is torn out to save an unwanted dependency on tk and X11.
93c559
# we recommend it when tk is already installed (for better UX)
93c559
Recommends: (%{pkgname}-tkinter%{?_isa} = %{version}-%{release} if tk%{?_isa})
93c559
93c559
# The zoneinfo module needs tzdata
93c559
Requires: tzdata
93c559
93c559
93c559
%description -n %{pkgname}-libs
93c559
This package contains runtime libraries for use by Python:
93c559
- the majority of the Python standard library
93c559
- a dynamically linked library for use by applications that embed Python as
93c559
  a scripting language, and by the main "%{exename}" executable
93c559
93c559
93c559
%package -n %{pkgname}-devel
93c559
Summary: Libraries and header files needed for Python development
93c559
Requires: %{pkgname} = %{version}-%{release}
93c559
Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release}
93c559
# The RPM related dependencies bring nothing to a non-RPM Python developer
93c559
# But we want them when packages BuildRequire python3-devel
93c559
Requires: (python-rpm-macros if rpm-build)
93c559
Requires: (python3-rpm-macros if rpm-build)
93c559
b1014d
# Require alternatives version that implements the --keep-foreign flag
b1014d
Requires(postun): alternatives >= 1.19.1-1
93c559
# python39 installs the alternatives master symlink to which we attach a slave
93c559
Requires(post): %{pkgname}
93c559
Requires(postun): %{pkgname}
93c559
93c559
%if %{without bootstrap}
93c559
# This is not "API" (packages that need setuptools should still BuildRequire it)
93c559
# However some packages apparently can build both with and without setuptools
93c559
# producing egg-info as file or directory (depending on setuptools presence).
93c559
# Directory-to-file updates are problematic in RPM, so we ensure setuptools is
93c559
# installed when -devel is required.
93c559
# See https://bugzilla.redhat.com/show_bug.cgi?id=1623914
93c559
# See https://fedoraproject.org/wiki/Packaging:Directory_Replacement
93c559
Requires: (%{pkgname}-setuptools if rpm-build)
93c559
%endif
93c559
93c559
# Generators run on Python 3.6 so we can take this dependency out of the bootstrap loop
93c559
Requires: (python3-rpm-generators if rpm-build)
93c559
93c559
Provides: %{pkgname}-2to3 = %{version}-%{release}
93c559
93c559
Conflicts: %{pkgname} < %{version}-%{release}
93c559
93c559
%if %{with rhel8_compat_shims}
93c559
Provides:  platform-python-devel = %{version}-%{release}
93c559
Provides:  platform-python-devel%{?_isa} = %{version}-%{release}
93c559
Obsoletes: platform-python-devel < %{pybasever}
93c559
%endif
93c559
93c559
%description -n %{pkgname}-devel
93c559
This package contains the header files and configuration needed to compile
93c559
Python extension modules (typically written in C or C++), to embed Python
93c559
into other programs, and to make binary distributions for Python libraries.
93c559
93c559
It also contains the necessary macros to build RPM packages with Python modules
93c559
and 2to3 tool, an automatic source converter from Python 2.X.
93c559
93c559
If you want to build an RPM against the python39 module, you also need to
93c559
install the python39-rpm-macros package.
93c559
93c559
%package -n %{pkgname}-idle
93c559
Summary: A basic graphical development environment for Python
93c559
Requires: %{pkgname} = %{version}-%{release}
93c559
Requires: %{pkgname}-tkinter = %{version}-%{release}
93c559
93c559
Provides: %{pkgname}-tools = %{version}-%{release}
93c559
Provides: %{pkgname}-tools%{?_isa} = %{version}-%{release}
93c559
Obsoletes: %{pkgname}-tools < %{version}-%{release}
93c559
b1014d
# Require alternatives version that implements the --keep-foreign flag
b1014d
Requires(postun): alternatives >= 1.19.1-1
93c559
# python39 installs the alternatives master symlink to which we attach a slave
93c559
Requires(post): %{pkgname}
93c559
Requires(postun): %{pkgname}
93c559
93c559
%description -n %{pkgname}-idle
93c559
IDLE is Python’s Integrated Development and Learning Environment.
93c559
93c559
IDLE has the following features: Python shell window (interactive
93c559
interpreter) with colorizing of code input, output, and error messages;
93c559
multi-window text editor with multiple undo, Python colorizing,
93c559
smart indent, call tips, auto completion, and other features;
93c559
search within any window, replace within editor windows, and
93c559
search through multiple files (grep); debugger with persistent
93c559
breakpoints, stepping, and viewing of global and local namespaces;
93c559
configuration, browsers, and other dialogs.
93c559
93c559
93c559
%package -n %{pkgname}-tkinter
93c559
Summary: A GUI toolkit for Python
93c559
Requires: %{pkgname} = %{version}-%{release}
93c559
93c559
%description -n %{pkgname}-tkinter
93c559
The Tkinter (Tk interface) library is a graphical user interface toolkit for
93c559
the Python programming language.
93c559
93c559
93c559
%package -n %{pkgname}-test
93c559
Summary: The self-test suite for the main python3 package
93c559
Requires: %{pkgname} = %{version}-%{release}
93c559
Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release}
93c559
93c559
%description -n %{pkgname}-test
93c559
The self-test suite for the Python interpreter.
93c559
93c559
This is only useful to test Python itself. For testing general Python code,
93c559
you should use the unittest module from %{pkgname}-libs, or a library such as
93c559
%{pkgname}-pytest.
93c559
93c559
93c559
%if %{with debug_build}
93c559
%package -n %{pkgname}-debug
93c559
Summary: Debug version of the Python runtime
93c559
93c559
# The debug build is an all-in-one package version of the regular build, and
93c559
# shares the same .py/.pyc files and directories as the regular build. Hence
93c559
# we depend on all of the subpackages of the regular build:
93c559
Requires: %{pkgname}%{?_isa} = %{version}-%{release}
93c559
Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release}
93c559
Requires: %{pkgname}-devel%{?_isa} = %{version}-%{release}
93c559
Requires: %{pkgname}-test%{?_isa} = %{version}-%{release}
93c559
Requires: %{pkgname}-tkinter%{?_isa} = %{version}-%{release}
93c559
Requires: %{pkgname}-idle%{?_isa} = %{version}-%{release}
93c559
93c559
%if %{with rhel8_compat_shims}
93c559
Provides:  platform-python-debug = %{version}-%{release}
93c559
Provides:  platform-python-debug%{?_isa} = %{version}-%{release}
93c559
Obsoletes: platform-python-debug < %{pybasever}
93c559
%endif
93c559
b1014d
# Require alternatives version that implements the --keep-foreign flag
b1014d
Requires(postun): alternatives >= 1.19.1-1
93c559
# python39 installs the alternatives master symlink to which we attach a slave
93c559
Requires(post): %{pkgname}
93c559
Requires(postun): %{pkgname}
93c559
93c559
%description -n %{pkgname}-debug
93c559
python3-debug provides a version of the Python runtime with numerous debugging
93c559
features enabled, aimed at advanced Python users such as developers of Python
93c559
extension modules.
93c559
93c559
This version uses more memory and will be slower than the regular Python build,
93c559
but is useful for tracking down reference-counting issues and other bugs.
93c559
93c559
The debug build shares installation directories with the standard Python
93c559
runtime. Python modules -- source (.py), bytecode (.pyc), and C-API extensions
93c559
(.cpython*.so) -- are compatible between this and the standard version
93c559
of Python.
93c559
93c559
The debug runtime additionally supports debug builds of C-API extensions
93c559
(with the "d" ABI flag) for debugging issues in those extensions.
93c559
%endif # with debug_build
93c559
93c559
%else  # with flatpackage
93c559
93c559
# We'll not provide this, on purpose
93c559
# No package in Fedora shall ever depend on flatpackage via this
93c559
%global __requires_exclude ^python\\(abi\\) = 3\\..$
93c559
%global __provides_exclude ^python\\(abi\\) = 3\\..$
93c559
93c559
# Python interpreter packages used to be named (or provide) name pythonXY (e.g.
93c559
# python39). However, to align it with the executable names and to prepare for
93c559
# Python 3.10, they were renamed to pythonX.Y (e.g. python3.9, python3.10). We
93c559
# provide and obsolete the previous names.
93c559
# - Here are the tags for the flat package. For the nonflat package, the
93c559
#   provide is repeated many lines above.
93c559
Provides: python%{pyshortver} = %{version}-%{release}
93c559
Obsoletes: python%{pyshortver} < %{version}-%{release}
93c559
93c559
%if %{with rpmwheels}
93c559
Requires: python%{python3_pkgversion}-setuptools-wheel
93c559
Requires: python%{python3_pkgversion}-pip-wheel
93c559
%else
93c559
Provides: bundled(python3dist(pip)) = %{pip_version}
93c559
Provides: bundled(python3dist(setuptools)) = %{setuptools_version}
93c559
%endif
93c559
b1014d
# Provides for the bundled libmpdec
b1014d
Provides: bundled(mpdecimal) = %{libmpdec_version}
b1014d
Provides: bundled(libmpdec) = %{libmpdec_version}
b1014d
93c559
# The zoneinfo module needs tzdata
93c559
Requires: tzdata
93c559
93c559
# The description for the flat package (SRPM and built)
93c559
%description
93c559
Python %{pybasever} package for developers.
93c559
93c559
This package exists to allow developers to test their code against a newer
93c559
version of Python. This is not a full Python stack and if you wish to run
93c559
your applications with Python %{pybasever}, update your Fedora to a newer
93c559
version once Python %{pybasever} is stable.
93c559
93c559
%endif # with flatpackage
93c559
93c559
93c559
%package -n %{pkgname}-rpm-macros
93c559
Summary:    RPM macros for building RPMs with Python %{pybasever}
93c559
License:    MIT
93c559
Provides:   %{pkgname}-modular-devel = %{version}-%{release}
93c559
Provides:   python-modular-rpm-macros == %{pybasever}
93c559
Conflicts:  python-modular-rpm-macros > %{pybasever}
93c559
Requires:   python3-rpm-macros
93c559
BuildArch:  noarch
93c559
93c559
%description -n %{pkgname}-rpm-macros
93c559
RPM macros for building RPMs with Python %{pybasever} from the python%{pyshortver} module.
93c559
If you want to build an RPM against the python%{pyshortver} module, you need to add:
93c559
93c559
    BuildRequire: %{pkgname}-rpm-macros.
93c559
93c559
# ======================================================
93c559
# The prep phase of the build:
93c559
# ======================================================
93c559
93c559
%prep
93c559
%autosetup -S git_am -N -n Python-%{upstream_version}
93c559
8f0bcc
# Temporary workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1954999
8f0bcc
%{?!apply_patch:%define apply_patch(qp:m:) {%__apply_patch %**}}
8f0bcc
93c559
# Apply patches up to 188
93c559
%apply_patch -q %{PATCH1}
93c559
%apply_patch -q %{PATCH111}
93c559
93c559
%if %{with rpmwheels}
93c559
%apply_patch -q %{PATCH189}
93c559
rm Lib/ensurepip/_bundled/*.whl
93c559
%endif
93c559
93c559
# Apply the remaining patches
93c559
%apply_patch -q %{PATCH251}
93c559
%apply_patch -q %{PATCH328}
93c559
%apply_patch -q %{PATCH329}
93c559
%apply_patch -q %{PATCH353}
8f0bcc
%apply_patch -q %{PATCH378}
93c559
93c559
# Remove all exe files to ensure we are not shipping prebuilt binaries
93c559
# note that those are only used to create Microsoft Windows installers
93c559
# and that functionality is broken on Linux anyway
93c559
find -name '*.exe' -print -delete
93c559
93c559
# Remove bundled libraries to ensure that we're using the system copy.
93c559
rm -r Modules/expat
93c559
93c559
# Remove files that should be generated by the build
93c559
# (This is after patching, so that we can use patches directly from upstream)
93c559
rm configure pyconfig.h.in
93c559
93c559
# When we use the legacy arch names, we need to change them in configure.ac
93c559
%if %{with legacy_archnames}
93c559
sed -i configure.ac \
93c559
    -e 's/\b%{platform_triplet_upstream}\b/%{platform_triplet_legacy}/'
93c559
%endif
93c559
93c559
93c559
# ======================================================
93c559
# Configuring and building the code:
93c559
# ======================================================
93c559
93c559
%build
93c559
93c559
# The build process embeds version info extracted from the Git repository
93c559
# into the Py_GetBuildInfo and sys.version strings.
93c559
# Our Git repository is artificial, so we don't want that.
93c559
# Tell configure to not use git.
93c559
export HAS_GIT=not-found
93c559
93c559
# Regenerate the configure script and pyconfig.h.in
93c559
autoconf
93c559
autoheader
93c559
93c559
# Remember the current directory (which has sources and the configure script),
93c559
# so we can refer to it after we "cd" elsewhere.
93c559
topdir=$(pwd)
93c559
93c559
# Get proper option names from bconds
93c559
%if %{with computed_gotos}
93c559
%global computed_gotos_flag yes
93c559
%else
93c559
%global computed_gotos_flag no
93c559
%endif
93c559
93c559
%if %{with optimizations}
93c559
%global optimizations_flag "--enable-optimizations"
93c559
%else
93c559
%global optimizations_flag "--disable-optimizations"
93c559
%endif
93c559
93c559
# Set common compiler/linker flags
93c559
# We utilize the %%extension_...flags macros here so users building C/C++
93c559
# extensions with our python won't get all the compiler/linker flags used
93c559
# in Fedora RPMs.
93c559
# Standard library built here will still use the %%build_...flags,
93c559
# Fedora packages utilizing %%py3_build will use them as well
93c559
# https://fedoraproject.org/wiki/Changes/Python_Extension_Flags
93c559
export CFLAGS="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
93c559
export CFLAGS_NODIST="%{build_cflags} -D_GNU_SOURCE -fPIC -fwrapv%{?with_no_semantic_interposition: -fno-semantic-interposition}"
93c559
export CXXFLAGS="%{extension_cxxflags} -D_GNU_SOURCE -fPIC -fwrapv"
93c559
export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
93c559
export OPT="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
93c559
export LINKCC="gcc"
93c559
export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
93c559
export LDFLAGS="%{extension_ldflags} -g $(pkg-config --libs-only-L openssl)"
93c559
export LDFLAGS_NODIST="%{build_ldflags}%{?with_no_semantic_interposition: -fno-semantic-interposition} -g $(pkg-config --libs-only-L openssl)"
93c559
93c559
# We can build several different configurations of Python: regular and debug.
93c559
# Define a common function that does one build:
93c559
BuildPython() {
93c559
  ConfName=$1
93c559
  ExtraConfigArgs=$2
93c559
  MoreCFlags=$3
93c559
93c559
  # Each build is done in its own directory
93c559
  ConfDir=build/$ConfName
93c559
  echo STARTING: BUILD OF PYTHON FOR CONFIGURATION: $ConfName
93c559
  mkdir -p $ConfDir
93c559
  pushd $ConfDir
93c559
93c559
  # Normally, %%configure looks for the "configure" script in the current
93c559
  # directory.
93c559
  # Since we changed directories, we need to tell %%configure where to look.
93c559
  %global _configure $topdir/configure
93c559
93c559
  # A workaround for https://bugs.python.org/issue39761
93c559
  export DFLAGS=" "
93c559
93c559
%configure \
93c559
  --with-platlibdir=%{_lib} \
93c559
  --enable-ipv6 \
93c559
  --enable-shared \
93c559
  --with-computed-gotos=%{computed_gotos_flag} \
93c559
  --with-dbmliborder=gdbm:ndbm:bdb \
93c559
  --with-system-expat \
93c559
  --with-system-ffi \
93c559
  --enable-loadable-sqlite-extensions \
93c559
  --with-dtrace \
93c559
  --with-lto \
93c559
  --with-ssl-default-suites=openssl \
93c559
  --with-builtin-hashlib-hashes=blake2 \
93c559
%if %{with valgrind}
93c559
  --with-valgrind \
93c559
%endif
93c559
  $ExtraConfigArgs \
93c559
  %{nil}
93c559
93c559
%global flags_override EXTRA_CFLAGS="$MoreCFlags" CFLAGS_NODIST="$CFLAGS_NODIST $MoreCFlags"
93c559
93c559
%if %{without bootstrap}
93c559
  # Regenerate generated files (needs python3)
93c559
  %make_build %{flags_override} regen-all PYTHON_FOR_REGEN="python%{pybasever}"
93c559
%endif
93c559
93c559
  # Invoke the build
93c559
  %make_build %{flags_override}
93c559
93c559
  popd
93c559
  echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfName
93c559
}
93c559
93c559
# Call the above to build each configuration.
93c559
93c559
%if %{with debug_build}
93c559
# The debug build is compiled with the lowest level of optimizations as to not optimize
93c559
# out frames. We also suppress the warnings as the default distro value of the FORTIFY_SOURCE
93c559
# option produces too many warnings when compiling at the O0 optimization level.
93c559
# See also: https://bugzilla.redhat.com/show_bug.cgi?id=1818857
93c559
BuildPython debug \
93c559
  "--without-ensurepip --with-pydebug" \
93c559
  "-O0 -Wno-cpp"
93c559
%endif # with debug_build
93c559
93c559
BuildPython optimized \
93c559
  "--without-ensurepip %{optimizations_flag}" \
93c559
  ""
93c559
93c559
# ======================================================
93c559
# Installing the built code:
93c559
# ======================================================
93c559
93c559
%install
93c559
93c559
# As in %%build, remember the current directory
93c559
topdir=$(pwd)
93c559
93c559
# We install a collection of hooks for gdb that make it easier to debug
93c559
# executables linked against libpython3* (such as /usr/bin/python3 itself)
93c559
#
93c559
# These hooks are implemented in Python itself (though they are for the version
93c559
# of python that gdb is linked with)
93c559
#
93c559
# gdb-archer looks for them in the same path as the ELF file or its .debug
93c559
# file, with a -gdb.py suffix.
93c559
# We put them next to the debug file, because ldconfig would complain if
93c559
# it found non-library files directly in /usr/lib/
93c559
# (see https://bugzilla.redhat.com/show_bug.cgi?id=562980)
93c559
#
93c559
# We'll put these files in the debuginfo package by installing them to e.g.:
93c559
#  /usr/lib/debug/usr/lib/libpython3.2.so.1.0.debug-gdb.py
93c559
# (note that the debug path is /usr/lib/debug for both 32/64 bit)
93c559
#
93c559
# See https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more
93c559
# information
93c559
93c559
%if %{with gdb_hooks}
93c559
DirHoldingGdbPy=%{_usr}/lib/debug/%{_libdir}
93c559
mkdir -p %{buildroot}$DirHoldingGdbPy
93c559
%endif # with gdb_hooks
93c559
93c559
# Multilib support for pyconfig.h
93c559
# 32- and 64-bit versions of pyconfig.h are different. For multilib support
93c559
# (making it possible to install 32- and 64-bit versions simultaneously),
93c559
# we need to install them under different filenames, and to make the common
93c559
# "pyconfig.h" include the right file based on architecture.
93c559
# See https://bugzilla.redhat.com/show_bug.cgi?id=192747
93c559
# Filanames are defined here:
93c559
%global _pyconfig32_h pyconfig-32.h
93c559
%global _pyconfig64_h pyconfig-64.h
93c559
%global _pyconfig_h pyconfig-%{__isa_bits}.h
93c559
93c559
# Use a common function to do an install for all our configurations:
93c559
InstallPython() {
93c559
93c559
  ConfName=$1
93c559
  PyInstSoName=$2
93c559
  MoreCFlags=$3
93c559
  LDVersion=$4
93c559
93c559
  # Switch to the directory with this configuration's built files
93c559
  ConfDir=build/$ConfName
93c559
  echo STARTING: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName
93c559
  mkdir -p $ConfDir
93c559
  pushd $ConfDir
93c559
93c559
  %make_install EXTRA_CFLAGS="$MoreCFlags"
93c559
93c559
  popd
93c559
93c559
%if %{with gdb_hooks}
93c559
  # See comment on $DirHoldingGdbPy above
93c559
  PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName-%{version}-%{release}.%{_arch}.debug-gdb.py
93c559
  cp Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy
93c559
%endif # with gdb_hooks
93c559
93c559
  # Rename the -devel script that differs on different arches to arch specific name
93c559
  mv %{buildroot}%{_bindir}/python${LDVersion}-{,`uname -m`-}config
93c559
  echo -e '#!/bin/sh\nexec %{_bindir}/python'${LDVersion}'-`uname -m`-config "$@"' > \
93c559
    %{buildroot}%{_bindir}/python${LDVersion}-config
93c559
    chmod +x %{buildroot}%{_bindir}/python${LDVersion}-config
93c559
93c559
  # Make python3-devel multilib-ready
93c559
  mv %{buildroot}%{_includedir}/python${LDVersion}/pyconfig.h \
93c559
     %{buildroot}%{_includedir}/python${LDVersion}/%{_pyconfig_h}
93c559
  cat > %{buildroot}%{_includedir}/python${LDVersion}/pyconfig.h << EOF
93c559
#include <bits/wordsize.h>
93c559
93c559
#if __WORDSIZE == 32
93c559
#include "%{_pyconfig32_h}"
93c559
#elif __WORDSIZE == 64
93c559
#include "%{_pyconfig64_h}"
93c559
#else
93c559
#error "Unknown word size"
93c559
#endif
93c559
EOF
93c559
93c559
  echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName
93c559
}
93c559
93c559
# Install the "debug" build first; any common files will be overridden with
93c559
# later builds
93c559
%if %{with debug_build}
93c559
InstallPython debug \
93c559
  %{py_INSTSONAME_debug} \
93c559
  -O0 \
93c559
  %{LDVERSION_debug}
93c559
%endif # with debug_build
93c559
93c559
# Now the optimized build:
93c559
InstallPython optimized \
93c559
  %{py_INSTSONAME_optimized} \
93c559
  "" \
93c559
  %{LDVERSION_optimized}
93c559
93c559
# Install directories for additional packages
93c559
install -d -m 0755 %{buildroot}%{pylibdir}/site-packages/__pycache__
93c559
%if "%{_lib}" == "lib64"
93c559
# The 64-bit version needs to create "site-packages" in /usr/lib/ (for
93c559
# pure-Python modules) as well as in /usr/lib64/ (for packages with extension
93c559
# modules).
93c559
# Note that rpmlint will complain about hardcoded library path;
93c559
# this is intentional.
93c559
install -d -m 0755 %{buildroot}%{_prefix}/lib/python%{pybasever}/site-packages/__pycache__
93c559
%endif
93c559
93c559
%if %{with main_python}
93c559
# add idle3 to menu
93c559
install -D -m 0644 Lib/idlelib/Icons/idle_16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/idle3.png
93c559
install -D -m 0644 Lib/idlelib/Icons/idle_32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/idle3.png
93c559
install -D -m 0644 Lib/idlelib/Icons/idle_48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/idle3.png
93c559
install -D -m 0644 Lib/idlelib/Icons/idle_256.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/idle3.png
93c559
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE10}
93c559
93c559
# Install and validate appdata file
93c559
mkdir -p %{buildroot}%{_metainfodir}
93c559
cp -a %{SOURCE11} %{buildroot}%{_metainfodir}
93c559
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/idle3.appdata.xml
93c559
%endif
93c559
93c559
# Make sure distutils looks at the right pyconfig.h file
93c559
# See https://bugzilla.redhat.com/show_bug.cgi?id=201434
93c559
# Similar for sysconfig: sysconfig.get_config_h_filename tries to locate
93c559
# pyconfig.h so it can be parsed, and needs to do this at runtime in site.py
93c559
# when python starts up (see https://bugzilla.redhat.com/show_bug.cgi?id=653058)
93c559
#
93c559
# Split this out so it goes directly to the pyconfig-32.h/pyconfig-64.h
93c559
# variants:
93c559
sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \
93c559
  %{buildroot}%{pylibdir}/distutils/sysconfig.py \
93c559
  %{buildroot}%{pylibdir}/sysconfig.py
93c559
93c559
# Install pathfix.py to bindir
93c559
# See https://github.com/fedora-python/python-rpm-porting/issues/24
93c559
cp -p Tools/scripts/pathfix.py %{buildroot}%{_bindir}/pathfix%{pybasever}.py
93c559
93c559
# Install i18n tools to bindir
93c559
# They are also in python2, so we version them
93c559
# https://bugzilla.redhat.com/show_bug.cgi?id=1571474
93c559
for tool in pygettext msgfmt; do
93c559
  cp -p Tools/i18n/${tool}.py %{buildroot}%{_bindir}/${tool}%{pybasever}.py
93c559
  ln -s ${tool}%{pybasever}.py %{buildroot}%{_bindir}/${tool}3.py
93c559
done
93c559
93c559
# Switch all shebangs to refer to the specific Python version.
93c559
# This currently only covers files matching ^[a-zA-Z0-9_]+\.py$,
93c559
# so handle files named using other naming scheme separately.
93c559
LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \
93c559
  Tools/scripts/pathfix.py \
93c559
  -i "%{_bindir}/python%{pybasever}" -pn \
93c559
  %{buildroot} \
93c559
  %{buildroot}%{_bindir}/*%{pybasever}.py \
93c559
  %{?with_gdb_hooks:%{buildroot}$DirHoldingGdbPy/*.py}
93c559
93c559
# Remove shebang lines from .py files that aren't executable, and
93c559
# remove executability from .py files that don't have a shebang line:
93c559
find %{buildroot} -name \*.py \
93c559
  \( \( \! -perm /u+x,g+x,o+x -exec sed -e '/^#!/Q 0' -e 'Q 1' {} \; \
93c559
  -print -exec sed -i '1d' {} \; \) -o \( \
93c559
  -perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \
93c559
  -exec chmod a-x {} \; \) \)
93c559
93c559
# Get rid of DOS batch files:
93c559
find %{buildroot} -name \*.bat -exec rm {} \;
93c559
93c559
# Get rid of backup files:
93c559
find %{buildroot}/ -name "*~" -exec rm -f {} \;
93c559
find . -name "*~" -exec rm -f {} \;
93c559
93c559
# Do bytecompilation with the newly installed interpreter.
93c559
# This is similar to the script in macros.pybytecompile
93c559
# compile *.pyc
93c559
# Python CMD line options:
93c559
# -s - don't add user site directory to sys.path
93c559
# -B - don't write .pyc files on import
93c559
# compileall CMD line options:
93c559
# -f - force rebuild even if timestamps are up to date
93c559
# -o - optimization levels to run compilation with
93c559
# -s - part of path to left-strip from path to source file (buildroot)
93c559
# -p - path to add as prefix to path to source file (/ to make it absolute)
93c559
# --hardlink-dupes - hardlink different optimization level pycs together if identical (saves space)
93c559
LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
93c559
%{buildroot}%{_bindir}/python%{pybasever} -s -B -m compileall \
93c559
-f %{_smp_mflags} -o 0 -o 1 -o 2 -s %{buildroot} -p / %{buildroot} --hardlink-dupes || :
93c559
93c559
# Turn this BRP off, it is done by compileall2 --hardlink-dupes above
93c559
%global __brp_python_hardlink %{nil}
93c559
93c559
# Since we have pathfix.py in bindir, this is created, but we don't want it
93c559
rm -rf %{buildroot}%{_bindir}/__pycache__
93c559
93c559
# Fixup permissions for shared libraries from non-standard 555 to standard 755:
93c559
find %{buildroot} -perm 555 -exec chmod 755 {} \;
93c559
93c559
# Create "/usr/bin/python3-debug", a symlink to the python3 debug binary, to
93c559
# avoid the user having to know the precise version and ABI flags.
93c559
# See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=676748
93c559
%if %{with debug_build} && %{with main_python}
93c559
ln -s \
93c559
  %{_bindir}/python%{LDVERSION_debug} \
93c559
  %{buildroot}%{_bindir}/python3-debug
93c559
%endif
93c559
93c559
# There's 2to3-X.X executable and 2to3 soft link to it.
93c559
# No reason to have both, so keep only 2to3 as an executable.
93c559
# See https://bugzilla.redhat.com/show_bug.cgi?id=1111275
93c559
# RHEL: We keep 2to3-X.X versioned not to conflict with other versions
93c559
93c559
%if %{without main_python}
93c559
# Remove stuff that would conflict with python3 package
93c559
rm %{buildroot}%{_bindir}/python3
93c559
rm %{buildroot}%{_bindir}/pydoc3
93c559
rm %{buildroot}%{_bindir}/pygettext3.py
93c559
rm %{buildroot}%{_bindir}/msgfmt3.py
93c559
rm %{buildroot}%{_bindir}/idle3
93c559
rm %{buildroot}%{_bindir}/python3-*
93c559
rm %{buildroot}%{_bindir}/2to3
93c559
rm %{buildroot}%{_libdir}/libpython3.so
93c559
rm %{buildroot}%{_mandir}/man1/python3.1*
93c559
rm %{buildroot}%{_libdir}/pkgconfig/python3.pc
93c559
rm %{buildroot}%{_libdir}/pkgconfig/python3-embed.pc
93c559
%else
93c559
# Link the unversioned stuff
93c559
# https://fedoraproject.org/wiki/Changes/Python_means_Python3
93c559
ln -s ./python3 %{buildroot}%{_bindir}/python
93c559
ln -s ./pydoc3 %{buildroot}%{_bindir}/pydoc
93c559
ln -s ./pygettext3.py %{buildroot}%{_bindir}/pygettext.py
93c559
ln -s ./msgfmt3.py %{buildroot}%{_bindir}/msgfmt.py
93c559
ln -s ./idle3 %{buildroot}%{_bindir}/idle
93c559
ln -s ./python3-config %{buildroot}%{_bindir}/python-config
93c559
ln -s ./python3.1 %{buildroot}%{_mandir}/man1/python.1
93c559
ln -s ./python3.pc %{buildroot}%{_libdir}/pkgconfig/python.pc
93c559
ln -s ./pathfix%{pybasever}.py %{buildroot}%{_bindir}/pathfix.py
93c559
%if %{with debug_build}
93c559
ln -s ./python3-debug %{buildroot}%{_bindir}/python-debug
93c559
%endif
93c559
%endif
93c559
93c559
%if %{with rhel8_compat_shims}
93c559
# Provide RHEL8 backwards compatible symbolic links in %%_libexecdir
93c559
mkdir -p %{buildroot}%{_libexecdir}
93c559
ln -s %{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/platform-python
93c559
ln -s %{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/platform-python%{pybasever}
93c559
ln -s %{_bindir}/python%{pybasever}-config %{buildroot}%{_libexecdir}/platform-python-config
93c559
ln -s %{_bindir}/python%{pybasever}-config %{buildroot}%{_libexecdir}/platform-python%{pybasever}-config
93c559
ln -s %{_bindir}/python%{pybasever}-`uname -m`-config %{buildroot}%{_libexecdir}/platform-python%{pybasever}-`uname -m`-config
93c559
# There were also executables with %%{LDVERSION_optimized} in RHEL 8,
93c559
# but since Python 3.8 %%{LDVERSION_optimized} == %%{pybasever}.
93c559
# We list both in the %%files section to assert this.
93c559
%if %{with debug_build}
93c559
ln -s %{_bindir}/python%{LDVERSION_debug} %{buildroot}%{_libexecdir}/platform-python-debug
93c559
ln -s %{_bindir}/python%{LDVERSION_debug} %{buildroot}%{_libexecdir}/platform-python%{LDVERSION_debug}
93c559
ln -s %{_bindir}/python%{LDVERSION_debug}-config %{buildroot}%{_libexecdir}/platform-python%{LDVERSION_debug}-config
93c559
ln -s %{_bindir}/python%{LDVERSION_debug}-`uname -m`-config %{buildroot}%{_libexecdir}/platform-python%{LDVERSION_debug}-`uname -m`-config
93c559
%endif
93c559
%endif
93c559
93c559
# Remove large, autogenerated sources and keep only the non-optimized pycache
93c559
for file in %{buildroot}%{pylibdir}/pydoc_data/topics.py $(grep --include='*.py' -lr %{buildroot}%{pylibdir}/encodings -e 'Python Character Mapping Codec .* from .* with gencodec.py'); do
93c559
    directory=$(dirname ${file})
93c559
    module=$(basename ${file%%.py})
93c559
    mv ${directory}/{__pycache__/${module}.cpython-%{pyshortver}.pyc,${module}.pyc}
93c559
    rm ${directory}/{__pycache__/${module}.cpython-%{pyshortver}.opt-?.pyc,${module}.py}
93c559
done
93c559
93c559
# Python RPM macros
93c559
mkdir -p %{buildroot}%{rpmmacrodir}/
93c559
install -m 644 %{SOURCE3} \
93c559
    %{buildroot}/%{rpmmacrodir}/
93c559
93c559
# All ghost files controlled by alternatives need to exist for the files
93c559
# section check to succeed
93c559
# - Don't list /usr/bin/python as a ghost file so `yum install /usr/bin/python`
93c559
#   doesn't install this package
93c559
touch %{buildroot}%{_bindir}/unversioned-python
93c559
touch %{buildroot}%{_mandir}/man1/python.1.gz
93c559
touch %{buildroot}%{_bindir}/python3
93c559
touch %{buildroot}%{_mandir}/man1/python3.1.gz
93c559
touch %{buildroot}%{_bindir}/pydoc3
93c559
touch %{buildroot}%{_bindir}/pydoc-3
93c559
touch %{buildroot}%{_bindir}/idle3
93c559
touch %{buildroot}%{_bindir}/python3-config
93c559
touch %{buildroot}%{_bindir}/python3-debug
93c559
touch %{buildroot}%{_bindir}/python3-debug-config
93c559
93c559
93c559
# ======================================================
93c559
# Checks for packaging issues
93c559
# ======================================================
93c559
93c559
%check
93c559
93c559
# first of all, check timestamps of bytecode files
93c559
find %{buildroot} -type f -a -name "*.py" -print0 | \
93c559
    LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
93c559
    PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
93c559
    xargs -0 %{buildroot}%{_bindir}/python%{pybasever} %{SOURCE8}
93c559
93c559
# Ensure that the curses module was linked against libncursesw.so, rather than
93c559
# libncurses.so
93c559
# See https://bugzilla.redhat.com/show_bug.cgi?id=539917
93c559
ldd %{buildroot}/%{dynload_dir}/_curses*.so \
93c559
    | grep curses \
93c559
    | grep libncurses.so && (echo "_curses.so linked against libncurses.so" ; exit 1)
93c559
93c559
# Ensure that the debug modules are linked against the debug libpython, and
93c559
# likewise for the optimized modules and libpython:
93c559
for Module in %{buildroot}/%{dynload_dir}/*.so ; do
93c559
    case $Module in
93c559
    *.%{SOABI_debug})
93c559
        ldd $Module | grep %{py_INSTSONAME_optimized} &&
93c559
            (echo Debug module $Module linked against optimized %{py_INSTSONAME_optimized} ; exit 1)
93c559
93c559
        ;;
93c559
    *.%{SOABI_optimized})
93c559
        ldd $Module | grep %{py_INSTSONAME_debug} &&
93c559
            (echo Optimized module $Module linked against debug %{py_INSTSONAME_debug} ; exit 1)
93c559
        ;;
93c559
    esac
93c559
done
93c559
b1014d
# Verify that the bundled libmpdec version python was compiled with, is the same version we have virtual
b1014d
# provides for in the SPEC.
b1014d
test "$(LD_LIBRARY_PATH=$(pwd)/build/optimized $(pwd)/build/optimized/python -c 'import decimal; print(decimal.__libmpdec_version__)')" = \
b1014d
     "%{libmpdec_version}"
b1014d
93c559
93c559
# ======================================================
93c559
# Running the upstream test suite
93c559
# ======================================================
93c559
93c559
topdir=$(pwd)
93c559
CheckPython() {
93c559
  ConfName=$1
93c559
  ConfDir=$(pwd)/build/$ConfName
93c559
93c559
  echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
93c559
93c559
  # Note that we're running the tests using the version of the code in the
93c559
  # builddir, not in the buildroot.
93c559
93c559
  # Show some info, helpful for debugging test failures
93c559
  LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.pythoninfo
93c559
93c559
  # Run the upstream test suite
93c559
  # --timeout=1800: kill test running for longer than 30 minutes
93c559
  # test_distutils
93c559
  #   distutils.tests.test_bdist_rpm tests fail when bootstraping the Python
93c559
  #   package: rpmbuild requires /usr/bin/pythonX.Y to be installed
93c559
  LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \
93c559
    -wW --slowest -j0 --timeout=1800 \
93c559
    %if %{with bootstrap}
93c559
    -x test_distutils \
93c559
    %endif
93c559
    %ifarch %{mips64}
93c559
    -x test_ctypes \
93c559
    %endif
93c559
93c559
  echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
93c559
93c559
}
93c559
93c559
%if %{with tests}
93c559
93c559
# Check each of the configurations:
93c559
%if %{with debug_build}
93c559
CheckPython debug
93c559
%endif # with debug_build
93c559
CheckPython optimized
93c559
93c559
%endif # with tests
93c559
93c559
93c559
# ======================================================
93c559
# Scriptlets for alternatives
93c559
# ======================================================
93c559
93c559
%post
93c559
# Alternative for /usr/bin/python -> /usr/bin/python3 + man page
93c559
alternatives --install %{_bindir}/unversioned-python \
93c559
                       python \
93c559
                       %{_bindir}/python3 \
93c559
                       300 \
93c559
             --slave   %{_bindir}/python \
93c559
                       unversioned-python \
93c559
                       %{_bindir}/python3 \
93c559
             --slave   %{_mandir}/man1/python.1.gz \
93c559
                       unversioned-python-man \
93c559
                       %{_mandir}/man1/python3.1.gz
93c559
93c559
# Alternative for /usr/bin/python -> /usr/bin/python3.9 + man page
93c559
alternatives --install %{_bindir}/unversioned-python \
93c559
                       python \
93c559
                       %{_bindir}/python3.9 \
93c559
                       209 \
93c559
             --slave   %{_bindir}/python \
93c559
                       unversioned-python \
93c559
                       %{_bindir}/python3.9 \
93c559
             --slave   %{_mandir}/man1/python.1.gz \
93c559
                       unversioned-python-man \
93c559
                       %{_mandir}/man1/python3.9.1.gz
93c559
93c559
# Alternative for /usr/bin/python3 -> /usr/bin/python3.8 + related files
93c559
# Create only if it doesn't exist already
93c559
EXISTS=`alternatives --display python3 | \
93c559
        grep -c "^/usr/bin/python3.9 - priority [0-9]*"`
93c559
93c559
if [ $EXISTS -eq 0 ]; then
93c559
    alternatives --install %{_bindir}/python3 \
93c559
                           python3 \
93c559
                           %{_bindir}/python3.9 \
93c559
                           3900 \
93c559
                 --slave   %{_mandir}/man1/python3.1.gz \
93c559
                           python3-man \
93c559
                           %{_mandir}/man1/python3.9.1.gz \
93c559
                 --slave   %{_bindir}/pydoc3 \
93c559
                           pydoc3 \
93c559
                           %{_bindir}/pydoc3.9 \
93c559
                 --slave   %{_bindir}/pydoc-3 \
93c559
                           pydoc-3 \
93c559
                           %{_bindir}/pydoc3.9
93c559
fi
93c559
93c559
%postun
93c559
# Do this only during uninstall process (not during update)
93c559
if [ $1 -eq 0 ]; then
b1014d
    alternatives --keep-foreign --remove python \
93c559
                        %{_bindir}/python3.9
93c559
b1014d
    alternatives --keep-foreign --remove python3 \
93c559
                        %{_bindir}/python3.9
93c559
93c559
    # Remove link python → python3 if no other python3.* exists
93c559
    if ! alternatives --display python3 > /dev/null; then
b1014d
        alternatives --keep-foreign --remove python \
93c559
                            %{_bindir}/python3
93c559
    fi
93c559
fi
93c559
93c559
93c559
%post devel
93c559
alternatives --add-slave python3 %{_bindir}/python3.9 \
93c559
    %{_bindir}/python3-config \
93c559
    python3-config \
93c559
    %{_bindir}/python3.9-config
93c559
93c559
%postun devel
93c559
# Do this only during uninstall process (not during update)
93c559
if [ $1 -eq 0 ]; then
b1014d
    alternatives --keep-foreign --remove-slave python3 %{_bindir}/python3.9 \
93c559
        python3-config
93c559
fi
93c559
93c559
93c559
%post debug
93c559
alternatives --add-slave python3 %{_bindir}/python3.9 \
93c559
    %{_bindir}/python3-debug \
93c559
    python3-debug \
93c559
    %{_bindir}/python3.9d
93c559
alternatives --add-slave python3 %{_bindir}/python3.9 \
93c559
    %{_bindir}/python3-debug-config \
93c559
    python3-debug-config \
93c559
    %{_bindir}/python3.9d-config
93c559
93c559
%postun debug
93c559
# Do this only during uninstall process (not during update)
93c559
if [ $1 -eq 0 ]; then
b1014d
    alternatives --keep-foreign --remove-slave python3 %{_bindir}/python3.9 \
93c559
        python3-debug
b1014d
    alternatives --keep-foreign --remove-slave python3 %{_bindir}/python3.9 \
93c559
        python3-debug-config
93c559
fi
93c559
93c559
93c559
%post idle
93c559
alternatives --add-slave python3 %{_bindir}/python3.9 \
93c559
    %{_bindir}/idle3 \
93c559
    idle3 \
93c559
    %{_bindir}/idle3.9
93c559
93c559
%postun idle
93c559
# Do this only during uninstall process (not during update)
93c559
if [ $1 -eq 0 ]; then
b1014d
    alternatives --keep-foreign --remove-slave python3 %{_bindir}/python3.9 \
93c559
       idle3
93c559
fi
93c559
93c559
93c559
# ======================================================
93c559
# Files for each RPM (sub)package
93c559
# ======================================================
93c559
93c559
%files -n %{pkgname}-rpm-macros
93c559
%{rpmmacrodir}/macros.python%{pyshortver}
93c559
93c559
%files -n %{pkgname}
93c559
%doc README.rst
93c559
93c559
# Alternatives
93c559
%ghost %{_bindir}/unversioned-python
93c559
%ghost %{_mandir}/man1/python.1.gz
93c559
%ghost %{_bindir}/python3
93c559
%ghost %{_mandir}/man1/python3.1.gz
93c559
%ghost %{_bindir}/pydoc3
93c559
%ghost %{_bindir}/pydoc-3
93c559
93c559
%if %{with main_python}
93c559
%{_bindir}/pydoc*
93c559
%{_bindir}/python3
93c559
%else
93c559
%{_bindir}/pydoc%{pybasever}
93c559
%endif
93c559
93c559
%{_bindir}/python%{pybasever}
93c559
%{_bindir}/python%{LDVERSION_optimized}
93c559
%{_mandir}/*/*3*
93c559
93c559
%if %{with rhel8_compat_shims}
93c559
%{_libexecdir}/platform-python
93c559
%{_libexecdir}/platform-python%{pybasever}
93c559
%{_libexecdir}/platform-python%{LDVERSION_optimized}
93c559
%endif
93c559
93c559
%if %{with main_python}
93c559
%if %{without flatpackage}
93c559
%files -n python-unversioned-command
93c559
%endif
93c559
%{_bindir}/python
93c559
%{_mandir}/*/python.1*
93c559
%endif
93c559
93c559
%if %{without flatpackage}
93c559
%files -n %{pkgname}-libs
93c559
%doc README.rst
93c559
%endif
93c559
93c559
%dir %{pylibdir}
93c559
%dir %{dynload_dir}
93c559
93c559
%license %{pylibdir}/LICENSE.txt
93c559
93c559
%{pylibdir}/lib2to3
93c559
%if %{without flatpackage}
93c559
%exclude %{pylibdir}/lib2to3/tests
93c559
%endif
93c559
93c559
%dir %{pylibdir}/unittest/
93c559
%dir %{pylibdir}/unittest/__pycache__/
93c559
%{pylibdir}/unittest/*.py
93c559
%{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes}
93c559
93c559
%dir %{pylibdir}/asyncio/
93c559
%dir %{pylibdir}/asyncio/__pycache__/
93c559
%{pylibdir}/asyncio/*.py
93c559
%{pylibdir}/asyncio/__pycache__/*%{bytecode_suffixes}
93c559
93c559
%dir %{pylibdir}/venv/
93c559
%dir %{pylibdir}/venv/__pycache__/
93c559
%{pylibdir}/venv/*.py
93c559
%{pylibdir}/venv/__pycache__/*%{bytecode_suffixes}
93c559
%{pylibdir}/venv/scripts
93c559
93c559
%{pylibdir}/wsgiref
93c559
%{pylibdir}/xmlrpc
93c559
93c559
%dir %{pylibdir}/ensurepip/
93c559
%dir %{pylibdir}/ensurepip/__pycache__/
93c559
%{pylibdir}/ensurepip/*.py
93c559
%{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes}
93c559
93c559
%if %{with rpmwheels}
93c559
%exclude %{pylibdir}/ensurepip/_bundled
93c559
%else
93c559
%dir %{pylibdir}/ensurepip/_bundled
93c559
%{pylibdir}/ensurepip/_bundled/*.whl
93c559
%{pylibdir}/ensurepip/_bundled/__init__.py
93c559
%{pylibdir}/ensurepip/_bundled/__pycache__/*%{bytecode_suffixes}
93c559
%endif
93c559
93c559
%dir %{pylibdir}/concurrent/
93c559
%dir %{pylibdir}/concurrent/__pycache__/
93c559
%{pylibdir}/concurrent/*.py
93c559
%{pylibdir}/concurrent/__pycache__/*%{bytecode_suffixes}
93c559
93c559
%dir %{pylibdir}/concurrent/futures/
93c559
%dir %{pylibdir}/concurrent/futures/__pycache__/
93c559
%{pylibdir}/concurrent/futures/*.py
93c559
%{pylibdir}/concurrent/futures/__pycache__/*%{bytecode_suffixes}
93c559
93c559
%{pylibdir}/pydoc_data
93c559
93c559
%{dynload_dir}/_blake2.%{SOABI_optimized}.so
93c559
93c559
%{dynload_dir}/_asyncio.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_bisect.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_bz2.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_codecs_cn.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_codecs_hk.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_codecs_iso2022.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_codecs_jp.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_codecs_kr.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_codecs_tw.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_contextvars.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_crypt.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_csv.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_ctypes.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_curses.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_curses_panel.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_dbm.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_decimal.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_elementtree.%{SOABI_optimized}.so
93c559
%if %{with gdbm}
93c559
%{dynload_dir}/_gdbm.%{SOABI_optimized}.so
93c559
%endif
93c559
%{dynload_dir}/_hashlib.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_heapq.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_json.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_lsprof.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_lzma.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_multibytecodec.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_multiprocessing.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_opcode.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_pickle.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_posixsubprocess.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_queue.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_random.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_socket.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_sqlite3.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_ssl.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_statistics.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_struct.%{SOABI_optimized}.so
93c559
%{dynload_dir}/array.%{SOABI_optimized}.so
93c559
%{dynload_dir}/audioop.%{SOABI_optimized}.so
93c559
%{dynload_dir}/binascii.%{SOABI_optimized}.so
93c559
%{dynload_dir}/cmath.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_datetime.%{SOABI_optimized}.so
93c559
%{dynload_dir}/fcntl.%{SOABI_optimized}.so
93c559
%{dynload_dir}/grp.%{SOABI_optimized}.so
93c559
%{dynload_dir}/math.%{SOABI_optimized}.so
93c559
%{dynload_dir}/mmap.%{SOABI_optimized}.so
93c559
%{dynload_dir}/nis.%{SOABI_optimized}.so
93c559
%{dynload_dir}/ossaudiodev.%{SOABI_optimized}.so
93c559
%{dynload_dir}/parser.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_posixshmem.%{SOABI_optimized}.so
93c559
%{dynload_dir}/pyexpat.%{SOABI_optimized}.so
93c559
%{dynload_dir}/readline.%{SOABI_optimized}.so
93c559
%{dynload_dir}/resource.%{SOABI_optimized}.so
93c559
%{dynload_dir}/select.%{SOABI_optimized}.so
93c559
%{dynload_dir}/spwd.%{SOABI_optimized}.so
93c559
%{dynload_dir}/syslog.%{SOABI_optimized}.so
93c559
%{dynload_dir}/termios.%{SOABI_optimized}.so
93c559
%{dynload_dir}/unicodedata.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_uuid.%{SOABI_optimized}.so
93c559
%{dynload_dir}/xxlimited.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_xxsubinterpreters.%{SOABI_optimized}.so
93c559
%{dynload_dir}/zlib.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_zoneinfo.%{SOABI_optimized}.so
93c559
93c559
%dir %{pylibdir}/site-packages/
93c559
%dir %{pylibdir}/site-packages/__pycache__/
93c559
%{pylibdir}/site-packages/README.txt
93c559
%{pylibdir}/*.py
93c559
%dir %{pylibdir}/__pycache__/
93c559
%{pylibdir}/__pycache__/*%{bytecode_suffixes}
93c559
93c559
%dir %{pylibdir}/collections/
93c559
%dir %{pylibdir}/collections/__pycache__/
93c559
%{pylibdir}/collections/*.py
93c559
%{pylibdir}/collections/__pycache__/*%{bytecode_suffixes}
93c559
93c559
%dir %{pylibdir}/ctypes/
93c559
%dir %{pylibdir}/ctypes/__pycache__/
93c559
%{pylibdir}/ctypes/*.py
93c559
%{pylibdir}/ctypes/__pycache__/*%{bytecode_suffixes}
93c559
%{pylibdir}/ctypes/macholib
93c559
93c559
%{pylibdir}/curses
93c559
93c559
%dir %{pylibdir}/dbm/
93c559
%dir %{pylibdir}/dbm/__pycache__/
93c559
%{pylibdir}/dbm/*.py
93c559
%{pylibdir}/dbm/__pycache__/*%{bytecode_suffixes}
93c559
93c559
%dir %{pylibdir}/distutils/
93c559
%dir %{pylibdir}/distutils/__pycache__/
93c559
%{pylibdir}/distutils/*.py
93c559
%{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes}
93c559
%{pylibdir}/distutils/README
93c559
%{pylibdir}/distutils/command
93c559
93c559
%dir %{pylibdir}/email/
93c559
%dir %{pylibdir}/email/__pycache__/
93c559
%{pylibdir}/email/*.py
93c559
%{pylibdir}/email/__pycache__/*%{bytecode_suffixes}
93c559
%{pylibdir}/email/mime
93c559
%doc %{pylibdir}/email/architecture.rst
93c559
93c559
%{pylibdir}/encodings
93c559
93c559
%{pylibdir}/html
93c559
%{pylibdir}/http
93c559
93c559
%dir %{pylibdir}/importlib/
93c559
%dir %{pylibdir}/importlib/__pycache__/
93c559
%{pylibdir}/importlib/*.py
93c559
%{pylibdir}/importlib/__pycache__/*%{bytecode_suffixes}
93c559
93c559
%dir %{pylibdir}/json/
93c559
%dir %{pylibdir}/json/__pycache__/
93c559
%{pylibdir}/json/*.py
93c559
%{pylibdir}/json/__pycache__/*%{bytecode_suffixes}
93c559
93c559
%{pylibdir}/logging
93c559
%{pylibdir}/multiprocessing
93c559
93c559
%dir %{pylibdir}/sqlite3/
93c559
%dir %{pylibdir}/sqlite3/__pycache__/
93c559
%{pylibdir}/sqlite3/*.py
93c559
%{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes}
93c559
93c559
%if %{without flatpackage}
93c559
%exclude %{pylibdir}/turtle.py
93c559
%exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes}
93c559
%endif
93c559
93c559
%{pylibdir}/urllib
93c559
%{pylibdir}/xml
93c559
%{pylibdir}/zoneinfo
93c559
93c559
%if "%{_lib}" == "lib64"
93c559
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}
93c559
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages
93c559
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages/__pycache__/
93c559
%endif
93c559
93c559
# "Makefile" and the config-32/64.h file are needed by
93c559
# distutils/sysconfig.py:_init_posix(), so we include them in the core
93c559
# package, along with their parent directories (bug 531901):
93c559
%dir %{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/
93c559
%{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/Makefile
93c559
%dir %{_includedir}/python%{LDVERSION_optimized}/
93c559
%{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h}
93c559
93c559
%{_libdir}/%{py_INSTSONAME_optimized}
93c559
%if %{with main_python}
93c559
%{_libdir}/libpython3.so
93c559
%endif
93c559
93c559
93c559
%if %{without flatpackage}
93c559
%files -n %{pkgname}-devel
93c559
%endif
93c559
93c559
%{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/*
93c559
%if %{without flatpackage}
93c559
%exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/Makefile
93c559
%exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h}
93c559
%endif
93c559
%{_includedir}/python%{LDVERSION_optimized}/*.h
93c559
%{_includedir}/python%{LDVERSION_optimized}/internal/
93c559
%{_includedir}/python%{LDVERSION_optimized}/cpython/
93c559
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
93c559
93c559
%if %{with main_python}
93c559
%{_bindir}/python3-config
93c559
%{_bindir}/python-config
93c559
%{_libdir}/pkgconfig/python3.pc
93c559
%{_libdir}/pkgconfig/python.pc
93c559
%{_libdir}/pkgconfig/python3-embed.pc
93c559
%{_bindir}/pathfix.py
93c559
%{_bindir}/pygettext3.py
93c559
%{_bindir}/pygettext.py
93c559
%{_bindir}/msgfmt3.py
93c559
%{_bindir}/msgfmt.py
93c559
%endif
93c559
93c559
%{_bindir}/2to3-%{pybasever}
93c559
%{_bindir}/pathfix%{pybasever}.py
93c559
%{_bindir}/pygettext%{pybasever}.py
93c559
%{_bindir}/msgfmt%{pybasever}.py
93c559
93c559
%{_bindir}/python%{pybasever}-config
93c559
%{_bindir}/python%{LDVERSION_optimized}-config
93c559
%{_bindir}/python%{LDVERSION_optimized}-*-config
93c559
# Alternatives
93c559
%ghost %{_bindir}/python3-config
93c559
93c559
%{_libdir}/libpython%{LDVERSION_optimized}.so
93c559
%{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc
93c559
%{_libdir}/pkgconfig/python-%{LDVERSION_optimized}-embed.pc
93c559
%{_libdir}/pkgconfig/python-%{pybasever}.pc
93c559
%{_libdir}/pkgconfig/python-%{pybasever}-embed.pc
93c559
93c559
%if %{with rhel8_compat_shims}
93c559
%{_libexecdir}/platform-python-config
93c559
%{_libexecdir}/platform-python%{pybasever}-config
93c559
%{_libexecdir}/platform-python%{LDVERSION_optimized}-config
93c559
%{_libexecdir}/platform-python%{pybasever}-*-config
93c559
%{_libexecdir}/platform-python%{LDVERSION_optimized}-*-config
93c559
%endif
93c559
93c559
93c559
%if %{without flatpackage}
93c559
%files -n %{pkgname}-idle
93c559
%endif
93c559
93c559
%if %{with main_python}
93c559
%{_bindir}/idle*
93c559
%else
93c559
%{_bindir}/idle%{pybasever}
93c559
# Alternatives
93c559
%ghost %{_bindir}/idle3
93c559
%endif
93c559
93c559
%{pylibdir}/idlelib
93c559
93c559
%if %{with main_python}
93c559
%{_metainfodir}/idle3.appdata.xml
93c559
%{_datadir}/applications/idle3.desktop
93c559
%{_datadir}/icons/hicolor/*/apps/idle3.*
93c559
%endif
93c559
93c559
%if %{without flatpackage}
93c559
%files -n %{pkgname}-tkinter
93c559
%endif
93c559
93c559
%{pylibdir}/tkinter
93c559
%if %{without flatpackage}
93c559
%exclude %{pylibdir}/tkinter/test
93c559
%endif
93c559
%{dynload_dir}/_tkinter.%{SOABI_optimized}.so
93c559
%{pylibdir}/turtle.py
93c559
%{pylibdir}/__pycache__/turtle*%{bytecode_suffixes}
93c559
%dir %{pylibdir}/turtledemo
93c559
%{pylibdir}/turtledemo/*.py
93c559
%{pylibdir}/turtledemo/*.cfg
93c559
%dir %{pylibdir}/turtledemo/__pycache__/
93c559
%{pylibdir}/turtledemo/__pycache__/*%{bytecode_suffixes}
93c559
93c559
93c559
%if %{without flatpackage}
93c559
%files -n %{pkgname}-test
93c559
%endif
93c559
93c559
%{pylibdir}/ctypes/test
93c559
%{pylibdir}/distutils/tests
93c559
%{pylibdir}/sqlite3/test
93c559
%{pylibdir}/test
93c559
%{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_testbuffer.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_testcapi.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_testimportmultiple.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_testinternalcapi.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_testmultiphase.%{SOABI_optimized}.so
93c559
%{dynload_dir}/_xxtestfuzz.%{SOABI_optimized}.so
93c559
%{pylibdir}/lib2to3/tests
93c559
%{pylibdir}/tkinter/test
93c559
%{pylibdir}/unittest/test
93c559
93c559
# We don't bother splitting the debug build out into further subpackages:
93c559
# if you need it, you're probably a developer.
93c559
93c559
# Hence the manifest is the combination of analogous files in the manifests of
93c559
# all of the other subpackages
93c559
93c559
%if %{with debug_build}
93c559
%if %{without flatpackage}
93c559
%files -n %{pkgname}-debug
93c559
%endif
93c559
93c559
%if %{with main_python}
93c559
%{_bindir}/python3-debug
93c559
%{_bindir}/python-debug
93c559
%endif
93c559
93c559
# Analog of the core subpackage's files:
93c559
%{_bindir}/python%{LDVERSION_debug}
93c559
# Alternatives
93c559
%ghost %{_bindir}/python3-debug
93c559
93c559
# Analog of the -libs subpackage's files:
93c559
# ...with debug builds of the built-in "extension" modules:
93c559
93c559
%{dynload_dir}/_blake2.%{SOABI_debug}.so
93c559
93c559
%{dynload_dir}/_asyncio.%{SOABI_debug}.so
93c559
%{dynload_dir}/_bisect.%{SOABI_debug}.so
93c559
%{dynload_dir}/_bz2.%{SOABI_debug}.so
93c559
%{dynload_dir}/_codecs_cn.%{SOABI_debug}.so
93c559
%{dynload_dir}/_codecs_hk.%{SOABI_debug}.so
93c559
%{dynload_dir}/_codecs_iso2022.%{SOABI_debug}.so
93c559
%{dynload_dir}/_codecs_jp.%{SOABI_debug}.so
93c559
%{dynload_dir}/_codecs_kr.%{SOABI_debug}.so
93c559
%{dynload_dir}/_codecs_tw.%{SOABI_debug}.so
93c559
%{dynload_dir}/_contextvars.%{SOABI_debug}.so
93c559
%{dynload_dir}/_crypt.%{SOABI_debug}.so
93c559
%{dynload_dir}/_csv.%{SOABI_debug}.so
93c559
%{dynload_dir}/_ctypes.%{SOABI_debug}.so
93c559
%{dynload_dir}/_curses.%{SOABI_debug}.so
93c559
%{dynload_dir}/_curses_panel.%{SOABI_debug}.so
93c559
%{dynload_dir}/_dbm.%{SOABI_debug}.so
93c559
%{dynload_dir}/_decimal.%{SOABI_debug}.so
93c559
%{dynload_dir}/_elementtree.%{SOABI_debug}.so
93c559
%if %{with gdbm}
93c559
%{dynload_dir}/_gdbm.%{SOABI_debug}.so
93c559
%endif
93c559
%{dynload_dir}/_hashlib.%{SOABI_debug}.so
93c559
%{dynload_dir}/_heapq.%{SOABI_debug}.so
93c559
%{dynload_dir}/_json.%{SOABI_debug}.so
93c559
%{dynload_dir}/_lsprof.%{SOABI_debug}.so
93c559
%{dynload_dir}/_lzma.%{SOABI_debug}.so
93c559
%{dynload_dir}/_multibytecodec.%{SOABI_debug}.so
93c559
%{dynload_dir}/_multiprocessing.%{SOABI_debug}.so
93c559
%{dynload_dir}/_opcode.%{SOABI_debug}.so
93c559
%{dynload_dir}/_pickle.%{SOABI_debug}.so
93c559
%{dynload_dir}/_posixsubprocess.%{SOABI_debug}.so
93c559
%{dynload_dir}/_queue.%{SOABI_debug}.so
93c559
%{dynload_dir}/_random.%{SOABI_debug}.so
93c559
%{dynload_dir}/_socket.%{SOABI_debug}.so
93c559
%{dynload_dir}/_sqlite3.%{SOABI_debug}.so
93c559
%{dynload_dir}/_ssl.%{SOABI_debug}.so
93c559
%{dynload_dir}/_statistics.%{SOABI_debug}.so
93c559
%{dynload_dir}/_struct.%{SOABI_debug}.so
93c559
%{dynload_dir}/array.%{SOABI_debug}.so
93c559
%{dynload_dir}/audioop.%{SOABI_debug}.so
93c559
%{dynload_dir}/binascii.%{SOABI_debug}.so
93c559
%{dynload_dir}/cmath.%{SOABI_debug}.so
93c559
%{dynload_dir}/_datetime.%{SOABI_debug}.so
93c559
%{dynload_dir}/fcntl.%{SOABI_debug}.so
93c559
%{dynload_dir}/grp.%{SOABI_debug}.so
93c559
%{dynload_dir}/math.%{SOABI_debug}.so
93c559
%{dynload_dir}/mmap.%{SOABI_debug}.so
93c559
%{dynload_dir}/nis.%{SOABI_debug}.so
93c559
%{dynload_dir}/ossaudiodev.%{SOABI_debug}.so
93c559
%{dynload_dir}/parser.%{SOABI_debug}.so
93c559
%{dynload_dir}/_posixshmem.%{SOABI_debug}.so
93c559
%{dynload_dir}/pyexpat.%{SOABI_debug}.so
93c559
%{dynload_dir}/readline.%{SOABI_debug}.so
93c559
%{dynload_dir}/resource.%{SOABI_debug}.so
93c559
%{dynload_dir}/select.%{SOABI_debug}.so
93c559
%{dynload_dir}/spwd.%{SOABI_debug}.so
93c559
%{dynload_dir}/syslog.%{SOABI_debug}.so
93c559
%{dynload_dir}/termios.%{SOABI_debug}.so
93c559
%{dynload_dir}/unicodedata.%{SOABI_debug}.so
93c559
%{dynload_dir}/_uuid.%{SOABI_debug}.so
93c559
%{dynload_dir}/_xxsubinterpreters.%{SOABI_debug}.so
93c559
%{dynload_dir}/_xxtestfuzz.%{SOABI_debug}.so
93c559
%{dynload_dir}/zlib.%{SOABI_debug}.so
93c559
%{dynload_dir}/_zoneinfo.%{SOABI_debug}.so
93c559
93c559
# No need to split things out the "Makefile" and the config-32/64.h file as we
93c559
# do for the regular build above (bug 531901), since they're all in one package
93c559
# now; they're listed below, under "-devel":
93c559
93c559
%{_libdir}/%{py_INSTSONAME_debug}
93c559
93c559
# Analog of the -devel subpackage's files:
93c559
%{pylibdir}/config-%{LDVERSION_debug}-%{platform_triplet}
93c559
%{_includedir}/python%{LDVERSION_debug}
93c559
%{_bindir}/python%{LDVERSION_debug}-config
93c559
%{_bindir}/python%{LDVERSION_debug}-*-config
93c559
# Alternatives
93c559
%ghost %{_bindir}/python3-debug-config
93c559
93c559
%{_libdir}/libpython%{LDVERSION_debug}.so
93c559
%{_libdir}/libpython%{LDVERSION_debug}.so.%{py_SOVERSION}
93c559
%{_libdir}/pkgconfig/python-%{LDVERSION_debug}.pc
93c559
%{_libdir}/pkgconfig/python-%{LDVERSION_debug}-embed.pc
93c559
93c559
%if %{with rhel8_compat_shims}
93c559
%{_libexecdir}/platform-python-debug
93c559
%{_libexecdir}/platform-python%{LDVERSION_debug}
93c559
%{_libexecdir}/platform-python%{LDVERSION_debug}-config
93c559
%{_libexecdir}/platform-python%{LDVERSION_debug}-*-config
93c559
%endif
93c559
93c559
# Analog of the -tools subpackage's files:
93c559
#  None for now; we could build precanned versions that have the appropriate
93c559
# shebang if needed
93c559
93c559
# Analog  of the tkinter subpackage's files:
93c559
%{dynload_dir}/_tkinter.%{SOABI_debug}.so
93c559
93c559
# Analog  of the -test subpackage's files:
93c559
%{dynload_dir}/_ctypes_test.%{SOABI_debug}.so
93c559
%{dynload_dir}/_testbuffer.%{SOABI_debug}.so
93c559
%{dynload_dir}/_testcapi.%{SOABI_debug}.so
93c559
%{dynload_dir}/_testimportmultiple.%{SOABI_debug}.so
93c559
%{dynload_dir}/_testinternalcapi.%{SOABI_debug}.so
93c559
%{dynload_dir}/_testmultiphase.%{SOABI_debug}.so
93c559
93c559
%endif # with debug_build
93c559
93c559
# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from ldconfig
93c559
# See https://bugzilla.redhat.com/show_bug.cgi?id=562980
93c559
#
93c559
# The /usr/lib/rpm/redhat/macros defines %%__debug_package to use
93c559
# debugfiles.list, and it appears that everything below /usr/lib/debug and
93c559
# (/usr/src/debug) gets added to this file (via LISTFILES) in
93c559
# /usr/lib/rpm/find-debuginfo.sh
93c559
#
93c559
# Hence by installing it below /usr/lib/debug we ensure it is added to the
93c559
# -debuginfo subpackage
93c559
# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
93c559
# payload file would be unpackaged)
93c559
93c559
# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1476593
93c559
%undefine _debuginfo_subpackages
93c559
93c559
# ======================================================
93c559
# Finally, the changelog:
93c559
# ======================================================
93c559
93c559
%changelog
1f0454
* Tue Dec 13 2022 Charalampos Stratakis <cstratak@redhat.com> - 3.9.16-1
1f0454
- Update to 3.9.16
1f0454
- Security fix for CVE-2022-45061
1f0454
Resolves: rhbz#2144072
1f0454
1f0454
* Mon Nov 07 2022 Lumír Balhar <lbalhar@redhat.com> - 3.9.14-2
1f0454
- Fix for CVE-2022-42919
1f0454
Resolves: rhbz#2138705
1f0454
1f0454
* Mon Sep 12 2022 Charalampos Stratakis <cstratak@redhat.com> - 3.9.14-1
1f0454
- Update to 3.9.14
1f0454
- Security fixes for CVE-2020-10735 and CVE-2021-28861
1f0454
Resolves: rhbz#1834423, rhbz#2120642
1f0454
8f0bcc
* Tue Jun 14 2022 Charalampos Stratakis <cstratak@redhat.com> - 3.9.13-1
8f0bcc
- Update to 3.9.13
8f0bcc
- Security fix for CVE-2015-20107
8f0bcc
- Fix the test suite support for Expat >= 2.4.5
8f0bcc
Resolves: rhbz#2075390
8f0bcc
bde3fd
* Tue Sep 07 2021 Charalampos Stratakis <cstratak@redhat.com> - 3.9.7-1
bde3fd
- Update to 3.9.7
bde3fd
Resolves: rhbz#2003102
bde3fd
b1014d
* Thu Aug 05 2021 Tomas Orsava <torsava@redhat.com> - 3.9.6-2
b1014d
- Adjusted the postun scriptlets to enable upgrading to RHEL 9
b1014d
- Resolves: rhbz#1933055
b1014d
b1014d
* Tue Jul 27 2021 Charalampos Stratakis <cstratak@redhat.com> - 3.9.6-1
b1014d
- Update to 3.9.6
b1014d
- Fix CVE-2021-29921: Improper input validation of octal strings in the ipaddress module
b1014d
Resolves: rhbz#1957458
b1014d
b1014d
* Fri Apr 30 2021 Charalampos Stratakis <cstratak@redhat.com> - 3.9.2-2
b1014d
- Security fix for CVE-2021-3426: information disclosure via pydoc
b1014d
Resolves: rhbz#1935913
b1014d
b1014d
* Wed Mar 03 2021 Lumír Balhar <lbalhar@redhat.com> - 3.9.2-1
b1014d
- Update to 3.9.2 to fix CVE-2021-23336
b1014d
Resolves: rhbz#1928904
b1014d
93c559
* Wed Feb 10 2021 Charalampos Stratakis <cstratak@redhat.com> - 3.9.1-5
93c559
- Compile the debug build with -O0 instead of -Og
93c559
Resolves: rhbz#1926283
93c559
93c559
* Fri Feb 05 2021 Charalampos Stratakis <cstratak@redhat.com> - 3.9.1-4
93c559
- Add support for FIPS mode
93c559
Resolves: rhbz#1877430
93c559
93c559
* Wed Jan 27 2021 Tomas Orsava <torsava@redhat.com> - 3.9.1-3
93c559
- Security fix for CVE-2021-3177
93c559
- Resolves: rhbz#1918168, rhbz#1877430
93c559
93c559
* Wed Jan 06 2021 Tomas Orsava <torsava@redhat.com> - 3.9.1-2
93c559
- Convert from Fedora to the python39 module in RHEL8
93c559
- Resolves: rhbz#1877430
93c559
93c559
* Tue Dec 08 2020 Tomas Hrnciar <thrnciar@redhat.com> - 3.9.1-1
93c559
- Update to 3.9.1
93c559
93c559
* Fri Nov 27 2020 Tomas Hrnciar <thrnciar@redhat.com> - 3.9.1~rc1-1
93c559
- Update to 3.9.1rc1
93c559
93c559
* Tue Oct 06 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9.0-1
93c559
- Update to 3.9.0 final
93c559
93c559
* Fri Sep 25 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~rc2-2
93c559
- Use upstream architecture names on Fedora 34+
93c559
- https://fedoraproject.org/wiki/Changes/Python_Upstream_Architecture_Names
93c559
93c559
* Thu Sep 17 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~rc2-1
93c559
- Update to 3.9.0rc2
93c559
93c559
* Wed Aug 12 2020 Petr Viktorin <pviktori@redhat.com> - 3.9.0~rc1-2
93c559
- In sys.version and initial REPL message, list the source commit as "default"
93c559
93c559
* Tue Aug 11 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~rc1-1
93c559
- Update to 3.9.0rc1
93c559
93c559
* Mon Aug 03 2020 Lumír Balhar <lbalhar@redhat.com> - 3.9.0~b5-5
93c559
- Add support for upstream architectures' names (patch 353)
93c559
93c559
* Thu Jul 30 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~b5-4
93c559
- Make python3-libs installable without python3
93c559
  Resolves: rhbz#1862082
93c559
93c559
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.9.0~b5-3
93c559
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
93c559
93c559
* Fri Jul 24 2020 Lumír Balhar <lbalhar@redhat.com> - 3.9.0~b5-2
93c559
- Add versioned pathfix%%{pybasever}.py to main and non-main RPMs
93c559
93c559
* Mon Jul 20 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~b5-1
93c559
- Update to 3.9.0b5
93c559
93c559
* Thu Jul 16 2020 Marcel Plch <mplch@redhat.com> - 3.9.0~b4-2
93c559
- Remove large, autogenerated Python sources and redundant pycache levels to reduce filesystem footprint
93c559
93c559
* Sat Jul 04 2020 Tomas Hrnciar <thrnciar@redhat.com> - 3.9.0~b4-1
93c559
- Update to 3.9.0b4
93c559
93c559
* Wed Jun 10 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~b3-1
93c559
- Update to 3.9.0b3
93c559
93c559
* Tue Jun 09 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~b2-1
93c559
- Update to 3.9.0b2
93c559
93c559
* Fri May 29 2020 Petr Viktorin <pviktori@redhat.com> - 3.9.0~b1-4
93c559
- Add cherry-picks for bugs found in 3.9.0b1
93c559
93c559
* Thu May 21 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~b1-3
93c559
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python3.9
93c559
93c559
* Thu May 21 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~b1-2
93c559
- Bootstrap for https://fedoraproject.org/wiki/Changes/Python3.9
93c559
93c559
* Tue May 19 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~b1-1
93c559
- Update to Python 3.9.0b1
93c559
93c559
* Thu May 07 2020 Tomas Orsava <torsava@redhat.com> - 3.9.0~a6-2
93c559
- Rename from python39 to python3.9
93c559
93c559
* Tue Apr 28 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~a6-1
93c559
- Update to Python 3.9.0a6
93c559
93c559
* Tue Mar 24 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~a5-1
93c559
- Update to Python 3.9.0a5
93c559
93c559
* Thu Feb 27 2020 Marcel Plch <mplch@redhat.com> - 3.9.0~a4-1
93c559
- Update to Python 3.9.0a4
93c559
93c559
* Tue Feb 11 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~a3-2
93c559
- Update the ensurepip module to work with setuptools >= 45
93c559
93c559
* Mon Jan 27 2020 Victor Stinner <vstinner@python.org> - 3.9.0~a3-1
93c559
- Update to Python 3.9.0a3
93c559
93c559
* Thu Dec 19 2019 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~a2-1
93c559
- Rebased to Python 3.9.0a2
93c559
93c559
* Wed Dec 04 2019 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~a1-3
93c559
- Build Python with -fno-semantic-interposition for better performance
93c559
- https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup
93c559
93c559
* Thu Nov 28 2019 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~a1-2
93c559
- Don't remove the test.test_tools module
93c559
93c559
* Wed Nov 20 2019 Miro Hrončok <mhroncok@redhat.com> - 3.9.0~a1-1
93c559
- Rebased to Python 3.9.0a1
93c559
93c559
* Mon Oct 14 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.0-1
93c559
- Update to Python 3.8.0 final
93c559
93c559
* Tue Oct 01 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.0~rc1-1
93c559
- Rebased to Python 3.8.0rc1
93c559
93c559
* Sat Aug 31 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.0~b4-1
93c559
- Rebased to Python 3.8.0b4
93c559
- Enable Profile-guided optimization for all arches, not just x86 (#1741015)
93c559
93c559
* Mon Jul 29 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.0~b3-1
93c559
- Update to 3.8.0b3
93c559
93c559
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.0~b2-2
93c559
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
93c559
93c559
* Fri Jul 05 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.0~b2-1
93c559
- Update to 3.8.0b2
93c559
93c559
* Wed Jun 05 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.0~b1-1
93c559
- Update to 3.8.0b1
93c559
93c559
* Fri May 17 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.0~a4-2
93c559
- Remove a faulty patch that resulted in invalid value of
93c559
  distutils.sysconfig.get_config_var('LIBPL') (#1710767)
93c559
93c559
* Tue May 07 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.0~a4-1
93c559
- Update to 3.8.0a4
93c559
93c559
* Tue Mar 26 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.0~a3-1
93c559
- Update to 3.8.0a3
93c559
93c559
* Mon Feb 25 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.0~a2-1
93c559
- Update to 3.8.0a2
93c559
93c559
* Mon Feb 18 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.0~a1-3
93c559
- Reduced default build flags used to build extension modules
93c559
  https://fedoraproject.org/wiki/Changes/Python_Extension_Flags
93c559
93c559
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.8.0~a1-2
93c559
- Rebuild for readline 8.0
93c559
93c559
* Tue Feb 05 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.0~a1-1
93c559
- Update to 3.8.0a1