Blame python3.spec

e32ce1
# ======================================================
e32ce1
# Conditionals and other variables controlling the build
e32ce1
# ======================================================
e32ce1
e32ce1
# NOTES ON BOOTSTRAPING PYTHON 3.4:
e32ce1
#
e32ce1
# Due to dependency cycle between Python, pip, setuptools and
e32ce1
# wheel caused by the rewheel patch, one has to build in the
e32ce1
# following order:
e32ce1
#
e32ce1
# 1) python3 with with_rewheel set to 0
e32ce1
# 2) python3-setuptools and python3-pip with with_rewheel set to 0
e32ce1
# 3) python3-wheel
e32ce1
# 4) python3-setuptools and python3-pip with with_rewheel set to 1
e32ce1
# 5) python3 with with_rewheel set to 1
e32ce1
5d8c89
%global with_rewheel 0
e32ce1
e32ce1
%global pybasever 3.4
e32ce1
e32ce1
# pybasever without the dot:
e32ce1
%global pyshortver 34
e32ce1
e32ce1
%global pylibdir %{_libdir}/python%{pybasever}
e32ce1
%global dynload_dir %{pylibdir}/lib-dynload
e32ce1
e32ce1
# SOABI is defined in the upstream configure.in from Python-3.2a2 onwards,
e32ce1
# for PEP 3149:
e32ce1
#   http://www.python.org/dev/peps/pep-3149/
e32ce1
e32ce1
# ("configure.in" became "configure.ac" in Python 3.3 onwards, and in
e32ce1
# backports)
e32ce1
e32ce1
# ABIFLAGS, LDVERSION and SOABI are in the upstream Makefile
e32ce1
# With Python 3.3, we lose the "u" suffix due to PEP 393
e32ce1
%global ABIFLAGS_optimized m
e32ce1
%global ABIFLAGS_debug     dm
e32ce1
e32ce1
%global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized}
e32ce1
%global LDVERSION_debug     %{pybasever}%{ABIFLAGS_debug}
e32ce1
e32ce1
%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}
e32ce1
%global SOABI_debug     cpython-%{pyshortver}%{ABIFLAGS_debug}
e32ce1
e32ce1
# All bytecode files are now in a __pycache__ subdirectory, with a name
e32ce1
# reflecting the version of the bytecode (to permit sharing of python libraries
e32ce1
# between different runtimes)
e32ce1
# See http://www.python.org/dev/peps/pep-3147/
e32ce1
# For example,
e32ce1
#   foo/bar.py
e32ce1
# now has bytecode at:
e32ce1
#   foo/__pycache__/bar.cpython-34.pyc
e32ce1
#   foo/__pycache__/bar.cpython-34.pyo
e32ce1
%global bytecode_suffixes .cpython-34.py?
e32ce1
e32ce1
# Python's configure script defines SOVERSION, and this is used in the Makefile
e32ce1
# to determine INSTSONAME, the name of the libpython DSO:
e32ce1
#   LDLIBRARY='libpython$(VERSION).so'
e32ce1
#   INSTSONAME="$LDLIBRARY".$SOVERSION
e32ce1
# We mirror this here in order to make it easier to add the -gdb.py hooks.
e32ce1
# (if these get out of sync, the payload of the libs subpackage will fail
e32ce1
# and halt the build)
e32ce1
%global py_SOVERSION 1.0
e32ce1
%global py_INSTSONAME_optimized libpython%{LDVERSION_optimized}.so.%{py_SOVERSION}
e32ce1
%global py_INSTSONAME_debug     libpython%{LDVERSION_debug}.so.%{py_SOVERSION}
e32ce1
e32ce1
%global with_debug_build 1
e32ce1
e32ce1
%global with_gdb_hooks 1
e32ce1
e32ce1
%global with_systemtap 1
e32ce1
e32ce1
# some arches don't have valgrind so we need to disable its support on them
e32ce1
%ifnarch s390
e32ce1
%global with_valgrind 1
e32ce1
%else
e32ce1
%global with_valgrind 0
e32ce1
%endif
e32ce1
e32ce1
%global with_gdbm 1
e32ce1
e32ce1
# Change from yes to no to turn this off
e32ce1
%global with_computed_gotos yes
e32ce1
e32ce1
# Turn this to 0 to turn off the "check" phase:
e32ce1
%global run_selftest_suite 1
e32ce1
e32ce1
# We want to byte-compile the .py files within the packages using the new
e32ce1
# python3 binary.
e32ce1
# 
e32ce1
# Unfortunately, rpmbuild's infrastructure requires us to jump through some
e32ce1
# hoops to avoid byte-compiling with the system python 2 version:
e32ce1
#   /usr/lib/rpm/redhat/macros sets up build policy that (amongst other things)
e32ce1
# defines __os_install_post.  In particular, "brp-python-bytecompile" is
e32ce1
# invoked without an argument thus using the wrong version of python
e32ce1
# (/usr/bin/python, rather than the freshly built python), thus leading to
e32ce1
# numerous syntax errors, and incorrect magic numbers in the .pyc files.  We
e32ce1
# thus override __os_install_post to avoid invoking this script:
e32ce1
%global __os_install_post /usr/lib/rpm/brp-compress \
e32ce1
  %{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}} \
e32ce1
  /usr/lib/rpm/brp-strip-static-archive %{__strip} \
e32ce1
  /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \
e32ce1
  /usr/lib/rpm/brp-python-hardlink 
