churchyard / rpms / python2

Forked from rpms/python2 3 years ago
Clone
4f38fe
# ======================================================
4f38fe
# Conditionals and other variables controlling the build
4f38fe
# ======================================================
4f38fe
e4e4db
# Note that the bcond macros are named for the CLI option they create.
e4e4db
# "%%bcond_without" means "ENABLE by default and create a --without option"
e4e4db
4d74b7
# Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package
4d74b7
# Uses upstream bundled prebuilt wheels otherwise
4d74b7
%bcond_without rpmwheels
e4e4db
e4e4db
# Extra build for debugging the interpreter or C-API extensions
e4e4db
# (the -debug subpackages)
e4e4db
%bcond_without debug_build
Matej Stuchlik b1e5a4
ba2118
# Only use this when bootstrapping python3
ba2118
# Needed to build setuptools for the first time
ba2118
%bcond_with python3_bootstrap
ba2118
0626de
%global unicode ucs4
cvsdist e0fde9
158b42
%global python python2
158b42
c6247f
%global pybasever 2.7
05912b
%global pylibdir %{_libdir}/python%{pybasever}
05912b
%global tools_dir %{pylibdir}/Tools
05912b
%global demo_dir %{pylibdir}/Demo
05912b
%global doc_tools_dir %{pylibdir}/Doc/tools
05912b
%global dynload_dir %{pylibdir}/lib-dynload
05912b
%global site_packages %{pylibdir}/site-packages
cvsdist e0fde9
32b703
# Python's configure script defines SOVERSION, and this is used in the Makefile
32b703
# to determine INSTSONAME, the name of the libpython DSO:
32b703
#   LDLIBRARY='libpython$(VERSION).so'
32b703
#   INSTSONAME="$LDLIBRARY".$SOVERSION
32b703
# We mirror this here in order to make it easier to add the -gdb.py hooks.
32b703
# (if these get out of sync, the payload of the libs subpackage will fail
32b703
# and halt the build)
32b703
%global py_SOVERSION 1.0
f020ab
%global py_INSTSONAME_optimized libpython%{pybasever}.so.%{py_SOVERSION}
f020ab
%global py_INSTSONAME_debug     libpython%{pybasever}_d.so.%{py_SOVERSION}
32b703
5810c5
# Disabled for now:
5810c5
%global with_huntrleaks 0
5810c5
b25d60
%global with_gdb_hooks 1
b25d60
cff1b4
%global with_systemtap 1
4bb3fe
6ad7fb
# some arches don't have valgrind so we need to disable its support on them
dc5f99
%ifnarch s390 %{mips} riscv64
000d17
%global with_valgrind 1
382340
%else
382340
%global with_valgrind 0
000d17
%endif
000d17
05e831
%global with_gdbm 1
5764ad
7a7d98
%if 0%{?_module_build}
7a7d98
%global with_valgrind 0
7a7d98
%global with_systemtap 0
e4e4db
e4e4db
# (Don't) Run the test suite in %%check
e4e4db
%bcond_with tests
e4e4db
%else
e4e4db
# Run the test suite in %%check
e4e4db
%bcond_without tests
7a7d98
%endif
7a7d98
3be16b
# Disable automatic bytecompilation. The python2.7 binary is not yet
3be16b
# available in /usr/bin when Python is built. Also, the bytecompilation fails
3be16b
# on files that test invalid syntax.
3be16b
%undefine __brp_python_bytecompile
08290b
# The above is broken now
08290b
# https://bugzilla.redhat.com/show_bug.cgi?id=1597664
08290b
# This is an older non-standard way to disable the brp script, as a workaround
08290b
%undefine py_auto_byte_compile
4bb3fe
c6247f
# We need to get a newer configure generated out of configure.in for the following
c6247f
# patches:
c6247f
#   patch 4 (CFLAGS)
c6247f
#   patch 52 (valgrind)
c6247f
#   patch 55 (systemtap)
bc10ab
#   patch 145 (linux2)
8adf4f
#
c6247f
# For patch 55 (systemtap), we need to get a new header for configure to use
c6247f
#
c6247f
# configure.in requires autoconf-2.65, but the version in Fedora is currently
c6247f
# autoconf-2.66
c6247f
#
c6247f
# For now, we'll generate a patch to the generated configure script and
c6247f
# pyconfig.h.in on a machine that has a local copy of autoconf 2.65
c6247f
#
c6247f
# Instructions on obtaining such a copy can be seen at
c6247f
#   http://bugs.python.org/issue7997
c6247f
#
c6247f
# To make it easy to regenerate the patch, this specfile can be run in two
c6247f
# ways:
c6247f
# (i) regenerate_autotooling_patch  0 : the normal approach: prep the
c6247f
# source tree using a pre-generated patch to the "configure" script, and do a
c6247f
# full build
c6247f
# (ii) regenerate_autotooling_patch 1 : intended to be run on a developer's
c6247f
# workstation: prep the source tree without patching configure, then rerun a
c6247f
# local copy of autoconf-2.65, regenerate the patch, then exit, without doing
c6247f
# the rest of the build
c6247f
%global regenerate_autotooling_patch 0
c6247f
0052c9
# Python 2 is deprecated in Fedora 30+, see:
0052c9
#   https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
0052c9
# This means that new packages MUST NOT depend on python2, even transitively
0052c9
#   see: https://fedoraproject.org/wiki/Packaging:Deprecating_Packages
0052c9
# Python 2 will not be supported after 2019. Use the python3 package instead
0052c9
# if possible.
0052c9
%if 0%{fedora} >= 30
0052c9
%global deprecated Provides: deprecated()
0052c9
%endif
0052c9
4f38fe
4f38fe
# ==================
4f38fe
# Top-level metadata
4f38fe
# ==================
a7ef9c
Summary: An interpreted, interactive, object-oriented programming language
cvsdist e0fde9
Name: %{python}
4856e5
# Remember to also rebase python2-docs when changing this:
066c25
Version: 2.7.15
ebba43
Release: 11%{?dist}
2d954f
License: Python
cvsdist e4efab
Group: Development/Languages
2ec5b3
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
jbj 8e4b82
Provides: python(abi) = %{pybasever}
4f38fe
0052c9
%?deprecated
0052c9
4f38fe
4f38fe
# =======================
4f38fe
# Build-time requirements
4f38fe
# =======================
4f38fe
4f38fe
# (keep this list alphabetized)
4f38fe
4f38fe
BuildRequires: autoconf
7a7d98
%if ! 0%{?_module_build}
f9657e
BuildRequires: bluez-libs-devel
7a7d98
%endif
4f38fe
BuildRequires: bzip2
4f38fe
BuildRequires: bzip2-devel
7a7d98
BuildRequires: glibc-devel
7a7d98
BuildRequires: gmp-devel
7a7d98
BuildRequires: libdb-devel
7a7d98
BuildRequires: libffi-devel
7a7d98
BuildRequires: ncurses-devel
7a7d98
BuildRequires: pkgconfig
7a7d98
BuildRequires: readline-devel
7a7d98
BuildRequires: sqlite-devel
7a7d98
BuildRequires: tcl-devel
067ca1
8b06c1
# https://bugzilla.redhat.com/show_bug.cgi?id=1609291
8b06c1
BuildRequires: compat-openssl10-devel
8b06c1
3056bf
# For the nis module
3056bf
BuildRequires: libnsl2-devel
3056bf
BuildRequires: libtirpc-devel
3056bf
067ca1
# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME.  We use
067ca1
# it (in pyexpat) in order to enable the fix in Python-2.7.3 for CVE-2012-0876:
067ca1
BuildRequires: expat-devel >= 2.1.0
067ca1
4f38fe
BuildRequires: findutils
4f38fe
BuildRequires: gcc-c++
5764ad
%if %{with_gdbm}
75ba8b
# ABI change without soname bump, reverted
75ba8b
BuildRequires: gdbm-devel >= 1:1.13
5764ad
%endif
7a7d98
%if ! 0%{?_module_build}
4f38fe
BuildRequires: libGL-devel
4f38fe
BuildRequires: libX11-devel
7a7d98
%endif
4f38fe
4f38fe
%if 0%{?with_systemtap}
4f38fe
BuildRequires: systemtap-sdt-devel
4f38fe
# (this introduces a circular dependency, in that systemtap-sdt-devel's
4f38fe
# /usr/bin/dtrace is a python script)
4f38fe
%global tapsetdir      /usr/share/systemtap/tapset
4f38fe
%endif # with_systemtap
4f38fe
4f38fe
BuildRequires: tar
7a7d98
%if ! 0%{?_module_build}
4f38fe
BuildRequires: tix-devel
4f38fe
BuildRequires: tk-devel
7a7d98
%endif
4f38fe
4f38fe
%if 0%{?with_valgrind}
4f38fe
BuildRequires: valgrind-devel
4f38fe
%endif
4f38fe
4f38fe
BuildRequires: zlib-devel
4f38fe
4d74b7
%if %{with rpmwheels}
4d74b7
BuildRequires: python-setuptools-wheel
4d74b7
BuildRequires: python-pip-wheel
4d74b7
%endif
Matej Stuchlik b1e5a4
002eb7
# Providing python27 as now multiple interpreters exist in Fedora
002eb7
# alongside the system one e.g. python26, python33 etc
002eb7
Provides:   python27 = %{version}-%{release}
002eb7
002eb7
# https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
002eb7
# We recommend /usr/bin/python so users get it by default
002eb7
# Versioned recommends are problematic, and we know that the package requires
002eb7
# python2 back with fixed version, so we just use the path here:
002eb7
Recommends: %{_bindir}/python
4f38fe
4d74b7
# Previously, this was required for our rewheel patch to work.
4d74b7
# This is technically no longer needed, but we keep it recommended
4d74b7
# for the developer experience.
4d74b7
Recommends: python2-setuptools
4d74b7
Recommends: python2-pip
4d74b7
4f38fe
4f38fe
# =======================
4f38fe
# Source code and patches
4f38fe
# =======================
4f38fe
890215
Source: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
60b7a5
4bb3fe
# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
4bb3fe
# version of pythondeps.sh:
4bb3fe
Source2: pythondeps.sh
4bb3fe
%global __python_requires %{SOURCE2}
4bb3fe
3dde1c
# Systemtap tapset to make it easier to use the systemtap static probes
3dde1c
# (actually a template; LIBRARY_PATH will get fixed up during install)
3dde1c
# Written by dmalcolm; not yet sent upstream
3dde1c
Source3: libpython.stp
3dde1c
3dde1c
3dde1c
# Example systemtap script using the tapset
3dde1c
# Written by wcohen, mjw, dmalcolm; not yet sent upstream
3dde1c
Source4: systemtap-example.stp
3dde1c
c22243
# Another example systemtap script that uses the tapset
c22243
# Written by dmalcolm; not yet sent upstream
c22243
Source5: pyfuntop.stp
4bb3fe
e0483e
Source7: pynche
85867c
9b458a
# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
9b458a
# the Makefile and config.c
9b458a
#
9b458a
# Upstream leaves many things disabled by default, to try to make it easy as
9b458a
# possible to build the code on as many platforms as possible.
9b458a
#
9b458a
# TODO: many modules can also now be built by setup.py after the python binary
9b458a
# has been built; need to assess if we should instead build things there
9b458a
#
9b458a
# We patch it downstream as follows:
9b458a
#   - various modules are built by default by upstream as static libraries;
9b458a
#   we built them as shared libraries
9b458a
#   - build the "readline" module (appears to also be handled by setup.py now)
3056bf
#   - build the nis module (which needs the tirpc library since glibc 2.26)
9b458a
#   - enable the build of the following modules:
9b458a
#     - array arraymodule.c	# array objects
9b458a
#     - cmath cmathmodule.c # -lm # complex math library functions
9b458a
#     - math mathmodule.c # -lm # math library functions, e.g. sin()
9b458a
#     - _struct _struct.c	# binary structure packing/unpacking
9b458a
#     - time timemodule.c # -lm # time operations and variables
9b458a
#     - operator operator.c	# operator.add() and similar goodies
9b458a
#     - _weakref _weakref.c	# basic weak reference support
9b458a
#     - _testcapi _testcapimodule.c    # Python C API test module
9b458a
#     - _random _randommodule.c	# Random number generator
9b458a
#     - _collections _collectionsmodule.c # Container types
9b458a
#     - itertools itertoolsmodule.c
9b458a
#     - strop stropmodule.c
9b458a
#     - _functools _functoolsmodule.c
9b458a
#     - _bisect _bisectmodule.c	# Bisection algorithms
9b458a
#     - unicodedata unicodedata.c    # static Unicode character database
9b458a
#     - _locale _localemodule.c
9b458a
#     - fcntl fcntlmodule.c	# fcntl(2) and ioctl(2)
8adf4f
#     - spwd spwdmodule.c		# spwd(3)
9b458a
#     - grp grpmodule.c		# grp(3)
9b458a
#     - select selectmodule.c	# select(2); not on ancient System V
9b458a
#     - mmap mmapmodule.c  # Memory-mapped files
9b458a
#     - _csv _csv.c  # CSV file helper
9b458a
#     - _socket socketmodule.c  # Socket module helper for socket(2)
9b458a
#     - _ssl _ssl.c
9b458a
#     - crypt cryptmodule.c -lcrypt	# crypt(3)
9b458a
#     - termios termios.c	# Steen Lumholt's termios module
9b458a
#     - resource resource.c	# Jeremy Hylton's rlimit interface
9b458a
#     - audioop audioop.c	# Operations on audio samples
9b458a
#     - imageop imageop.c	# Operations on images
9b458a
#     - _md5 md5module.c md5.c
9b458a
#     - _sha shamodule.c
9b458a
#     - _sha256 sha256module.c
9b458a
#     - _sha512 sha512module.c
9b458a
#     - linuxaudiodev linuxaudiodev.c
9b458a
#     - timing timingmodule.c
9b458a
#     - _tkinter _tkinter.c tkappinit.c
9b458a
#     - dl dlmodule.c
9b458a
#     - gdbm gdbmmodule.c
9b458a
#     - _bsddb _bsddb.c
9b458a
#     - binascii binascii.c
9b458a
#     - parser parsermodule.c
9b458a
#     - cStringIO cStringIO.c
9b458a
#     - cPickle cPickle.c
9b458a
#     - zlib zlibmodule.c
9b458a
#     - _multibytecodec cjkcodecs/multibytecodec.c
9b458a
#     - _codecs_cn cjkcodecs/_codecs_cn.c
9b458a
#     - _codecs_hk cjkcodecs/_codecs_hk.c
9b458a
#     - _codecs_iso2022 cjkcodecs/_codecs_iso2022.c
9b458a
#     - _codecs_jp cjkcodecs/_codecs_jp.c
9b458a
#     - _codecs_kr cjkcodecs/_codecs_kr.c
9b458a
#     - _codecs_tw cjkcodecs/_codecs_tw.c
4b97ee
Patch0: python-2.7.1-config.patch
9b458a
9b458a
# Removes the "-g" option from "pydoc", for some reason; I believe
9b458a
# (dmalcolm 2010-01-29) that this was introduced in this change:
9b458a
# - fix pydoc (#68082)
9b458a
# in 2.2.1-12 as a response to the -g option needing TkInter installed
9b458a
# (Red Hat Linux 8)
9b458a
# Not upstream
42d74b
Patch1: 00001-pydocnogui.patch
94e658
9b458a
# Add $(CFLAGS) to the linker arguments when linking the "python" binary
9b458a
# since some architectures (sparc64) need this (rhbz:199373).
9b458a
# Not yet filed upstream
440a06
Patch4: python-2.5-cflags.patch
9b458a
9b458a
# Work around a bug in Python' gettext module relating to the "Plural-Forms"
9b458a
# header (rhbz:252136)
9b458a
# Related to upstream issues:
9b458a
#   http://bugs.python.org/issue1448060 and http://bugs.python.org/issue1475523
9b458a
# though the proposed upstream patches are, alas, different
b7dfd0
Patch6: python-2.5.1-plural-fix.patch
9b458a
8adf4f
# This patch was listed in the changelog as:
9b458a
#  * Fri Sep 14 2007 Jeremy Katz <katzj@redhat.com> - 2.5.1-11
8adf4f
#  - fix encoding of sqlite .py files to work around weird encoding problem
9b458a
#  in Turkish (#283331)
9b458a
# A traceback attached to rhbz 244016 shows the problem most clearly: a
9b458a
# traceback on attempting to import the sqlite module, with:
9b458a
#   "SyntaxError: encoding problem: with BOM (__init__.py, line 1)"
9b458a
# This seems to come from Parser/tokenizer.c:check_coding_spec
9b458a
# Our patch changes two source files within sqlite3, removing the
8adf4f
# "coding: ISO-8859-1" specs and character E4 = U+00E4 =
8adf4f
# LATIN SMALL LETTER A WITH DIAERESIS from in ghaering's surname.
9b458a
#
9b458a
# It may be that the conversion of "ISO-8859-1" to "iso-8859-1" is thwarted
9b458a
# by the implementation of "tolower" in the Turkish locale; see:
9b458a
#   https://bugzilla.redhat.com/show_bug.cgi?id=191096#c9
8adf4f
#
9b458a
# TODO: Not yet sent upstream, and appears to me (dmalcolm 2010-01-29) that
9b458a
# it may be papering over a symptom
e574c7
Patch7: python-2.5.1-sqlite-encoding.patch
9b458a
9b458a
# FIXME: Lib/ctypes/util.py posix implementation defines a function
9b458a
# _get_soname(f).  Upstreams's implementation of this uses objdump to read the
9b458a
# SONAME from a library; we avoid this, apparently to minimize space
9b458a
# requirements on the live CD:
9b458a
# (rhbz:307221)
202761
Patch10: 00010-2.7.13-binutils-no-dep.patch
9b458a
b0a6ae
# Upstream as of Python 2.7.3:
b0a6ae
#  Patch11: python-2.7rc1-codec-ascii-tolower.patch
9b458a
9b458a
# Add various constants to the socketmodule (rhbz#436560):
9b458a
# TODO: these patches were added in 2.5.1-22 and 2.5.1-24 but appear not to
9b458a
# have been sent upstream yet:
c6247f
Patch13: python-2.7rc1-socketmodule-constants.patch
c6247f
Patch14: python-2.7rc1-socketmodule-constants2.patch
9b458a
9b458a
# Remove an "-rpath $(LIBDIR)" argument from the linkage args in configure.in:
9b458a
# FIXME: is this for OSF, not Linux?
a7ef9c
Patch16: python-2.6-rpath.patch
60b7a5
f5df1f
# Fixup distutils/unixccompiler.py to remove standard library path from rpath:
f5df1f
# Adapted from Patch0 in ivazquez' python3000 specfile, removing usage of
f5df1f
# super() as it's an old-style class
f5df1f
Patch17: python-2.6.4-distutils-rpath.patch
f5df1f
6ad7fb
# 00055 #
5ae15c
# Systemtap support: add statically-defined probe points
5ae15c
# Patch based on upstream bug: http://bugs.python.org/issue4111
c22243
# fixed up by mjw and wcohen for 2.6.2, then fixed up by dmalcolm for 2.6.4
c6247f
# then rewritten by mjw (attachment 390110 of rhbz 545179), then reformatted
c6247f
# for 2.7rc1 by dmalcolm:
e16547
Patch55: 00055-systemtap.patch
5ae15c
cf221a
# Only used when "%%{_lib}" == "lib64"
9b458a
# Fixup various paths throughout the build and in distutils from "lib" to "lib64",
9b458a
# and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of
9b458a
# /usr/lib/pythonMAJOR.MINOR/site-packages
9b458a
# Not upstream
202761
Patch102: 00102-2.7.13-lib64.patch
c6247f
c6247f
# Python 2.7 split out much of the path-handling from distutils/sysconfig.py to
c6247f
# a new sysconfig.py (in r77704).
c6247f
# We need to make equivalent changes to that new file to ensure that the stdlib
c6247f
# and platform-specific code go to /usr/lib64 not /usr/lib, on 64-bit archs:
c6247f
Patch103: python-2.7-lib64-sysconfig.patch
cvsdist 20402f
6ad7fb
# 00104 #
cf221a
# Only used when "%%{_lib}" == "lib64"
866e92
# Another lib64 fix, for distutils/tests/test_install.py; not upstream:
866e92
Patch104: 00104-lib64-fix-for-test_install.patch
866e92
6ad7fb
# 00111 #
3fdd60
# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
3fdd60
# a libpythonMAJOR.MINOR.a (bug 550692):
48617b
# Downstream only: not appropriate for upstream
e16547
Patch111: 00111-no-static-lib.patch
3fdd60
6ad7fb
# 00112 #
f020ab
# Patch to support building both optimized vs debug stacks DSO ABIs, sharing
f020ab
# the same .py and .pyc files, using "_d.so" to signify a debug build of an
f020ab
# extension module.
f020ab
#
8adf4f
# Based on Debian's patch for the same,
f020ab
#  http://patch-tracker.debian.org/patch/series/view/python2.6/2.6.5-2/debug-build.dpatch
8adf4f
#
f020ab
# (which was itself based on the upstream Windows build), but with some
f020ab
# changes:
f020ab
#
f020ab
#   * Debian's patch to dynload_shlib.c looks for module_d.so, then module.so,
f020ab
# but this can potentially find a module built against the wrong DSO ABI.  We
f020ab
# instead search for just module_d.so in a debug build
f020ab
#
f020ab
#   * We remove this change from configure.in's build of the Makefile:
f020ab
#   SO=$DEBUG_EXT.so
f020ab
# so that sysconfig.py:customize_compiler stays with shared_lib_extension='.so'
f020ab
# on debug builds, so that UnixCCompiler.find_library_file can find system
f020ab
# libraries (otherwise "make sharedlibs" fails to find system libraries,
f020ab
# erroneously looking e.g. for "libffi_d.so" rather than "libffi.so")
f020ab
#
f020ab
#   * We change Lib/distutils/command/build_ext.py:build_ext.get_ext_filename
f020ab
# to add the _d there, when building an extension.  This way, "make sharedlibs"
f020ab
# can build ctypes, by finding the sysmtem libffi.so (rather than failing to
f020ab
# find "libffi_d.so"), and builds the module as _ctypes_d.so
8adf4f
#
f020ab
#   * Similarly, update build_ext:get_libraries handling of Py_ENABLE_SHARED by
f020ab
# appending "_d" to the python library's name for the debug configuration
f020ab
#
f020ab
#   * We modify Modules/makesetup to add the "_d" to the generated Makefile
f020ab
# rules for the various Modules/*.so targets
f020ab
#
f020ab
# This may introduce issues when building an extension that links directly
f020ab
# against another extension (e.g. users of NumPy?), but seems more robust when
f020ab
# searching for external libraries
f020ab
#
f020ab
#   * We don't change Lib/distutils/command/build.py: build.build_purelib to
f020ab
# embed plat_specifier, leaving it as is, as pure python builds should be
f020ab
# unaffected by these differences (we'll be sharing the .py and .pyc files)
f020ab
#
f020ab
#   * We introduce DEBUG_SUFFIX as well as DEBUG_EXT:
f020ab
#     - DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d" for
f020ab
# a debug build
f020ab
#     - DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a
f020ab
# debug build
f020ab
#
f020ab
#   Both will be empty in an optimized build.  "_d" contains characters that
f020ab
# are valid ELF metadata, but this leads to various ugly filesystem paths (such
f020ab
# as the include path), and DEBUG_SUFFIX allows these paths to have more natural
f020ab
# names.  Changing this requires changes elsewhere in the distutils code.
f020ab
#
f020ab
#   * We add DEBUG_SUFFIX to PYTHON in the Makefile, so that the two
f020ab
# configurations build parallel-installable binaries with different names
f020ab
# ("python-debug" vs "python").
f020ab
#
f020ab
#   * Similarly, we add DEBUG_SUFFIX within python-config and
f020ab
#  python$(VERSION)-config, so that the two configuration get different paths
f020ab
#  for these.
73e351
#
73e351
#  See also patch 130 below
73e351
#
202761
Patch112: 00112-2.7.13-debug-build.patch
50ca18
ab11e4
6ad7fb
# 00113 #
ab11e4
# Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options
ab11e4
# described at http://svn.python.org/projects/python/trunk/Misc/SpecialBuilds.txt
ab11e4
# so that if they are enabled, they will be in that build's pyconfig.h, so that
ab11e4
# extension modules will reliably use them
48617b
# Not yet sent upstream
e16547
Patch113: 00113-more-configuration-flags.patch
ab11e4
6ad7fb
# 00114 #
1b84fe
# Add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
1b84fe
# (rhbz:553020); partially upstream as http://bugs.python.org/issue7647
48617b
# Not yet sent upstream
e16547
Patch114: 00114-statvfs-f_flag-constants.patch
1b84fe
c6247f
# Upstream r79310 removed the "Modules" directory from sys.path when Python is
c6247f
# running from the build directory on POSIX to fix a unit test (issue #8205).
c6247f
# This seems to have broken the compileall.py done in "make install": it cannot
c6247f
# find shared library extension modules at this point in the build (sys.path
c6247f
# does not contain DESTDIR/usr/lib(64)/python-2.7/lib-dynload for some reason),
c6247f
# leading to the build failing with:
c6247f
# Traceback (most recent call last):
c6247f
#   File "/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/compileall.py", line 17, in <module>
c6247f
#     import struct
c6247f
#   File "/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/struct.py", line 1, in <module>
c6247f
#    from _struct import *
c6247f
# ImportError: No module named _struct
7b42f4
# This patch adds the build Modules directory to build path.
7b42f4
Patch121: 00121-add-Modules-to-build-path.patch
c6247f
4b97ee
# 2.7.1 (in r84230) added a test to test_abc which fails if python is
4b97ee
# configured with COUNT_ALLOCS, which is the case for our debug build
4b97ee
# (the COUNT_ALLOCS instrumentation keeps "C" alive).
4b97ee
# Not yet sent upstream
4b97ee
Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
4b97ee
6ad7fb
# 00130 #
73e351
# Add "--extension-suffix" option to python-config and python-debug-config
73e351
# (rhbz#732808)
73e351
#
73e351
# This is adapted from 3.2's PEP-3149 support.
73e351
#
73e351
# Fedora's debug build has some non-standard features (see also patch 112
73e351
# above), though largely shared with Debian/Ubuntu and Windows
73e351
#
73e351
# In particular, SO in the Makefile is currently always just ".so" for our
73e351
# python 2 optimized builds, but for python 2 debug it should be '_d.so', to
73e351
# distinguish the debug vs optimized ABI, following the pattern in the above
73e351
# patch.
73e351
#
73e351
# Not yet sent upstream
73e351
Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch
73e351
6ad7fb
# 00131 #
e25252
# The four tests in test_io built on top of check_interrupted_write_retry
e25252
# fail when built in Koji, for ppc and ppc64; for some reason, the SIGALRM
e25252
# handlers are never called, and the call to write runs to completion
e25252
# (rhbz#732998)
e16547
Patch131: 00131-disable-tests-in-test_io.patch
e25252
6ad7fb
# 00132 #
866e92
# Add non-standard hooks to unittest for use in the "check" phase below, when
866e92
# running selftests within the build:
866e92
#   @unittest._skipInRpmBuild(reason)
866e92
# for tests that hang or fail intermittently within the build environment, and:
866e92
#   @unittest._expectedFailureInRpmBuild
866e92
# for tests that always fail within the build environment
866e92
#
866e92
# The hooks only take effect if WITHIN_PYTHON_RPM_BUILD is set in the
866e92
# environment, which we set manually in the appropriate portion of the "check"
866e92
# phase below (and which potentially other python-* rpms could set, to reuse
866e92
# these unittest hooks in their own "check" phases)
866e92
Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch
866e92
6ad7fb
# 00133 #
866e92
# "dl" is deprecated, and test_dl doesn't work on 64-bit builds:
866e92
Patch133: 00133-skip-test_dl.patch
866e92
6ad7fb
# 00136 #
866e92
# Some tests try to seek on sys.stdin, but don't work as expected when run
866e92
# within Koji/mock; skip them within the rpm build:
866e92
Patch136: 00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
866e92
6ad7fb
# 00137 #
866e92
# Some tests within distutils fail when run in an rpmbuild:
866e92
Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
866e92
6ad7fb
# 00138 #
866e92
# Fixup some tests within distutils to work with how debug builds are set up:
866e92
Patch138: 00138-fix-distutils-tests-in-debug-build.patch
866e92
6ad7fb
# 00139 #
866e92
# ARM-specific: skip known failure in test_float:
866e92
#  http://bugs.python.org/issue8265 (rhbz#706253)
866e92
Patch139: 00139-skip-test_float-known-failure-on-arm.patch
866e92
6ad7fb
# 00140 #
866e92
# Sparc-specific: skip known failure in test_ctypes:
866e92
#  http://bugs.python.org/issue8314 (rhbz#711584)
866e92
# which appears to be a libffi bug
866e92
Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch
866e92
6ad7fb
# 00142 #
866e92
# Some pty tests fail when run in mock (rhbz#714627):
866e92
Patch142: 00142-skip-failing-pty-tests-in-rpmbuild.patch
866e92
6ad7fb
# 00143 #
e16547
# Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid
e16547
# aliasing violations (rhbz#698726)
e16547
# Sent upstream as http://bugs.python.org/issue12872
e16547
Patch143: 00143-tsc-on-ppc.patch
e16547
6ad7fb
# 00144 #
5764ad
# (Optionally) disable the gdbm module:
5764ad
Patch144: 00144-no-gdbm.patch
5764ad
6ad7fb
# 00146 #
991332
# Support OpenSSL FIPS mode (e.g. when OPENSSL_FORCE_FIPS_MODE=1 is set)
991332
# - handle failures from OpenSSL (e.g. on attempts to use MD5 in a
991332
#   FIPS-enforcing environment)
991332
# - add a new "usedforsecurity" keyword argument to the various digest
991332
#   algorithms in hashlib so that you can whitelist a callsite with
991332
#   "usedforsecurity=False"
991332
# (sent upstream for python 3 as http://bugs.python.org/issue9216; this is a
991332
# backport to python 2.7; see RHEL6 patch 119)
991332
# - enforce usage of the _hashlib implementation: don't fall back to the _md5
991332
#   and _sha* modules (leading to clearer error messages if fips selftests
991332
#   fail)
991332
# - don't build the _md5 and _sha* modules; rely on the _hashlib implementation
991332
#   of hashlib (for example, md5.py will use _hashlib's implementation of MD5,
991332
#   if permitted by the FIPS setting)
991332
# (rhbz#563986)
991332
Patch146: 00146-hashlib-fips.patch
991332
6ad7fb
# 00147 #
a43d18
# Add a sys._debugmallocstats() function
a43d18
# Based on patch 202 from RHEL 5's python.spec, with updates from rhbz#737198
e85703
# Sent upstream as http://bugs.python.org/issue14785
a43d18
Patch147: 00147-add-debug-malloc-stats.patch
a43d18
6ad7fb
# 00153 #
b0a6ae
# Strip out lines of the form "warning: Unable to open ..." from gdb's stderr
b0a6ae
# when running test_gdb.py; also cope with change to gdb in F17 onwards in
b0a6ae
# which values are printed as "v@entry" rather than just "v":
48617b
# Not yet sent upstream
b0a6ae
Patch153: 00153-fix-test_gdb-noise.patch
cd5070
6ad7fb
# 00155 #
7461fe
# Avoid allocating thunks in ctypes unless absolutely necessary, to avoid
7461fe
# generating SELinux denials on "import ctypes" and "import uuid" when
7461fe
# embedding Python within httpd (rhbz#814391)
7461fe
Patch155: 00155-avoid-ctypes-thunks.patch
7461fe
6ad7fb
# 00156 #
926168
# Recent builds of gdb will only auto-load scripts from certain safe
1fa9c8
# locations.  Turn off this protection when running test_gdb in the selftest
1fa9c8
# suite to ensure that it can load our -gdb.py script (rhbz#817072):
48617b
# Not yet sent upstream
926168
Patch156: 00156-gdb-autoload-safepath.patch
926168
a96f75
# 00157 #
a96f75
# Update uid/gid handling throughout the standard library: uid_t and gid_t are
a96f75
# unsigned 32-bit values, but existing code often passed them through C long
a96f75
# values, which are signed 32-bit values on 32-bit architectures, leading to
a96f75
# negative int objects for uid/gid values >= 2^31 on 32-bit architectures.
a96f75
#
a96f75
# Introduce _PyObject_FromUid/Gid to convert uid_t/gid_t values to python
a96f75
# objects, using int objects where the value will fit (long objects otherwise),
a96f75
# and _PyArg_ParseUid/Gid to convert int/long to uid_t/gid_t, with -1 allowed
a96f75
# as a special case (since this is given special meaning by the chown syscall)
a96f75
#
a96f75
# Update standard library to use this throughout for uid/gid values, so that
a96f75
# very large uid/gid values are round-trippable, and -1 remains usable.
a96f75
# (rhbz#697470)
a96f75
Patch157: 00157-uid-gid-overflows.patch
a96f75
9fa4f3
# 00165 #
9fa4f3
# Backport to Python 2 from Python 3.3 of improvements to the "crypt" module
9fa4f3
# adding precanned ways of salting a password (rhbz#835021)
9fa4f3
# Based on r88500 patch to py3k from Python 3.3
9fa4f3
# plus 6482dd1c11ed, 0586c699d467, 62994662676a, 74a1110a3b50, plus edits
9fa4f3
# to docstrings to note that this additional functionality is not standard
9fa4f3
# within 2.7
9fa4f3
Patch165: 00165-crypt-module-salt-backport.patch
9fa4f3
d63f6b
# 00167 #
d63f6b
# Don't run any of the stack navigation tests in test_gdb when Python is
d63f6b
# optimized, since there appear to be many different ways in which gdb can
d63f6b
# fail to read the PyFrameObject* for arbitrary places in the callstack,
d63f6b
# presumably due to compiler optimization (rhbz#912025)
d63f6b
#
d63f6b
# Not yet sent upstream
d63f6b
Patch167: 00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
d63f6b
01cf2c
# 00168 #
01cf2c
# Update distutils.sysconfig so that if CFLAGS is defined in the environment,
01cf2c
# when building extension modules, it is appended to the full compilation
01cf2c
# flags from Python's Makefile, rather than instead reducing the compilation
01cf2c
# flags to the subset within OPT and adding it to those.
01cf2c
#
01cf2c
# In particular, this should ensure that "-fno-strict-aliasing" is used by
01cf2c
# "python setup.py build" even when CFLAGS is defined in the environment.
01cf2c
#
01cf2c
# (rhbz#849994)
01cf2c
Patch168: 00168-distutils-cflags.patch
01cf2c
41aa0d
# 00169 #
41aa0d
# Use SHA-256 rather than implicitly using MD5 within the challenge handling
41aa0d
# in multiprocessing.connection
41aa0d
#
41aa0d
# Sent upstream as http://bugs.python.org/issue17258
41aa0d
# (rhbz#879695)
41aa0d
Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
41aa0d
6a2708
# 00170 #
6a2708
# In debug builds, try to print repr() when a C-level assert fails in the
6a2708
# garbage collector (typically indicating a reference-counting error
6a2708
# somewhere else e.g in an extension module)
6a2708
# Backported to 2.7 from a patch I sent upstream for py3k
6a2708
#   http://bugs.python.org/issue9263  (rhbz#614680)
6a2708
# hiding the proposed new macros/functions within gcmodule.c to avoid exposing
6a2708
# them within the extension API.
6a2708
# (rhbz#850013)
6a2708
Patch170: 00170-gc-assertions.patch
6a2708
4e8ad3
# 00174 #
4e8ad3
# Workaround for failure to set up prefix/exec_prefix when running
4e8ad3
# an embededed libpython that sets Py_SetProgramName() to a name not
4e8ad3
# on $PATH when run from the root directory due to
4e8ad3
#   https://fedoraproject.org/wiki/Features/UsrMove
4e8ad3
# e.g. cmpi-bindings under systemd (rhbz#817554):
4e8ad3
Patch174: 00174-fix-for-usr-move.patch
4e8ad3
7b42f4
# 00180 #
7b42f4
# Enable building on ppc64p7
7b42f4
# Not appropriate for upstream, Fedora-specific naming
7b42f4
Patch180: 00180-python-add-support-for-ppc64p7.patch
7b42f4
7b42f4
# 00181 #
a31104
# Allow arbitrary timeout for Condition.wait, as reported in
a31104
# https://bugzilla.redhat.com/show_bug.cgi?id=917709
a31104
# Upstream doesn't want this: http://bugs.python.org/issue17748
a31104
# But we have no better solution downstream yet, and since there is
a31104
# no API breakage, we apply this patch.
a31104
# Doesn't apply to Python 3, where this is fixed otherwise and works.
7b42f4
Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch
cd7ed9
Matej Stuchlik 6f6573
# 00185 #
a9f6e8
# Makes urllib2 honor "no_proxy" enviroment variable for "ftp:" URLs
a9f6e8
# when ftp_proxy is set
a9f6e8
Patch185: 00185-urllib2-honors-noproxy-for-ftp.patch
a9f6e8
a9f6e8
# 00187 #
a9f6e8
# Add an explicit RPATH to pyexpat.so pointing at the directory
a9f6e8
# containing the system expat (which has the extra XML_SetHashSalt
a9f6e8
# symbol), to avoid an ImportError with a link error if there's an
a9f6e8
# LD_LIBRARY_PATH containing a "vanilla" build of expat (without the
a9f6e8
# symbol)
a9f6e8
Patch187: 00187-add-RPATH-to-pyexpat.patch
a9f6e8
4d74b7
# 00189 #
4d74b7
# Instead of bundled wheels, use our RPM packaged wheels from
4d74b7
# /usr/share/python-wheels
4d74b7
Patch189: 00189-use-rpm-wheels.patch
4d74b7
d60e5a
# 00190 #
c86b2c
# Fixes gdb py-bt command not to raise exception while processing
c86b2c
# statements from eval
c86b2c
# rhbz#1008154 (patch by Attila Fazekas)
d60e5a
Patch190: 00190-gdb-py-bt-dont-raise-exception-from-eval.patch
c86b2c
112f64
# 00191 #
112f64
# Disabling NOOP test as it fails without internet connection
112f64
Patch191: 00191-disable-NOOP.patch
112f64
673992
# 00193 #
673992
# Enable loading sqlite extensions. This patch isn't needed for
673992
# python3.spec, since Python 3 has a configuration option for this.
673992
# rhbz#1066708
673992
# Patch provided by John C. Peterson
673992
Patch193: 00193-enable-loading-sqlite-extensions.patch
673992
3056bf
# 00289 #
3056bf
# Disable automatic detection for the nis module
3056bf
# (we handle it it in Setup.dist, see Patch0)
3056bf
Patch289: 00289-disable-nis-detection.patch
3056bf
0dfe62
# 00309 #
0dfe62
# CVE-2018-1000802
0dfe62
# shutil._call_external_zip to use subprocess instead of distutils.spawn
0dfe62
# rhbz#1631662
0dfe62
# Fixed upstream https://bugs.python.org/issue34540
0dfe62
Patch309: 00309-shutil-spawn-subprocess.patch
0dfe62
ebba43
# 00310 #
ebba43
# CVE-2018-14647
ebba43
# Use XML_SetHashSalt in _elementtree
ebba43
# rhbz#1631822
ebba43
# Fixed upstream https://bugs.python.org/issue34623
ebba43
Patch310: 00310-use-xml-sethashsalt-in-elementtree.patch
ebba43
866e92
# (New patches go here ^^^)
866e92
#
890215
# When adding new patches to "python2" and "python3" in Fedora, EL, etc.,
a75935
# please try to keep the patch numbers in-sync between all specfiles.
866e92
#
a75935
# More information, and a patch number catalog, is at:
866e92
#
a75935
#     https://fedoraproject.org/wiki/SIGs/Python/PythonPatches
866e92
c6247f
# This is the generated patch to "configure"; see the description of
cf221a
#   %%{regenerate_autotooling_patch}
c6247f
# above:
1554eb
1554eb
# Disable tk for modularity builds to break up build dependencies
1554eb
Patch04000: 04000-modularity-disable-tk.patch
1554eb
498957
Patch5000: 05000-autotool-intermediates.patch
468e2b
4f38fe
# ======================================================
4f38fe
# Additional metadata, and subpackages
4f38fe
# ======================================================
4f38fe
ce1eee
URL: https://www.python.org/
cvsdist e4efab
cvsdist e4efab
%description
890215
Python 2 is an old version of the language that is incompatible with the 3.x
890215
line of releases. The language is mostly the same, but many details, especially
890215
how built-in objects like dictionaries and strings work, have changed
890215
considerably, and a lot of deprecated features have finally been removed in the
890215
3.x line.
890215
890215
Note that documentation for Python 2 is provided in the python2-docs
cvsdist e4efab
package.
cvsdist e4efab
890215
This package provides the "python2" executable; most of the actual
890215
implementation is within the "python2-libs" package.
2ec5b3
002eb7
002eb7
%package -n python-unversioned-command
002eb7
Summary: The "python" command that runs Python 2
002eb7
BuildArch: noarch
002eb7
# https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
0052c9
%?deprecated
002eb7
002eb7
# In theory this could require any python2 version
002eb7
Requires: python2 == %{version}-%{release}
002eb7
# But since we want to provide versioned python, we require exact version
002eb7
Provides: python = %{version}-%{release}
002eb7
# This also save us an explicit conflict for older python2 builds
002eb7
002eb7
%description -n python-unversioned-command
002eb7
This package contains /usr/bin/python - the "python" command that runs Python 2.
002eb7
002eb7
87c8da
%package libs
890215
Summary: Runtime libraries for Python 2
87c8da
Group: Applications/System
0052c9
%?deprecated
2ec5b3
59062c
# Needed for ctypes, to load libraries, worked around for Live CDs size
59062c
# Requires: binutils
87c8da
067ca1
# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME.  We use
067ca1
# this symbol (in pyexpat), so we must explicitly state this dependency to
067ca1
# prevent "import pyexpat" from failing with a linker error if someone hasn't
067ca1
# yet upgraded expat:
067ca1
Requires: expat >= 2.1.0
067ca1
f3da2c
# Python built with glibc >= 2.24.90-26 needs to require it (rhbz#1410644).
f3da2c
Requires: glibc%{?_isa} >= 2.24.90-26
f3da2c
75ba8b
%if %{with_gdbm}
75ba8b
# ABI change without soname bump, reverted
75ba8b
Requires: gdbm%{?_isa} >= 1:1.13
75ba8b
%endif
75ba8b
4d74b7
%if %{with rpmwheels}
4d74b7
Requires: python-setuptools-wheel
4d74b7
Requires: python-pip-wheel
4d74b7
%else
4d74b7
Provides: bundled(python2-pip) = 9.0.3
4d74b7
Provides: bundled(python2-setuptools) = 39.0.1
4d74b7
%endif
4d74b7
158b42
Provides: python-libs = %{version}-%{release}
158b42
Provides: python-libs%{?_isa} = %{version}-%{release}
158b42
87c8da
%description libs
890215
This package contains files used to embed Python 2 into applications.
87c8da
cvsdist e4efab
%package devel
890215
Summary: Libraries and header files needed for Python 2 development
cvsdist e4efab
Group: Development/Libraries
0052c9
%?deprecated
0052c9
0626de
Requires: %{python}%{?_isa} = %{version}-%{release}
Orion Poplawski 9e0b4c
Requires: python-rpm-macros
Orion Poplawski 9e0b4c
Requires: python2-rpm-macros
c6247f
Requires: pkgconfig
3bebf1
ba2118
%if %{without python3_bootstrap}
ba2118
# When bootstrapping python3, we need to build setuptools
ba2118
# But setuptools BR python2-devel and that brings in python3-rpm-generators
ba2118
# python3-rpm-generators needs python3-setuptools, so we cannot have it yet
ba2118
Requires: python3-rpm-generators
ba2118
%endif
ba2118
e8ef86
# This is not "API" (packages that need setuptools should still BuildRequire it)
e8ef86
# However some packages apparently can build both with and without setuptools
e8ef86
# producing egg-info as file or directory (depending on setuptools presence).
e8ef86
# Directory-to-file updates are problematic in RPM, so we ensure setuptools is
e8ef86
# installed when -devel is required.
e8ef86
# See https://bugzilla.redhat.com/show_bug.cgi?id=1623922
e8ef86
# See https://fedoraproject.org/wiki/Packaging:Directory_Replacement
e8ef86
Requires: python2-setuptools
e8ef86
3bebf1
# https://bugzilla.redhat.com/show_bug.cgi?id=1217376
3bebf1
# https://bugzilla.redhat.com/show_bug.cgi?id=1496757
3bebf1
# https://bugzilla.redhat.com/show_bug.cgi?id=1218294
3bebf1
# TODO change to a specific subpackage once available (#1218294)
3bebf1
Requires: redhat-rpm-config
3bebf1
cvsdist 64c8a9
# Needed here because of the migration of Makefile from -devel to the main
cvsdist 64c8a9
# package
cvsdist 64c8a9
Conflicts: %{python} < %{version}-%{release}
cvsdist e4efab
158b42
Provides: python-devel = %{version}-%{release}
158b42
Provides: python-devel%{?_isa} = %{version}-%{release}
158b42
cvsdist e4efab
%description devel
890215
This package contains libraries and header files used to build applications
890215
with and native libraries for Python 2
cvsdist e4efab
cvsdist e4efab
%package tools
890215
Summary: A collection of development tools included with Python 2
cvsdist e4efab
Group: Development/Tools
0052c9
%?deprecated
0052c9
cvsdist 8caa1f
Requires: %{name} = %{version}-%{release}
158b42
Requires: %{python}-tkinter = %{version}-%{release}
158b42
158b42
Provides: python-tools = %{version}-%{release}
158b42
Provides: python-tools%{?_isa} = %{version}-%{release}
cvsdist e4efab
cvsdist e4efab
%description tools
890215
This package includes several tools to help with the development of Python 2
8adf4f
programs, including IDLE (an IDE with editing and debugging facilities), a
8adf4f
color editor (pynche), and a python gettext program (pygettext.py).
cvsdist e4efab
158b42
%package tkinter
890215
Summary: A graphical user interface for the Python 2 scripting language
cvsdist e4efab
Group: Development/Languages
0052c9
%?deprecated
0052c9
cvsdist 8caa1f
Requires: %{name} = %{version}-%{release}
cvsdist e4efab
158b42
Provides: tkinter = %{version}-%{release}
158b42
Provides: tkinter%{?_isa} = %{version}-%{release}
158b42
Provides: tkinter2 = %{version}-%{release}
158b42
Provides: tkinter2%{?_isa} = %{version}-%{release}
158b42
Provides: python-tkinter = %{version}-%{release}
158b42
Provides: python-tkinter%{?_isa} = %{version}-%{release}
158b42
158b42
%description tkinter
cvsdist e0fde9
cvsdist e4efab
The Tkinter (Tk interface) program is an graphical user interface for
890215
the Python 2 scripting language.
cvsdist e4efab
890215
You should install the python2tkinter package if you'd like to use a graphical
890215
user interface for Python 2 programming.
cvsdist e4efab
860ed4
%package test
890215
Summary: The test modules from the main python2 package
860ed4
Group: Development/Languages
0052c9
%?deprecated
0052c9
860ed4
Requires: %{name} = %{version}-%{release}
860ed4
158b42
Provides: python-test = %{version}-%{release}
158b42
Provides: python-test%{?_isa} = %{version}-%{release}
158b42
860ed4
%description test
860ed4
890215
The test modules from the main python2 package: %{name}
860ed4
These have been removed to save space, as they are never or almost
860ed4
never used in production.
860ed4
890215
You might want to install the python2-test package if you're developing python 2
b02c01
code that uses more than just unittest and/or test.support.
860ed4
e4e4db
%if %{with debug_build}
f020ab
%package debug
890215
Summary: Debug version of the Python 2 runtime
f020ab
Group: Applications/System
0052c9
%?deprecated
f020ab
f020ab
# The debug build is an all-in-one package version of the regular build, and
f020ab
# shares the same .py/.pyc files and directories as the regular build.  Hence
f020ab
# we depend on all of the subpackages of the regular build:
f020ab
Requires: %{name}%{?_isa} = %{version}-%{release}
f020ab
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
f020ab
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
f020ab
Requires: %{name}-test%{?_isa} = %{version}-%{release}
158b42
Requires: %{python}-tkinter%{?_isa} = %{version}-%{release}
f020ab
Requires: %{name}-tools%{?_isa} = %{version}-%{release}
f020ab
158b42
Provides: python-debug = %{version}-%{release}
158b42
Provides: python-debug%{?_isa} = %{version}-%{release}
158b42
f020ab
%description debug
890215
python2-debug provides a version of the Python 2 runtime with numerous debugging
f020ab
features enabled, aimed at advanced Python users, such as developers of Python
f020ab
extension modules.
f020ab
890215
This version uses more memory and will be slower than the regular Python 2 build,
f020ab
but is useful for tracking down reference-counting issues, and other bugs.
f020ab
f020ab
The bytecodes are unchanged, so that .pyc files are compatible between the two
890215
version of Python 2, but the debugging features mean that C/C++ extension modules
f020ab
are ABI-incompatible with those built for the standard runtime.
f020ab
890215
It shares installation directories with the standard Python 2 runtime, so that
f020ab
.py and .pyc files can be shared.  All compiled extension modules gain a "_d"
890215
suffix ("foo_d.so" rather than "foo.so") so that each Python 2 implementation can
f020ab
load its own extensions.
e4e4db
%endif # with debug_build
f020ab
4f38fe
4f38fe
# ======================================================
4f38fe
# The prep phase of the build:
4f38fe
# ======================================================
4f38fe
cvsdist e4efab
%prep
60b7a5
%setup -q -n Python-%{version}
cvsdist e4efab
3dde1c
%if 0%{?with_systemtap}
3dde1c
# Provide an example of usage of the tapset:
3dde1c
cp -a %{SOURCE4} .
c22243
cp -a %{SOURCE5} .
3dde1c
%endif # with_systemtap
3dde1c
05912b
# Ensure that we're using the system copy of various libraries, rather than
05912b
# copies shipped by upstream in the tarball:
94e658
#   Remove embedded copy of expat:
94e658
rm -r Modules/expat || exit 1
94e658
05912b
#   Remove embedded copy of libffi:
0626de
for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx ; do
0626de
  rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
