Blame SPECS/python3.9.spec

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