e32ce1
# to remove the invocation of brp-python-bytecompile, whilst keeping the
e32ce1
# invocation of brp-python-hardlink (since this should still work for python3
e32ce1
# pyc/pyo files)
e32ce1
e32ce1
e32ce1
# We need to get a newer configure generated out of configure.in for the following
e32ce1
# patches:
e32ce1
#   patch 55 (systemtap)
e32ce1
#   patch 113 (more config flags)
e32ce1
#
e32ce1
# For patch 55 (systemtap), we need to get a new header for configure to use
e32ce1
#
e32ce1
# configure.in requires autoconf-2.65, but the version in Fedora is currently
e32ce1
# autoconf-2.66
e32ce1
#
e32ce1
# For now, we'll generate a patch to the generated configure script and
e32ce1
# pyconfig.h.in on a machine that has a local copy of autoconf 2.65
e32ce1
#
e32ce1
# Instructions on obtaining such a copy can be seen at
e32ce1
#   http://bugs.python.org/issue7997
e32ce1
#
e32ce1
# To make it easy to regenerate the patch, this specfile can be run in two
e32ce1
# ways:
e32ce1
# (i) regenerate_autotooling_patch  0 : the normal approach: prep the
e32ce1
# source tree using a pre-generated patch to the "configure" script, and do a
e32ce1
# full build
e32ce1
# (ii) regenerate_autotooling_patch 1 : intended to be run on a developer's
e32ce1
# workstation: prep the source tree without patching configure, then rerun a
e32ce1
# local copy of autoconf-2.65, regenerate the patch, then exit, without doing
e32ce1
# the rest of the build
e32ce1
%global regenerate_autotooling_patch 0
e32ce1
e32ce1
e32ce1
# ==================
e32ce1
# Top-level metadata
e32ce1
# ==================
e32ce1
Summary: Version 3 of the Python programming language aka Python 3000
e32ce1
Name: python3
e32ce1
Version: %{pybasever}.3
e32ce1
Release: 11%{?dist}
e32ce1
License: Python
e32ce1
Group: Development/Languages
e32ce1
e32ce1
e32ce1
# =======================
e32ce1
# Build-time requirements
e32ce1
# =======================
e32ce1
e32ce1
# (keep this list alphabetized)
e32ce1
e32ce1
BuildRequires: autoconf
e32ce1
BuildRequires: bluez-libs-devel
e32ce1
BuildRequires: bzip2
e32ce1
BuildRequires: bzip2-devel
e32ce1
BuildRequires: db4-devel >= 4.7
e32ce1
e32ce1
# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME.  We use
e32ce1
# it (in pyexpat) in order to enable the fix in Python-3.2.3 for CVE-2012-0876:
e32ce1
BuildRequires: expat-devel >= 2.1.0
e32ce1
e32ce1
BuildRequires: findutils
e32ce1
BuildRequires: gcc-c++
e32ce1
%if %{with_gdbm}
e32ce1
BuildRequires: gdbm-devel
e32ce1
%endif
e32ce1
BuildRequires: glibc-devel
e32ce1
BuildRequires: gmp-devel
e32ce1
BuildRequires: libffi-devel
e32ce1
BuildRequires: libGL-devel
e32ce1
BuildRequires: libX11-devel
e32ce1
BuildRequires: ncurses-devel
e32ce1
# workaround http://bugs.python.org/issue19804 (test_uuid requires ifconfig)
e32ce1
BuildRequires: net-tools
e32ce1
BuildRequires: openssl-devel
e32ce1
BuildRequires: pkgconfig
e32ce1
BuildRequires: readline-devel
e32ce1
BuildRequires: sqlite-devel
e32ce1
e32ce1
%if 0%{?with_systemtap}
e32ce1
BuildRequires: systemtap-sdt-devel
e32ce1
# (this introduces a dependency on "python", in that systemtap-sdt-devel's
e32ce1
# /usr/bin/dtrace is a python 2 script)
e32ce1
%global tapsetdir      /usr/share/systemtap/tapset
e32ce1
%endif # with_systemtap
e32ce1
e32ce1
BuildRequires: tar
e32ce1
BuildRequires: tcl-devel
e32ce1
BuildRequires: tix-devel
e32ce1
BuildRequires: tk-devel
e32ce1
e32ce1
%if 0%{?with_valgrind}
e32ce1
BuildRequires: valgrind-devel
e32ce1
%endif
e32ce1
e32ce1
BuildRequires: xz-devel
e32ce1
BuildRequires: zlib-devel
e32ce1
e32ce1
%if 0%{?with_rewheel}
e32ce1
BuildRequires: python3-setuptools
e32ce1
BuildRequires: python3-pip
e32ce1
%endif
e32ce1
e32ce1
e32ce1
# =======================
e32ce1
# Source code and patches
e32ce1
# =======================
e32ce1
e32ce1
Source: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
e32ce1
e32ce1
# Avoid having various bogus auto-generated Provides lines for the various
e32ce1
# python c modules' SONAMEs:
e32ce1
Source1: find-provides-without-python-sonames.sh
e32ce1
%global _use_internal_dependency_generator 0
e32ce1
%global __find_provides %{SOURCE1}
e32ce1
e32ce1
# Supply an RPM macro "py_byte_compile" for the python3-devel subpackage
e32ce1
# to enable specfiles to selectively byte-compile individual files and paths
e32ce1
# with different Python runtimes as necessary:
e32ce1
Source3: macros.pybytecompile%{pybasever}
e32ce1
e32ce1
# Systemtap tapset to make it easier to use the systemtap static probes
e32ce1
# (actually a template; LIBRARY_PATH will get fixed up during install)
e32ce1
# Written by dmalcolm; not yet sent upstream
e32ce1
Source5: libpython.stp
e32ce1
e32ce1
# Example systemtap script using the tapset
e32ce1
# Written by wcohen, mjw, dmalcolm; not yet sent upstream
e32ce1
Source6: systemtap-example.stp
e32ce1
e32ce1
# Another example systemtap script that uses the tapset
e32ce1
# Written by dmalcolm; not yet sent upstream
e32ce1
Source7: pyfuntop.stp
e32ce1
e32ce1
# A simple script to check timestamps of bytecode files
e32ce1
# Run in check section with Python that is currently being built
e32ce1
# Written by bkabrda
e32ce1
Source8: check-pyc-and-pyo-timestamps.py
e32ce1
e32ce1
# Fixup distutils/unixccompiler.py to remove standard library path from rpath:
e32ce1
# Was Patch0 in ivazquez' python3000 specfile:
e32ce1
Patch1:         Python-3.1.1-rpath.patch
e32ce1
e32ce1
# Some tests were removed due to audiotest.au not being packaged. This was
e32ce1
# however added to the archive in 3.3.1, so we no longer delete the tests.
e32ce1
#  Patch3: 00003-remove-mimeaudio-tests.patch
e32ce1
e32ce1
# 00055 #
e32ce1
# Systemtap support: add statically-defined probe points
e32ce1
# Patch sent upstream as http://bugs.python.org/issue14776
e32ce1
# with some subsequent reworking to cope with LANG=C in an rpmbuild
e32ce1
# (where sys.getfilesystemencoding() == 'ascii')
e32ce1
Patch55: 00055-systemtap.patch
e32ce1
e32ce1
Patch102: 00102-lib64.patch
e32ce1
e32ce1
# 00104 #
e32ce1
# Only used when "%{_lib}" == "lib64"
e32ce1
# Another lib64 fix, for distutils/tests/test_install.py; not upstream:
e32ce1
Patch104: 00104-lib64-fix-for-test_install.patch
e32ce1
e32ce1
# 00111 #
e32ce1
# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
e32ce1
# a libpythonMAJOR.MINOR.a (bug 550692):
e32ce1
# Downstream only: not appropriate for upstream
e32ce1
Patch111: 00111-no-static-lib.patch
e32ce1
e32ce1
# 00112 #
e32ce1
# Patch112: python-2.7rc1-debug-build.patch: this is not relevant to Python 3,
e32ce1
# for 3.2 onwards
e32ce1
e32ce1
# 00113 #
e32ce1
# Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options
e32ce1
# described at http://svn.python.org/projects/python/trunk/Misc/SpecialBuilds.txt
e32ce1
# so that if they are enabled, they will be in that build's pyconfig.h, so that
e32ce1
# extension modules will reliably use them
e32ce1
# Not yet sent upstream
e32ce1
Patch113: 00113-more-configuration-flags.patch
e32ce1
e32ce1
# 00114 #
e32ce1
# Upstream as of Python 3.4.0.b2
e32ce1
#  Patch114: 00114-statvfs-f_flag-constants.patch
e32ce1
e32ce1
# 00125 #
e32ce1
# COUNT_ALLOCS is useful for debugging, but the upstream behaviour of always
e32ce1
# emitting debug info to stdout on exit is too verbose and makes it harder to
e32ce1
# use the debug build.  Add a "PYTHONDUMPCOUNTS" environment variable which
e32ce1
# must be set to enable the output on exit
e32ce1
# Not yet sent upstream
e32ce1
Patch125: 00125-less-verbose-COUNT_ALLOCS.patch
e32ce1
e32ce1
# 00130 #
e32ce1
# Python 2's:
e32ce1
#   Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch
e32ce1
# is not relevant to Python 3 (for 3.2 onwards)
e32ce1
e32ce1
# 00131 #
e32ce1
# The four tests in test_io built on top of check_interrupted_write_retry
e32ce1
# fail when built in Koji, for ppc and ppc64; for some reason, the SIGALRM
e32ce1
# handlers are never called, and the call to write runs to completion
e32ce1
# (rhbz#732998)
e32ce1
Patch131: 00131-disable-tests-in-test_io.patch
e32ce1
e32ce1
# 00132 #
e32ce1
# Add non-standard hooks to unittest for use in the "check" phase below, when
e32ce1
# running selftests within the build:
e32ce1
#   @unittest._skipInRpmBuild(reason)
e32ce1
# for tests that hang or fail intermittently within the build environment, and:
e32ce1
#   @unittest._expectedFailureInRpmBuild
e32ce1
# for tests that always fail within the build environment
e32ce1
#
e32ce1
# The hooks only take effect if WITHIN_PYTHON_RPM_BUILD is set in the
e32ce1
# environment, which we set manually in the appropriate portion of the "check"
e32ce1
# phase below (and which potentially other python-* rpms could set, to reuse
e32ce1
# these unittest hooks in their own "check" phases)
e32ce1
Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch
e32ce1
e32ce1
# 00133 #
e32ce1
# 00133-skip-test_dl.patch is not relevant for python3: the "dl" module no
e32ce1
# longer exists
e32ce1
e32ce1
# 00134 #
e32ce1
# Fix a failure in test_sys.py when configured with COUNT_ALLOCS enabled
e32ce1
# Not yet sent upstream
e32ce1
Patch134: 00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
e32ce1
e32ce1
# 00135 #
e32ce1
# test_weakref's test_callback_in_cycle_resurrection doesn't work with
e32ce1
# COUNT_ALLOCS, as the metrics keep "C" alive.  Work around this for our
e32ce1
# debug build:
e32ce1
# Not yet sent upstream
e32ce1
Patch135: 00135-fix-test-within-test_weakref-in-debug-build.patch
e32ce1
e32ce1
# 00136 #
e32ce1
# Patch136: 00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch does not seem
e32ce1
# to be needed by python3
e32ce1
e32ce1
# 00137 #
e32ce1
# Some tests within distutils fail when run in an rpmbuild:
e32ce1
Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
e32ce1
e32ce1
# 00138 #
e32ce1
# Patch138: 00138-fix-distutils-tests-in-debug-build.patch is not relevant for
e32ce1
# python3
e32ce1
e32ce1
# 00139 #
e32ce1
# ARM-specific: skip known failure in test_float:
e32ce1
#  http://bugs.python.org/issue8265 (rhbz#706253)
e32ce1
Patch139: 00139-skip-test_float-known-failure-on-arm.patch
e32ce1
e32ce1
# ideally short lived patch disabling a test thats fragile on different arches
e32ce1
Patch140: python3-arm-skip-failing-fragile-test.patch
e32ce1
e32ce1
# Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch does not appear
e32ce1
# to be relevant for python3
e32ce1
e32ce1
# 00141 #
e32ce1
# Fix tests for case when  tests for case when configured with
e32ce1
# COUNT_ALLOCS (debug build): http://bugs.python.org/issue19527
e32ce1
# Applies to: test_gc, test_module, test_io, test_logging, test_warnings,
e32ce1
#             test_threading
e32ce1
Patch141: 00141-fix-tests_with_COUNT_ALLOCS.patch
e32ce1
e32ce1
# 00143 #
e32ce1
# Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid
e32ce1
# aliasing violations (rhbz#698726)
e32ce1
# Sent upstream as http://bugs.python.org/issue12872
e32ce1
Patch143: 00143-tsc-on-ppc.patch
e32ce1
e32ce1
# 00144 #
e32ce1
# (Optionally) disable the gdbm module:
e32ce1
# python.spec's
e32ce1
#   Patch144: 00144-no-gdbm.patch
e32ce1
# is not needed in python3.spec
e32ce1
e32ce1
# 00145 #
e32ce1
# python.spec's
e32ce1
#   Patch145: 00145-force-sys-platform-to-be-linux2.patch
e32ce1
# is upstream for Python 3 as of 3.2.2
e32ce1
e32ce1
# 00146 #
e32ce1
# Support OpenSSL FIPS mode (e.g. when OPENSSL_FORCE_FIPS_MODE=1 is set)
e32ce1
# - handle failures from OpenSSL (e.g. on attempts to use MD5 in a
e32ce1
#   FIPS-enforcing environment)
e32ce1
# - add a new "usedforsecurity" keyword argument to the various digest
e32ce1
#   algorithms in hashlib so that you can whitelist a callsite with
e32ce1
#   "usedforsecurity=False"
e32ce1
# (sent upstream for python 3 as http://bugs.python.org/issue9216 ; see RHEL6
e32ce1
# python patch 119)
e32ce1
# - enforce usage of the _hashlib implementation: don't fall back to the _md5
e32ce1
#   and _sha* modules (leading to clearer error messages if fips selftests
e32ce1
#   fail)
e32ce1
# - don't build the _md5 and _sha* modules; rely on the _hashlib implementation
e32ce1
#   of hashlib
e32ce1
# (rhbz#563986)
e32ce1
# Note: Up to Python 3.4.0.b1, upstream had their own implementation of what
e32ce1
# they assumed would become sha3. This patch was adapted to give it the
e32ce1
# usedforsecurity argument, even though it did nothing (OpenSSL didn't have
e32ce1
# sha3 implementation at that time).In 3.4.0.b2, sha3 implementation was reverted
e32ce1
# (see http://bugs.python.org/issue16113), but the alterations were left in the
e32ce1
# patch, since they may be useful again if upstream decides to rerevert sha3
e32ce1
# implementation and OpenSSL still doesn't support it. For now, they're harmless.
e32ce1
Patch146: 00146-hashlib-fips.patch
e32ce1
e32ce1
# 00147 #
e32ce1
# Add a sys._debugmallocstats() function
e32ce1
# Sent upstream as http://bugs.python.org/issue14785
e32ce1
# Upstream as of Python 3.3.0
e32ce1
#  Patch147: 00147-add-debug-malloc-stats.patch
e32ce1
e32ce1
# 00148 #
e32ce1
# Upstream as of Python 3.2.3:
e32ce1
#  Patch148: 00148-gdbm-1.9-magic-values.patch
e32ce1
e32ce1
# 00149 #
e32ce1
# Upstream as of Python 3.2.3:
e32ce1
#  Patch149: 00149-backport-issue11254-pycache-bytecompilation-fix.patch
e32ce1
e32ce1
# 00150 #
e32ce1
# temporarily disable rAssertAlmostEqual in test_cmath on PPC (bz #750811)
e32ce1
# caused by a glibc bug. This patch can be removed when we have a glibc with
e32ce1
# the patch mentioned here:
e32ce1
#   http://sourceware.org/bugzilla/show_bug.cgi?id=13472
e32ce1
Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch
e32ce1
e32ce1
# 00151 #
e32ce1
# python.spec had:
e32ce1
#  Patch151: 00151-fork-deadlock.patch
e32ce1
e32ce1
# 00152 #
e32ce1
# Fix a regex in test_gdb so that it doesn't choke when gdb provides a full
e32ce1
# path to Python/bltinmodule.c:
e32ce1
# Committed upstream as 77824:abcd29c9a791 as part of fix for
e32ce1
# http://bugs.python.org/issue12605
e32ce1
#  Patch152: 00152-fix-test-gdb-regex.patch
e32ce1
e32ce1
# 00153 #
e32ce1
# Strip out lines of the form "warning: Unable to open ..." from gdb's stderr
e32ce1
# when running test_gdb.py; also cope with change to gdb in F17 onwards in
e32ce1
# which values are printed as "v@entry" rather than just "v":
e32ce1
# Not yet sent upstream
e32ce1
# Upstream as of 3.4.3
e32ce1
#  Patch153: 00153-fix-test_gdb-noise.patch
e32ce1
e32ce1
# 00154 #
e32ce1
# python3.spec on f15 has:
e32ce1
#  Patch154: 00154-skip-urllib-test-requiring-working-DNS.patch
e32ce1
e32ce1
# 00155 #
e32ce1
# Avoid allocating thunks in ctypes unless absolutely necessary, to avoid
e32ce1
# generating SELinux denials on "import ctypes" and "import uuid" when
e32ce1
# embedding Python within httpd (rhbz#814391)
e32ce1
Patch155: 00155-avoid-ctypes-thunks.patch
e32ce1
e32ce1
# 00156 #
e32ce1
# Recent builds of gdb will only auto-load scripts from certain safe
e32ce1
# locations.  Turn off this protection when running test_gdb in the selftest
e32ce1
# suite to ensure that it can load our -gdb.py script (rhbz#817072):
e32ce1
# Upsream as of 3.4.3
e32ce1
#  Patch156: 00156-gdb-autoload-safepath.patch
e32ce1
e32ce1
# 00157 #
e32ce1
# Update uid/gid handling throughout the standard library: uid_t and gid_t are
e32ce1
# unsigned 32-bit values, but existing code often passed them through C long
e32ce1
# values, which are signed 32-bit values on 32-bit architectures, leading to
e32ce1
# negative int objects for uid/gid values >= 2^31 on 32-bit architectures.
e32ce1
#
e32ce1
# Introduce _PyObject_FromUid/Gid to convert uid_t/gid_t values to python
e32ce1
# objects, using int objects where the value will fit (long objects otherwise),
e32ce1
# and _PyArg_ParseUid/Gid to convert int/long to uid_t/gid_t, with -1 allowed
e32ce1
# as a special case (since this is given special meaning by the chown syscall)
e32ce1
#
e32ce1
# Update standard library to use this throughout for uid/gid values, so that
e32ce1
# very large uid/gid values are round-trippable, and -1 remains usable.
e32ce1
# (rhbz#697470)
e32ce1
Patch157: 00157-uid-gid-overflows.patch
e32ce1
e32ce1
# 00158 #
e32ce1
# Upstream as of Python 3.3.1
e32ce1
e32ce1
# 00159 #
e32ce1
#  Patch159: 00159-correct-libdb-include-path.patch
e32ce1
# in python.spec
e32ce1
# TODO: python3 status?
e32ce1
e32ce1
# 00160 #
e32ce1
# Python 3.3 added os.SEEK_DATA and os.SEEK_HOLE, which may be present in the
e32ce1
# header files in the build chroot, but may not be supported in the running
e32ce1
# kernel, hence we disable this test in an rpm build.
e32ce1
# Adding these was upstream issue http://bugs.python.org/issue10142
e32ce1
# Not yet sent upstream
e32ce1
Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch
e32ce1
e32ce1
# 00161 #
e32ce1
# (Was only needed for Python 3.3.0b1)
e32ce1
e32ce1
# 00162 #
e32ce1
# (Was only needed for Python 3.3.0b1)
e32ce1
e32ce1
# 00163 #
e32ce1
# Some tests within test_socket fail intermittently when run inside Koji;
e32ce1
# disable them using unittest._skipInRpmBuild
e32ce1
# Not yet sent upstream
e32ce1
Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch
e32ce1
e32ce1
# 0164 #
e32ce1
# some tests in test._io interrupted_write-* fail on PPC (rhbz#846849)
e32ce1
# testChainingDescriptors  test in test_exceptions fails on PPc, too (rhbz#846849)
e32ce1
# disable those tests so that rebuilds on PPC can continue
e32ce1
Patch164: 00164-disable-interrupted_write-tests-on-ppc.patch
e32ce1
e32ce1
# 00165 #
e32ce1
# python.spec has:
e32ce1
#   Patch165: 00165-crypt-module-salt-backport.patch
e32ce1
# which is a backport from 3.3 and thus not relevant to "python3"
e32ce1
e32ce1
# 00166 #
e32ce1
#  Patch166: 00166-fix-fake-repr-in-gdb-hooks.patch
e32ce1
# in python.spec
e32ce1
# TODO: python3 status?
e32ce1
e32ce1
# 00167 #
e32ce1
#  Patch167: 00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
e32ce1
# in python.spec
e32ce1
# TODO: python3 status?
e32ce1
e32ce1
# 00168 #
e32ce1
#  Patch168: 00168-distutils-cflags.patch
e32ce1
# in python.spec
e32ce1
# TODO: python3 status?
e32ce1
e32ce1
# 00169 #
e32ce1
#  Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
e32ce1
# in python.spec
e32ce1
# TODO: python3 status?
e32ce1
e32ce1
# 00170 #                                                                                           
e32ce1
# In debug builds, try to print repr() when a C-level assert fails in the                           
e32ce1
# garbage collector (typically indicating a reference-counting error                                
e32ce1
# somewhere else e.g in an extension module)                                                        
e32ce1
# Backported to 2.7 from a patch I sent upstream for py3k                                           
e32ce1
#   http://bugs.python.org/issue9263  (rhbz#614680)                                                 
e32ce1
# hiding the proposed new macros/functions within gcmodule.c to avoid exposing                      
e32ce1
# them within the extension API.                                                                    
e32ce1
# (rhbz#850013
e32ce1
Patch170: 00170-gc-assertions.patch
e32ce1
e32ce1
# 00171 #
e32ce1
# python.spec had:
e32ce1
#  Patch171: 00171-raise-correct-exception-when-dev-urandom-is-missing.patch
e32ce1
# TODO: python3 status?
e32ce1
e32ce1
# 00172 #
e32ce1
# python.spec had:
e32ce1
#  Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch
e32ce1
# TODO: python3 status?
e32ce1
e32ce1
# 00173 #
e32ce1
# Workaround for ENOPROTOOPT seen in Koji withi test.support.bind_port()
e32ce1
# (rhbz#913732)
e32ce1
Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch
e32ce1
e32ce1
# 00174 #
e32ce1
#  Patch174: 00174-fix-for-usr-move.patch
e32ce1
# TODO: python3 status?
e32ce1
e32ce1
# 00175 #
e32ce1
# Upstream as of Python 3.3.2
e32ce1
#  Patch175: 00175-fix-configure-Wformat.patch
e32ce1
e32ce1
# 00176 #
e32ce1
# Fixed upstream as of Python 3.3.1
e32ce1
#  Patch176: 00176-upstream-issue16754-so-extension.patch
e32ce1
e32ce1
# 00177 #
e32ce1
# Fixed upstream as of Python 3.4.0.b2
e32ce1
#  Patch177: 00177-platform-unicode.patch
e32ce1
e32ce1
# 00178 #
e32ce1
# Don't duplicate various FLAGS in sysconfig values
e32ce1
# http://bugs.python.org/issue17679
e32ce1
# Does not affect python2 AFAICS (different sysconfig values initialization)
e32ce1
Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch
e32ce1
e32ce1
# 00179 #
e32ce1
# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=951802
e32ce1
# Reported upstream in http://bugs.python.org/issue17737
e32ce1
# This patch basically looks at every frame and if it is somehow corrupted,
e32ce1
# it just stops printing the traceback - it doesn't fix the actual bug.
e32ce1
# This bug seems to only affect ARM.
e32ce1
# Doesn't seem to affect Python 2 AFAICS.
e32ce1
Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch
e32ce1
e32ce1
# 00180 #
e32ce1
# Enable building on ppc64p7
e32ce1
# Not appropriate for upstream, Fedora-specific naming
e32ce1
Patch180: 00180-python-add-support-for-ppc64p7.patch
e32ce1
e32ce1
# 00181 #
e32ce1
# python.spec has
e32ce1
#  Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch
e32ce1
# Does not affect python3
e32ce1
e32ce1
# 00182 #
e32ce1
# Fixed upstream as of Python 3.3.2
e32ce1
#  Patch182: 00182-fix-test_gdb-test_threads.patch
e32ce1
e32ce1
# 00183 #
e32ce1
# Fixed upstream as of Python 3.4.0a4
e32ce1
#  Patch183: 00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch
e32ce1
e32ce1
# 00184 #
e32ce1
# Fix for https://bugzilla.redhat.com/show_bug.cgi?id=979696
e32ce1
# Fixes build of ctypes against libffi with multilib wrapper
e32ce1
# Python recognizes ffi.h only if it contains "#define LIBFFI_H",
e32ce1
# but the wrapper doesn't contain that, which makes the build fail
e32ce1
# We patch this by also accepting "#define ffi_wrapper_h"
e32ce1
Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
e32ce1
e32ce1
# 00185 #
e32ce1
# Fixed upstream as of Python 3.4.0a4
e32ce1
#  Patch185: 00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
e32ce1
e32ce1
# 00186 #
e32ce1
# Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1023607
e32ce1
# Previously, this fixed a problem where some *.py files were not being
e32ce1
# bytecompiled properly during build. This was result of py_compile.compile
e32ce1
# raising exception when trying to convert test file with bad encoding, and
e32ce1
# thus not continuing bytecompilation for other files.
e32ce1
# This was fixed upstream, but the test hasn't been merged yet, so we keep it
e32ce1
Patch186: 00186-dont-raise-from-py_compile.patch
e32ce1
e32ce1
# 00187 #
e32ce1
# Fixed upstream as of Python 3.4.0b1
e32ce1
#  Patch187: 00187-remove-pthread-atfork.patch
e32ce1
e32ce1
# 00188 #
e32ce1
# Downstream only patch that should be removed when we compile all guaranteed
e32ce1
# hashlib algorithms properly. The problem is this:
e32ce1
# - during tests, test_hashlib is imported and executed before test_lib2to3
e32ce1
# - if at least one hash function has failed, trying to import it triggers an
e32ce1
#   exception that is being caught and exception is logged:
e32ce1
#   http://hg.python.org/cpython/file/2de806c8b070/Lib/hashlib.py#l217
e32ce1
# - logging the exception makes logging module run basicConfig
e32ce1
# - when lib2to3 tests are run again, lib2to3 runs basicConfig again, which
e32ce1
#   doesn't do anything, because it was run previously
e32ce1
#   (logging.root.handlers != []), which means that the default setup
e32ce1
#   (most importantly logging level) is not overriden. That means that a test
e32ce1
#   relying on this will fail (test_filename_changing_on_output_single_dir)
e32ce1
Patch188: 00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch
e32ce1
e32ce1
# 00189 #
e32ce1
#
e32ce1
# Add the rewheel module, allowing to recreate wheels from already installed
e32ce1
# ones
e32ce1
# https://github.com/bkabrda/rewheel
e32ce1
%if 0%{with_rewheel}
e32ce1
Patch189: 00189-add-rewheel-module.patch
e32ce1
%endif
e32ce1
e32ce1
# 00190 #
e32ce1
#
e32ce1
# Fix tests with SQLite >= 3.8.4
e32ce1
# http://bugs.python.org/issue20901
e32ce1
# http://hg.python.org/cpython/rev/4d626a9df062
e32ce1
# FIXED UPSTREAM
e32ce1
# Patch190: 00190-fix-tests-with-sqlite-3.8.4.patch
e32ce1
e32ce1
# 00193
e32ce1
#
e32ce1
# Skip correct number of *.pyc file bytes in ModuleFinder.load_module
e32ce1
# rhbz#1060338
e32ce1
# http://bugs.python.org/issue20778
e32ce1
# FIXED UPSTREAM
e32ce1
# Patch193: 00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch
e32ce1
e32ce1
# Tests requiring SIGHUP to work don't work in Koji
e32ce1
# see rhbz#1088233
e32ce1
Patch194: temporarily-disable-tests-requiring-SIGHUP.patch
e32ce1
e32ce1
# 00195
e32ce1
#
e32ce1
# Don't declare Werror=declaration-after-statement for extension
e32ce1
# modules through setup.py
e32ce1
# http://bugs.python.org/issue21121
e32ce1
# FIXED UPSTREAM
e32ce1
# Patch195: 00195-dont-add-Werror-declaration-after-statement.patch
e32ce1
e32ce1
# 00196
e32ce1
#
e32ce1
#  Fix test_gdb failure on ppc64le
e32ce1
Patch196: 00196-test-gdb-match-addr-before-builtin.patch
e32ce1
e32ce1
# 00197
e32ce1
#
e32ce1
# The CGIHTTPServer Python module did not properly handle URL-encoded
e32ce1
# path separators in URLs. This may have enabled attackers to disclose a CGI
e32ce1
# script's source code or execute arbitrary scripts in the server's
e32ce1
# document root.
e32ce1
# FIXED UPSTREAM
e32ce1
# Patch197: 00197-fix-CVE-2014-4650.patch
e32ce1
e32ce1
# OpenSSL disabled SSLv3 in SSLv23 method
e32ce1
# This patch alters python tests to reflect this change
e32ce1
# Issue: http://bugs.python.org/issue22638 Upstream discussion about SSLv3 in Python
e32ce1
Patch199: 00199-alter-tests-to-reflect-sslv3-disabled.patch
e32ce1
e32ce1
# 00200 #                                                                                           
e32ce1
# Fix for gettext plural form headers (lines that begin with "#")                                   
e32ce1
# Note: Backported from scl
e32ce1
Patch200: 00200-gettext-plural-fix.patch
e32ce1
e32ce1
# 00201 #                                                                                           
e32ce1
# Fixes memory leak in gdbm module (rhbz#977308)                                                    
e32ce1
# This was upstreamed as a part of bigger patch, but for our purposes                               
e32ce1
# this is ok: http://bugs.python.org/issue18404                                                     
e32ce1
# Note: Backported from scl
e32ce1
Patch201: 00201-fix-memory-leak-in-gdbm.patch 
e32ce1
e32ce1
# 00202 #
e32ce1
# Fixes undefined behaviour in faulthandler which caused test to hang on x86_64
e32ce1
# http://bugs.python.org/issue23433
e32ce1
Patch202: 00202-fix-undefined-behaviour-in-faulthandler.patch
e32ce1
e32ce1
# test_threading fails in koji dues to it's handling of signals
e32ce1
Patch203: 00203-disable-threading-test-koji.patch
e32ce1
e32ce1
# openssl requires DH keys to be > 768bits
e32ce1
Patch204: 00204-increase-dh-keys-size.patch
e32ce1
e32ce1
# 00209 #
e32ce1
# CVE-2016-5636: http://seclists.org/oss-sec/2016/q2/560
e32ce1
# rhbz#1345859: https://bugzilla.redhat.com/show_bug.cgi?id=1345859
e32ce1
# https://hg.python.org/cpython/rev/10dad6da1b28/
e32ce1
# https://hg.python.org/cpython/rev/5533a9e02b21
e32ce1
# Fix possible integer overflow and heap corruption in zipimporter.get_data()
e32ce1
# FIXED UPSTREAM: https://bugs.python.org/issue26171
e32ce1
Patch209: 00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch
e32ce1
e32ce1
# 00210 #
e32ce1
# CVE-2016-0772 python: smtplib StartTLS stripping attack
e32ce1
# rhbz#1303647: https://bugzilla.redhat.com/show_bug.cgi?id=1303647
e32ce1
# rhbz#1346345: https://bugzilla.redhat.com/show_bug.cgi?id=1346345
e32ce1
# FIXED UPSTREAM: https://hg.python.org/cpython/rev/d590114c2394
e32ce1
# Raise an error when STARTTLS fails
e32ce1
Patch210: 00210-Raise-an-error-when-STARTTLS-fails.patch
e32ce1
e32ce1
# 00211 #
e32ce1
# CVE-2016-5699 python: http protocol steam injection attack
e32ce1
#   https://bugzilla.redhat.com/show_bug.cgi?id=1303699
e32ce1
#   FIXED UPSTREAM: https://hg.python.org/cpython/rev/bf3e1c9b80e9
e32ce1
# Disabled HTTP header injections in http.client
e32ce1
# Resolves: rhbz#1331392
e32ce1
Patch211: 00211-Disabled-HTTP-header-injections-in-http-client.patch
e32ce1
e32ce1
# 00212 #
e32ce1
# Fix test breakage with version 2.2.0 of Expat
e32ce1
# rhbz#1353918: https://bugzilla.redhat.com/show_bug.cgi?id=1353918
e32ce1
# NOT YET FIXED UPSTREAM: http://bugs.python.org/issue27369
e32ce1
Patch212: 00212-fix-test-pyexpat-failure.patch
e32ce1
e32ce1
# (New patches go here ^^^)
e32ce1
#
e32ce1
# When adding new patches to "python" and "python3" in Fedora 17 onwards,
e32ce1
# please try to keep the patch numbers in-sync between the two specfiles:
e32ce1
#
e32ce1
#   - use the same patch number across both specfiles for conceptually-equivalent
e32ce1
#     fixes, ideally with the same name
e32ce1
#
e32ce1
#   - when a patch is relevant to both specfiles, use the same introductory
e32ce1
#     comment in both specfiles where possible (to improve "diff" output when
e32ce1
#     comparing them)
e32ce1
#
e32ce1
#   - when a patch is only relevant for one of the two specfiles, leave a gap
e32ce1
#     in the patch numbering in the other specfile, adding a comment when
e32ce1
#     omitting a patch, both in the manifest section here, and in the "prep"
e32ce1
#     phase below
e32ce1
#
e32ce1
# Hopefully this will make it easier to ensure that all relevant fixes are
e32ce1
# applied to both versions.
e32ce1
e32ce1
# This is the generated patch to "configure"; see the description of
e32ce1
#   %{regenerate_autotooling_patch}
e32ce1
# above:
e32ce1
Patch5000: 05000-autotool-intermediates.patch
e32ce1
e32ce1
BuildRoot: %{_tmppath}/%{name}-%{version}-root
e32ce1
e32ce1
# ======================================================
e32ce1
# Additional metadata, and subpackages
e32ce1
# ======================================================
e32ce1
e32ce1
URL: http://www.python.org/
e32ce1
e32ce1
# See notes in bug 532118:
e32ce1
Provides: python(abi) = %{pybasever}
e32ce1
e32ce1
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
e32ce1
e32ce1
%if 0%{with_rewheel}
e32ce1
Requires: python3-setuptools
e32ce1
Requires: python3-pip
e32ce1
%endif
e32ce1
e32ce1
%description
e32ce1
Python 3 is a new version of the language that is incompatible with the 2.x
e32ce1
line of releases. The language is mostly the same, but many details, especially
e32ce1
how built-in objects like dictionaries and strings work, have changed
e32ce1
considerably, and a lot of deprecated features have finally been removed.
e32ce1
e32ce1
%package libs
e32ce1
Summary:        Python 3 runtime libraries
e32ce1
Group:          Development/Libraries
e32ce1
#Requires:       %{name} = %{version}-%{release}
e32ce1
e32ce1
# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME.  We use
e32ce1
# this symbol (in pyexpat), so we must explicitly state this dependency to
e32ce1
# prevent "import pyexpat" from failing with a linker error if someone hasn't
e32ce1
# yet upgraded expat:
e32ce1
Requires: expat >= 2.1.0
e32ce1
e32ce1
%description libs
e32ce1
This package contains files used to embed Python 3 into applications.
e32ce1
e32ce1
%package devel
e32ce1
Summary: Libraries and header files needed for Python 3 development
e32ce1
Group: Development/Libraries
e32ce1
Requires: %{name} = %{version}-%{release}
e32ce1
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
e32ce1
BuildRequires: python-rpm-macros
e32ce1
Requires: python-rpm-macros
e32ce1
Requires: python3-rpm-macros
e32ce1
Conflicts: %{name} < %{version}-%{release}
e32ce1
e32ce1
%description devel
e32ce1
This package contains libraries and header files used to build applications
e32ce1
with and native libraries for Python 3
e32ce1
e32ce1
%package tools
e32ce1
Summary: A collection of tools included with Python 3
e32ce1
Group: Development/Tools
e32ce1
Requires: %{name} = %{version}-%{release}
e32ce1
Requires: %{name}-tkinter = %{version}-%{release}
e32ce1
e32ce1
%description tools
e32ce1
This package contains several tools included with Python 3
e32ce1
e32ce1
%package tkinter
e32ce1
Summary: A GUI toolkit for Python 3
e32ce1
Group: Development/Languages
e32ce1
Requires: %{name} = %{version}-%{release}
e32ce1
e32ce1
%description tkinter
e32ce1
The Tkinter (Tk interface) program is an graphical user interface for
e32ce1
the Python scripting language.
e32ce1
e32ce1
%package test
e32ce1
Summary: The test modules from the main python 3 package
e32ce1
Group: Development/Languages
e32ce1
Requires: %{name} = %{version}-%{release}
e32ce1
Requires: %{name}-tools = %{version}-%{release}
e32ce1
e32ce1
%description test
e32ce1
The test modules from the main %{name} package.
e32ce1
These are in a separate package to save space, as they are almost never used
e32ce1
in production.
e32ce1
e32ce1
You might want to install the python3-test package if you're developing
e32ce1
python 3 code that uses more than just unittest and/or test_support.py.
e32ce1
e32ce1
%if 0%{?with_debug_build}
e32ce1
%package debug
e32ce1
Summary: Debug version of the Python 3 runtime
e32ce1
Group: Applications/System
e32ce1
e32ce1
# The debug build is an all-in-one package version of the regular build, and
e32ce1
# shares the same .py/.pyc files and directories as the regular build.  Hence
e32ce1
# we depend on all of the subpackages of the regular build:
e32ce1
Requires: %{name}%{?_isa} = %{version}-%{release}
e32ce1
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
e32ce1
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
e32ce1
Requires: %{name}-test%{?_isa} = %{version}-%{release}
e32ce1
Requires: %{name}-tkinter%{?_isa} = %{version}-%{release}
e32ce1
Requires: %{name}-tools%{?_isa} = %{version}-%{release}
e32ce1
e32ce1
%description debug
e32ce1
python3-debug provides a version of the Python 3 runtime with numerous debugging
e32ce1
features enabled, aimed at advanced Python users, such as developers of Python
e32ce1
extension modules.
e32ce1
e32ce1
This version uses more memory and will be slower than the regular Python 3 build,
e32ce1
but is useful for tracking down reference-counting issues, and other bugs.
e32ce1
e32ce1
The bytecodes are unchanged, so that .pyc files are compatible between the two
e32ce1
versions of Python 3, but the debugging features mean that C/C++ extension
e32ce1
modules are ABI-incompatible with those built for the standard runtime.
e32ce1
e32ce1
It shares installation directories with the standard Python 3 runtime, so that
e32ce1
.py and .pyc files can be shared.  All compiled extension modules gain a "_d"
e32ce1
suffix ("foo_d.so" rather than "foo.so") so that each Python 3 implementation
e32ce1
can load its own extensions.
e32ce1
%endif # with_debug_build
e32ce1
e32ce1
# ======================================================
e32ce1
# The prep phase of the build:
e32ce1
# ======================================================
e32ce1
e32ce1
%prep
e32ce1
%setup -q -n Python-%{version}%{?prerel}
e32ce1
chmod +x %{SOURCE1}
e32ce1
e32ce1
%if 0%{?with_systemtap}
e32ce1
# Provide an example of usage of the tapset:
e32ce1
cp -a %{SOURCE6} .
e32ce1
cp -a %{SOURCE7} .
e32ce1
%endif # with_systemtap
e32ce1
e32ce1
# Ensure that we're using the system copy of various libraries, rather than
e32ce1
# copies shipped by upstream in the tarball:
e32ce1
#   Remove embedded copy of expat:
e32ce1
rm -r Modules/expat || exit 1
e32ce1
e32ce1
#   Remove embedded copy of libffi:
e32ce1
for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx ; do
e32ce1
  rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