0626de
done
0626de
05912b
#   Remove embedded copy of zlib:
05912b
rm -r Modules/zlib || exit 1
05912b
7c1eb9
## Disabling hashlib patch for now as it needs to be reimplemented
7c1eb9
## for OpenSSL 1.1.0.
991332
# Don't build upstream Python's implementation of these crypto algorithms;
991332
# instead rely on _hashlib and OpenSSL.
991332
#
991332
# For example, in our builds md5.py uses always uses hashlib.md5 (rather than
991332
# falling back to _md5 when hashlib.md5 is not available); hashlib.md5 is
991332
# implemented within _hashlib via OpenSSL (and thus respects FIPS mode)
7c1eb9
#for f in md5module.c md5.c shamodule.c sha256module.c sha512module.c; do
7c1eb9
#    rm Modules/$f
7c1eb9
#done
991332
05912b
#
05912b
# Apply patches:
05912b
#
cvsdist e0fde9
%patch0 -p1 -b .rhconfig
60b7a5
%patch1 -p1 -b .no_gui
440a06
%patch4 -p1 -b .cflags
b7dfd0
%patch6 -p1 -b .plural
e574c7
%patch7 -p1
60b7a5
a95ca8
%if "%{_lib}" == "lib64"
60b7a5
%patch102 -p1 -b .lib64
c6247f
%patch103 -p1 -b .lib64-sysconfig
866e92
%patch104 -p1
cvsdist 20402f
%endif
60b7a5
59062c
%patch10 -p1 -b .binutils-no-dep
b7ef3f
%patch13 -p1 -b .socketmodule
a7ef9c
%patch14 -p1 -b .socketmodule2
a7ef9c
%patch16 -p1 -b .rpath
f5df1f
%patch17 -p1 -b .distutils-rpath
59062c
c22243
%if 0%{?with_systemtap}
5ae15c
%patch55 -p1 -b .systemtap
c22243
%endif
5e852d
3fdd60
%patch111 -p1 -b .no-static-lib
3fdd60
f020ab
%patch112 -p1 -b .debug-build
f020ab
ab11e4
%patch113 -p1 -b .more-configuration-flags
ab11e4
1b84fe
%patch114 -p1 -b .statvfs-f-flag-constants
1b84fe
96cf82
42d74b
%patch121 -p1
4b97ee
%patch128 -p1
e16547
73e351
%patch130 -p1
94e850
663654
%ifarch ppc %{power64}
e25252
%patch131 -p1
e25252
%endif
e25252
866e92
%patch132 -p1
866e92
%patch133 -p1
b27665
%patch136 -p1 -b .stdin-test
866e92
%patch137 -p1
866e92
%patch138 -p1
866e92
%ifarch %{arm}
866e92
%patch139 -p1
866e92
%endif
866e92
%ifarch %{sparc}
866e92
%patch140 -p1
866e92
%endif
b64e81
%patch142 -p1 -b .tty-fail
e16547
%patch143 -p1 -b .tsc-on-ppc
5764ad
%if !%{with_gdbm}
5764ad
%patch144 -p1
5764ad
%endif
7c1eb9
#patch146 -p1
a43d18
%patch147 -p1
b0a6ae
%patch153 -p0
7461fe
%patch155 -p1
926168
%patch156 -p1
899afa
%patch157 -p1
9fa4f3
%patch165 -p1
9fa4f3
mv Modules/cryptmodule.c Modules/_cryptmodule.c
d63f6b
%patch167 -p1
01cf2c
%patch168 -p1
41aa0d
%patch169 -p1
6a2708
%patch170 -p1
4e8ad3
%patch174 -p1 -b .fix-for-usr-move
7b42f4
%patch180 -p1
7b42f4
%patch181 -p1
Matej Stuchlik 6f6573
%patch185 -p1
a9f6e8
%patch187 -p1
4d74b7
4d74b7
%if %{with rpmwheels}
4d74b7
%patch189 -p1
4d74b7
rm Lib/ensurepip/_bundled/*.whl
4d74b7
%endif
4d74b7
d60e5a
%patch190 -p1
112f64
%patch191 -p1
673992
%patch193 -p1
3056bf
%patch289 -p1
0dfe62
%patch309 -p1
ebba43
%patch310 -p1
Iryna Shcherbina 6bc3f6
9fa4f3
32febd
%if 0%{?_module_build}
7a7d98
%patch4000 -p1
bd0f7d
%endif
866e92
cvsdist e0fde9
# This shouldn't be necesarry, but is right now (2.2a3)
cvsdist e0fde9
find -name "*~" |xargs rm -f
cvsdist 6b969f
c6247f
%if ! 0%{regenerate_autotooling_patch}
c6247f
# Normally we apply the patch to "configure"
c6247f
# We don't apply the patch if we're working towards regenerating it
498957
%patch5000 -p0 -b .autotool-intermediates
c6247f
%endif
c6247f
4f38fe
4f38fe
# ======================================================
4f38fe
# Configuring and building the code:
4f38fe
# ======================================================
4f38fe
cvsdist e4efab
%build
791e9f
topdir=$(pwd)
94e850
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
94e850
export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
791e9f
export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
94e850
export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
cvsdist d4a395
export LINKCC="gcc"
0473b0
export LDFLAGS="$RPM_LD_FLAGS"
cvsdist 20402f
if pkg-config openssl ; then
791e9f
  export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
791e9f
  export LDFLAGS="$LDFLAGS $(pkg-config --libs-only-L openssl)"
cvsdist 20402f
fi
cvsdist d855cb
# Force CC
cvsdist d855cb
export CC=gcc
5ae15c
c6247f
%if 0%{regenerate_autotooling_patch}
c6247f
# If enabled, this code regenerates the patch to "configure", using a
c6247f
# local copy of autoconf-2.65, then exits the build
c6247f
#
c6247f
# The following assumes that the copy is installed to ~/autoconf-2.65/bin
c6247f
# as per these instructions:
c6247f
#   http://bugs.python.org/issue7997
c6247f
c6247f
for f in pyconfig.h.in configure ; do
c6247f
    cp $f $f.autotool-intermediates ;
c6247f
done
5ae15c
c6247f
# Rerun the autotools:
c6247f
PATH=~/autoconf-2.65/bin:$PATH autoconf
5ae15c
autoheader
5ae15c
c6247f
# Regenerate the patch:
498957
gendiff . .autotool-intermediates > %{PATCH5000}
c6247f
c6247f
c6247f
# Exit the build
c6247f
exit 1
c6247f
%endif
c6247f
f020ab
# Define a function, for how to perform a "build" of python for a given
f020ab
# configuration:
f020ab
BuildPython() {
8adf4f
  ConfName=$1
f020ab
  BinaryName=$2
f020ab
  SymlinkName=$3
f020ab
  ExtraConfigArgs=$4
f020ab
  PathFixWithThisBinary=$5
f020ab
f020ab
  ConfDir=build/$ConfName
f020ab
f020ab
  echo STARTING: BUILD OF PYTHON FOR CONFIGURATION: $ConfName - %{_bindir}/$BinaryName
f020ab
  mkdir -p $ConfDir
f020ab
f020ab
  pushd $ConfDir
f020ab
f020ab
  # Use the freshly created "configure" script, but in the directory two above:
f020ab
  %global _configure $topdir/configure
f020ab
3fdd60
%configure \
3fdd60
  --enable-ipv6 \
3fdd60
  --enable-shared \
f522dd
  --enable-unicode=%{unicode} \
f522dd
  --with-dbmliborder=gdbm:ndbm:bdb \
f522dd
  --with-system-expat \
3fdd60
  --with-system-ffi \
5ae15c
%if 0%{?with_systemtap}
5ae15c
  --with-dtrace \
5ae15c
  --with-tapset-install-dir=%{tapsetdir} \
5ae15c
%endif
f522dd
%if 0%{?with_valgrind}
f522dd
  --with-valgrind \
f522dd
%endif
f020ab
  $ExtraConfigArgs \
f020ab
  %{nil}
cvsdist e0fde9
970523
make EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags}
f020ab
f020ab
# We need to fix shebang lines across the full source tree.
f020ab
#
f020ab
# We do this using the pathfix.py script, which requires one of the
f020ab
# freshly-built Python binaries.
f020ab
#
f020ab
# We use the optimized python binary, and make the shebangs point at that same
f020ab
# optimized python binary:
f020ab
if $PathFixWithThisBinary
f020ab
then
b1a24b
  # pathfix.py currently only works with files matching ^[a-zA-Z0-9_]+\.py$
b1a24b
  # when crawling through directories, so we handle the special cases manually
b95f6c
  LD_LIBRARY_PATH="$topdir/$ConfDir" ./$BinaryName \
f020ab
    $topdir/Tools/scripts/pathfix.py \
b1a24b
      -i "%{_bindir}/python%{pybasever}" \
b1a24b
      $topdir \
b1a24b
      $topdir/Tools/pynche/pynche \
b1a24b
      $topdir/Demo/pdist/{rcvs,rcsbump,rrcs} \
b1a24b
      $topdir/Demo/scripts/find-uname.py \
b1a24b
      $topdir/Tools/scripts/reindent-rst.py
f020ab
fi
f020ab
60b7a5
# Rebuild with new python
60b7a5
# We need a link to a versioned python in the build directory
f020ab
ln -s $BinaryName $SymlinkName
970523
LD_LIBRARY_PATH="$topdir/$ConfDir" PATH=$PATH:$topdir/$ConfDir make -s EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags}
f020ab
f020ab
  popd
f020ab
  echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfDir
f020ab
}
60b7a5
f020ab
# Use "BuildPython" to support building with different configurations:
60b7a5
e4e4db
%if %{with debug_build}
f020ab
BuildPython debug \
f020ab
  python-debug \
f020ab
  python%{pybasever}-debug \
663654
%ifarch %{ix86} x86_64 ppc %{power64}
ab11e4
  "--with-pydebug --with-tsc --with-count-allocs --with-call-profile" \
0c63f1
%else
0c63f1
  "--with-pydebug --with-count-allocs --with-call-profile" \
0c63f1
%endif
f020ab
  false
e4e4db
%endif # with debug_build
f020ab
f020ab
BuildPython optimized \
f020ab
  python \
f020ab
  python%{pybasever} \
1554eb
%ifarch %{ix86} x86_64
1554eb
  "--enable-optimizations" \
1554eb
%else
f020ab
  "" \
1554eb
%endif
f020ab
  true
cvsdist e0fde9
4f38fe
4f38fe
# ======================================================
4f38fe
# Installing the built code:
4f38fe
# ======================================================
4f38fe
cvsdist e4efab
%install
f020ab
topdir=$(pwd)
791e9f
rm -rf %{buildroot}
791e9f
mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir}
cvsdist e0fde9
cvsdist 20402f
# Clean up patched .py files that are saved as .lib64
cvsdist 20402f
for f in distutils/command/install distutils/sysconfig; do
cvsdist 20402f
    rm -f Lib/$f.py.lib64
cvsdist 20402f
done
cvsdist 20402f
f020ab
InstallPython() {
f020ab
8adf4f
  ConfName=$1
f020ab
  BinaryName=$2
f020ab
  PyInstSoName=$3
f020ab
f020ab
  ConfDir=build/$ConfName
f020ab
f020ab
  echo STARTING: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName - %{_bindir}/$BinaryName
f020ab
  mkdir -p $ConfDir
f020ab
f020ab
  pushd $ConfDir
f020ab
791e9f
make install DESTDIR=%{buildroot}
f020ab
c6247f
# We install a collection of hooks for gdb that make it easier to debug
c6247f
# executables linked against libpython (such as /usr/lib/python itself)
c6247f
#
c6247f
# These hooks are implemented in Python itself
c6247f
#
c6247f
# gdb-archer looks for them in the same path as the ELF file, with a -gdb.py suffix.
c6247f
# We put them in the debuginfo package by installing them to e.g.:
c6247f
#  /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
f020ab
# (note that the debug path is /usr/lib/debug for both 32/64 bit)
c6247f
#
c6247f
# See https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more
c6247f
# information
8adf4f
#
f020ab
# Initially I tried:
f020ab
#  /usr/lib/libpython2.6.so.1.0-gdb.py
f020ab
# but doing so generated noise when ldconfig was rerun (rhbz:562980)
f020ab
#
f020ab
%if 0%{?with_gdb_hooks}
f020ab
DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
4922a4
PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName-%{version}-%{release}.%{_arch}.debug-gdb.py
f020ab
f020ab
mkdir -p %{buildroot}$DirHoldingGdbPy
c6247f
cp $topdir/Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy
f020ab
f020ab
# Manually byte-compile the file, in case find-debuginfo.sh is run before
f020ab
# brp-python-bytecompile, so that the .pyc/.pyo files are properly listed in
f020ab
# the debuginfo manifest:
f020ab
LD_LIBRARY_PATH="$topdir/$ConfDir" $topdir/$ConfDir/$BinaryName \
f020ab
  -c "import compileall; import sys; compileall.compile_dir('%{buildroot}$DirHoldingGdbPy', ddir='$DirHoldingGdbPy')"
f020ab
f020ab
LD_LIBRARY_PATH="$topdir/$ConfDir" $topdir/$ConfDir/$BinaryName -O \
f020ab
  -c "import compileall; import sys; compileall.compile_dir('%{buildroot}$DirHoldingGdbPy', ddir='$DirHoldingGdbPy')"
f020ab
%endif # with_gdb_hooks
f020ab
f020ab
  popd
f020ab
f020ab
  echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName
f020ab
}
f020ab
f020ab
# Use "InstallPython" to support building with different configurations:
f020ab
f020ab
# Install the "debug" build first, so that we can move some files aside
e4e4db
%if %{with debug_build}
f020ab
InstallPython debug \
f020ab
  python%{pybasever}-debug \
f020ab
  %{py_INSTSONAME_debug}
e4e4db
%endif # with debug_build
f020ab
f020ab
# Now the optimized build:
f020ab
InstallPython optimized \
f020ab
  python%{pybasever} \
f020ab
  %{py_INSTSONAME_optimized}
f020ab
f020ab
8adf4f
# Fix the interpreter path in binaries installed by distutils
cvsdist d4a395
# (which changes them by itself)
cvsdist d4a395
# Make sure we preserve the file permissions
791e9f
for fixed in %{buildroot}%{_bindir}/pydoc; do
Matej Stuchlik a8af8d
    sed 's,#!.*/python$,#!/usr/bin/env python%{pybasever},' $fixed > $fixed- \
