churchyard / rpms / python36

Forked from rpms/python36 5 years ago
Clone
043c574
# ==================
043c574
# Top-level metadata
043c574
# ==================
043c574
043c574
%global pybasever 3.6
c769a6b
043c574
# pybasever without the dot:
043c574
%global pyshortver 36
043c574
8bee8c4
Name: python%{pyshortver}
8bee8c4
Summary: Version %{pybasever} of the Python interpreter
8c67baf
URL: https://www.python.org/
8c67baf
b7855d3
#  WARNING  When rebasing to a new Python version,
b7855d3
#           remember to update the python3-docs package as well
Victor Stinner 761bbd3
%global general_version %{pybasever}.11
a4690dd
#global prerel ...
a4690dd
%global upstream_version %{general_version}%{?prerel}
a4690dd
Version: %{general_version}%{?prerel:~%{prerel}}
8129d49
Release: 4%{?dist}
043c574
License: Python
043c574
043c574
043c574
# ==================================
043c574
# Conditionals controlling the build
043c574
# ==================================
043c574
043c574
# Note that the bcond macros are named for the CLI option they create.
043c574
# "%%bcond_without" means "ENABLE by default and create a --without option"
043c574
8c67baf
# Flat package, i.e. python36, python37, python38 for tox etc.
8c67baf
# warning: changes some other defaults
8c67baf
# in Fedora, never turn this on for the python3 package
8c67baf
# and always keep it on for python36 etc.
8c67baf
# WARNING: This does not change the package name and summary above
8bee8c4
%bcond_without flatpackage
8c67baf
04c140d
# Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package
04c140d
# Uses upstream bundled prebuilt wheels otherwise
04c140d
%bcond_without rpmwheels
8c67baf
f63e273
# Expensive optimizations (mainly, profile-guided optimizations)
a7a170b
%ifarch %{ix86} x86_64
a7a170b
%bcond_without optimizations
a7a170b
%else
f63e273
# On some architectures, the optimized build takes tens of hours, possibly
f63e273
# longer than Koji's 24-hour timeout. Disable optimizations here.
a7a170b
%bcond_with optimizations
a7a170b
%endif
a7a170b
f63e273
# Run the test suite in %%check
043c574
%bcond_without tests
f63e273
f63e273
# Extra build for debugging the interpreter or C-API extensions
f63e273
# (the -debug subpackages)
8c67baf
%if %{with flatpackage}
8c67baf
%bcond_with debug_build
8c67baf
%else
043c574
%bcond_without debug_build
8c67baf
%endif
f63e273
f63e273
# Support for the GDB debugger
043c574
%bcond_without gdb_hooks
f63e273
f63e273
# The dbm.gnu module (key-value database)
043c574
%bcond_without gdbm
f63e273
f63e273
# Main interpreter loop optimization
043c574
%bcond_without computed_gotos
043c574
f63e273
# Support for the Valgrind debugger/profiler
b9da5bc
%ifarch %{valgrind_arches}
043c574
%bcond_without valgrind
043c574
%else
043c574
%bcond_with valgrind
043c574
%endif
043c574
043c574
043c574
# ==================================
043c574
# Notes from bootstraping Python 3.6
043c574
# ==================================
Matej Stuchlik 95668bd
#
59c11e6
# New Python major version (3.X) break ABI and bytecode compatibility,
59c11e6
# so all packages depending on it need to be rebuilt.
59c11e6
#
afb0016
# Due to a dependency cycle between Python, gdb, rpm, pip, setuptools, wheel,
59c11e6
# and other packages, this isn't straightforward.
59c11e6
# Build in the following order:
Matej Stuchlik 95668bd
#
bb9ca6b
# 1. At the same time:
59c11e6
#     - gdb without python support (add %%global _without_python 1 on top of
59c11e6
#       gdb's SPEC file)
2d5b843
#     - python-rpm-generators
bb9ca6b
#       (this can be done also during step 2., but should be done before 3.)
59c11e6
# 2. python3 without rewheel (use %%bcond_with rewheel instead of
59c11e6
#     %%bcond_without)
2d5b843
# 3. gdb with python support (remove %%global _without_python 1 on top of
2d5b843
#    gdb's SPEC file)
afb0016
# 4. rpm
afb0016
# 5. python-setuptools with bootstrap set to 1
afb0016
# 6. python-pip with build_wheel set to 0
afb0016
# 7. python-wheel with %%bcond_without bootstrap
afb0016
# 8. python-setuptools with bootstrap set to 0 and also with_check set to 0
afb0016
# 9. python-pip with build_wheel set to 1
afb0016
# 10. pyparsing
59c11e6
# 11. python3 with rewheel
afb0016
#
59c11e6
# Then the most important packages have to be built, in dependency order.
59c11e6
# These were:
afb0016
#   python-sphinx, pytest, python-requests, cloud-init, dnf, anaconda, abrt
59c11e6
#
59c11e6
# After these have been built, a targeted rebuild should be done for the rest.
Matej Stuchlik 95668bd
Matej Stuchlik 11fb599
043c574
# =====================
043c574
# General global macros
043c574
# =====================
5080ffc
a3483f9
%global pylibdir %{_libdir}/python%{pybasever}
4aab458
%global dynload_dir %{pylibdir}/lib-dynload
a3483f9
0c74e11
# ABIFLAGS, LDVERSION and SOABI are in the upstream configure.ac
0c74e11
# See PEP 3149 for some background: http://www.python.org/dev/peps/pep-3149/
1c94c1a
%global ABIFLAGS_optimized m
1c94c1a
%global ABIFLAGS_debug     dm
5080ffc
5080ffc
%global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized}
5080ffc
%global LDVERSION_debug     %{pybasever}%{ABIFLAGS_debug}
5080ffc
Robert Kuska 08f3736
%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{_arch}-linux%{_gnu}
Robert Kuska 08f3736
%global SOABI_debug     cpython-%{pyshortver}%{ABIFLAGS_debug}-%{_arch}-linux%{_gnu}
5080ffc
0c74e11
# All bytecode files are in a __pycache__ subdirectory, with a name
0c74e11
# reflecting the version of the bytecode.
0c74e11
# See PEP 3147: http://www.python.org/dev/peps/pep-3147/
7eb10c8
# For example,
7eb10c8
#   foo/bar.py
0c74e11
# has bytecode at:
043c574
#   foo/__pycache__/bar.cpython-%%{pyshortver}.pyc
043c574
#   foo/__pycache__/bar.cpython-%%{pyshortver}.opt-1.pyc
3bbc2a0
#   foo/__pycache__/bar.cpython-%%{pyshortver}.opt-2.pyc
043c574
%global bytecode_suffixes .cpython-%{pyshortver}*.pyc
7eb10c8
d5a5bf3
# Python's configure script defines SOVERSION, and this is used in the Makefile
d5a5bf3
# to determine INSTSONAME, the name of the libpython DSO:
d5a5bf3
#   LDLIBRARY='libpython$(VERSION).so'
d5a5bf3
#   INSTSONAME="$LDLIBRARY".$SOVERSION
d5a5bf3
# We mirror this here in order to make it easier to add the -gdb.py hooks.
d5a5bf3
# (if these get out of sync, the payload of the libs subpackage will fail
d5a5bf3
# and halt the build)
d5a5bf3
%global py_SOVERSION 1.0
5080ffc
%global py_INSTSONAME_optimized libpython%{LDVERSION_optimized}.so.%{py_SOVERSION}
5080ffc
%global py_INSTSONAME_debug     libpython%{LDVERSION_debug}.so.%{py_SOVERSION}
d5a5bf3
1824b3e
# Disable automatic bytecompilation. The python3 binary is not yet be
1824b3e
# available in /usr/bin when Python is built. Also, the bytecompilation fails
1824b3e
# on files that test invalid syntax.
1824b3e
%undefine py_auto_byte_compile
7eb10c8
64593af
# For multilib support, files that are different between 32- and 64-bit arches
64593af
# need different filenames. Use "64" or "32" according to the word size.
4ced9a1
# Currently, the best way to determine an architecture's word size happens to
4ced9a1
# be checking %%{_lib}.
4ced9a1
%if "%{_lib}" == "lib64"
64593af
%global wordsize 64
64593af
%else
64593af
%global wordsize 32
64593af
%endif
64593af
64593af
c769a6b
# =======================
c769a6b
# Build-time requirements
c769a6b
# =======================
c769a6b
c769a6b
# (keep this list alphabetized)
c769a6b
c769a6b
BuildRequires: autoconf
81ac8c8
BuildRequires: bluez-libs-devel
c769a6b
BuildRequires: bzip2
c769a6b
BuildRequires: bzip2-devel
66c621f
BuildRequires: desktop-file-utils
33e1101
BuildRequires: expat-devel
5974f19
c769a6b
BuildRequires: findutils
c769a6b
BuildRequires: gcc-c++
043c574
%if %{with gdbm}
bcf86c3
BuildRequires: gdbm-devel
5fe31d8
%endif
b054080
BuildRequires: git-core
5915c90
BuildRequires: glibc-all-langpacks
c769a6b
BuildRequires: glibc-devel
c769a6b
BuildRequires: gmp-devel
a4690dd
BuildRequires: gnupg2
66c621f
BuildRequires: libappstream-glib
c769a6b
BuildRequires: libffi-devel
6ff303e
BuildRequires: libnsl2-devel
6ff303e
BuildRequires: libtirpc-devel
c769a6b
BuildRequires: libGL-devel
c769a6b
BuildRequires: libX11-devel
c769a6b
BuildRequires: ncurses-devel
66c621f
c769a6b
BuildRequires: pkgconfig
c769a6b
BuildRequires: readline-devel
242778f
BuildRequires: redhat-rpm-config >= 127
c769a6b
BuildRequires: sqlite-devel
47069ff
BuildRequires: gdb
c769a6b
54d40fa
BuildRequires: openssl-devel
cbd5d5d
c769a6b
BuildRequires: tar
c769a6b
BuildRequires: tcl-devel
c769a6b
BuildRequires: tix-devel
c769a6b
BuildRequires: tk-devel
c769a6b
043c574
%if %{with valgrind}
c769a6b
BuildRequires: valgrind-devel
c769a6b
%endif
c769a6b
f2b86e2
BuildRequires: xz-devel
c769a6b
BuildRequires: zlib-devel
c769a6b
51501f9
BuildRequires: /usr/bin/dtrace
51501f9
5f24f39
# workaround http://bugs.python.org/issue19804 (test_uuid requires ifconfig)
5f24f39
BuildRequires: /usr/sbin/ifconfig
5f24f39
04c140d
%if %{with rpmwheels}
04c140d
BuildRequires: python-setuptools-wheel
04c140d
BuildRequires: python-pip-wheel
Matej Stuchlik 11fb599
%endif
Matej Stuchlik 11fb599
c769a6b
c769a6b
# =======================
c769a6b
# Source code and patches
c769a6b
# =======================
c769a6b
a4690dd
Source0: %{url}ftp/python/%{general_version}/Python-%{upstream_version}.tar.xz
a4690dd
Source1: %{url}ftp/python/%{general_version}/Python-%{upstream_version}.tar.xz.asc
a4690dd
Source2: %{url}static/files/pubkeys.txt
a3483f9
3dbbc14
# A simple script to check timestamps of bytecode files
3dbbc14
# Run in check section with Python that is currently being built
b49696c
# Originally written by bkabrda
b49696c
Source8: check-pyc-timestamps.py
71040c9
860f392
# Desktop menu entry for idle3
860f392
Source10: idle3.desktop
860f392
860f392
# AppData file for idle3
860f392
Source11: idle3.appdata.xml
860f392
bf1e00d
# (Patches taken from github.com/fedora-python/cpython)
bf1e00d
bf1e00d
# 00001 # d06a8853cf4bae9e115f45e1d531d2dc152c5cc8
bf1e00d
# Fixup distutils/unixccompiler.py to remove standard library path from rpath
bf1e00d
# Was Patch0 in ivazquez' python3000 specfile
bf1e00d
Patch1: 00001-rpath.patch
bf1e00d
bf1e00d
# 00102 # 4a773a6f1c51615333cbae27982904a312777223
bf1e00d
# Change the various install paths to use /usr/lib64/ instead or /usr/lib/
bf1e00d
#
bf1e00d
# Only used when "%%{_lib}" == "lib64".
2c6abcc
Patch102: 00102-lib64.patch
c923b51
bf1e00d
# 00111 # f07cfb42e1868a3bba0890edf4a72beaeeae370c
bf1e00d
# Don't try to build a libpythonMAJOR.MINOR.a
bf1e00d
#
bf1e00d
# Downstream only: not appropriate for upstream.
bf1e00d
#
c4a5733
# See https://bugzilla.redhat.com/show_bug.cgi?id=556092
c923b51
Patch111: 00111-no-static-lib.patch
c923b51
bf1e00d
# 00132 # 75c270b8641ddff06c0edf7be7cc444e6debb6d7
bf1e00d
# Add rpmbuild hooks to unittest
bf1e00d
#
bf1e00d
# Add non-standard hooks to unittest for use in the "check" phase, when
0c8875f
# running selftests within the build:
0c8875f
#   @unittest._skipInRpmBuild(reason)
0c8875f
# for tests that hang or fail intermittently within the build environment, and:
0c8875f
#   @unittest._expectedFailureInRpmBuild
0c8875f
# for tests that always fail within the build environment
0c8875f
#
0c8875f
# The hooks only take effect if WITHIN_PYTHON_RPM_BUILD is set in the
0c8875f
# environment, which we set manually in the appropriate portion of the "check"
0c8875f
# phase below (and which potentially other python-* rpms could set, to reuse
0c8875f
# these unittest hooks in their own "check" phases)
0c8875f
Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch
0c8875f
bf1e00d
# 00155 # 0ef7ae83073c1bbe610d4678ed56ae775fd6e174
bf1e00d
# avoid allocating thunks in ctypes unless absolutely necessary
bf1e00d
#
8a28107
# Avoid allocating thunks in ctypes unless absolutely necessary, to avoid
8a28107
# generating SELinux denials on "import ctypes" and "import uuid" when
c4a5733
# embedding Python within httpd
c4a5733
# See https://bugzilla.redhat.com/show_bug.cgi?id=814391
8a28107
Patch155: 00155-avoid-ctypes-thunks.patch
8a28107
bf1e00d
# 00160 # f69288aba24c43c506c3e90e2aa658e436e76e72
bf1e00d
# Disable test_fs_holes in RPM build
bf1e00d
#
3b4dd24
# Python 3.3 added os.SEEK_DATA and os.SEEK_HOLE, which may be present in the
3b4dd24
# header files in the build chroot, but may not be supported in the running
3b4dd24
# kernel, hence we disable this test in an rpm build.
3b4dd24
# Adding these was upstream issue http://bugs.python.org/issue10142
823581e
Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch
3b4dd24
bf1e00d
# 00163 # 88e26259f7da12e17adb936815aa421d84c69f09
bf1e00d
# Disable parts of test_socket in RPM build
bf1e00d
#
48d2048
# Some tests within test_socket fail intermittently when run inside Koji;
48d2048
# disable them using unittest._skipInRpmBuild
48d2048
Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch
48d2048
bf1e00d
# 00170 # 5a71e038b7511727657466d7796cf9c11c67334a
bf1e00d
# In debug builds, try to print repr() when a C-level assert fails
bf1e00d
#
Robert Kuska a0e3ab8
# In debug builds, try to print repr() when a C-level assert fails in the
Robert Kuska a0e3ab8
# garbage collector (typically indicating a reference-counting error
Robert Kuska a0e3ab8
# somewhere else e.g in an extension module)
720c2ad
# The new macros/functions within gcmodule.c are hidden to avoid exposing
Robert Kuska a0e3ab8
# them within the extension API.
720c2ad
# Sent upstream: http://bugs.python.org/issue9263
720c2ad
# See https://bugzilla.redhat.com/show_bug.cgi?id=614680
Robert Kuska 86a9a20
Patch170: 00170-gc-assertions.patch
260ceea
bf1e00d
# 00189 # dd3bacdeb7a9c0c99ab78229d3f1aa4c9761efb4
bf1e00d
# Instead of bundled wheels, use our RPM packaged wheels
bf1e00d
#
bf1e00d
# We keep them in /usr/share/python-wheels
04c140d
Patch189: 00189-use-rpm-wheels.patch
cbd7e11
# The following versions of setuptools/pip are bundled when this patch is not applied.
cbd7e11
# The versions are written in Lib/ensurepip/__init__.py, this patch removes them.
cbd7e11
# When the bundled setuptools/pip wheel is updated, the patch no longer applies cleanly.
cbd7e11
# In such cases, the patch needs to be amended and the versions updated here:
cbd7e11
%global pip_version 18.1
cbd7e11
%global setuptools_version 40.6.2
486eb43
bf1e00d
# 00251 # 2eabd04356402d488060bc8fe316ad13fc8a3356
bf1e00d
# Change user install location
bf1e00d
#
332b947
# Set values of prefix and exec_prefix in distutils install command
332b947
# to /usr/local if executable is /usr/bin/python* and RPM build
bf1e00d
# is not detected to make pip and distutils install into separate location.
bf1e00d
#
46034c8
# Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
332b947
Patch251: 00251-change-user-install-location.patch
332b947
bf1e00d
# 00262 # eb17e4d0defe4a58be25df5128fda6eab53acbbb
bf1e00d
# PEP538 - Coerce legacy C locale
bf1e00d
#
3b36b49
# Backport of PEP 538: Coercing the legacy C locale to a UTF-8 based locale
3b36b49
# https://www.python.org/dev/peps/pep-0538/
3b36b49
# Fedora Change: https://fedoraproject.org/wiki/Changes/python3_c.utf-8_locale
3b36b49
# Original proposal: https://bugzilla.redhat.com/show_bug.cgi?id=1404918
3b36b49
Patch262: 00262-pep538_coerce_legacy_c_locale.patch
3b36b49
bf1e00d
# 00274 # 4f787db88208be509a31af7505b6118b267e2583
bf1e00d
# Upstream uses Debian-style architecture naming, change to match Fedora
9423d36
Patch274: 00274-fix-arch-names.patch
9423d36
bf1e00d
# 00292 # 7bee9c57be78ac9bb512ddc08b1f73271c494e4d
bf1e00d
# Restore PyExc_RecursionErrorInst symbol
bf1e00d
#
d623e92
# Restore the public PyExc_RecursionErrorInst symbol that was removed
d623e92
# from the 3.6.4 release upstream.
d623e92
# Reported upstream: https://bugs.python.org/issue30697
d623e92
Patch292: 00292-restore-PyExc_RecursionErrorInst-symbol.patch
d623e92
bf1e00d
# 00294 # dddeb1c65cb86057d5c44be91e7965e5681c87e0
bf1e00d
# Define TLS cipher suite on build time
bf1e00d
#
969d514
# Define TLS cipher suite on build time depending
969d514
# on the OpenSSL default cipher suite selection.
969d514
# Fixed upstream on CPython's 3.7 branch:
969d514
# https://bugs.python.org/issue31429
969d514
# See also: https://bugzilla.redhat.com/show_bug.cgi?id=1489816
969d514
Patch294: 00294-define-TLS-cipher-suite-on-build-time.patch
969d514
bf1e00d
# 00343 # 2f4ec09a1daea8357f6a4a73c9f68d3fed3b1b96
bf1e00d
# Fix test_faulthandler on GCC 10
bf1e00d
#
Victor Stinner 4cbb173
# bpo-38965: Fix faulthandler._stack_overflow() on GCC 10
Victor Stinner 4cbb173
# Fixed upstream and backported from the 3.7 branch:
Victor Stinner 4cbb173
# https://bugs.python.org/issue38965
Victor Stinner 4cbb173
# https://github.com/python/cpython/commit/f4a21d3b239bf4f4e4e2a8a5936b9b040645b246
Victor Stinner 4cbb173
#
Victor Stinner 4cbb173
# bpo-21131: Fix faulthandler.register(chain=True) stack (GH-15276)
Victor Stinner 4cbb173
# https://bugs.python.org/issue21131
Victor Stinner 4cbb173
# https://github.com/python/cpython/commit/ac827edc493d3ac3f5b9b0cc353df1d4b418a9aa
Victor Stinner 4cbb173
Patch343: 00343-faulthandler-gcc10.patch
Victor Stinner 4cbb173
f17eb5e
# 00351 # 62210578a7157342bd7cbf426f8934da31773c4d
f17eb5e
# Avoid infinite loop in the tarfile module
f17eb5e
#
f17eb5e
# Avoid infinite loop when reading specially crafted TAR files using the tarfile module
f17eb5e
# (CVE-2019-20907).
f17eb5e
# Fixed upstream: https://bugs.python.org/issue39017
f17eb5e
Patch351: 00351-avoid-infinite-loop-in-the-tarfile-module.patch
f17eb5e
744239c
# 00352 # 5253c417a23b3658fa115d2c72fa54b20293a31c
744239c
# Resolve hash collisions for IPv4Interface and IPv6Interface
744239c
#
744239c
# CVE-2020-14422
744239c
# The hash() methods of classes IPv4Interface and IPv6Interface had issue
744239c
# of generating constant hash values of 32 and 128 respectively causing hash collisions.
744239c
# The fix uses the hash() function to generate hash values for the objects
744239c
# instead of XOR operation.
744239c
# Fixed upstream: https://bugs.python.org/issue41004
744239c
Patch352: 00352-resolve-hash-collisions-for-ipv4interface-and-ipv6interface.patch
744239c
8129d49
# 00353 # f3c11e227c715450b3c1e945a5004e84cce41a58
8129d49
# Original names for architectures with different names downstream
8129d49
#
8129d49
# Pythons in RHEL/Fedora use different names for some architectures
8129d49
# than upstream and other distros (for example ppc64 vs. powerpc64).
8129d49
# See patch 274.
8129d49
# That means that an extension built with the default upstream settings
8129d49
# (on other distro or as an manylinux wheel) cannot be found by Python
8129d49
# on RHEL/Fedora because it has a different suffix.
8129d49
# This patch adds the original names to importlib so Python is able
8129d49
# to import extensions with an original architecture name in its
8129d49
# file name.
8129d49
#
8129d49
# WARNING: This patch has no effect on Python built with bootstrap
8129d49
# enabled because Python/importlib_external.h is not regenerated
8129d49
# and therefore Python during bootstrap contains importlib from
8129d49
# upstream without this feature. It's possible to include
8129d49
# Python/importlib_external.h to this patch but it'd make rebasing
8129d49
# a nightmare because it's basically a binary file.
8129d49
Patch353: 00353-Original-names-for-architectures-with-different-name.patch
8129d49
99ac2fc
# (New patches go here ^^^)
99ac2fc
#
77a5f91
# When adding new patches to "python" and "python3" in Fedora, EL, etc.,
77a5f91
# please try to keep the patch numbers in-sync between all specfiles.
99ac2fc
#
77a5f91
# More information, and a patch number catalog, is at:
99ac2fc
#
77a5f91
#     https://fedoraproject.org/wiki/SIGs/Python/PythonPatches
77a5f91
c969609
094ccc0
# ==========================================
094ccc0
# Descriptions, and metadata for subpackages
094ccc0
# ==========================================
a3483f9
bcf86c3
# People might want to dnf install pythonX.Y instead of pythonXY;
bcf86c3
# we enable this in both flat and nonflat package.
bcf86c3
Provides: python%{pybasever} = %{version}-%{release}
bcf86c3
8c67baf
%if %{without flatpackage}
8c67baf
094ccc0
# Packages with Python modules in standard locations automatically
094ccc0
# depend on python(abi). Provide that here.
a3483f9
Provides: python(abi) = %{pybasever}
a3483f9
26c1be5
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
26c1be5
f50a7d3
# In order to support multiple Python interpreters for development purposes,
8c67baf
# packages with the naming scheme flatpackage (e.g. python35) exist for
f50a7d3
# non-default versions of Python 3.
f50a7d3
# For consistency, and to keep the upgrade path clean, we Provide/Obsolete
f50a7d3
# these names here.
1768987
Provides: python%{pyshortver} = %{version}-%{release}
f50a7d3
# Note that using Obsoletes without package version is not standard practice.
f50a7d3
# Here we assert that *any* version of the system's default interpreter is
f50a7d3
# preferable to an "extra" interpreter. For example, python3-3.6.1 will
f50a7d3
# replace python36-3.6.2.
f50a7d3
Obsoletes: python%{pyshortver}
1768987
e522c84
# Shall be removed in Fedora 31
1f528da
# The release is bumped to 20, so we can do f27 platform-python updates
1f528da
# If the release in f27 ever goes >= 20, raise it here
1f528da
# If platform-python is ever reintroduced, make it higher version than this:
1f528da
%global platpyver 3.6.2-20
e522c84
Obsoletes: platform-python < %{platpyver}
e522c84
3a05665
# Previously, this was required for our rewheel patch to work.
3a05665
# This is technically no longer needed, but we keep it recommended
3a05665
# for the developer experience.
3a05665
Recommends: python3-setuptools
3a05665
Recommends: python3-pip
3a05665
3f778c4
# This prevents ALL subpackages built from this spec to require
3f778c4
# /usr/bin/python3*. Granularity per subpackage is impossible.
3f778c4
# It's intended for the libs package not to drag in the interpreter, see
3f778c4
# https://bugzilla.redhat.com/show_bug.cgi?id=1547131
3f778c4
# All others require %%{name} anyway.
3f778c4
%global __requires_exclude ^/usr/bin/python3
3f778c4
3f778c4
15a5ab1
# The description used both for the SRPM and the main `python3` subpackage:
a3483f9
%description
c2f8719
Python is an accessible, high-level, dynamically typed, interpreted programming
3bbc2a0
language, designed with an emphasis on code readability.
c2f8719
It includes an extensive standard library, and has a vast ecosystem of
c2f8719
third-party libraries.
6245861
af1dc26
The %{name} package provides the "python3" executable: the reference
15a5ab1
interpreter for the Python language, version 3.
c2f8719
The majority of its standard library is provided in the %{name}-libs package,
c2f8719
which should be installed automatically along with %{name}.
c2f8719
The remaining parts of the Python standard library are broken out into the
c2f8719
%{name}-tkinter and %{name}-test packages, which may need to be installed
c2f8719
separately.
6245861
c2f8719
Documentation for Python is provided in the %{name}-docs package.
c2f8719
c2f8719
Packages containing additional libraries for Python are generally named with
c2f8719
the "%{name}-" prefix.
6245861
a3483f9
a3483f9
%package libs
6245861
Summary:        Python runtime libraries
a3483f9
04c140d
%if %{with rpmwheels}
04c140d
Requires: python-setuptools-wheel
04c140d
Requires: python-pip-wheel
04c140d
%else
cbd7e11
Provides: bundled(python3dist(pip)) = %{pip_version}
cbd7e11
Provides: bundled(python3dist(setuptools)) = %{setuptools_version}
04c140d
%endif
04c140d
3f778c4
# There are files in the standard library that have python shebang.
3f778c4
# We've filtered the automatic requirement out so libs are installable without
3f778c4
# the main package. This however makes it pulled in by default.
3f778c4
# See https://bugzilla.redhat.com/show_bug.cgi?id=1547131
3f778c4
Recommends: %{name}%{?_isa} = %{version}-%{release}
3f778c4
e522c84
# Shall be removed in Fedora 31
e522c84
Obsoletes: platform-python-libs < %{platpyver}
e522c84
Obsoletes: platform-python-libs-devel < %{platpyver}
e522c84
a3483f9
%description libs
6245861
This package contains runtime libraries for use by Python:
c2f8719
- the majority of the Python standard library
c2f8719
- a dynamically linked library for use by applications that embed Python as
c2f8719
  a scripting language, and by the main "python3" executable