e32ce1
done
e32ce1
e32ce1
#   Remove embedded copy of zlib:
e32ce1
rm -r Modules/zlib || exit 1
e32ce1
e32ce1
# Don't build upstream Python's implementation of these crypto algorithms;
e32ce1
# instead rely on _hashlib and OpenSSL.
e32ce1
#
e32ce1
# For example, in our builds hashlib.md5 is implemented within _hashlib via
e32ce1
# OpenSSL (and thus respects FIPS mode), and does not fall back to _md5
e32ce1
# TODO: there seems to be no OpenSSL support in Python for sha3 so far
e32ce1
# when it is there, also remove _sha3/ dir
e32ce1
for f in md5module.c sha1module.c sha256module.c sha512module.c; do
e32ce1
    rm Modules/$f
e32ce1
done
e32ce1
e32ce1
%if 0%{with_rewheel}
e32ce1
%global pip_version 7.1.0
e32ce1
sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/ensurepip/__init__.py
e32ce1
%endif
e32ce1
e32ce1
#
e32ce1
# Apply patches:
e32ce1
#
e32ce1
%patch1 -p1
e32ce1
# 3: upstream as of Python 3.3.1
e32ce1
e32ce1
%if 0%{?with_systemtap}
e32ce1
%patch55 -p1 -b .systemtap
e32ce1
%endif
e32ce1
e32ce1
%if "%{_lib}" == "lib64"
e32ce1
%patch102 -p1
e32ce1
%patch104 -p1
e32ce1
%endif
e32ce1
e32ce1
e32ce1
%patch111 -p1
e32ce1
# 112: not for python3
e32ce1
%patch113 -p1
e32ce1
# 00114: Upstream as of Python 3.4.0.b2
e32ce1
e32ce1
%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
e32ce1
e32ce1
%ifarch ppc %{power64}
e32ce1
%patch131 -p1
e32ce1
%endif
e32ce1
e32ce1
%patch132 -p1
e32ce1
# 00133: not for python3
e32ce1
%patch134 -p1
e32ce1
%patch135 -p1
e32ce1
# 00136: not for python3
e32ce1
%patch137 -p1
e32ce1
# 00138: not for python3
e32ce1
%ifarch %{arm}
e32ce1
%patch139 -p1
e32ce1
%patch140 -p1
e32ce1
%endif
e32ce1
# 00140: not for python3
e32ce1
%patch141 -p1
e32ce1
%patch143 -p1 -b .tsc-on-ppc
e32ce1
# 00144: not for python3
e32ce1
# 00145: not for python3
e32ce1
%patch146 -p1
e32ce1
# 00147: upstream as of Python 3.3.0
e32ce1
# 00148: upstream as of Python 3.2.3
e32ce1
# 00149: upstream as of Python 3.2.3
e32ce1
%ifarch ppc %{power64}
e32ce1
%patch150 -p1
e32ce1
%endif
e32ce1
# 00151: not for python3
e32ce1
# 00152: upstream as of Python 3.3.0b2
e32ce1
# 00153: upstream as of Python 3.4.3
e32ce1
# 00154: not for this branch
e32ce1
%patch155 -p1
e32ce1
# 00156: upstream as of 3.4.3
e32ce1
%patch157 -p1
e32ce1
#00158: FIXME
e32ce1
#00159: FIXME
e32ce1
%patch160 -p1
e32ce1
# 00161: was only needed for Python 3.3.0b1
e32ce1
# 00162: was only needed for Python 3.3.0b1
e32ce1
%patch163 -p1
e32ce1
%ifarch ppc %{power64}
e32ce1
%patch164 -p1
e32ce1
%endif
e32ce1
#00165: TODO
e32ce1
#00166: TODO
e32ce1
#00167: TODO
e32ce1
#00168: TODO
e32ce1
#00169: TODO
e32ce1
#00170: TODO
e32ce1
#00171: TODO
e32ce1
#00172: TODO
e32ce1
%patch173 -p1
e32ce1
#00174: TODO
e32ce1
# 00175: upstream as of Python 3.3.2
e32ce1
# 00176: upstream as of Python 3.3.1
e32ce1
# 00177: upstream as of Python 3.4.0.b2
e32ce1
%patch178 -p1
e32ce1
%patch179 -p1
e32ce1
%patch180 -p1
e32ce1
# 00181: not for python3
e32ce1
# 00182: upstream as of Python 3.3.2
e32ce1
# 00183  upstream as of Python 3.4.0a4
e32ce1
%patch184  -p1
e32ce1
# 00185  upstream as of Python 3.4.0a4
e32ce1
%patch186 -p1
e32ce1
# 00187: upstream as of Python 3.4.0b1
e32ce1
%patch188 -p1
e32ce1
e32ce1
%if 0%{with_rewheel}
e32ce1
%patch189 -p1
e32ce1
%endif
e32ce1
e32ce1
# 00190: upstream as of Python 3.4.1
e32ce1
# 00193: upstream as of Python 3.4.1
e32ce1
%patch194 -p1
e32ce1
# 00195: upstream as of Python 3.4.2
e32ce1
%patch196 -p1
e32ce1
# 00197: upstream as of Python 3.4.2
e32ce1
%patch199 -p1
e32ce1
%patch202 -p1
e32ce1
%patch203 -p1
e32ce1
%patch204 -p1
e32ce1
e32ce1
%patch209 -p1
e32ce1
%patch210 -p1
e32ce1
%patch211 -p1
e32ce1
%patch212 -p1
e32ce1
e32ce1
# Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there
e32ce1
# are many differences between 2.6 and the Python 3 library.
e32ce1
#
e32ce1
# Fix up the URLs within pydoc to point at the documentation for this
e32ce1
# MAJOR.MINOR version:
e32ce1
#
e32ce1
sed --in-place \
e32ce1
    --expression="s|http://docs.python.org/library|http://docs.python.org/%{pybasever}/library|g" \