cvsdist d4a395
        && cat $fixed- > $fixed && rm -f $fixed-
cvsdist d4a395
done
cvsdist e0fde9
860ed4
# Junk, no point in putting in -test sub-pkg
791e9f
rm -f %{buildroot}/%{pylibdir}/idlelib/testcode.py*
860ed4
440a06
# don't include tests that are run at build time in the package
59062c
# This is documented, and used: rhbz#387401
860ed4
if /bin/false; then
860ed4
 # Move this to -test subpackage.
59062c
mkdir save_bits_of_test
59062c
for i in test_support.py __init__.py; do
791e9f
  cp -a %{buildroot}/%{pylibdir}/test/$i save_bits_of_test
59062c
done
791e9f
rm -rf %{buildroot}/%{pylibdir}/test
791e9f
mkdir %{buildroot}/%{pylibdir}/test
791e9f
cp -a save_bits_of_test/* %{buildroot}/%{pylibdir}/test
860ed4
fi
440a06
cvsdist e4efab
# tools
cvsdist e0fde9
05912b
mkdir -p ${RPM_BUILD_ROOT}%{site_packages}
cvsdist e4efab
cvsdist e4efab
#pynche
e0483e
install -p -m755 %{SOURCE7} ${RPM_BUILD_ROOT}%{_bindir}/pynche
Mihai Ibanescu fe0d34
chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/pynche
cvsdist d4a395
rm -f Tools/pynche/*.pyw
e0483e
cp -rp Tools/pynche \
05912b
  ${RPM_BUILD_ROOT}%{site_packages}/
cvsdist e4efab
cvsdist e4efab
mv Tools/pynche/README Tools/pynche/README.pynche
cvsdist e4efab
cvsdist e0fde9
#gettext
791e9f
install -m755  Tools/i18n/pygettext.py %{buildroot}%{_bindir}/
791e9f
install -m755  Tools/i18n/msgfmt.py %{buildroot}%{_bindir}/
cvsdist e0fde9
cvsdist 2f0d56
# Useful development tools
791e9f
install -m755 -d %{buildroot}%{tools_dir}/scripts
791e9f
install Tools/README %{buildroot}%{tools_dir}/
791e9f
install Tools/scripts/*py %{buildroot}%{tools_dir}/scripts/
cvsdist d78f1e
Mihai Ibanescu 44819f
# Documentation tools
791e9f
install -m755 -d %{buildroot}%{doc_tools_dir}
791e9f
#install -m755 Doc/tools/mkhowto %{buildroot}%{doc_tools_dir}
Mihai Ibanescu 44819f
cvsdist d78f1e
# Useful demo scripts
791e9f
install -m755 -d %{buildroot}%{demo_dir}
791e9f
cp -ar Demo/* %{buildroot}%{demo_dir}
cvsdist 2f0d56
cvsdist e0fde9
# Get rid of crap
791e9f
find %{buildroot}/ -name "*~"|xargs rm -f
791e9f
find %{buildroot}/ -name ".cvsignore"|xargs rm -f
f5df1f
find %{buildroot}/ -name "*.bat"|xargs rm -f
cvsdist e0fde9
find . -name "*~"|xargs rm -f
cvsdist e0fde9
find . -name ".cvsignore"|xargs rm -f
cvsdist e0fde9
#zero length
791e9f
rm -f %{buildroot}%{pylibdir}/LICENSE.txt
cvsdist e0fde9
9e09f0
9e09f0
# Provide binaries in the form of bin2 and bin2.7, thus implementing
9e09f0
# (and expanding) the recommendations of PEP 394.
9e09f0
mv %{buildroot}%{_bindir}/idle %{buildroot}%{_bindir}/idle%{pybasever}
9e09f0
ln -s ./idle%{pybasever} %{buildroot}%{_bindir}/idle2
9e09f0
ln -s ./idle2 %{buildroot}%{_bindir}/idle
9e09f0
9e09f0
mv %{buildroot}%{_bindir}/pynche %{buildroot}%{_bindir}/pynche%{pybasever}
9e09f0
ln -s ./pynche%{pybasever} %{buildroot}%{_bindir}/pynche2
9e09f0
ln -s ./pynche2 %{buildroot}%{_bindir}/pynche
9e09f0
9e09f0
mv %{buildroot}%{_bindir}/pydoc %{buildroot}%{_bindir}/pydoc%{pybasever}
9e09f0
ln -s ./pydoc%{pybasever} %{buildroot}%{_bindir}/pydoc2
9e09f0
ln -s ./pydoc2 %{buildroot}%{_bindir}/pydoc
9e09f0
9e09f0
mv %{buildroot}%{_bindir}/pygettext.py %{buildroot}%{_bindir}/pygettext%{pybasever}.py
9e09f0
ln -s ./pygettext%{pybasever}.py %{buildroot}%{_bindir}/pygettext2.py
9e09f0
ln -s ./pygettext2.py %{buildroot}%{_bindir}/pygettext.py
9e09f0
9e09f0
mv %{buildroot}%{_bindir}/msgfmt.py %{buildroot}%{_bindir}/msgfmt%{pybasever}.py
9e09f0
ln -s ./msgfmt%{pybasever}.py %{buildroot}%{_bindir}/msgfmt2.py
9e09f0
ln -s ./msgfmt2.py %{buildroot}%{_bindir}/msgfmt.py
9e09f0
9e09f0
mv %{buildroot}%{_bindir}/smtpd.py %{buildroot}%{_bindir}/smtpd%{pybasever}.py
9e09f0
ln -s ./smtpd%{pybasever}.py %{buildroot}%{_bindir}/smtpd2.py
9e09f0
ln -s ./smtpd2.py %{buildroot}%{_bindir}/smtpd.py
9e09f0
Mihai Ibanescu f9962c
# Fix for bug #136654
791e9f
rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au %{buildroot}%{pylibdir}/test/audiotest.au
cvsdist d4a395
Mihai Ibanescu adb16c
# Fix bug #143667: python should own /usr/lib/python2.x on 64-bit machines
643544
%if "%{_lib}" == "lib64"
Matej Stuchlik a8af8d
install -d %{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages
Mihai Ibanescu adb16c
%endif
Mihai Ibanescu adb16c
Mihai Ibanescu f1d253
# Make python-devel multilib-ready (bug #192747, #139911)
0626de
%global _pyconfig32_h pyconfig-32.h
0626de
%global _pyconfig64_h pyconfig-64.h
Mihai Ibanescu f1d253
dc5f99
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64} riscv64
0626de
%global _pyconfig_h %{_pyconfig64_h}
Mihai Ibanescu f1d253
%else
0626de
%global _pyconfig_h %{_pyconfig32_h}
Mihai Ibanescu f1d253
%endif
f078d6
e4e4db
%if %{with debug_build}
f078d6
%global PyIncludeDirs python%{pybasever} python%{pybasever}-debug
f078d6
%else
f078d6
%global PyIncludeDirs python%{pybasever}
f078d6
%endif
f078d6
f078d6
for PyIncludeDir in %{PyIncludeDirs} ; do
f020ab
  mv %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h \
f020ab
     %{buildroot}%{_includedir}/$PyIncludeDir/%{_pyconfig_h}
f020ab
  cat > %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h << EOF
Mihai Ibanescu f1d253
#include <bits/wordsize.h>
Mihai Ibanescu f1d253
Mihai Ibanescu f1d253
#if __WORDSIZE == 32
Mihai Ibanescu f1d253
#include "%{_pyconfig32_h}"
Mihai Ibanescu f1d253
#elif __WORDSIZE == 64
Mihai Ibanescu f1d253
#include "%{_pyconfig64_h}"
Mihai Ibanescu f1d253
#else
59062c
#error "Unknown word size"
Mihai Ibanescu f1d253
#endif
Mihai Ibanescu f1d253
EOF
f020ab
done
791e9f
ln -s ../../libpython%{pybasever}.so %{buildroot}%{pylibdir}/config/libpython%{pybasever}.so
Mihai Ibanescu f1d253
Mihai Ibanescu 3af5a6
# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file
a8ca61
# Similar for sysconfig: sysconfig.get_config_h_filename tries to locate
a8ca61
# pyconfig.h so it can be parsed, and needs to do this at runtime in site.py
a8ca61
# when python starts up.
a8ca61
#
a8ca61
# Split this out so it goes directly to the pyconfig-32.h/pyconfig-64.h
a8ca61
# variants:
a8ca61
sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \
a8ca61
  %{buildroot}%{pylibdir}/distutils/sysconfig.py \
a8ca61
  %{buildroot}%{pylibdir}/sysconfig.py
Mihai Ibanescu 3af5a6
671ce7
# Ensure that the curses module was linked against libncursesw.so, rather than
671ce7
# libncurses.so (bug 539917)
791e9f
ldd %{buildroot}/%{dynload_dir}/_curses*.so \
671ce7
    | grep curses \
671ce7
    | grep libncurses.so && (echo "_curses.so linked against libncurses.so" ; exit 1)
671ce7
f020ab
# Ensure that the debug modules are linked against the debug libpython, and
f020ab
# likewise for the optimized modules and libpython:
f020ab
for Module in %{buildroot}/%{dynload_dir}/*.so ; do
f020ab
    case $Module in
f020ab
    *_d.so)
f020ab
        ldd $Module | grep %{py_INSTSONAME_optimized} &&
f020ab
            (echo Debug module $Module linked against optimized %{py_INSTSONAME_optimized} ; exit 1)
8adf4f
f020ab
        ;;
f020ab
    *)
f020ab
        ldd $Module | grep %{py_INSTSONAME_debug} &&
f020ab
            (echo Optimized module $Module linked against debug %{py_INSTSONAME_optimized} ; exit 1)
f020ab
        ;;
f020ab
    esac
f020ab
done
b25d60
3dde1c
#
3dde1c
# Systemtap hooks:
3dde1c
#
3dde1c
%if 0%{?with_systemtap}
3dde1c
# Install a tapset for this libpython into tapsetdir, fixing up the path to the
3dde1c
# library:
3dde1c
mkdir -p %{buildroot}%{tapsetdir}
3f17ce
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64}
f020ab
%global libpython_stp_optimized libpython%{pybasever}-64.stp
f020ab
%global libpython_stp_debug     libpython%{pybasever}-debug-64.stp
3dde1c
%else
f020ab
%global libpython_stp_optimized libpython%{pybasever}-32.stp
f020ab
%global libpython_stp_debug     libpython%{pybasever}-debug-32.stp
3dde1c
%endif
3dde1c
3dde1c
sed \
f020ab
   -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_optimized}|" \
f020ab
   %{SOURCE3} \
f020ab
   > %{buildroot}%{tapsetdir}/%{libpython_stp_optimized}
f020ab
e4e4db
%if %{with debug_build}
f020ab
sed \
f020ab
   -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_debug}|" \
3dde1c
   %{SOURCE3} \
f020ab
   > %{buildroot}%{tapsetdir}/%{libpython_stp_debug}
e4e4db
%endif # with debug_build
3dde1c
%endif # with_systemtap
3dde1c
3be16b
# Do bytecompilation with the newly installed interpreter.
3be16b
# compile *.pyo
3be16b
find %{buildroot} -type f -a -name "*.py" -print0 | \
3be16b
    LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
3be16b
    PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
3be16b
    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:]]' || :
3be16b
# compile *.pyc
3be16b
find %{buildroot} -type f -a -name "*.py" -print0 | \
3be16b
    LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
3be16b
    PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
3be16b
    xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2]) for f in sys.argv[1:]]' || :
3be16b
3be16b
Matej Stuchlik 19530b
# Make library-files user writable
Matej Stuchlik 19530b
/usr/bin/chmod 755 %{buildroot}%{dynload_dir}/*.so
Matej Stuchlik 19530b
/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}.so.1.0
4922a4
%if %{with debug_build}
Matej Stuchlik 19530b
/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}_d.so.1.0
4922a4
%endif
Matej Stuchlik 19530b
4f38fe
4f38fe
# ======================================================
4f38fe
# Running the upstream test suite
4f38fe
# ======================================================
4f38fe
5810c5
%check
5810c5
topdir=$(pwd)
5810c5
CheckPython() {
5810c5
  ConfName=$1
5810c5
  BinaryName=$2
5810c5
  ConfDir=$(pwd)/build/$ConfName
5810c5
5810c5
  echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
5810c5
5810c5
  # Note that we're running the tests using the version of the code in the
5810c5
  # builddir, not in the buildroot.
5810c5
5810c5
  pushd $ConfDir
5810c5
e25252
  EXTRATESTOPTS="--verbose"
5810c5
3f17ce
%ifarch s390 s390x %{power64} %{arm} aarch64 %{mips}
cfa0d5
    EXTRATESTOPTS="$EXTRATESTOPTS -x test_gdb"
cfa0d5
%endif
3f17ce
%ifarch %{mips64}
3f17ce
    EXTRATESTOPTS="$EXTRATESTOPTS -x test_ctypes"
3f17ce
%endif
cfa0d5
5810c5
%if 0%{?with_huntrleaks}
5810c5
  # Try to detect reference leaks on debug builds.  By default this means
5810c5
  # running every test 10 times (6 to stabilize, then 4 to watch):
5810c5
  if [ "$ConfName" = "debug"  ] ; then
5810c5
    EXTRATESTOPTS="$EXTRATESTOPTS --huntrleaks : "
5810c5
  fi
5810c5
%endif
5810c5
bbbca2
  # Run the upstream test suite, setting "WITHIN_PYTHON_RPM_BUILD" so that the
866e92
  # our non-standard decorators take effect on the relevant tests:
866e92
  #   @unittest._skipInRpmBuild(reason)
866e92
  #   @unittest._expectedFailureInRpmBuild
866e92
  WITHIN_PYTHON_RPM_BUILD= EXTRATESTOPTS="$EXTRATESTOPTS" make test
5810c5
5810c5
  popd
5810c5
5810c5
  echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
5810c5
5810c5
}
5810c5
e4e4db
%if %{with tests}
bc10ab
080ef9
# no locale coercion in python2
080ef9
# test_ssl:test_load_dh_params shutil.copies into unicode filename
080ef9
export LC_ALL=C.utf-8
080ef9
5810c5
# Check each of the configurations:
e4e4db
%if %{with debug_build}
5810c5
CheckPython \
5810c5
  debug \
5810c5
  python%{pybasever}-debug
e4e4db
%endif # with debug_build
5810c5
CheckPython \
5810c5
  optimized \
5810c5
  python%{pybasever}
5810c5
e4e4db
%endif # with tests
bc10ab
bc10ab
4f38fe
# ======================================================
4f38fe
# Cleaning up
4f38fe
# ======================================================
4f38fe
4f38fe
05912b
%files
69a4fe
%{!?_licensedir:%global license %%doc}
69a4fe
%license LICENSE
69a4fe
%doc README
Mihai Ibanescu d6509b
%{_bindir}/pydoc*
1df0c9
%{_bindir}/%{python}
1df0c9
%{_bindir}/python%{pybasever}
002eb7
%{_mandir}/*/python2*
002eb7
002eb7
%files -n python-unversioned-command
002eb7
%{_bindir}/python
002eb7
%{_mandir}/*/python.1.*
cvsdist e0fde9
2ec5b3
%files libs
69a4fe
%{!?_licensedir:%global license %%doc}
69a4fe
%license LICENSE
69a4fe
%doc README
05912b
%dir %{pylibdir}
05912b
%dir %{dynload_dir}
7c1eb9
7c1eb9
%{dynload_dir}/_md5module.so
7c1eb9
%{dynload_dir}/_sha256module.so
7c1eb9
%{dynload_dir}/_sha512module.so
7c1eb9
%{dynload_dir}/_shamodule.so
7c1eb9
05912b
%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
05912b
%{dynload_dir}/_bisectmodule.so
05912b
%{dynload_dir}/_bsddb.so
05912b
%{dynload_dir}/_codecs_cn.so
05912b
%{dynload_dir}/_codecs_hk.so
05912b
%{dynload_dir}/_codecs_iso2022.so
05912b
%{dynload_dir}/_codecs_jp.so
05912b
%{dynload_dir}/_codecs_kr.so
05912b
%{dynload_dir}/_codecs_tw.so
05912b
%{dynload_dir}/_collectionsmodule.so
05912b
%{dynload_dir}/_csv.so
05912b
%{dynload_dir}/_ctypes.so
05912b
%{dynload_dir}/_curses.so
05912b
%{dynload_dir}/_curses_panel.so
05912b
%{dynload_dir}/_elementtree.so
05912b
%{dynload_dir}/_functoolsmodule.so
05912b
%{dynload_dir}/_hashlib.so
05912b
%{dynload_dir}/_heapq.so
05912b
%{dynload_dir}/_hotshot.so
c6247f
%{dynload_dir}/_io.so
05912b
%{dynload_dir}/_json.so
05912b
%{dynload_dir}/_localemodule.so
05912b
%{dynload_dir}/_lsprof.so
05912b
%{dynload_dir}/_multibytecodecmodule.so
05912b
%{dynload_dir}/_multiprocessing.so
05912b
%{dynload_dir}/_randommodule.so
05912b
%{dynload_dir}/_socketmodule.so
05912b
%{dynload_dir}/_sqlite3.so
05912b
%{dynload_dir}/_ssl.so
05912b
%{dynload_dir}/_struct.so
05912b
%{dynload_dir}/arraymodule.so
05912b
%{dynload_dir}/audioop.so
05912b
%{dynload_dir}/binascii.so
05912b
%{dynload_dir}/bz2.so
05912b
%{dynload_dir}/cPickle.so
05912b
%{dynload_dir}/cStringIO.so
05912b
%{dynload_dir}/cmathmodule.so
187fef
%{dynload_dir}/_cryptmodule.so
05912b
%{dynload_dir}/datetime.so
05912b
%{dynload_dir}/dbm.so
05912b
%{dynload_dir}/dlmodule.so
05912b
%{dynload_dir}/fcntlmodule.so
05912b
%{dynload_dir}/future_builtins.so
5764ad
%if %{with_gdbm}
05912b
%{dynload_dir}/gdbmmodule.so
5764ad
%endif
05912b
%{dynload_dir}/grpmodule.so
05912b
%{dynload_dir}/imageop.so
05912b
%{dynload_dir}/itertoolsmodule.so
05912b
%{dynload_dir}/linuxaudiodev.so
c6247f
%{dynload_dir}/math.so
05912b
%{dynload_dir}/mmapmodule.so
05912b
%{dynload_dir}/nismodule.so
05912b
%{dynload_dir}/operator.so
05912b
%{dynload_dir}/ossaudiodev.so
05912b
%{dynload_dir}/parsermodule.so
05912b
%{dynload_dir}/pyexpat.so
05912b
%{dynload_dir}/readline.so
05912b
%{dynload_dir}/resource.so
05912b
%{dynload_dir}/selectmodule.so
05912b
%{dynload_dir}/spwdmodule.so
05912b
%{dynload_dir}/stropmodule.so
05912b
%{dynload_dir}/syslog.so
05912b
%{dynload_dir}/termios.so
05912b
%{dynload_dir}/timemodule.so
05912b
%{dynload_dir}/timingmodule.so
05912b
%{dynload_dir}/unicodedata.so
05912b
%{dynload_dir}/xxsubtype.so
05912b
%{dynload_dir}/zlibmodule.so
05912b
05912b
%dir %{site_packages}
05912b
%{site_packages}/README
05912b
%{pylibdir}/*.py*
05912b
%{pylibdir}/*.doc
66ec06
%{pylibdir}/wsgiref.egg-info
05912b
%dir %{pylibdir}/bsddb
05912b
%{pylibdir}/bsddb/*.py*
05912b
%{pylibdir}/compiler
05912b
%dir %{pylibdir}/ctypes
05912b
%{pylibdir}/ctypes/*.py*
05912b
%{pylibdir}/ctypes/macholib
05912b
%{pylibdir}/curses
05912b
%dir %{pylibdir}/distutils
05912b
%{pylibdir}/distutils/*.py*
05912b
%{pylibdir}/distutils/README
05912b
%{pylibdir}/distutils/command
768145
%exclude %{pylibdir}/distutils/command/wininst-*.exe
05912b
%dir %{pylibdir}/email
05912b
%{pylibdir}/email/*.py*
05912b
%{pylibdir}/email/mime
05912b
%{pylibdir}/encodings
05912b
%{pylibdir}/hotshot
Robert Kuska 288187
%{pylibdir}/idlelib
c6247f
%{pylibdir}/importlib
05912b
%dir %{pylibdir}/json
05912b
%{pylibdir}/json/*.py*
Robert Kuska 288187
%{pylibdir}/lib2to3
Robert Kuska 288187
%exclude %{pylibdir}/lib2to3/tests
05912b
%{pylibdir}/logging
05912b
%{pylibdir}/multiprocessing
05912b
%{pylibdir}/plat-linux2
c6247f
%{pylibdir}/pydoc_data
05912b
%dir %{pylibdir}/sqlite3
05912b
%{pylibdir}/sqlite3/*.py*
b02c01
b02c01
# Some bits of test are used for actual testing of stuff, not just python itself:
b02c01
# See also https://bugzilla.redhat.com/show_bug.cgi?id=1528899
05912b
%dir %{pylibdir}/test
05912b
%{pylibdir}/test/__init__.py*
b02c01
%{pylibdir}/test/support/
b02c01
%{pylibdir}/test/script_helper.py*
b02c01
%{pylibdir}/test/test_support.py*
b02c01
c6247f
%{pylibdir}/unittest
05912b
%{pylibdir}/wsgiref
05912b
%{pylibdir}/xml
643544
%if "%{_lib}" == "lib64"
0626de
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}
0626de
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages
Mihai Ibanescu adb16c
%endif
cvsdist e4efab
8274ac
# "Makefile" and the config-32/64.h file are needed by
2ec5b3
# distutils/sysconfig.py:_init_posix(), so we include them in the libs
8274ac
# package, along with their parent directories (bug 531901):
05912b
%dir %{pylibdir}/config
05912b
%{pylibdir}/config/Makefile
0626de
%dir %{_includedir}/python%{pybasever}
0626de
%{_includedir}/python%{pybasever}/%{_pyconfig_h}
8274ac
f020ab
%{_libdir}/%{py_INSTSONAME_optimized}
3dde1c
%if 0%{?with_systemtap}
a98848
%dir %(dirname %{tapsetdir})
a98848
%dir %{tapsetdir}
f020ab
%{tapsetdir}/%{libpython_stp_optimized}
c22243
%doc systemtap-example.stp pyfuntop.stp
3dde1c
%endif
87c8da
Matej Stuchlik b1e5a4
%dir %{pylibdir}/ensurepip/
Matej Stuchlik b1e5a4
%{pylibdir}/ensurepip/*.py*
4d74b7
%if %{with rpmwheels}
Matej Stuchlik b1e5a4
%exclude %{pylibdir}/ensurepip/_bundled
4d74b7
%else
4d74b7
%dir %{pylibdir}/ensurepip/_bundled
4d74b7
%{pylibdir}/ensurepip/_bundled/*.whl
Matej Stuchlik b1e5a4
%endif
Matej Stuchlik b1e5a4
Matej Stuchlik b1e5a4
cvsdist e4efab
%files devel
c6247f
%{_libdir}/pkgconfig/python-%{pybasever}.pc
c6247f
%{_libdir}/pkgconfig/python.pc
b0a6ae
%{_libdir}/pkgconfig/python2.pc
05912b
%{pylibdir}/config/*
05912b
%exclude %{pylibdir}/config/Makefile
768145
%{pylibdir}/distutils/command/wininst-*.exe
0626de
%{_includedir}/python%{pybasever}/*.h
0626de
%exclude %{_includedir}/python%{pybasever}/%{_pyconfig_h}
267e1a
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
f3e7a4
%{_bindir}/python-config
9345b0
%{_bindir}/python2-config
1df0c9
%{_bindir}/python%{pybasever}-config
87c8da
%{_libdir}/libpython%{pybasever}.so
Thomas Spura 965c95
cvsdist e0fde9
%files tools
cvsdist e4efab
%doc Tools/pynche/README.pynche
05912b
%{site_packages}/pynche
Mihai Ibanescu ce25e1
%{_bindir}/smtpd*.py*
d2afb4
d2afb4
# https://bugzilla.redhat.com/show_bug.cgi?id=1111275
d2afb4
%exclude %{_bindir}/2to3*
d2afb4
Mihai Ibanescu f9962c
%{_bindir}/idle*
Mihai Ibanescu f9962c
%{_bindir}/pynche*
jbj 8e4b82
%{_bindir}/pygettext*.py*
jbj 8e4b82
%{_bindir}/msgfmt*.py*
cvsdist 2f0d56
%{tools_dir}
cvsdist d78f1e
%{demo_dir}
05912b
%{pylibdir}/Doc
cvsdist e4efab
158b42
%files tkinter
05912b
%{pylibdir}/lib-tk
7a7d98
%if ! 0%{?_module_build}
05912b
%{dynload_dir}/_tkinter.so
7a7d98
%endif
cvsdist e4efab
860ed4
%files test
05912b
%{pylibdir}/bsddb/test
05912b
%{pylibdir}/ctypes/test
05912b
%{pylibdir}/distutils/tests
05912b
%{pylibdir}/email/test
05912b
%{pylibdir}/json/tests
8b8196
%{pylibdir}/lib2to3/tests
05912b
%{pylibdir}/sqlite3/test
c905a3
%{pylibdir}/test/*
b02c01
b02c01
# Some bits of test are used for actual testing of stuff, not just python itself:
b02c01
# See also https://bugzilla.redhat.com/show_bug.cgi?id=1528899
c905a3
%exclude %{pylibdir}/test/__init__.py*
b02c01
%exclude %{pylibdir}/test/support/
b02c01
%exclude %{pylibdir}/test/script_helper.py*
b02c01
%exclude %{pylibdir}/test/test_support.py*
b02c01
05912b
%{dynload_dir}/_ctypes_test.so
05912b
%{dynload_dir}/_testcapimodule.so
860ed4
f020ab
f020ab
# We don't bother splitting the debug build out into further subpackages:
f020ab
# if you need it, you're probably a developer.
f020ab
f020ab
# Hence the manifest is the combination of analogous files in the manifests of
f020ab
# all of the other subpackages
f020ab
e4e4db
%if %{with debug_build}
f020ab
%files debug
f020ab
f020ab
# Analog of the core subpackage's files:
158b42
%{_bindir}/python-debug
f020ab
%{_bindir}/%{python}-debug
f020ab
%{_bindir}/python%{pybasever}-debug
f020ab
2ec5b3
# Analog of the -libs subpackage's files, with debug builds of the built-in
2ec5b3
# "extension" modules:
7c1eb9
7c1eb9
%{dynload_dir}/_md5module_d.so
7c1eb9
%{dynload_dir}/_sha256module_d.so
7c1eb9
%{dynload_dir}/_sha512module_d.so
7c1eb9
%{dynload_dir}/_shamodule_d.so
7c1eb9
f020ab
%{dynload_dir}/_bisectmodule_d.so
f020ab
%{dynload_dir}/_bsddb_d.so
f020ab
%{dynload_dir}/_codecs_cn_d.so
f020ab
%{dynload_dir}/_codecs_hk_d.so
f020ab
%{dynload_dir}/_codecs_iso2022_d.so
f020ab
%{dynload_dir}/_codecs_jp_d.so
f020ab
%{dynload_dir}/_codecs_kr_d.so
f020ab
%{dynload_dir}/_codecs_tw_d.so
f020ab
%{dynload_dir}/_collectionsmodule_d.so
f020ab
%{dynload_dir}/_csv_d.so
f020ab
%{dynload_dir}/_ctypes_d.so
f020ab
%{dynload_dir}/_curses_d.so
f020ab
%{dynload_dir}/_curses_panel_d.so
f020ab
%{dynload_dir}/_elementtree_d.so
f020ab
%{dynload_dir}/_functoolsmodule_d.so
f020ab
%{dynload_dir}/_hashlib_d.so
f020ab
%{dynload_dir}/_heapq_d.so
f020ab
%{dynload_dir}/_hotshot_d.so
c6247f
%{dynload_dir}/_io_d.so
f020ab
%{dynload_dir}/_json_d.so
f020ab
%{dynload_dir}/_localemodule_d.so
f020ab
%{dynload_dir}/_lsprof_d.so
f020ab
%{dynload_dir}/_multibytecodecmodule_d.so
f020ab
%{dynload_dir}/_multiprocessing_d.so
f020ab
%{dynload_dir}/_randommodule_d.so
f020ab
%{dynload_dir}/_socketmodule_d.so
f020ab
%{dynload_dir}/_sqlite3_d.so
f020ab
%{dynload_dir}/_ssl_d.so
f020ab
%{dynload_dir}/_struct_d.so
f020ab
%{dynload_dir}/arraymodule_d.so
f020ab
%{dynload_dir}/audioop_d.so
f020ab
%{dynload_dir}/binascii_d.so
f020ab
%{dynload_dir}/bz2_d.so
f020ab
%{dynload_dir}/cPickle_d.so
f020ab
%{dynload_dir}/cStringIO_d.so
f020ab
%{dynload_dir}/cmathmodule_d.so
187fef
%{dynload_dir}/_cryptmodule_d.so
f020ab
%{dynload_dir}/datetime_d.so
f020ab
%{dynload_dir}/dbm_d.so
f020ab
%{dynload_dir}/dlmodule_d.so
f020ab
%{dynload_dir}/fcntlmodule_d.so
f020ab
%{dynload_dir}/future_builtins_d.so
5764ad
%if %{with_gdbm}
f020ab
%{dynload_dir}/gdbmmodule_d.so
5764ad
%endif
f020ab
%{dynload_dir}/grpmodule_d.so
f020ab
%{dynload_dir}/imageop_d.so
f020ab
%{dynload_dir}/itertoolsmodule_d.so
f020ab
%{dynload_dir}/linuxaudiodev_d.so
c6247f
%{dynload_dir}/math_d.so
f020ab
%{dynload_dir}/mmapmodule_d.so
f020ab
%{dynload_dir}/nismodule_d.so
f020ab
%{dynload_dir}/operator_d.so
f020ab
%{dynload_dir}/ossaudiodev_d.so
f020ab
%{dynload_dir}/parsermodule_d.so
f020ab
%{dynload_dir}/pyexpat_d.so
f020ab
%{dynload_dir}/readline_d.so
f020ab
%{dynload_dir}/resource_d.so
f020ab
%{dynload_dir}/selectmodule_d.so
f020ab
%{dynload_dir}/spwdmodule_d.so
f020ab
%{dynload_dir}/stropmodule_d.so
f020ab
%{dynload_dir}/syslog_d.so
f020ab
%{dynload_dir}/termios_d.so
f020ab
%{dynload_dir}/timemodule_d.so
f020ab
%{dynload_dir}/timingmodule_d.so
f020ab
%{dynload_dir}/unicodedata_d.so
f020ab
%{dynload_dir}/xxsubtype_d.so
f020ab
%{dynload_dir}/zlibmodule_d.so
f020ab
f020ab
# No need to split things out the "Makefile" and the config-32/64.h file as we
f020ab
# do for the regular build above (bug 531901), since they're all in one package
f020ab
# now; they're listed below, under "-devel":
f020ab
f020ab
%{_libdir}/%{py_INSTSONAME_debug}
f020ab
%if 0%{?with_systemtap}
a98848
%dir %(dirname %{tapsetdir})
a98848
%dir %{tapsetdir}
f020ab
%{tapsetdir}/%{libpython_stp_debug}
f020ab
%endif
f020ab
f020ab
# Analog of the -devel subpackage's files:
f020ab
%dir %{pylibdir}/config-debug
9345b0
%{_libdir}/pkgconfig/python-%{pybasever}-debug.pc
9345b0
%{_libdir}/pkgconfig/python-debug.pc
9345b0
%{_libdir}/pkgconfig/python2-debug.pc
f020ab
%{pylibdir}/config-debug/*
f020ab
%{_includedir}/python%{pybasever}-debug/*.h
f020ab
%{_bindir}/python-debug-config
9345b0
%{_bindir}/python2-debug-config
f020ab
%{_bindir}/python%{pybasever}-debug-config
f020ab
%{_libdir}/libpython%{pybasever}_d.so
f020ab
f020ab
# Analog of the -tools subpackage's files:
f020ab
#  None for now; we could build precanned versions that have the appropriate
f020ab
# shebang if needed
f020ab
7a7d98
%if ! 0%{?_module_build}
f020ab
# Analog  of the tkinter subpackage's files:
f020ab
%{dynload_dir}/_tkinter_d.so
7a7d98
%endif
f020ab
f020ab
# Analog  of the -test subpackage's files:
f020ab
%{dynload_dir}/_ctypes_test_d.so
f020ab
%{dynload_dir}/_testcapimodule_d.so
f020ab
e4e4db
%endif # with debug_build
f078d6
32b703
# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
32b703
# ldconfig (rhbz:562980).
8adf4f
#
4ad35a
# The /usr/lib/rpm/redhat/macros defines the __debug_package macro to use
32b703
# debugfiles.list, and it appears that everything below /usr/lib/debug and
32b703
# (/usr/src/debug) gets added to this file (via LISTFILES) in
32b703
# /usr/lib/rpm/find-debuginfo.sh
8adf4f
#
32b703
# Hence by installing it below /usr/lib/debug we ensure it is added to the
32b703
# -debuginfo subpackage
8adf4f
# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
32b703
# payload file would be unpackaged)
32b703
Sanqui db65c5
# Workaround for rhbz#1476593
Sanqui db65c5
%undefine _debuginfo_subpackages
4f38fe
4f38fe
# ======================================================
4f38fe
# Finally, the changelog:
4f38fe
# ======================================================
4f38fe
cvsdist e4efab
%changelog
ebba43
* Mon Sep 24 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-11
ebba43
- Security fix for CVE-2018-14647 (#1631822)
ebba43
0dfe62
* Thu Sep 20 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-10
0dfe62
- Security fix for CVE-2018-1000802 (#1631662)
0dfe62
0052c9
* Thu Sep 06 2018 Petr Viktorin <pviktori@redhat.com> - 2.7.15-9
0052c9
- Deprecate python2 and all subpackages in Fedora 30+ (#1625773)
0052c9
e8ef86
* Thu Aug 30 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-8
e8ef86
- Require python2-setuptools from python2-devel to prevent packaging errors (#1623922)
e8ef86
4d74b7
* Tue Aug 21 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-7
4d74b7
- Use RPM built wheels of pip and setuptools in ensurepip instead of our rewheel patch
4d74b7
fb3986
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.15-6
fb3986
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
fb3986
002eb7
* Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-5
002eb7
- Move /usr/bin/python into a separate package
002eb7
  https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
002eb7
- Revert https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
002eb7
5ee9c1
* Wed Jun 13 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-4
5ee9c1
- Rebuilt for Python 3.7
5ee9c1
2b53e7
* Wed Jun 13 2018 Miro Hrončok <mhroncok@redhat.com>