c2f8719
a3483f9
a3483f9
%package devel
6245861
Summary: Libraries and header files needed for Python development
c75d3be
Requires: %{name} = %{version}-%{release}
c75d3be
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Orion Poplawski 1eeebcf
BuildRequires: python-rpm-macros
Orion Poplawski 1eeebcf
Requires: python-rpm-macros
Orion Poplawski 1eeebcf
Requires: python3-rpm-macros
bb9ca6b
Requires: python3-rpm-generators
71718b6
d938460
Provides: %{name}-2to3 = %{version}-%{release}
d938460
Provides: 2to3 = %{version}-%{release}
d938460
a3483f9
Conflicts: %{name} < %{version}-%{release}
a3483f9
e522c84
# Shall be removed in Fedora 31
e522c84
Obsoletes: platform-python-devel < %{platpyver}
e522c84
a3483f9
%description devel
c2f8719
This package contains the header files and configuration needed to compile
c2f8719
Python extension modules (typically written in C or C++), to embed Python
c2f8719
into other programs, and to make binary distributions for Python libraries.
c2f8719
d938460
It also contains the necessary macros to build RPM packages with Python modules
d938460
and 2to3 tool, an automatic source converter from Python 2.X.
6245861
a3483f9
d938460
%package idle
d938460
Summary: A basic graphical development environment for Python
a3483f9
Requires: %{name} = %{version}-%{release}
a3483f9
Requires: %{name}-tkinter = %{version}-%{release}
a3483f9
b0aea52
Provides: idle3 = %{version}-%{release}
b0aea52
d938460
Provides: %{name}-tools = %{version}-%{release}
d938460
Provides: %{name}-tools%{?_isa} = %{version}-%{release}
d938460
Obsoletes: %{name}-tools < %{version}-%{release}
357f40b
e522c84
# Shall be removed in Fedora 31
e522c84
Obsoletes: platform-python-tools < %{platpyver}
e522c84
d938460
%description idle
d938460
IDLE is Python’s Integrated Development and Learning Environment.
d938460
d938460
IDLE has the following features: Python shell window (interactive
d938460
interpreter) with colorizing of code input, output, and error messages;
d938460
multi-window text editor with multiple undo, Python colorizing,
d938460
smart indent, call tips, auto completion, and other features;
d938460
search within any window, replace within editor windows, and
d938460
search through multiple files (grep); debugger with persistent
d938460
breakpoints, stepping, and viewing of global and local namespaces;
d938460
configuration, browsers, and other dialogs.
c2f8719
a3483f9
a3483f9
%package tkinter
6245861
Summary: A GUI toolkit for Python
a3483f9
Requires: %{name} = %{version}-%{release}
a3483f9
e522c84
# Shall be removed in Fedora 31
e522c84
Obsoletes: platform-python-tkinter < %{platpyver}
e522c84
a3483f9
%description tkinter
c2f8719
The Tkinter (Tk interface) library is a graphical user interface toolkit for
c2f8719
the Python programming language.
c2f8719
a3483f9
a3483f9
%package test
c2f8719
Summary: The self-test suite for the main python3 package
a3483f9
Requires: %{name} = %{version}-%{release}
a3483f9
e522c84
# Shall be removed in Fedora 31
e522c84
Obsoletes: platform-python-test < %{platpyver}
c2f8719
a3483f9
%description test
c2f8719
The self-test suite for the Python interpreter.
c2f8719
c2f8719
This is only useful to test Python itself. For testing general Python code,
c2f8719
you should use the unittest module from %{name}-libs, or a library such as
2bcebb2
%{name}-pytest or %{name}-nose.
a3483f9
a3483f9
043c574
%if %{with debug_build}
55cf580
%package debug
6245861
Summary: Debug version of the Python runtime
55cf580
55cf580
# The debug build is an all-in-one package version of the regular build, and
3bbc2a0
# shares the same .py/.pyc files and directories as the regular build. Hence
55cf580
# we depend on all of the subpackages of the regular build:
55cf580
Requires: %{name}%{?_isa} = %{version}-%{release}
55cf580
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
55cf580
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
55cf580
Requires: %{name}-test%{?_isa} = %{version}-%{release}
55cf580
Requires: %{name}-tkinter%{?_isa} = %{version}-%{release}
d938460
Requires: %{name}-idle%{?_isa} = %{version}-%{release}
55cf580
55cf580
%description debug
6245861
python3-debug provides a version of the Python runtime with numerous debugging
c2f8719
features enabled, aimed at advanced Python users such as developers of Python
55cf580
extension modules.
55cf580
6245861
This version uses more memory and will be slower than the regular Python build,
c2f8719
but is useful for tracking down reference-counting issues and other bugs.
55cf580
c2f8719
The bytecode format is unchanged, so that .pyc files are compatible between
c2f8719
this and the standard version of Python, but the debugging features mean that
c2f8719
C/C++ extension modules are ABI-incompatible and must be built for each version
c2f8719
separately.
55cf580
c2f8719
The debug build shares installation directories with the standard Python
c2f8719
runtime, so that .py and .pyc files can be shared.
c2f8719
Compiled extension modules use a special ABI flag ("d") in the filename,
3bbc2a0
so extensions for both versions can co-exist in the same directory.
043c574
%endif # with debug_build
55cf580
8c67baf
%else  # with flatpackage
8c67baf
8c67baf
# We'll not provide this, on purpose
8c67baf
# No package in Fedora shall ever depend on flatpackage via this
8c67baf
%global __requires_exclude ^python\\(abi\\) = 3\\..$
8c67baf
%global __provides_exclude ^python\\(abi\\) = 3\\..$
8c67baf
04c140d
%if %{with rpmwheels}
04c140d
Requires: python-setuptools-wheel
04c140d
Requires: python-pip-wheel
04c140d
%else
cbd7e11
Provides: bundled(python3dist(pip)) = %{pip_version}
cbd7e11
Provides: bundled(python3dist(setuptools)) = %{setuptools_version}
04c140d
%endif
8c67baf
8c67baf
# The description for the flat package
8c67baf
%description
8c67baf
Python %{pybasever} package for developers.
8c67baf
8c67baf
This package exists to allow developers to test their code against an older
8c67baf
version of Python. This is not a full Python stack and if you wish to run
8c67baf
your applications with Python %{pybasever}, see other distributions
8c67baf
that support it, such as CentOS or RHEL with Software Collections
8c67baf
or older Fedora releases.
8c67baf
8c67baf
%endif # with flatpackage
c2f8719
c769a6b
# ======================================================
c769a6b
# The prep phase of the build:
c769a6b
# ======================================================
c769a6b
a3483f9
%prep
a4690dd
%gpgverify -k2 -s1 -d0
b054080
%autosetup -S git_am -N -n Python-%{upstream_version}
6859f23
b054080
# Apply initial patches manually
b054080
%apply_patch -q %{PATCH1}
7eb10c8
a3483f9
%if "%{_lib}" == "lib64"
b054080
%apply_patch -q %{PATCH102}
a3483f9
%endif
b054080
b054080
%apply_patch -q %{PATCH111}
b054080
%apply_patch -q %{PATCH132}
b054080
%apply_patch -q %{PATCH155}
b054080
%apply_patch -q %{PATCH160}
b054080
%apply_patch -q %{PATCH163}
b054080
%apply_patch -q %{PATCH170}
0c8875f
04c140d
%if %{with rpmwheels}
b054080
%apply_patch -q %{PATCH189}
04c140d
rm Lib/ensurepip/_bundled/*.whl
Matej Stuchlik 11fb599
%endif
Matej Stuchlik 11fb599
b054080
# Apply the remaining patches
b054080
%autopatch -m 190
27c558e
b054080
# Remove bundled libraries to ensure that we're using the system copy.
b054080
rm -r Modules/expat
b054080
rm -r Modules/zlib
0efd3d3
96a7bd5
# Remove files that should be generated by the build
96a7bd5
# (This is after patching, so that we can use patches directly from upstream)
96a7bd5
rm configure pyconfig.h.in
96a7bd5
96a7bd5
c769a6b
# ======================================================
c769a6b
# Configuring and building the code:
c769a6b
# ======================================================
c769a6b
a3483f9
%build
96a7bd5
96a7bd5
# Regenerate the configure script and pyconfig.h.in
96a7bd5
autoconf
96a7bd5
autoheader
96a7bd5
db2797c
# Remember the current directory (which has sources and the configure script),
db2797c
# so we can refer to it after we "cd" elsewhere.
55cf580
topdir=$(pwd)
db2797c
db2797c
# Get proper option names from bconds
db2797c
%if %{with computed_gotos}
db2797c
%global computed_gotos_flag yes
db2797c
%else
db2797c
%global computed_gotos_flag no
db2797c
%endif
db2797c
db2797c
%if %{with optimizations}
db2797c
%global optimizations_flag "--enable-optimizations"
db2797c
%else
db2797c
%global optimizations_flag "--disable-optimizations"
db2797c
%endif
db2797c
db2797c
# Set common compiler/linker flags
242778f
# We utilize the %%extension_...flags macros here so users building C/C++
242778f
# extensions with our python won't get all the compiler/linker flags used
242778f
# in Fedora RPMs.
242778f
# Standard library built here will still use the %%build_...flags,
242778f
# Fedora packages utilizing %%py3_build will use them as well
242778f
# https://fedoraproject.org/wiki/Changes/Python_Extension_Flags
242778f
export CFLAGS="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
242778f
export CFLAGS_NODIST="%{build_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
242778f
export CXXFLAGS="%{extension_cxxflags} -D_GNU_SOURCE -fPIC -fwrapv"
db2797c
export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
242778f
export OPT="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv"
a3483f9
export LINKCC="gcc"
db2797c
export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
242778f
export LDFLAGS="%{extension_ldflags} -g $(pkg-config --libs-only-L openssl)"
242778f
export LDFLAGS_NODIST="%{build_ldflags} -g $(pkg-config --libs-only-L openssl)"
a3483f9
db2797c
# We can build several different configurations of Python: regular and debug.
db2797c
# Define a common function that does one build:
55cf580
BuildPython() {
Robert Kuska a0e3ab8
  ConfName=$1
db2797c
  ExtraConfigArgs=$2
db2797c
  MoreCFlags=$3
55cf580
db2797c
  # Each build is done in its own directory
55cf580
  ConfDir=build/$ConfName
db2797c
  echo STARTING: BUILD OF PYTHON FOR CONFIGURATION: $ConfName
55cf580
  mkdir -p $ConfDir
55cf580
  pushd $ConfDir
55cf580
db2797c
  # Normally, %%configure looks for the "configure" script in the current
db2797c
  # directory.
db2797c
  # Since we changed directories, we need to tell %%configure where to look.
55cf580
  %global _configure $topdir/configure
55cf580
c969609
%configure \
c969609
  --enable-ipv6 \
c969609
  --enable-shared \
043c574
  --with-computed-gotos=%{computed_gotos_flag} \
ecc5705
  --with-dbmliborder=gdbm:ndbm:bdb \
ecc5705
  --with-system-expat \
ecc5705
  --with-system-ffi \
b8daf73
  --enable-loadable-sqlite-extensions \
af1b222
  --with-dtrace \
3f69bcd
  --with-lto \
969d514
  --with-ssl-default-suites=openssl \
043c574
%if %{with valgrind}
31a06df
  --with-valgrind \
31a06df
%endif
55cf580
  $ExtraConfigArgs \
55cf580
  %{nil}
c969609
8129d49
  # Regenerate generated importlib frozen modules (see patch 353)
8129d49
  %make_build EXTRA_CFLAGS="$CFLAGS $MoreCFlags" regen-importlib
8129d49
db2797c
  # Invoke the build
c134c49
  %make_build EXTRA_CFLAGS="$CFLAGS $MoreCFlags"
a3483f9
55cf580
  popd
db2797c
  echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfName
55cf580
}
55cf580
db2797c
# Call the above to build each configuration.
55cf580
043c574
%if %{with debug_build}
55cf580
BuildPython debug \
db2797c
  "--without-ensurepip --with-pydebug" \
db2797c
  "-O0"
043c574
%endif # with debug_build
55cf580
55cf580
BuildPython optimized \
db2797c
  "--without-ensurepip %{optimizations_flag}" \
db2797c
  ""
55cf580
c769a6b
# ======================================================
c769a6b
# Installing the built code:
c769a6b
# ======================================================
a3483f9
a3483f9
%install
208332b
208332b
# As in %%build, remember the current directory
55cf580
topdir=$(pwd)
a3483f9
208332b
# We install a collection of hooks for gdb that make it easier to debug
208332b
# executables linked against libpython3* (such as /usr/bin/python3 itself)
208332b
#
208332b
# These hooks are implemented in Python itself (though they are for the version
208332b
# of python that gdb is linked with)
208332b
#
208332b
# gdb-archer looks for them in the same path as the ELF file or its .debug
208332b
# file, with a -gdb.py suffix.
208332b
# We put them next to the debug file, because ldconfig would complain if
208332b
# it found non-library files directly in /usr/lib/
208332b
# (see https://bugzilla.redhat.com/show_bug.cgi?id=562980)
208332b
#
208332b
# We'll put these files in the debuginfo package by installing them to e.g.:
208332b
#  /usr/lib/debug/usr/lib/libpython3.2.so.1.0.debug-gdb.py
208332b
# (note that the debug path is /usr/lib/debug for both 32/64 bit)
208332b
#
208332b
# See https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more
208332b
# information
208332b
208332b
%if %{with gdb_hooks}
208332b
DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
208332b
mkdir -p %{buildroot}$DirHoldingGdbPy
208332b
%endif # with gdb_hooks
208332b
6c51695
# Multilib support for pyconfig.h
6c51695
# 32- and 64-bit versions of pyconfig.h are different. For multilib support
6c51695
# (making it possible to install 32- and 64-bit versions simultaneously),
6c51695
# we need to install them under different filenames, and to make the common
6c51695
# "pyconfig.h" include the right file based on architecture.
6c51695
# See https://bugzilla.redhat.com/show_bug.cgi?id=192747
6c51695
# Filanames are defined here:
6c51695
%global _pyconfig32_h pyconfig-32.h
6c51695
%global _pyconfig64_h pyconfig-64.h
64593af
%global _pyconfig_h pyconfig-%{wordsize}.h
6c51695
208332b
# Use a common function to do an install for all our configurations:
55cf580
InstallPython() {
55cf580
Robert Kuska a0e3ab8
  ConfName=$1
55cf580
  PyInstSoName=$2
Matej Stuchlik 318f360
  MoreCFlags=$3
474cc9f
  LDVersion=$4
55cf580
208332b
  # Switch to the directory with this configuration's built files
55cf580
  ConfDir=build/$ConfName
55cf580
  echo STARTING: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName
55cf580
  mkdir -p $ConfDir
55cf580
  pushd $ConfDir
55cf580
c134c49
  %make_install EXTRA_CFLAGS="$MoreCFlags"
a3483f9
cfd3e15
  popd
55cf580
043c574
%if %{with gdb_hooks}
208332b
  # See comment on $DirHoldingGdbPy above
e49a729
  PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName-%{version}-%{release}.%{_arch}.debug-gdb.py
cfd3e15
  cp Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy
043c574
%endif # with gdb_hooks
55cf580
474cc9f
  # Rename the -devel script that differs on different arches to arch specific name
474cc9f
  mv %{buildroot}%{_bindir}/python${LDVersion}-{,`uname -m`-}config
474cc9f
  echo -e '#!/bin/sh\nexec `dirname $0`/python'${LDVersion}'-`uname -m`-config "$@"' > \
474cc9f
    %{buildroot}%{_bindir}/python${LDVersion}-config
474cc9f
  echo '[ $? -eq 127 ] && echo "Could not find python'${LDVersion}'-`uname -m`-config. Look around to see available arches." >&2' >> \
474cc9f
    %{buildroot}%{_bindir}/python${LDVersion}-config
474cc9f
    chmod +x %{buildroot}%{_bindir}/python${LDVersion}-config
474cc9f
6c51695
  # Make python3-devel multilib-ready
6c51695
  mv %{buildroot}%{_includedir}/python${LDVersion}/pyconfig.h \
6c51695
     %{buildroot}%{_includedir}/python${LDVersion}/%{_pyconfig_h}
6c51695
  cat > %{buildroot}%{_includedir}/python${LDVersion}/pyconfig.h << EOF
6c51695
#include <bits/wordsize.h>
6c51695
6c51695
#if __WORDSIZE == 32
e8fa184
#include "%{_pyconfig32_h}"
6c51695
#elif __WORDSIZE == 64
e8fa184
#include "%{_pyconfig64_h}"
6c51695
#else
6c51695
#error "Unknown word size"
6c51695
#endif
6c51695
EOF
6c51695
55cf580
  echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName
55cf580
}
55cf580
7c72174
# Install the "debug" build first; any common files will be overridden with
208332b
# later builds
043c574
%if %{with debug_build}
55cf580
InstallPython debug \
Matej Stuchlik 318f360
  %{py_INSTSONAME_debug} \
474cc9f
  -O0 \
ffaa0f3
  %{LDVERSION_debug}
043c574
%endif # with debug_build
55cf580
55cf580
# Now the optimized build:
55cf580
InstallPython optimized \
208332b
  %{py_INSTSONAME_optimized} \
474cc9f
  "" \
ffaa0f3
  %{LDVERSION_optimized}
55cf580
f86b3d1
# Install directories for additional packages
b3fc51b
install -d -m 0755 %{buildroot}%{pylibdir}/site-packages/__pycache__
f86b3d1
%if "%{_lib}" == "lib64"
f86b3d1
# The 64-bit version needs to create "site-packages" in /usr/lib/ (for
f86b3d1
# pure-Python modules) as well as in /usr/lib64/ (for packages with extension
f86b3d1
# modules).
f86b3d1
# Note that rpmlint will complain about hardcoded library path;
f86b3d1
# this is intentional.
f86b3d1
install -d -m 0755 %{buildroot}%{_prefix}/lib/python%{pybasever}/site-packages/__pycache__
f86b3d1
%endif
a3483f9
8c67baf
%if %{without flatpackage}
860f392
# add idle3 to menu
b3fc51b
install -D -m 0644 Lib/idlelib/Icons/idle_16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/idle3.png
b3fc51b
install -D -m 0644 Lib/idlelib/Icons/idle_32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/idle3.png
b3fc51b
install -D -m 0644 Lib/idlelib/Icons/idle_48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/idle3.png
b3fc51b
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE10}
860f392
860f392
# Install and validate appdata file
a93be81
mkdir -p %{buildroot}%{_metainfodir}
a93be81
cp -a %{SOURCE11} %{buildroot}%{_metainfodir}
a93be81
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/idle3.appdata.xml
8c67baf
%endif
860f392
6c51695
# Make sure distutils looks at the right pyconfig.h file
6c51695
# See https://bugzilla.redhat.com/show_bug.cgi?id=201434
824c34b
# Similar for sysconfig: sysconfig.get_config_h_filename tries to locate
824c34b
# pyconfig.h so it can be parsed, and needs to do this at runtime in site.py
6c51695
# when python starts up (see https://bugzilla.redhat.com/show_bug.cgi?id=653058)
824c34b
#
824c34b
# Split this out so it goes directly to the pyconfig-32.h/pyconfig-64.h
824c34b
# variants:
824c34b
sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \
824c34b
  %{buildroot}%{pylibdir}/distutils/sysconfig.py \
824c34b
  %{buildroot}%{pylibdir}/sysconfig.py
a3483f9
d938460
# Install pathfix.py to bindir
d938460
# See https://github.com/fedora-python/python-rpm-porting/issues/24
d938460
cp -p Tools/scripts/pathfix.py %{buildroot}%{_bindir}/
d938460
d7a3b52
# Install i18n tools to bindir
d7a3b52
# They are also in python2, so we version them
d7a3b52
# https://bugzilla.redhat.com/show_bug.cgi?id=1571474
d7a3b52
for tool in pygettext msgfmt; do
d7a3b52
  cp -p Tools/i18n/${tool}.py %{buildroot}%{_bindir}/${tool}%{pybasever}.py
d7a3b52
  ln -s ${tool}%{pybasever}.py %{buildroot}%{_bindir}/${tool}3.py
d7a3b52
done
d7a3b52
a3483f9
# Switch all shebangs to refer to the specific Python version.
Iryna Shcherbina 685fb7b
# This currently only covers files matching ^[a-zA-Z0-9_]+\.py$,
Iryna Shcherbina 685fb7b
# so handle files named using other naming scheme separately.
55cf580
LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \
55cf580
  Tools/scripts/pathfix.py \
6c5992e
  -i "%{_bindir}/python%{pybasever}" -pn \
6c5992e
  %{buildroot} \
d7a3b52
  %{buildroot}%{_bindir}/*%{pybasever}.py \
6c5992e
  %{?with_gdb_hooks:%{buildroot}$DirHoldingGdbPy/*.py}
0652b06
d938460
# Remove tests for python3-tools which was removed in
d938460
# https://bugzilla.redhat.com/show_bug.cgi?id=1312030
d938460
rm -rf %{buildroot}%{pylibdir}/test/test_tools
0652b06
a3483f9
# Remove shebang lines from .py files that aren't executable, and
a3483f9
# remove executability from .py files that don't have a shebang line:
71040c9
find %{buildroot} -name \*.py \
a3483f9
  \( \( \! -perm /u+x,g+x,o+x -exec sed -e '/^#!/Q 0' -e 'Q 1' {} \; \
a3483f9
  -print -exec sed -i '1d' {} \; \) -o \( \
a3483f9
  -perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \
a3483f9
  -exec chmod a-x {} \; \) \)
a3483f9
a3483f9
# Get rid of DOS batch files:
71040c9
find %{buildroot} -name \*.bat -exec rm {} \;
a3483f9
a3483f9
# Get rid of backup files:
71040c9
find %{buildroot}/ -name "*~" -exec rm -f {} \;
a3483f9
find . -name "*~" -exec rm -f {} \;
a3483f9
Thomas Spura 1c26b68
# Do bytecompilation with the newly installed interpreter.
Thomas Spura e6314e6
# This is similar to the script in macros.pybytecompile
Thomas Spura ae2fc1c
# compile *.pyc
Thomas Spura ae2fc1c
find %{buildroot} -type f -a -name "*.py" -print0 | \
Thomas Spura ae2fc1c
    LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
3dbbc14
    PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
b2fa007
    xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2], optimize=opt) for opt in range(3) for f in sys.argv[1:]]' || :
a3483f9
0652b06
# Since we have pathfix.py in bindir, this is created, but we don't want it
0652b06
rm -rf %{buildroot}%{_bindir}/__pycache__
0652b06
a3483f9
# Fixup permissions for shared libraries from non-standard 555 to standard 755:
d54a775
find %{buildroot} -perm 555 -exec chmod 755 {} \;
a3483f9
9640a7e
# Create "/usr/bin/python3-debug", a symlink to the python3 debug binary, to
c4a5733
# avoid the user having to know the precise version and ABI flags.
c4a5733
# See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=676748
8c67baf
%if %{with debug_build} && %{without flatpackage}
9640a7e
ln -s \
9640a7e
  %{_bindir}/python%{LDVERSION_debug} \
9640a7e
  %{buildroot}%{_bindir}/python3-debug
00fd884
%endif
9640a7e
8c67baf
%if %{with flatpackage}
8c67baf
# Remove stuff that would conflict with python3 package
8c67baf
rm %{buildroot}%{_bindir}/python3
8c67baf
rm %{buildroot}%{_bindir}/pydoc3
8c67baf
rm %{buildroot}%{_bindir}/pathfix.py
d7a3b52
rm %{buildroot}%{_bindir}/pygettext3.py
d7a3b52
rm %{buildroot}%{_bindir}/msgfmt3.py
8c67baf
rm %{buildroot}%{_bindir}/idle3
8c67baf
rm %{buildroot}%{_bindir}/python3-*
8c67baf
rm %{buildroot}%{_bindir}/pyvenv
8c67baf
rm %{buildroot}%{_bindir}/2to3*
8c67baf
rm %{buildroot}%{_libdir}/libpython3.so
8c67baf
rm %{buildroot}%{_mandir}/man1/python3.1*
8c67baf
rm %{buildroot}%{_libdir}/pkgconfig/python3.pc
8c67baf
%endif
7e7918a
c769a6b
# ======================================================
ec8375c
# Checks for packaging issues
c769a6b
# ======================================================
c769a6b
a3483f9
%check
3dbbc14
3dbbc14
# first of all, check timestamps of bytecode files
3dbbc14
find %{buildroot} -type f -a -name "*.py" -print0 | \
3dbbc14
    LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
3dbbc14
    PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
3dbbc14
    xargs -0 %{buildroot}%{_bindir}/python%{pybasever} %{SOURCE8}
3dbbc14
ec8375c
# Ensure that the curses module was linked against libncursesw.so, rather than
ec8375c
# libncurses.so
ec8375c
# See https://bugzilla.redhat.com/show_bug.cgi?id=539917
ec8375c
ldd %{buildroot}/%{dynload_dir}/_curses*.so \
ec8375c
    | grep curses \
ec8375c
    | grep libncurses.so && (echo "_curses.so linked against libncurses.so" ; exit 1)
ec8375c
ec8375c
# Ensure that the debug modules are linked against the debug libpython, and
ec8375c
# likewise for the optimized modules and libpython:
ec8375c
for Module in %{buildroot}/%{dynload_dir}/*.so ; do
ec8375c
    case $Module in
ec8375c
    *.%{SOABI_debug})
ec8375c
        ldd $Module | grep %{py_INSTSONAME_optimized} &&
ec8375c
            (echo Debug module $Module linked against optimized %{py_INSTSONAME_optimized} ; exit 1)
ec8375c
ec8375c
        ;;
ec8375c
    *.%{SOABI_optimized})
ec8375c
        ldd $Module | grep %{py_INSTSONAME_debug} &&
ec8375c
            (echo Optimized module $Module linked against debug %{py_INSTSONAME_debug} ; exit 1)
ec8375c
        ;;
ec8375c
    esac
ec8375c
done
ec8375c
ec8375c
# ======================================================
ec8375c
# Running the upstream test suite
ec8375c
# ======================================================
ec8375c
55cf580
topdir=$(pwd)
55cf580
CheckPython() {
Robert Kuska a0e3ab8
  ConfName=$1
5080ffc
  ConfDir=$(pwd)/build/$ConfName
55cf580
ac7a36c
  # The "modern" security policies are not handled gracefully by the test suite
ac7a36c
  # of an older Python version. This is fixed upstream for 3.7+.
ac7a36c
  # Instead of fixing the tests, we disable the system wide policy via:
ac7a36c
  export OPENSSL_CONF=/non-existing-file
ac7a36c
  # This is a compromise between skipping and fixing the ssl tests.
ac7a36c
55cf580
  echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
55cf580
5a48967
  # Note that we're running the tests using the version of the code in the
5a48967
  # builddir, not in the buildroot.
5db81fb
0c8875f
  # Run the upstream test suite, setting "WITHIN_PYTHON_RPM_BUILD" so that the
0c8875f
  # our non-standard decorators take effect on the relevant tests:
0c8875f
  #   @unittest._skipInRpmBuild(reason)
0c8875f
  #   @unittest._expectedFailureInRpmBuild
29b9689
  # test_faulthandler.test_register_chain currently fails on ppc64le and
29b9689
  #   aarch64, see upstream bug http://bugs.python.org/issue21131
0c8875f
  WITHIN_PYTHON_RPM_BUILD= \
9a778ac
  LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \
5b6a3e0
    -wW --slowest --findleaks \
Matej Stuchlik 318f360
    -x test_distutils \
bbf2225
    -x test_bdist_rpm \
be04920
    -x test_gdb \
29b9689
    %ifarch ppc64le aarch64
1b09295
    -x test_faulthandler \
8d54999
    %endif
4bc70e0
    %ifarch %{mips64}
1b09295
    -x test_ctypes \
4bc70e0
    %endif
be04920
    %ifarch ppc64le
be04920
    -x test_buffer \
Matej Stuchlik 1746188
    %endif
a3483f9
5db81fb
  echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
55cf580
55cf580
}
55cf580
043c574
%if %{with tests}
a5cef79
55cf580
# Check each of the configurations:
043c574
%if %{with debug_build}
55cf580
CheckPython debug
043c574
%endif # with debug_build
55cf580
CheckPython optimized
55cf580
043c574
%endif # with tests
a5cef79
55cf580
4aab458
%files
Iryna Shcherbina aba719b
%doc README.rst
8c67baf
8c67baf
%if %{without flatpackage}
a3483f9
%{_bindir}/pydoc*
a3483f9
%{_bindir}/python3
1c94c1a
%{_bindir}/pyvenv
a3483f9
%{_mandir}/*/*
8c67baf
%{_bindir}/pyvenv
8c67baf
%else
8c67baf
%{_bindir}/pydoc%{pybasever}
8c67baf
%{_mandir}/*/python%{pybasever}*
8c67baf
%endif
8c67baf
%{_bindir}/pyvenv-%{pybasever}
8c67baf
%{_bindir}/python%{pybasever}
8c67baf
%{_bindir}/python%{pybasever}m
26c1be5
8c67baf
%if %{without flatpackage}
26c1be5
%files libs
Iryna Shcherbina aba719b
%doc README.rst
8c67baf
%endif
60aba0a
11efc8e
%dir %{pylibdir}
11efc8e
%dir %{dynload_dir}
11efc8e
5a268c1
%license %{pylibdir}/LICENSE.txt
5a268c1
60aba0a
%{pylibdir}/lib2to3
8c67baf
%if %{without flatpackage}
60aba0a
%exclude %{pylibdir}/lib2to3/tests
8c67baf
%endif
60aba0a
60aba0a
%dir %{pylibdir}/unittest/
60aba0a
%dir %{pylibdir}/unittest/__pycache__/
60aba0a
%{pylibdir}/unittest/*.py
60aba0a
%{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes}
60aba0a
60aba0a
%dir %{pylibdir}/asyncio/
60aba0a
%dir %{pylibdir}/asyncio/__pycache__/
60aba0a
%{pylibdir}/asyncio/*.py
60aba0a
%{pylibdir}/asyncio/__pycache__/*%{bytecode_suffixes}
60aba0a
60aba0a
%dir %{pylibdir}/venv/
60aba0a
%dir %{pylibdir}/venv/__pycache__/
60aba0a
%{pylibdir}/venv/*.py
60aba0a
%{pylibdir}/venv/__pycache__/*%{bytecode_suffixes}
60aba0a
%{pylibdir}/venv/scripts
60aba0a
60aba0a
%{pylibdir}/wsgiref
60aba0a
%{pylibdir}/xmlrpc
60aba0a
60aba0a
%dir %{pylibdir}/ensurepip/
60aba0a
%dir %{pylibdir}/ensurepip/__pycache__/
60aba0a
%{pylibdir}/ensurepip/*.py
60aba0a
%{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes}
8c67baf
04c140d
%if %{with rpmwheels}
60aba0a
%exclude %{pylibdir}/ensurepip/_bundled
8c67baf
%else
8c67baf
%dir %{pylibdir}/ensurepip/_bundled
8c67baf
%{pylibdir}/ensurepip/_bundled/*.whl
8c67baf
%endif
60aba0a
60aba0a
%dir %{pylibdir}/test/
60aba0a
%dir %{pylibdir}/test/__pycache__/
60aba0a
%dir %{pylibdir}/test/support/
60aba0a
%dir %{pylibdir}/test/support/__pycache__/
60aba0a
%{pylibdir}/test/__init__.py
60aba0a
%{pylibdir}/test/__pycache__/__init__%{bytecode_suffixes}
60aba0a
%{pylibdir}/test/support/__init__.py
60aba0a
%{pylibdir}/test/support/__pycache__/__init__%{bytecode_suffixes}
60aba0a
60aba0a
%dir %{pylibdir}/concurrent/
60aba0a
%dir %{pylibdir}/concurrent/__pycache__/
60aba0a
%{pylibdir}/concurrent/*.py
60aba0a
%{pylibdir}/concurrent/__pycache__/*%{bytecode_suffixes}
60aba0a
60aba0a
%dir %{pylibdir}/concurrent/futures/
60aba0a
%dir %{pylibdir}/concurrent/futures/__pycache__/
60aba0a
%{pylibdir}/concurrent/futures/*.py
60aba0a
%{pylibdir}/concurrent/futures/__pycache__/*%{bytecode_suffixes}
60aba0a
60aba0a
%{pylibdir}/pydoc_data
60aba0a
1c8e9a6
%{dynload_dir}/_blake2.%{SOABI_optimized}.so
f7bd058
%{dynload_dir}/_md5.%{SOABI_optimized}.so
1c8e9a6
%{dynload_dir}/_sha1.%{SOABI_optimized}.so
f7bd058
%{dynload_dir}/_sha256.%{SOABI_optimized}.so
1c8e9a6
%{dynload_dir}/_sha3.%{SOABI_optimized}.so
f7bd058
%{dynload_dir}/_sha512.%{SOABI_optimized}.so
1c8e9a6
1b09295
%{dynload_dir}/_asyncio.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_bisect.%{SOABI_optimized}.so
1c94c1a
%{dynload_dir}/_bz2.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_codecs_cn.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_codecs_hk.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_codecs_iso2022.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_codecs_jp.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_codecs_kr.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_codecs_tw.%{SOABI_optimized}.so
1c94c1a
%{dynload_dir}/_crypt.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_csv.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_ctypes.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_curses.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_curses_panel.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_dbm.%{SOABI_optimized}.so
1c94c1a
%{dynload_dir}/_decimal.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_elementtree.%{SOABI_optimized}.so
043c574
%if %{with gdbm}
5080ffc
%{dynload_dir}/_gdbm.%{SOABI_optimized}.so
5fe31d8
%endif
5080ffc
%{dynload_dir}/_hashlib.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_heapq.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_json.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_lsprof.%{SOABI_optimized}.so
1c94c1a
%{dynload_dir}/_lzma.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_multibytecodec.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_multiprocessing.%{SOABI_optimized}.so
3aee76e
%{dynload_dir}/_opcode.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_pickle.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_posixsubprocess.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_random.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_socket.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_sqlite3.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_ssl.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_struct.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/array.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/audioop.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/binascii.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/cmath.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_datetime.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/fcntl.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/grp.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/math.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/mmap.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/nis.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/ossaudiodev.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/parser.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/pyexpat.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/readline.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/resource.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/select.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/spwd.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/syslog.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/termios.%{SOABI_optimized}.so
Matej Stuchlik abb2ff8
%{dynload_dir}/_testmultiphase.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/unicodedata.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/xxlimited.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/zlib.%{SOABI_optimized}.so
4aab458
13c4a4f
%dir %{pylibdir}/site-packages/
13c4a4f
%dir %{pylibdir}/site-packages/__pycache__/
1c8e9a6
%{pylibdir}/site-packages/README.txt
7eb10c8
%{pylibdir}/*.py
e1c7be0
%dir %{pylibdir}/__pycache__/
7eb10c8
%{pylibdir}/__pycache__/*%{bytecode_suffixes}
1c94c1a
1c94c1a
%dir %{pylibdir}/collections/
1c94c1a
%dir %{pylibdir}/collections/__pycache__/
1c94c1a
%{pylibdir}/collections/*.py
1c94c1a
%{pylibdir}/collections/__pycache__/*%{bytecode_suffixes}
5080ffc
5080ffc
%dir %{pylibdir}/ctypes/
e1c7be0
%dir %{pylibdir}/ctypes/__pycache__/
7eb10c8
%{pylibdir}/ctypes/*.py
7eb10c8
%{pylibdir}/ctypes/__pycache__/*%{bytecode_suffixes}
a3483f9
%{pylibdir}/ctypes/macholib
5080ffc
a3483f9
%{pylibdir}/curses
5080ffc
5080ffc
%dir %{pylibdir}/dbm/
e1c7be0
%dir %{pylibdir}/dbm/__pycache__/
7eb10c8
%{pylibdir}/dbm/*.py
7eb10c8
%{pylibdir}/dbm/__pycache__/*%{bytecode_suffixes}
5080ffc
a6cf423
%dir %{pylibdir}/distutils/
a6cf423
%dir %{pylibdir}/distutils/__pycache__/
a6cf423
%{pylibdir}/distutils/*.py
a6cf423
%{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes}
a6cf423
%{pylibdir}/distutils/README
a6cf423
%{pylibdir}/distutils/command
bbbc440
%exclude %{pylibdir}/distutils/command/wininst-*.exe
a6cf423
5080ffc
%dir %{pylibdir}/email/
e1c7be0
%dir %{pylibdir}/email/__pycache__/
7eb10c8
%{pylibdir}/email/*.py
7eb10c8
%{pylibdir}/email/__pycache__/*%{bytecode_suffixes}
a3483f9
%{pylibdir}/email/mime
1c94c1a
%doc %{pylibdir}/email/architecture.rst
5080ffc
a3483f9
%{pylibdir}/encodings
cb97d29
a3483f9
%{pylibdir}/html
a3483f9
%{pylibdir}/http
5080ffc
5080ffc
%dir %{pylibdir}/importlib/
e1c7be0
%dir %{pylibdir}/importlib/__pycache__/
7eb10c8
%{pylibdir}/importlib/*.py
7eb10c8
%{pylibdir}/importlib/__pycache__/*%{bytecode_suffixes}
5080ffc
5080ffc
%dir %{pylibdir}/json/
e1c7be0
%dir %{pylibdir}/json/__pycache__/
7eb10c8
%{pylibdir}/json/*.py
7eb10c8
%{pylibdir}/json/__pycache__/*%{bytecode_suffixes}
5080ffc
a3483f9
%{pylibdir}/logging
a3483f9
%{pylibdir}/multiprocessing
5080ffc
5080ffc
%dir %{pylibdir}/sqlite3/
e1c7be0
%dir %{pylibdir}/sqlite3/__pycache__/
7eb10c8
%{pylibdir}/sqlite3/*.py
7eb10c8
%{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes}
5080ffc
8c67baf
%if %{without flatpackage}
5080ffc
%exclude %{pylibdir}/turtle.py
5080ffc
%exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes}
8c67baf
%endif
5080ffc
a3483f9
%{pylibdir}/urllib
347356c
%{pylibdir}/xml
1c94c1a
a3483f9
%if "%{_lib}" == "lib64"
37de674
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}
37de674
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages
13c4a4f
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages/__pycache__/
a3483f9
%endif
a3483f9
a3483f9
# "Makefile" and the config-32/64.h file are needed by
a3483f9
# distutils/sysconfig.py:_init_posix(), so we include them in the core
a3483f9
# package, along with their parent directories (bug 531901):
bea97d9
%dir %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/
bea97d9
%{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/Makefile
5080ffc
%dir %{_includedir}/python%{LDVERSION_optimized}/
5080ffc
%{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h}
a3483f9
Robert Kuska 0837458
%{_libdir}/%{py_INSTSONAME_optimized}
8c67baf
%if %{without flatpackage}
34c15c7
%{_libdir}/libpython3.so
8c67baf
%endif
a3483f9
8c67baf
%if %{without flatpackage}
a3483f9
%files devel
d938460
%{_bindir}/2to3
d938460
# TODO: Remove 2to3-3.7 once rebased to 3.7
d938460
%{_bindir}/2to3-%{pybasever}
8c67baf
%endif
8c67baf
bea97d9
%{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/*
8c67baf
%if %{without flatpackage}
bea97d9
%exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/Makefile
8c67baf
%exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h}
8c67baf
%endif
bbbc440
%{pylibdir}/distutils/command/wininst-*.exe
5080ffc
%{_includedir}/python%{LDVERSION_optimized}/*.h
a3483f9
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
8c67baf
8c67baf
%if %{without flatpackage}
a3483f9
%{_bindir}/python3-config
8c67baf
%{_libdir}/pkgconfig/python3.pc
8c67baf
%{_bindir}/pathfix.py
d7a3b52
%{_bindir}/pygettext3.py
d7a3b52
%{_bindir}/msgfmt3.py
8c67baf
%endif
8c67baf
d7a3b52
%{_bindir}/pygettext%{pybasever}.py
d7a3b52
%{_bindir}/msgfmt%{pybasever}.py
d7a3b52
a3483f9
%{_bindir}/python%{pybasever}-config
5080ffc
%{_bindir}/python%{LDVERSION_optimized}-config
f188880
%{_bindir}/python%{LDVERSION_optimized}-*-config
5080ffc
%{_libdir}/libpython%{LDVERSION_optimized}.so
5080ffc
%{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc
55cf580
%{_libdir}/pkgconfig/python-%{pybasever}.pc
a3483f9
8c67baf
%if %{without flatpackage}
d938460
%files idle
8c67baf
a3483f9
%{_bindir}/idle*
8c67baf
%else
8c67baf
%{_bindir}/idle%{pybasever}
8c67baf
%endif
8c67baf
d938460
%{pylibdir}/idlelib
8c67baf
8c67baf
%if %{without flatpackage}
a93be81
%{_metainfodir}/idle3.appdata.xml
860f392
%{_datadir}/applications/idle3.desktop
860f392
%{_datadir}/icons/hicolor/*/apps/idle3.*
8c67baf
%endif
a3483f9
8c67baf
%if %{without flatpackage}
a3483f9
%files tkinter
8c67baf
%endif
8c67baf
a3483f9
%{pylibdir}/tkinter
8c67baf
%if %{without flatpackage}
a3483f9
%exclude %{pylibdir}/tkinter/test
8c67baf
%endif
5080ffc
%{dynload_dir}/_tkinter.%{SOABI_optimized}.so
5080ffc
%{pylibdir}/turtle.py
5080ffc
%{pylibdir}/__pycache__/turtle*%{bytecode_suffixes}
5080ffc
%dir %{pylibdir}/turtledemo
5080ffc
%{pylibdir}/turtledemo/*.py
5080ffc
%{pylibdir}/turtledemo/*.cfg
5080ffc
%dir %{pylibdir}/turtledemo/__pycache__/
5080ffc
%{pylibdir}/turtledemo/__pycache__/*%{bytecode_suffixes}
a3483f9
8c67baf
%if %{without flatpackage}
a3483f9
%files test
8c67baf
%endif
a3483f9
%{pylibdir}/ctypes/test
a3483f9
%{pylibdir}/distutils/tests
a3483f9
%{pylibdir}/sqlite3/test
a3483f9
%{pylibdir}/test
5080ffc
%{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so
1c94c1a
%{dynload_dir}/_testbuffer.%{SOABI_optimized}.so
5080ffc
%{dynload_dir}/_testcapi.%{SOABI_optimized}.so
b282179
%{dynload_dir}/_testimportmultiple.%{SOABI_optimized}.so
a3483f9
%{pylibdir}/lib2to3/tests
a3483f9
%{pylibdir}/tkinter/test
e1c7be0
%{pylibdir}/unittest/test
a3483f9
55cf580
55cf580
# We don't bother splitting the debug build out into further subpackages:
55cf580
# if you need it, you're probably a developer.
55cf580
55cf580
# Hence the manifest is the combination of analogous files in the manifests of
55cf580
# all of the other subpackages
55cf580
043c574
%if %{with debug_build}
8c67baf
%if %{without flatpackage}
55cf580
%files debug
8c67baf
%{_bindir}/python3-debug
8c67baf
%endif
55cf580
55cf580
# Analog of the core subpackage's files:
5080ffc
%{_bindir}/python%{LDVERSION_debug}
55cf580
26c1be5
# Analog of the -libs subpackage's files:
55cf580
# ...with debug builds of the built-in "extension" modules:
f7bd058
1c8e9a6
%{dynload_dir}/_blake2.%{SOABI_debug}.so
f7bd058
%{dynload_dir}/_md5.%{SOABI_debug}.so
1c8e9a6
%{dynload_dir}/_sha1.%{SOABI_debug}.so
f7bd058
%{dynload_dir}/_sha256.%{SOABI_debug}.so
1c8e9a6
%{dynload_dir}/_sha3.%{SOABI_debug}.so
f7bd058
%{dynload_dir}/_sha512.%{SOABI_debug}.so
1c8e9a6
1b09295
%{dynload_dir}/_asyncio.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_bisect.%{SOABI_debug}.so
1c94c1a
%{dynload_dir}/_bz2.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_codecs_cn.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_codecs_hk.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_codecs_iso2022.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_codecs_jp.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_codecs_kr.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_codecs_tw.%{SOABI_debug}.so
1c94c1a
%{dynload_dir}/_crypt.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_csv.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_ctypes.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_curses.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_curses_panel.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_dbm.%{SOABI_debug}.so
1c94c1a
%{dynload_dir}/_decimal.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_elementtree.%{SOABI_debug}.so
043c574
%if %{with gdbm}
5080ffc
%{dynload_dir}/_gdbm.%{SOABI_debug}.so
5fe31d8
%endif
5080ffc
%{dynload_dir}/_hashlib.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_heapq.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_json.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_lsprof.%{SOABI_debug}.so
1c94c1a
%{dynload_dir}/_lzma.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_multibytecodec.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_multiprocessing.%{SOABI_debug}.so
3aee76e
%{dynload_dir}/_opcode.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_pickle.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_posixsubprocess.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_random.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_socket.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_sqlite3.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_ssl.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_struct.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/array.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/audioop.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/binascii.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/cmath.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_datetime.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/fcntl.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/grp.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/math.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/mmap.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/nis.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/ossaudiodev.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/parser.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/pyexpat.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/readline.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/resource.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/select.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/spwd.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/syslog.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/termios.%{SOABI_debug}.so
Matej Stuchlik abb2ff8
%{dynload_dir}/_testmultiphase.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/unicodedata.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/zlib.%{SOABI_debug}.so
55cf580
55cf580
# No need to split things out the "Makefile" and the config-32/64.h file as we
55cf580
# do for the regular build above (bug 531901), since they're all in one package
55cf580
# now; they're listed below, under "-devel":
55cf580
Robert Kuska 0837458
%{_libdir}/%{py_INSTSONAME_debug}
55cf580
55cf580
# Analog of the -devel subpackage's files:
bea97d9
%{pylibdir}/config-%{LDVERSION_debug}-%{_arch}-linux%{_gnu}
5080ffc
%{_includedir}/python%{LDVERSION_debug}
5080ffc
%{_bindir}/python%{LDVERSION_debug}-config
3a35e0b
%{_bindir}/python%{LDVERSION_debug}-*-config
5080ffc
%{_libdir}/libpython%{LDVERSION_debug}.so
Matej Stuchlik abb2ff8
%{_libdir}/libpython%{LDVERSION_debug}.so.1.0
5080ffc
%{_libdir}/pkgconfig/python-%{LDVERSION_debug}.pc
55cf580
55cf580
# Analog of the -tools subpackage's files:
55cf580
#  None for now; we could build precanned versions that have the appropriate
55cf580
# shebang if needed
55cf580
55cf580
# Analog  of the tkinter subpackage's files:
5080ffc
%{dynload_dir}/_tkinter.%{SOABI_debug}.so
55cf580
55cf580
# Analog  of the -test subpackage's files:
5080ffc
%{dynload_dir}/_ctypes_test.%{SOABI_debug}.so
1c94c1a
%{dynload_dir}/_testbuffer.%{SOABI_debug}.so
5080ffc
%{dynload_dir}/_testcapi.%{SOABI_debug}.so
b282179
%{dynload_dir}/_testimportmultiple.%{SOABI_debug}.so
55cf580
043c574
%endif # with debug_build
815994f
c4a5733
# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from ldconfig
c4a5733
# See https://bugzilla.redhat.com/show_bug.cgi?id=562980
Robert Kuska a0e3ab8
#
15a050e
# The /usr/lib/rpm/redhat/macros defines %%__debug_package to use
d5a5bf3
# debugfiles.list, and it appears that everything below /usr/lib/debug and
d5a5bf3
# (/usr/src/debug) gets added to this file (via LISTFILES) in
d5a5bf3
# /usr/lib/rpm/find-debuginfo.sh
Robert Kuska a0e3ab8
#
d5a5bf3
# Hence by installing it below /usr/lib/debug we ensure it is added to the
d5a5bf3
# -debuginfo subpackage
Robert Kuska a0e3ab8
# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
d5a5bf3
# payload file would be unpackaged)
d5a5bf3
c4a5733
# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1476593
c6fe5c6
%undefine _debuginfo_subpackages
d5a5bf3
c769a6b
# ======================================================
c769a6b
# Finally, the changelog:
c769a6b
# ======================================================
c769a6b
a3483f9
%changelog
8129d49
* Mon Aug 03 2020 Lumír Balhar <lbalhar@redhat.com> - 3.6.11-4
8129d49
- Add support for upstream architectures' names (patch 353)
8129d49
f17eb5e
* Fri Jul 31 2020 Charalampos Stratakis <cstratak@redhat.com> - 3.6.11-3
f17eb5e
- Avoid infinite loop when reading specially crafted TAR files (CVE-2019-20907)
f17eb5e
Resolves: rhbz#1856481
744239c
- Resolve hash collisions for Pv4Interface and IPv6Interface (CVE-2020-14422)
744239c
Resolves: rhbz#1854926
f17eb5e
534c9d3
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.11-2
534c9d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
534c9d3
Victor Stinner 761bbd3
* Wed Jul 01 2020 Petr Viktorin <pviktori@redhat.com> - 3.6.11-1
Victor Stinner 761bbd3
- Update to 3.6.11 final
Victor Stinner 761bbd3
Victor Stinner f337cd6
* Thu May 28 2020 Victor Stinner <vstinner@python.org> - 3.6.10-5
Victor Stinner f337cd6
- Fix python3-config --configdir (rhbz#1772988).
Victor Stinner f337cd6
c2158ae
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.10-2
c2158ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
c2158ae
5c307c1
* Fri Dec 20 2019 Miro Hrončok <mhroncok@redhat.com> - 3.6.10-1
5c307c1
- Update to 3.6.10
5c307c1
428ef5b
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.9-2
428ef5b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
428ef5b
d32d055
* Wed Jul 03 2019 Miro Hrončok <mhroncok@redhat.com> - 3.6.9-1
d32d055
- Update to 3.6.9
d32d055
242778f
* Mon Feb 18 2019 Miro Hrončok <mhroncok@redhat.com> - 3.6.8-6
242778f
- Reduced default build flags used to build extension modules
242778f
  https://fedoraproject.org/wiki/Changes/Python_Extension_Flags
242778f
de91971
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.6.8-5
de91971
- Rebuild for readline 8.0
de91971
7215bff
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.8-4
7215bff
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
7215bff
d9c9b90
* Wed Jan 23 2019 Patrik Kopkan <pkopkan@redhat.com> - 3.6.8-3
d9c9b90
- fix for CVE-2019-5010 (#1666519, #1666520)
d9c9b90
f5c9aee
* Mon Jan 14 2019 Björn Esser <besser82@fedoraproject.org> - 3.6.8-2
f5c9aee
- Rebuilt for libcrypt.so.2 (#1666033)
f5c9aee
0b48557
* Thu Dec 27 2018 Miro Hrončok <mhroncok@redhat.com> - 3.6.8-1
0b48557
- Update to 3.6.8
0b48557
7d12898
* Mon Oct 22 2018 Miro Hrončok <mhroncok@redhat.com> - 3.6.7-1
7d12898
- Update to 3.6.7
7d12898
4aa52bb
* Mon Sep 24 2018 Miro Hrončok <mhroncok@redhat.com> - 3.6.6-6
4aa52bb
- Security fix for CVE-2018-14647 (#1631822)
4aa52bb
d7a3b52
* Fri Aug 17 2018 Miro Hrončok <mhroncok@redhat.com> - 3.6.6-5
d7a3b52
- Add /usr/bin/pygettext3.py and msgfmt3.py to python3-devel
d7a3b52
Resolves: rhbz#1571474
d7a3b52
04c140d
* Wed Aug 15 2018 Miro Hrončok <mhroncok@redhat.com> - 3.6.6-4
04c140d
- Use RPM built wheels of pip and setuptools in ensurepip instead of our rewheel patch
04c140d
353f180
* Fri Aug 10 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.6.6-3
353f180
- Fix wrong requirement on gdbm
353f180
1d12e5b
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.6-2
1d12e5b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
1d12e5b
f35966c
* Tue Jul 10 2018 Charalampos Stratakis <cstratak@redhat.com> - 3.6.6-1
f35966c
- Update to Python 3.6.6
f35966c
bb5ad1d
* Mon Jun 18 2018 Miro Hrončok <mhroncok@redhat.com> - 3.6.5-5
bb5ad1d
- Introduce python36 package