e32ce1
    Lib/pydoc.py || exit 1
e32ce1
e32ce1
%if ! 0%{regenerate_autotooling_patch}
e32ce1
# Normally we apply the patch to "configure"
e32ce1
# We don't apply the patch if we're working towards regenerating it
e32ce1
%patch5000 -p0 -b .autotool-intermediates
e32ce1
%endif
e32ce1
e32ce1
# ======================================================
e32ce1
# Configuring and building the code:
e32ce1
# ======================================================
e32ce1
e32ce1
%build
e32ce1
topdir=$(pwd)
e32ce1
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
e32ce1
export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
e32ce1
export CPPFLAGS="`pkg-config --cflags-only-I libffi`"
e32ce1
export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
e32ce1
export LINKCC="gcc"
e32ce1
export CFLAGS="$CFLAGS `pkg-config --cflags openssl`"
e32ce1
export LDFLAGS="$RPM_LD_FLAGS `pkg-config --libs-only-L openssl`"
e32ce1
e32ce1
%if 0%{regenerate_autotooling_patch}
e32ce1
# If enabled, this code regenerates the patch to "configure", using a
e32ce1
# local copy of autoconf-2.65, then exits the build
e32ce1
#
e32ce1
# The following assumes that the copy is installed to ~/autoconf-2.65/bin
e32ce1
# as per these instructions:
e32ce1
#   http://bugs.python.org/issue7997
e32ce1
e32ce1
for f in pyconfig.h.in configure ; do
e32ce1
    cp $f $f.autotool-intermediates ;
e32ce1
done
e32ce1
e32ce1
# Rerun the autotools:
e32ce1
autoreconf
e32ce1
e32ce1
# Regenerate the patch:
e32ce1
gendiff . .autotool-intermediates > %{PATCH5000}
e32ce1
e32ce1
e32ce1
# Exit the build
e32ce1
exit 1
e32ce1
%endif
e32ce1
e32ce1
# Define a function, for how to perform a "build" of python for a given
e32ce1
# configuration:
e32ce1
BuildPython() {
e32ce1
  ConfName=$1	      
e32ce1
  BinaryName=$2
e32ce1
  SymlinkName=$3
e32ce1
  ExtraConfigArgs=$4
e32ce1
  PathFixWithThisBinary=$5
e32ce1
  MoreCFlags=$6
e32ce1
e32ce1
  ConfDir=build/$ConfName
e32ce1
e32ce1
  echo STARTING: BUILD OF PYTHON FOR CONFIGURATION: $ConfName - %{_bindir}/$BinaryName
e32ce1
  mkdir -p $ConfDir
e32ce1
e32ce1
  pushd $ConfDir
e32ce1
e32ce1
  # Use the freshly created "configure" script, but in the directory two above:
e32ce1
  %global _configure $topdir/configure
e32ce1
e32ce1
%configure \
e32ce1
  --enable-ipv6 \
e32ce1
  --enable-shared \
e32ce1
  --with-computed-gotos=%{with_computed_gotos} \
e32ce1
  --with-dbmliborder=gdbm:ndbm:bdb \
e32ce1
  --with-system-expat \
e32ce1
  --with-system-ffi \
e32ce1
  --enable-loadable-sqlite-extensions \
e32ce1
%if 0%{?with_systemtap}
e32ce1
  --with-systemtap \
e32ce1
%endif
e32ce1
%if 0%{?with_valgrind}
e32ce1
  --with-valgrind \
e32ce1
%endif
e32ce1
  $ExtraConfigArgs \
e32ce1
  %{nil}
e32ce1
e32ce1
  # Set EXTRA_CFLAGS to our CFLAGS (rather than overriding OPT, as we've done
e32ce1
  # in the past).
e32ce1
  # This should fix a problem with --with-valgrind where it adds
e32ce1
  #   -DDYNAMIC_ANNOTATIONS_ENABLED=1
e32ce1
  # to OPT which must be passed to all compilation units in the build,
e32ce1
  # otherwise leading to linker errors, e.g.
e32ce1
  #    missing symbol AnnotateRWLockDestroy
e32ce1
  #
e32ce1
  # Invoke the build:
e32ce1
  make EXTRA_CFLAGS="$CFLAGS $MoreCFlags" %{?_smp_mflags}
e32ce1
e32ce1
  popd
e32ce1
  echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfDir
e32ce1
}
e32ce1
e32ce1
# Use "BuildPython" to support building with different configurations:
e32ce1
e32ce1
%if 0%{?with_debug_build}
e32ce1
BuildPython debug \
e32ce1
  python-debug \
e32ce1
  python%{pybasever}-debug \
e32ce1
%ifarch %{ix86} x86_64 ppc %{power64}
e32ce1
  "--with-pydebug --with-tsc --with-count-allocs --with-call-profile --without-ensurepip" \
e32ce1
%else
e32ce1
  "--with-pydebug --with-count-allocs --with-call-profile --without-ensurepip" \
e32ce1
%endif
e32ce1
  false \
e32ce1
  -O0
e32ce1
%endif # with_debug_build
e32ce1
e32ce1
BuildPython optimized \
e32ce1
  python \
e32ce1
  python%{pybasever} \
e32ce1
  "--without-ensurepip" \
e32ce1
  true
e32ce1
e32ce1
# ======================================================
e32ce1
# Installing the built code:
e32ce1
# ======================================================
e32ce1
e32ce1
%install
e32ce1
topdir=$(pwd)
e32ce1
rm -fr %{buildroot}
e32ce1
mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir}
e32ce1
e32ce1
InstallPython() {
e32ce1
e32ce1
  ConfName=$1	      
e32ce1
  PyInstSoName=$2
e32ce1
  MoreCFlags=$3
e32ce1
e32ce1
  ConfDir=build/$ConfName
e32ce1
e32ce1
  echo STARTING: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName
e32ce1
  mkdir -p $ConfDir
e32ce1
e32ce1
  pushd $ConfDir
e32ce1
e32ce1
make install DESTDIR=%{buildroot} INSTALL="install -p" EXTRA_CFLAGS="$MoreCFlags"
e32ce1
e32ce1
  popd
e32ce1
e32ce1
  # We install a collection of hooks for gdb that make it easier to debug
e32ce1
  # executables linked against libpython3* (such as /usr/bin/python3 itself)
e32ce1
  #
e32ce1
  # These hooks are implemented in Python itself (though they are for the version
e32ce1
  # of python that gdb is linked with, in this case Python 2.7)
e32ce1
  #
e32ce1
  # gdb-archer looks for them in the same path as the ELF file, with a -gdb.py suffix.
e32ce1
  # We put them in the debuginfo package by installing them to e.g.:
e32ce1
  #  /usr/lib/debug/usr/lib/libpython3.2.so.1.0.debug-gdb.py
e32ce1
  #
e32ce1
  # See https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more
e32ce1
  # information
e32ce1
  #
e32ce1
  # Copy up the gdb hooks into place; the python file will be autoloaded by gdb
e32ce1
  # when visiting libpython.so, provided that the python file is installed to the
e32ce1
  # same path as the library (or its .debug file) plus a "-gdb.py" suffix, e.g:
e32ce1
  #  /usr/lib/debug/usr/lib64/libpython3.2.so.1.0.debug-gdb.py
e32ce1
  # (note that the debug path is /usr/lib/debug for both 32/64 bit)
e32ce1
  #
e32ce1
  # Initially I tried:
e32ce1
  #  /usr/lib/libpython3.1.so.1.0-gdb.py
e32ce1
  # but doing so generated noise when ldconfig was rerun (rhbz:562980)
e32ce1
  #
e32ce1
%if 0%{?with_gdb_hooks}
e32ce1
  DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
e32ce1
  PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName.debug-gdb.py
e32ce1
e32ce1
  mkdir -p %{buildroot}$DirHoldingGdbPy
e32ce1
  cp Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy
e32ce1
%endif # with_gdb_hooks
e32ce1
e32ce1
  echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName
e32ce1
}
e32ce1
e32ce1
# Use "InstallPython" to support building with different configurations:
e32ce1
e32ce1
# Install the "debug" build first, so that we can move some files aside
e32ce1
%if 0%{?with_debug_build}
e32ce1
InstallPython debug \
e32ce1
  %{py_INSTSONAME_debug} \
e32ce1
  -O0
e32ce1
%endif # with_debug_build
e32ce1
e32ce1
# Now the optimized build:
e32ce1
InstallPython optimized \
e32ce1
  %{py_INSTSONAME_optimized}
e32ce1
e32ce1
install -d -m 0755 ${RPM_BUILD_ROOT}%{pylibdir}/site-packages/__pycache__
e32ce1
e32ce1
mv ${RPM_BUILD_ROOT}%{_bindir}/2to3 ${RPM_BUILD_ROOT}%{_bindir}/python3-2to3
e32ce1
e32ce1
# Development tools
e32ce1
install -m755 -d ${RPM_BUILD_ROOT}%{pylibdir}/Tools
e32ce1
install Tools/README ${RPM_BUILD_ROOT}%{pylibdir}/Tools/
e32ce1
cp -ar Tools/freeze ${RPM_BUILD_ROOT}%{pylibdir}/Tools/
e32ce1
cp -ar Tools/i18n ${RPM_BUILD_ROOT}%{pylibdir}/Tools/
e32ce1
cp -ar Tools/pynche ${RPM_BUILD_ROOT}%{pylibdir}/Tools/
e32ce1
cp -ar Tools/scripts ${RPM_BUILD_ROOT}%{pylibdir}/Tools/
e32ce1
e32ce1
# Documentation tools
e32ce1
install -m755 -d %{buildroot}%{pylibdir}/Doc
e32ce1
cp -ar Doc/tools %{buildroot}%{pylibdir}/Doc/
e32ce1
e32ce1
# Demo scripts
e32ce1
cp -ar Tools/demo %{buildroot}%{pylibdir}/Tools/
e32ce1
e32ce1
# Fix for bug #136654
e32ce1
rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au %{buildroot}%{pylibdir}/test/audiotest.au
e32ce1
e32ce1
%if "%{_lib}" == "lib64"
e32ce1
install -d -m 0755 %{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages/__pycache__
e32ce1
%endif
e32ce1
e32ce1
# Make python3-devel multilib-ready (bug #192747, #139911)
e32ce1
%global _pyconfig32_h pyconfig-32.h
e32ce1
%global _pyconfig64_h pyconfig-64.h
e32ce1
e32ce1
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64
e32ce1
%global _pyconfig_h %{_pyconfig64_h}
e32ce1
%else
e32ce1
%global _pyconfig_h %{_pyconfig32_h}
e32ce1
%endif
e32ce1
e32ce1
# ABIFLAGS, LDVERSION and SOABI are in the upstream Makefile
e32ce1
%global ABIFLAGS_optimized m
e32ce1
%global ABIFLAGS_debug     dm
e32ce1
e32ce1
%global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized}
e32ce1
%global LDVERSION_debug     %{pybasever}%{ABIFLAGS_debug}
e32ce1
e32ce1
%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}
e32ce1
%global SOABI_debug     cpython-%{pyshortver}%{ABIFLAGS_debug}
e32ce1
e32ce1
%if 0%{?with_debug_build}
e32ce1
%global PyIncludeDirs python%{LDVERSION_optimized} python%{LDVERSION_debug}
e32ce1
e32ce1
%else
e32ce1
%global PyIncludeDirs python%{LDVERSION_optimized}
e32ce1
%endif
e32ce1
e32ce1
for PyIncludeDir in %{PyIncludeDirs} ; do
e32ce1
  mv %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h \
e32ce1
     %{buildroot}%{_includedir}/$PyIncludeDir/%{_pyconfig_h}
e32ce1
  cat > %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h << EOF
e32ce1
#include <bits wordsize.h="">
e32ce1
e32ce1
#if __WORDSIZE == 32
e32ce1
#include "%{_pyconfig32_h}"
e32ce1
#elif __WORDSIZE == 64
e32ce1
#include "%{_pyconfig64_h}"
e32ce1
#else
e32ce1
#error "Unknown word size"
e32ce1
#endif
e32ce1
EOF
e32ce1
done
e32ce1
e32ce1
# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file
e32ce1
# Similar for sysconfig: sysconfig.get_config_h_filename tries to locate
e32ce1
# pyconfig.h so it can be parsed, and needs to do this at runtime in site.py
e32ce1
# when python starts up (bug 653058)
e32ce1
#
e32ce1
# Split this out so it goes directly to the pyconfig-32.h/pyconfig-64.h
e32ce1
# variants:
e32ce1
sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \
e32ce1
  %{buildroot}%{pylibdir}/distutils/sysconfig.py \
e32ce1
  %{buildroot}%{pylibdir}/sysconfig.py
e32ce1
e32ce1
# Switch all shebangs to refer to the specific Python version.
e32ce1
LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \
e32ce1
  Tools/scripts/pathfix.py \
e32ce1
  -i "%{_bindir}/python%{pybasever}" \
e32ce1
  %{buildroot}
e32ce1
e32ce1
# Remove shebang lines from .py files that aren't executable, and
e32ce1
# remove executability from .py files that don't have a shebang line:
e32ce1
find %{buildroot} -name \*.py \
e32ce1
  \( \( \! -perm /u+x,g+x,o+x -exec sed -e '/^#!/Q 0' -e 'Q 1' {} \; \
e32ce1
  -print -exec sed -i '1d' {} \; \) -o \( \
e32ce1
  -perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \
e32ce1
  -exec chmod a-x {} \; \) \)
e32ce1
e32ce1
# .xpm and .xbm files should not be executable:
e32ce1
find %{buildroot} \
e32ce1
  \( -name \*.xbm -o -name \*.xpm -o -name \*.xpm.1 \) \
e32ce1
  -exec chmod a-x {} \;
e32ce1
e32ce1
# Remove executable flag from files that shouldn't have it:
e32ce1
chmod a-x \
e32ce1
  %{buildroot}%{pylibdir}/distutils/tests/Setup.sample \
e32ce1
  %{buildroot}%{pylibdir}/Tools/README
e32ce1
e32ce1
# Get rid of DOS batch files:
e32ce1
find %{buildroot} -name \*.bat -exec rm {} \;
e32ce1
e32ce1
# Get rid of backup files:
e32ce1
find %{buildroot}/ -name "*~" -exec rm -f {} \;
e32ce1
find . -name "*~" -exec rm -f {} \;
e32ce1
rm -f %{buildroot}%{pylibdir}/LICENSE.txt
e32ce1
# Junk, no point in putting in -test sub-pkg
e32ce1
rm -f ${RPM_BUILD_ROOT}/%{pylibdir}/idlelib/testcode.py*
e32ce1
e32ce1
# Get rid of stray patch file from buildroot:
e32ce1
rm -f %{buildroot}%{pylibdir}/test/test_imp.py.apply-our-changes-to-expected-shebang # from patch 4
e32ce1
e32ce1
# Fix end-of-line encodings:
e32ce1
find %{buildroot}/ -name \*.py -exec sed -i 's/\r//' {} \;
e32ce1
e32ce1
# Fix an encoding:
e32ce1
iconv -f iso8859-1 -t utf-8 %{buildroot}/%{pylibdir}/Demo/rpc/README > README.conv && mv -f README.conv %{buildroot}/%{pylibdir}/Demo/rpc/README
e32ce1
e32ce1
# Note that 
e32ce1
#  %{pylibdir}/Demo/distutils/test2to3/setup.py
e32ce1
# is in iso-8859-1 encoding, and that this is deliberate; this is test data
e32ce1
# for the 2to3 tool, and one of the functions of the 2to3 tool is to fixup
e32ce1
# character encodings within python source code
e32ce1
e32ce1
# Do bytecompilation with the newly installed interpreter.
e32ce1
# This is similar to the script in macros.pybytecompile
e32ce1
# compile *.pyo
e32ce1
find %{buildroot} -type f -a -name "*.py" -print0 | \
e32ce1
    LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
e32ce1
    PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
e32ce1
    xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2]) for f in sys.argv[1:]]' || :
e32ce1
# compile *.pyc
e32ce1
find %{buildroot} -type f -a -name "*.py" -print0 | \
e32ce1
    LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
e32ce1
    PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
e32ce1
    xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2], optimize=0) for f in sys.argv[1:]]' || :
e32ce1
e32ce1
# Fixup permissions for shared libraries from non-standard 555 to standard 755:
e32ce1
find %{buildroot} \
e32ce1
    -perm 555 -exec chmod 755 {} \;
e32ce1
e32ce1
# Install macros for rpm:
e32ce1
mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/
e32ce1
install -m 644 %{SOURCE3} %{buildroot}/%{_rpmconfigdir}/macros.d/
e32ce1
e32ce1
# Ensure that the curses module was linked against libncursesw.so, rather than
e32ce1
# libncurses.so (bug 539917)
e32ce1
ldd %{buildroot}/%{dynload_dir}/_curses*.so \
e32ce1
    | grep curses \
e32ce1
    | grep libncurses.so && (echo "_curses.so linked against libncurses.so" ; exit 1)
e32ce1
e32ce1
# Ensure that the debug modules are linked against the debug libpython, and
e32ce1
# likewise for the optimized modules and libpython:
e32ce1
for Module in %{buildroot}/%{dynload_dir}/*.so ; do
e32ce1
    case $Module in
e32ce1
    *.%{SOABI_debug})
e32ce1
        ldd $Module | grep %{py_INSTSONAME_optimized} &&
e32ce1
            (echo Debug module $Module linked against optimized %{py_INSTSONAME_optimized} ; exit 1)
e32ce1
            
e32ce1
        ;;
e32ce1
    *.%{SOABI_optimized})
e32ce1
        ldd $Module | grep %{py_INSTSONAME_debug} &&
e32ce1
            (echo Optimized module $Module linked against debug %{py_INSTSONAME_debug} ; exit 1)
e32ce1
        ;;
e32ce1
    esac
e32ce1
done
e32ce1
e32ce1
# Create "/usr/bin/python3-debug", a symlink to the python3 debug binary, to
e32ce1
# avoid the user having to know the precise version and ABI flags.  (see
e32ce1
# e.g. rhbz#676748):
e32ce1
%if 0%{?with_debug_build}
e32ce1
ln -s \
e32ce1
  %{_bindir}/python%{LDVERSION_debug} \
e32ce1
  %{buildroot}%{_bindir}/python3-debug
e32ce1
%endif
e32ce1
e32ce1
#
e32ce1
# Systemtap hooks:
e32ce1
#
e32ce1
%if 0%{?with_systemtap}
e32ce1
# Install a tapset for this libpython into tapsetdir, fixing up the path to the
e32ce1
# library:
e32ce1
mkdir -p %{buildroot}%{tapsetdir}
e32ce1
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64
e32ce1
%global libpython_stp_optimized libpython%{pybasever}-64.stp
e32ce1
%global libpython_stp_debug     libpython%{pybasever}-debug-64.stp
e32ce1
%else
e32ce1
%global libpython_stp_optimized libpython%{pybasever}-32.stp
e32ce1
%global libpython_stp_debug     libpython%{pybasever}-debug-32.stp
e32ce1
%endif
e32ce1
e32ce1
sed \
e32ce1
   -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_optimized}|" \
e32ce1
   %{_sourcedir}/libpython.stp \
e32ce1
   > %{buildroot}%{tapsetdir}/%{libpython_stp_optimized}
e32ce1
e32ce1
%if 0%{?with_debug_build}
e32ce1
# In Python 3, python3 and python3-debug don't point to the same binary,
e32ce1
# so we have to replace "python3" with "python3-debug" to get systemtap
e32ce1
# working with debug build
e32ce1
sed \
e32ce1
   -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_debug}|" \
e32ce1
   -e 's|"python3"|"python3-debug"|' \
e32ce1
   %{_sourcedir}/libpython.stp \
e32ce1
   > %{buildroot}%{tapsetdir}/%{libpython_stp_debug}
e32ce1
%endif # with_debug_build
e32ce1
e32ce1
%endif # with_systemtap
e32ce1
e32ce1
# Rename the script that differs on different arches to arch specific name
e32ce1
mv %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-{,`uname -m`-}config
e32ce1
echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_optimized}-`uname -m`-config "$@"' > \
e32ce1
  %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config
e32ce1
echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_optimized}-`uname -m`-config. Look around to see available arches." >&2' >> \
e32ce1
  %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config
e32ce1
  chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config
e32ce1
e32ce1
# ======================================================
e32ce1
# Running the upstream test suite
e32ce1
# ======================================================
e32ce1
e32ce1
%check
e32ce1
e32ce1
# first of all, check timestamps of bytecode files
e32ce1
find %{buildroot} -type f -a -name "*.py" -print0 | \
e32ce1
    LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
e32ce1
    PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
e32ce1
    xargs -0 %{buildroot}%{_bindir}/python%{pybasever} %{SOURCE8}
e32ce1
e32ce1
e32ce1
topdir=$(pwd)
e32ce1
CheckPython() {
e32ce1
  ConfName=$1	      
e32ce1
  ConfDir=$(pwd)/build/$ConfName
e32ce1
e32ce1
  echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
e32ce1
e32ce1
  # Note that we're running the tests using the version of the code in the
e32ce1
  # builddir, not in the buildroot.
e32ce1
e32ce1
  # Run the upstream test suite, setting "WITHIN_PYTHON_RPM_BUILD" so that the
e32ce1
  # our non-standard decorators take effect on the relevant tests:
e32ce1
  #   @unittest._skipInRpmBuild(reason)
e32ce1
  #   @unittest._expectedFailureInRpmBuild
e32ce1
  # test_faulthandler.test_register_chain currently fails on ppc64le and
e32ce1
  #   aarch64, see upstream bug http://bugs.python.org/issue21131
e32ce1
  WITHIN_PYTHON_RPM_BUILD= \
e32ce1
  LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \
e32ce1
    --verbose --findleaks \
e32ce1
    -x test_distutils \
e32ce1
    %ifarch ppc64le aarch64
e32ce1
    -x test_faulthandler \
e32ce1
    %endif
e32ce1
    %ifarch %{power64} s390 s390x armv7hl aarch64
e32ce1
    -x test_gdb
e32ce1
    %endif
e32ce1
e32ce1
  echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
e32ce1
e32ce1
}
e32ce1
e32ce1
%if 0%{run_selftest_suite}
e32ce1
e32ce1
# Check each of the configurations:
e32ce1
%if 0%{?with_debug_build}
e32ce1
CheckPython debug
e32ce1
%endif # with_debug_build
e32ce1
CheckPython optimized
e32ce1
e32ce1
%endif # run_selftest_suite
e32ce1
e32ce1
e32ce1
# ======================================================
e32ce1
# Cleaning up
e32ce1
# ======================================================
e32ce1
e32ce1
%clean
e32ce1
rm -fr %{buildroot}
e32ce1
e32ce1
e32ce1
# ======================================================
e32ce1
# Scriptlets
e32ce1
# ======================================================
e32ce1
e32ce1
%post libs -p /sbin/ldconfig
e32ce1
e32ce1
%postun libs -p /sbin/ldconfig
e32ce1
e32ce1
e32ce1
e32ce1
%files
e32ce1
%defattr(-, root, root)
e32ce1
%doc LICENSE README
e32ce1
%{_bindir}/pydoc*
e32ce1
%{_bindir}/python3
e32ce1
%{_bindir}/python%{pybasever}
e32ce1
%{_bindir}/python%{pybasever}m
e32ce1
%{_bindir}/pyvenv
e32ce1
%{_bindir}/pyvenv-%{pybasever}
e32ce1
%{_mandir}/*/*
e32ce1
e32ce1
%files libs
e32ce1
%defattr(-,root,root,-)
e32ce1
%doc LICENSE README
e32ce1
%dir %{pylibdir}
e32ce1
%dir %{dynload_dir}
e32ce1
%{dynload_dir}/_bisect.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_bz2.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_codecs_cn.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_codecs_hk.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_codecs_iso2022.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_codecs_jp.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_codecs_kr.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_codecs_tw.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_crypt.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_csv.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_ctypes.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_curses.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_curses_panel.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_dbm.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_decimal.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_elementtree.%{SOABI_optimized}.so
e32ce1
%if %{with_gdbm}
e32ce1
%{dynload_dir}/_gdbm.%{SOABI_optimized}.so
e32ce1
%endif
e32ce1
%{dynload_dir}/_hashlib.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_heapq.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_json.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_lsprof.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_lzma.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_multibytecodec.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_multiprocessing.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_opcode.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_pickle.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_posixsubprocess.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_random.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_socket.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_sqlite3.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_ssl.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_struct.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/array.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/audioop.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/binascii.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/cmath.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_datetime.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/fcntl.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/grp.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/math.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/mmap.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/nis.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/ossaudiodev.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/parser.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/pyexpat.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/readline.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/resource.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/select.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/spwd.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/syslog.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/termios.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/time.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/unicodedata.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/xxlimited.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/zlib.%{SOABI_optimized}.so
e32ce1
e32ce1
%dir %{pylibdir}/site-packages/
e32ce1
%dir %{pylibdir}/site-packages/__pycache__/
e32ce1
%{pylibdir}/site-packages/README
e32ce1
%{pylibdir}/*.py
e32ce1
%dir %{pylibdir}/__pycache__/
e32ce1
%{pylibdir}/__pycache__/*%{bytecode_suffixes}
e32ce1
e32ce1
%dir %{pylibdir}/asyncio/
e32ce1
%dir %{pylibdir}/asyncio/__pycache__/
e32ce1
%{pylibdir}/asyncio/*.py
e32ce1
%{pylibdir}/asyncio/__pycache__/*%{bytecode_suffixes}
e32ce1
e32ce1
%dir %{pylibdir}/collections/
e32ce1
%dir %{pylibdir}/collections/__pycache__/
e32ce1
%{pylibdir}/collections/*.py
e32ce1
%{pylibdir}/collections/__pycache__/*%{bytecode_suffixes}
e32ce1
e32ce1
%dir %{pylibdir}/concurrent/
e32ce1
%dir %{pylibdir}/concurrent/__pycache__/
e32ce1
%{pylibdir}/concurrent/*.py
e32ce1
%{pylibdir}/concurrent/__pycache__/*%{bytecode_suffixes}
e32ce1
e32ce1
%dir %{pylibdir}/concurrent/futures/
e32ce1
%dir %{pylibdir}/concurrent/futures/__pycache__/
e32ce1
%{pylibdir}/concurrent/futures/*.py
e32ce1
%{pylibdir}/concurrent/futures/__pycache__/*%{bytecode_suffixes}
e32ce1
e32ce1
%dir %{pylibdir}/ctypes/
e32ce1
%dir %{pylibdir}/ctypes/__pycache__/
e32ce1
%{pylibdir}/ctypes/*.py
e32ce1
%{pylibdir}/ctypes/__pycache__/*%{bytecode_suffixes}
e32ce1
%{pylibdir}/ctypes/macholib
e32ce1
e32ce1
%{pylibdir}/curses
e32ce1
e32ce1
%dir %{pylibdir}/dbm/
e32ce1
%dir %{pylibdir}/dbm/__pycache__/
e32ce1
%{pylibdir}/dbm/*.py
e32ce1
%{pylibdir}/dbm/__pycache__/*%{bytecode_suffixes}
e32ce1
e32ce1
%dir %{pylibdir}/distutils/
e32ce1
%dir %{pylibdir}/distutils/__pycache__/
e32ce1
%{pylibdir}/distutils/*.py
e32ce1
%{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes}
e32ce1
%{pylibdir}/distutils/README
e32ce1
%{pylibdir}/distutils/command
e32ce1
e32ce1
%dir %{pylibdir}/email/
e32ce1
%dir %{pylibdir}/email/__pycache__/
e32ce1
%{pylibdir}/email/*.py
e32ce1
%{pylibdir}/email/__pycache__/*%{bytecode_suffixes}
e32ce1
%{pylibdir}/email/mime
e32ce1
%doc %{pylibdir}/email/architecture.rst
e32ce1
e32ce1
%{pylibdir}/encodings
e32ce1
e32ce1
%dir %{pylibdir}/ensurepip/
e32ce1
%dir %{pylibdir}/ensurepip/__pycache__/
e32ce1
%{pylibdir}/ensurepip/*.py
e32ce1
%{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes}
e32ce1
%exclude %{pylibdir}/ensurepip/_bundled
e32ce1
e32ce1
%if 0%{?with_rewheel}
e32ce1
%dir %{pylibdir}/ensurepip/rewheel/
e32ce1
%dir %{pylibdir}/ensurepip/rewheel/__pycache__/
e32ce1
%{pylibdir}/ensurepip/rewheel/*.py
e32ce1
%{pylibdir}/ensurepip/rewheel/__pycache__/*%{bytecode_suffixes}
e32ce1
%endif
e32ce1
e32ce1
%{pylibdir}/html
e32ce1
%{pylibdir}/http
e32ce1
%{pylibdir}/idlelib
e32ce1
e32ce1
%dir %{pylibdir}/importlib/
e32ce1
%dir %{pylibdir}/importlib/__pycache__/
e32ce1
%{pylibdir}/importlib/*.py
e32ce1
%{pylibdir}/importlib/__pycache__/*%{bytecode_suffixes}
e32ce1
e32ce1
%dir %{pylibdir}/json/
e32ce1
%dir %{pylibdir}/json/__pycache__/
e32ce1
%{pylibdir}/json/*.py
e32ce1
%{pylibdir}/json/__pycache__/*%{bytecode_suffixes}
e32ce1
e32ce1
%{pylibdir}/lib2to3
e32ce1
%exclude %{pylibdir}/lib2to3/tests
e32ce1
%{pylibdir}/logging
e32ce1
%{pylibdir}/multiprocessing
e32ce1
%{pylibdir}/plat-linux
e32ce1
%{pylibdir}/pydoc_data
e32ce1
e32ce1
%dir %{pylibdir}/sqlite3/
e32ce1
%dir %{pylibdir}/sqlite3/__pycache__/
e32ce1
%{pylibdir}/sqlite3/*.py
e32ce1
%{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes}
e32ce1
e32ce1
%dir %{pylibdir}/test/
e32ce1
%dir %{pylibdir}/test/__pycache__/
e32ce1
%dir %{pylibdir}/test/support/
e32ce1
%dir %{pylibdir}/test/support/__pycache__/
e32ce1
%{pylibdir}/test/__init__.py
e32ce1
%{pylibdir}/test/__pycache__/__init__%{bytecode_suffixes}
e32ce1
%{pylibdir}/test/support/__init__.py
e32ce1
%{pylibdir}/test/support/__pycache__/__init__%{bytecode_suffixes}
e32ce1
e32ce1
%exclude %{pylibdir}/turtle.py
e32ce1
%exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes}
e32ce1
e32ce1
%dir %{pylibdir}/unittest/
e32ce1
%dir %{pylibdir}/unittest/__pycache__/
e32ce1
%{pylibdir}/unittest/*.py
e32ce1
%{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes}
e32ce1
e32ce1
%{pylibdir}/urllib
e32ce1
e32ce1
%dir %{pylibdir}/venv/
e32ce1
%dir %{pylibdir}/venv/__pycache__/
e32ce1
%{pylibdir}/venv/*.py
e32ce1
%{pylibdir}/venv/__pycache__/*%{bytecode_suffixes}
e32ce1
%{pylibdir}/venv/scripts
e32ce1
e32ce1
%{pylibdir}/wsgiref
e32ce1
%{pylibdir}/xml
e32ce1
%{pylibdir}/xmlrpc
e32ce1
e32ce1
%if "%{_lib}" == "lib64"
e32ce1
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}
e32ce1
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages
e32ce1
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages/__pycache__/
e32ce1
%endif
e32ce1
e32ce1
# "Makefile" and the config-32/64.h file are needed by
e32ce1
# distutils/sysconfig.py:_init_posix(), so we include them in the core
e32ce1
# package, along with their parent directories (bug 531901):
e32ce1
%dir %{pylibdir}/config-%{LDVERSION_optimized}/
e32ce1
%{pylibdir}/config-%{LDVERSION_optimized}/Makefile
e32ce1
%dir %{_includedir}/python%{LDVERSION_optimized}/
e32ce1
%{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h}
e32ce1
e32ce1
%{_libdir}/%{py_INSTSONAME_optimized}
e32ce1
%{_libdir}/libpython3.so
e32ce1
%if 0%{?with_systemtap}
e32ce1
%dir %(dirname %{tapsetdir})
e32ce1
%dir %{tapsetdir}
e32ce1
%{tapsetdir}/%{libpython_stp_optimized}
e32ce1
%doc systemtap-example.stp pyfuntop.stp
e32ce1
%endif
e32ce1
e32ce1
%files devel
e32ce1
%defattr(-,root,root)
e32ce1
%{pylibdir}/config-%{LDVERSION_optimized}/*
e32ce1
%exclude %{pylibdir}/config-%{LDVERSION_optimized}/Makefile
e32ce1
%{_includedir}/python%{LDVERSION_optimized}/*.h
e32ce1
%exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h}
e32ce1
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
e32ce1
%{_bindir}/python3-config
e32ce1
%{_bindir}/python%{pybasever}-config
e32ce1
%{_bindir}/python%{LDVERSION_optimized}-config
e32ce1
%{_bindir}/python%{LDVERSION_optimized}-*-config
e32ce1
%{_libdir}/libpython%{LDVERSION_optimized}.so
e32ce1
%{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc
e32ce1
%{_libdir}/pkgconfig/python-%{pybasever}.pc
e32ce1
%{_libdir}/pkgconfig/python3.pc
e32ce1
%{_rpmconfigdir}/macros.d/macros.pybytecompile%{pybasever}
e32ce1
e32ce1
%files tools
e32ce1
%defattr(-,root,root,755)
e32ce1
%{_bindir}/python3-2to3
e32ce1
%{_bindir}/2to3-%{pybasever}
e32ce1
%{_bindir}/idle*
e32ce1
%{pylibdir}/Tools
e32ce1
%doc %{pylibdir}/Doc
e32ce1
e32ce1
%files tkinter
e32ce1
%defattr(-,root,root,755)
e32ce1
%{pylibdir}/tkinter
e32ce1
%exclude %{pylibdir}/tkinter/test
e32ce1
%{dynload_dir}/_tkinter.%{SOABI_optimized}.so
e32ce1
%{pylibdir}/turtle.py
e32ce1
%{pylibdir}/__pycache__/turtle*%{bytecode_suffixes}
e32ce1
%dir %{pylibdir}/turtledemo
e32ce1
%{pylibdir}/turtledemo/*.py
e32ce1
%{pylibdir}/turtledemo/*.cfg
e32ce1
%dir %{pylibdir}/turtledemo/__pycache__/
e32ce1
%{pylibdir}/turtledemo/__pycache__/*%{bytecode_suffixes}
e32ce1
e32ce1
%files test
e32ce1
%defattr(-, root, root)
e32ce1
%{pylibdir}/ctypes/test
e32ce1
%{pylibdir}/distutils/tests
e32ce1
%{pylibdir}/sqlite3/test
e32ce1
%{pylibdir}/test
e32ce1
%{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_testbuffer.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_testcapi.%{SOABI_optimized}.so
e32ce1
%{dynload_dir}/_testimportmultiple.%{SOABI_optimized}.so
e32ce1
%{pylibdir}/lib2to3/tests
e32ce1
%{pylibdir}/tkinter/test
e32ce1
%{pylibdir}/unittest/test
e32ce1
e32ce1
e32ce1
# We don't bother splitting the debug build out into further subpackages:
e32ce1
# if you need it, you're probably a developer.
e32ce1
e32ce1
# Hence the manifest is the combination of analogous files in the manifests of
e32ce1
# all of the other subpackages
e32ce1
e32ce1
%if 0%{?with_debug_build}
e32ce1
%files debug
e32ce1
%defattr(-,root,root,-)
e32ce1
e32ce1
# Analog of the core subpackage's files:
e32ce1
%{_bindir}/python%{LDVERSION_debug}
e32ce1
%{_bindir}/python3-debug
e32ce1
e32ce1
# Analog of the -libs subpackage's files:
e32ce1
# ...with debug builds of the built-in "extension" modules:
e32ce1
%{dynload_dir}/_bisect.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_bz2.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_codecs_cn.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_codecs_hk.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_codecs_iso2022.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_codecs_jp.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_codecs_kr.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_codecs_tw.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_crypt.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_csv.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_ctypes.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_curses.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_curses_panel.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_dbm.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_decimal.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_elementtree.%{SOABI_debug}.so
e32ce1
%if %{with_gdbm}
e32ce1
%{dynload_dir}/_gdbm.%{SOABI_debug}.so
e32ce1
%endif
e32ce1
%{dynload_dir}/_hashlib.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_heapq.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_json.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_lsprof.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_lzma.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_multibytecodec.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_multiprocessing.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_opcode.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_pickle.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_posixsubprocess.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_random.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_socket.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_sqlite3.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_ssl.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_struct.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/array.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/audioop.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/binascii.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/cmath.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_datetime.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/fcntl.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/grp.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/math.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/mmap.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/nis.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/ossaudiodev.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/parser.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/pyexpat.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/readline.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/resource.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/select.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/spwd.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/syslog.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/termios.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/time.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/unicodedata.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/zlib.%{SOABI_debug}.so
e32ce1
e32ce1
# No need to split things out the "Makefile" and the config-32/64.h file as we
e32ce1
# do for the regular build above (bug 531901), since they're all in one package
e32ce1
# now; they're listed below, under "-devel":
e32ce1
e32ce1
%{_libdir}/%{py_INSTSONAME_debug}
e32ce1
%if 0%{?with_systemtap}
e32ce1
%dir %(dirname %{tapsetdir})
e32ce1
%dir %{tapsetdir}
e32ce1
%{tapsetdir}/%{libpython_stp_debug}
e32ce1
%endif
e32ce1
e32ce1
# Analog of the -devel subpackage's files:
e32ce1
%{pylibdir}/config-%{LDVERSION_debug}
e32ce1
%{_includedir}/python%{LDVERSION_debug}
e32ce1
%{_bindir}/python%{LDVERSION_debug}-config
e32ce1
%{_libdir}/libpython%{LDVERSION_debug}.so
e32ce1
%{_libdir}/pkgconfig/python-%{LDVERSION_debug}.pc
e32ce1
e32ce1
# Analog of the -tools subpackage's files:
e32ce1
#  None for now; we could build precanned versions that have the appropriate
e32ce1
# shebang if needed
e32ce1
e32ce1
# Analog  of the tkinter subpackage's files:
e32ce1
%{dynload_dir}/_tkinter.%{SOABI_debug}.so
e32ce1
e32ce1
# Analog  of the -test subpackage's files:
e32ce1
%{dynload_dir}/_ctypes_test.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_testbuffer.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_testcapi.%{SOABI_debug}.so
e32ce1
%{dynload_dir}/_testimportmultiple.%{SOABI_debug}.so
e32ce1
e32ce1
%endif # with_debug_build
e32ce1
e32ce1
# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
e32ce1
# ldconfig (rhbz:562980).
e32ce1
# 
e32ce1
# The /usr/lib/rpm/redhat/macros defines %__debug_package to use
e32ce1
# debugfiles.list, and it appears that everything below /usr/lib/debug and
e32ce1
# (/usr/src/debug) gets added to this file (via LISTFILES) in
e32ce1
# /usr/lib/rpm/find-debuginfo.sh
e32ce1
# 
e32ce1
# Hence by installing it below /usr/lib/debug we ensure it is added to the
e32ce1
# -debuginfo subpackage
e32ce1
# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py 
e32ce1
# payload file would be unpackaged)
e32ce1
e32ce1
e32ce1
# ======================================================
e32ce1
# Finally, the changelog:
e32ce1
# ======================================================
e32ce1
e32ce1
%changelog
e32ce1
* Mon Jul 11 2016 Charalampos Stratakis <cstratak@redhat.com> - 3.4.3-11
e32ce1
- Refactor patch for properly fixing CVE-2016-5636
e32ce1
e32ce1
* Mon Jul 11 2016 Charalampos Stratakis <cstratak@redhat.com> - 3.4.3-10
e32ce1
- Fix test_pyexpat failure with Expat version of 2.2.0
e32ce1
e32ce1
* Fri Jun 24 2016 Tomas Orsava <torsava@redhat.com> - 3.4.3-9
e32ce1
- Fix CVE-2016-5699 python: http protocol steam injection attack (rhbz#1303699)
e32ce1
- Fixed upstream: https://hg.python.org/cpython/rev/bf3e1c9b80e9
e32ce1
- Disabled HTTP header injections in http.client
e32ce1
Resolves: rhbz#1331392
e32ce1
e32ce1
* Thu Jun 16 2016 Tomas Orsava <torsava@redhat.com> - 3.4.3-8
e32ce1
- Fix for: CVE-2016-0772 python: smtplib StartTLS stripping attack
e32ce1
- Raise an error when STARTTLS fails
e32ce1
- rhbz#1303647: https://bugzilla.redhat.com/show_bug.cgi?id=1303647
e32ce1
- rhbz#1346345: https://bugzilla.redhat.com/show_bug.cgi?id=1346345
e32ce1
- Fixed upstream: https://hg.python.org/cpython/rev/d590114c2394
e32ce1
e32ce1
* Mon Jun 13 2016 Charalampos Stratakis <cstratak@redhat.com> - 3.4.3-7
e32ce1
- Added patch for fixing possible integer overflow and heap corruption in zipimporter.get_data()
e32ce1
e32ce1
* Mon Mar 28 2016 Orion Poplwski <orion@cora.nwra.com> - 3.4.3-6
e32ce1
- Drop python3 macros, require python/python3-rpm-macros
e32ce1
e32ce1
* Mon Jun 29 2015 Thomas Spura <tomspur@fedoraproject.org> - 3.4.3-5
e32ce1
- python3-devel: Require python-macros for version independant macros such as
e32ce1
  python_provide. See fpc#281 and fpc#534.
e32ce1
e32ce1
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.3-3
e32ce1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
e32ce1
e32ce1
* Wed Jun 17 2015 Matej Stuchlik <mstuchli@redhat.com> - 3.4.3-4
e32ce1
- Use 1024bit DH key in test_ssl
e32ce1
- Use -O0 when compiling -debug build
e32ce1
- Update pip version variable to the version we actually ship
e32ce1
e32ce1
* Wed Jun 17 2015 Matej Stuchlik <mstuchli@redhat.com> - 3.4.3-3
e32ce1
- Make relocating Python by changing _prefix actually work
e32ce1
Resolves: rhbz#1231801
e32ce1
e32ce1
* Mon May  4 2015 Peter Robinson <pbrobinson@fedoraproject.org> 3.4.3-2
e32ce1
- Disable test_gdb on aarch64 (rhbz#1196181), it joins all other non x86 arches
e32ce1
e32ce1
* Thu Mar 12 2015 Matej Stuchlik <mstuchli@redhat.com> - 3.4.3-1
e32ce1
- Updated to 3.4.3
e32ce1
- BuildPython now accepts additional build options
e32ce1
- Temporarily disabled test_gdb on arm (rhbz#1196181)
e32ce1
e32ce1
* Wed Feb 25 2015 Matej Stuchlik <mstuchli@redhat.com> - 3.4.2-7
e32ce1
- Fixed undefined behaviour in faulthandler which caused test to hang on x86_64
e32ce1
  (http://bugs.python.org/issue23433)
e32ce1
e32ce1
* Sat Feb 21 2015 Till Maas <opensource@till.name> - 3.4.2-6
e32ce1
- Rebuilt for Fedora 23 Change
e32ce1
  https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
e32ce1
e32ce1
* Tue Feb 17 2015 Ville Skyttä <ville.skytta@iki.fi> - 3.4.2-5
e32ce1
- Own systemtap dirs (#710733)
e32ce1
e32ce1
* Mon Jan 12 2015 Dan Horák <dan[at]danny.cz> - 3.4.2-4
e32ce1
- build with valgrind on ppc64le
e32ce1
- disable test_gdb on s390(x) until rhbz#1181034 is resolved
e32ce1
e32ce1
* Tue Dec 16 2014 Robert Kuska <rkuska@redhat.com> - 3.4.2-3
e32ce1
- New patches: 170 (gc asserts), 200 (gettext headers),
e32ce1
  201 (gdbm memory leak)
e32ce1
e32ce1
* Thu Dec 11 2014 Robert Kuska <rkuska@redhat.com> - 3.4.2-2
e32ce1
- OpenSSL disabled SSLv3 in SSLv23 method
e32ce1
e32ce1
* Thu Nov 13 2014 Matej Stuchlik <mstuchli@redhat.com> - 3.4.2-1
e32ce1
- Update to 3.4.2
e32ce1
- Refreshed patches: 156 (gdb autoload)
e32ce1
- Removed: 195 (Werror declaration), 197 (CVE-2014-4650)
e32ce1
e32ce1
* Mon Nov 03 2014 Slavek Kabrda <bkabrda@redhat.com> - 3.4.1-16
e32ce1
- Fix CVE-2014-4650 - CGIHTTPServer URL handling
e32ce1
Resolves: rhbz#1113529
e32ce1
e32ce1
* Sun Sep 07 2014 Karsten Hopp <karsten@redhat.com> 3.4.1-15
e32ce1
- exclude test_gdb on ppc* (rhbz#1132488)
e32ce1
e32ce1
* Thu Aug 21 2014 Slavek Kabrda <bkabrda@redhat.com> - 3.4.1-14
e32ce1
- Update rewheel patch with fix from https://github.com/bkabrda/rewheel/pull/1
e32ce1
e32ce1
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.1-13
e32ce1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
e32ce1
e32ce1
* Sun Jun  8 2014 Peter Robinson <pbrobinson@fedoraproject.org> 3.4.1-12
e32ce1
- aarch64 has valgrind, just list those that don't support it
e32ce1
e32ce1
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.1-11
e32ce1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
e32ce1
e32ce1
* Wed Jun 04 2014 Karsten Hopp <karsten@redhat.com> 3.4.1-10
e32ce1
- bump release and rebuild to link with the correct tcl/tk libs on ppcle
e32ce1
e32ce1
* Tue Jun 03 2014 Matej Stuchlik <mstuchli@redhat.com> - 3.4.1-9
e32ce1