4f38fe
# ======================================================
4f38fe
# Conditionals and other variables controlling the build
4f38fe
# ======================================================
4f38fe
Matej Stuchlik b1e5a4
%global with_rewheel 1
Matej Stuchlik b1e5a4
0626de
%{!?__python_ver:%global __python_ver EMPTY}
c6247f
#global __python_ver 27
0626de
%global unicode ucs4
cvsdist e0fde9
cvsdist 64c8a9
%if "%{__python_ver}" != "EMPTY"
0626de
%global main_python 0
0626de
%global python python%{__python_ver}
0626de
%global tkinter tkinter%{__python_ver}
cvsdist e0fde9
%else
0626de
%global main_python 1
0626de
%global python python
0626de
%global tkinter tkinter
cvsdist e0fde9
%endif
cvsdist e0fde9
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
f078d6
%global with_debug_build 1
f078d6
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
cfa0d5
%ifnarch s390
000d17
%global with_valgrind 1
382340
%else
382340
%global with_valgrind 0
000d17
%endif
000d17
05e831
%global with_gdbm 1
5764ad
bc10ab
# Turn this to 0 to turn off the "check" phase:
e3d0c5
%global run_selftest_suite 1
bc10ab
4bb3fe
# Some of the files below /usr/lib/pythonMAJOR.MINOR/test  (e.g. bad_coding.py)
4bb3fe
# are deliberately invalid, leading to SyntaxError exceptions if they get
4bb3fe
# byte-compiled.
4bb3fe
#
4bb3fe
# These errors are ignored by the normal python build, and aren't normally a
4bb3fe
# problem in the buildroots since /usr/bin/python isn't present.
8adf4f
#
4bb3fe
# However, for the case where we're rebuilding the python srpm on a machine
4bb3fe
# that does have python installed we need to set this to avoid
4bb3fe
# brp-python-bytecompile treating these as fatal errors:
4bb3fe
#
4bb3fe
%global _python_bytecompile_errors_terminate_build 0
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
4f38fe
4f38fe
# ==================
4f38fe
# Top-level metadata
4f38fe
# ==================
a7ef9c
Summary: An interpreted, interactive, object-oriented programming language
cvsdist e0fde9
Name: %{python}
71fe1b
# Remember to also rebase python-docs when changing this:
Matej Stuchlik b1e5a4
Version: 2.7.9
8c96ef
Release: 8%{?dist}
2d954f
License: Python
cvsdist e4efab
Group: Development/Languages
2ec5b3
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
cvsdist d855cb
Provides: python-abi = %{pybasever}
jbj 8e4b82
Provides: python(abi) = %{pybasever}
4f38fe
4f38fe
4f38fe
# =======================
4f38fe
# Build-time requirements
4f38fe
# =======================
4f38fe
4f38fe
# (keep this list alphabetized)
4f38fe
4f38fe
BuildRequires: autoconf
f9657e
BuildRequires: bluez-libs-devel
4f38fe
BuildRequires: bzip2
4f38fe
BuildRequires: bzip2-devel
067ca1
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}
4f38fe
BuildRequires: gdbm-devel
5764ad
%endif
4f38fe
BuildRequires: glibc-devel
4f38fe
BuildRequires: gmp-devel
4fd811
BuildRequires: libdb-devel
4f38fe
BuildRequires: libffi-devel
4f38fe
BuildRequires: libGL-devel
4f38fe
BuildRequires: libX11-devel
4f38fe
BuildRequires: ncurses-devel
4f38fe
BuildRequires: openssl-devel
4f38fe
BuildRequires: pkgconfig
4f38fe
BuildRequires: readline-devel
4f38fe
BuildRequires: sqlite-devel
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
4f38fe
BuildRequires: tcl-devel
4f38fe
BuildRequires: tix-devel
4f38fe
BuildRequires: tk-devel
4f38fe
4f38fe
%if 0%{?with_valgrind}
4f38fe
BuildRequires: valgrind-devel
4f38fe
%endif
4f38fe
4f38fe
BuildRequires: zlib-devel
4f38fe
Matej Stuchlik b1e5a4
%if 0%{?with_rewheel}
Matej Stuchlik b1e5a4
BuildRequires: python-setuptools
Matej Stuchlik b1e5a4
BuildRequires: python-pip
Matej Stuchlik b1e5a4
%endif
Matej Stuchlik b1e5a4
4f38fe
4f38fe
4f38fe
# =======================
4f38fe
# Source code and patches
4f38fe
# =======================
4f38fe
0473b0
Source: http://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
85867c
# Supply various useful macros for building python 2 modules:
85867c
#  __python2, python2_sitelib, python2_sitearch, python2_version
85867c
Source6: macros.python2
85867c
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)
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
#     - nis nismodule.c -lnsl	# Sun yellow pages -- not everywhere
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)
c6247f
Patch10: python-2.7rc1-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
43e7c4
# Upstream as of Python 2.7.4
43e7c4
#  Patch101: 00101-lib64-regex.patch
9b458a
9b458a
# 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
b0a6ae
Patch102: python-2.7.3-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 #
866e92
# 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
#
b0a6ae
Patch112: python-2.7.3-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
b0a6ae
# Upstream as of Python 2.7.3:
b0a6ae
#  Patch115: make-pydoc-more-robust-001.patch
96cf82
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
6ad7fb
# 00125 #
5810c5
# COUNT_ALLOCS is useful for debugging, but the upstream behaviour of always
5810c5
# emitting debug info to stdout on exit is too verbose and makes it harder to
5810c5
# use the debug build.  Add a "PYTHONDUMPCOUNTS" environment variable which
5810c5
# must be set to enable the output on exit
48617b
# Not yet sent upstream
e16547
Patch125: 00125-less-verbose-COUNT_ALLOCS.patch
5810c5
7b42f4
# Upstream as of Python 2.7.5
7b42f4
#  Patch126: fix-dbm_contains-on-64bit-bigendian.patch
e8c4a5
7b42f4
# Upstream as of Python 2.7.5
7b42f4
#  Patch127: fix-test_structmember-on-64bit-bigendian.patch
edea14
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
# 00134 #
866e92
# Fix a failure in test_sys.py when configured with COUNT_ALLOCS enabled
866e92
# Not yet sent upstream
866e92
Patch134: 00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
866e92
6ad7fb
# 00135 #
866e92
# Skip "test_callback_in_cycle_resurrection" in a debug build, where it fails:
866e92
# Not yet sent upstream
866e92
Patch135: 00135-skip-test-within-test_weakref-in-debug-build.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
# 00141 #
866e92
# Fix test_gc's test_newinstance case when configured with COUNT_ALLOCS:
48617b
# Not yet sent upstream
866e92
Patch141: 00141-fix-test_gc_with_COUNT_ALLOCS.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
# 00145 #
b0a6ae
# Upstream as of Python 2.7.3:
b0a6ae
#  Patch145: 00145-force-sys-platform-to-be-linux2.patch
bc10ab
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
# 00148 #
b0a6ae
# Upstream as of Python 2.7.3:
b0a6ae
#  Patch148: 00148-gdbm-1.9-magic-values.patch
05e831
6ad7fb
# 00149 #
df914e
# python3.spec's
df914e
#   Patch149: 00149-backport-issue11254-pycache-bytecompilation-fix.patch
df914e
# is not relevant for Python 2
df914e
6ad7fb
# 00150 #
cd5070
# python3.spec has:
cd5070
#  Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch
cd5070
# as a workaround for a glibc bug on PPC (bz #750811)
cd5070
6ad7fb
# 00151 #
b0a6ae
# Upstream as of Python 2.7.3:
b0a6ae
#  Patch151: 00151-fork-deadlock.patch
b0a6ae
6ad7fb
# 00152 #
b0a6ae
# python3.spec has:
b0a6ae
#  Patch152: 00152-fix-test-gdb-regex.patch
b0a6ae
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
# 00154 #
7461fe
# python3.spec on f15 has:
7461fe
#  Patch154: 00154-skip-urllib-test-requiring-working-DNS.patch
7461fe
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
43e7c4
# Upstream as of Python 2.7.4
43e7c4
# Patch158: 00158-fix-hashlib-leak.patch
5fd54b
4baa56
# 00160 #
4baa56
# python3.spec's
4baa56
#   Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch
4baa56
# is not relevant for Python 2
4baa56
4baa56
# 00161 #
4baa56
# python3.spec has:
4baa56
#   Patch161: 00161-fix-test_tools-directory.patch
4baa56
# which will likely become relevant for Python 2 next time we rebase
4baa56
4baa56
# 00162 #
4baa56
# python3.spec has:
4baa56
#  Patch162: 00162-distutils-sysconfig-fix-CC-options.patch
4baa56
4baa56
# 00163 #
4baa56
# python3.spec has:
4baa56
#  Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch
4baa56
9fa4f3
# 00164 #
9fa4f3
# python3.spec has:
9fa4f3
#  Patch164: 00164-disable-interrupted_write-tests-on-ppc.patch
9fa4f3
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
a0eea8
# 00166 #
a0eea8
# Bulletproof the gdb debugging hooks against the case where co_filename for
a0eea8
# a frame can't be read from the inferior process (rhbz#912025)
a0eea8
#
a0eea8
# Not yet sent upstream
a0eea8
Patch166: 00166-fix-fake-repr-in-gdb-hooks.patch
a0eea8
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
43e7c4
# Upstream as of Python 2.7.4
43e7c4
#  Patch171: 00171-raise-correct-exception-when-dev-urandom-is-missing.patch
c9c381
43e7c4
# Upstream as of Python 2.7.4
43e7c4
#  Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch
2938c6
d542ba
# 00173 #
d542ba
# Workaround for ENOPROTOOPT seen in Koji within
d542ba
# test.test_support.bind_port()
d542ba
# (rhbz#913732)
d542ba
Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch
2938c6
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
bc9fa6
# 00175 #
7b42f4
# Upstream as of Python 2.7.5
7b42f4
#  Patch175: 00175-fix-configure-Wformat.patch
bc9fa6
a31104
# 00176 #
7b42f4
# python3.spec had:
7b42f4
#  Patch176: 00176-upstream-issue16754-so-extension.patch
7b42f4
# doesn't affect python2
7b42f4
7b42f4
# 00177 #
7b42f4
# python3.spec has
7b42f4
#  Patch177: 00177-platform-unicode.patch
7b42f4
# Does not affect python2
7b42f4
7b42f4
# 00178 #
7b42f4
# python3.spec has
7b42f4
#  Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch
7b42f4
# Does not affect python2 AFAICS (different sysconfig values initialization)
7b42f4
7b42f4
# 00179 #
7b42f4
# python3.spec has
7b42f4
#  Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch
7b42f4
# Doesn't seem to affect python2
7b42f4
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
dfec9d
# 00182 #
dfec9d
# python3.spec had
dfec9d
#  Patch182: 00182-fix-test_gdb-test_threads.patch
dfec9d
dfec9d
# 00183 #
dfec9d
# python3.spec has
dfec9d
#  Patch183: 00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch
dfec9d
dfec9d
# 00184 #
dfec9d
# Fix for https://bugzilla.redhat.com/show_bug.cgi?id=979696
dfec9d
# Fixes build of ctypes against libffi with multilib wrapper
dfec9d
# Python recognizes ffi.h only if it contains "#define LIBFFI_H",
dfec9d
# but the wrapper doesn't contain that, which makes the build fail
dfec9d
# We patch this by also accepting "#define ffi_wrapper_h"
dfec9d
Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
dfec9d
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
c86b2c
# 00189 #
c86b2c
# Fixes gdb py-bt command not to raise exception while processing
c86b2c
# statements from eval
c86b2c
# rhbz#1008154 (patch by Attila Fazekas)
c86b2c
Patch189: 00189-gdb-py-bt-dont-raise-exception-from-eval.patch
c86b2c
c8f7a0
# 00190 #
c8f7a0
#
c8f7a0
# Importing get_python_version in bdist_rpm
c8f7a0
# http://bugs.python.org/issue18045
c8f7a0
# rhbz#1029082
Matej Stuchlik ebcba8
# FIXED UPSTREAM
Matej Stuchlik ebcba8
#Patch190: 00190-get_python_version.patch
c86b2c
112f64
# 00191 #
112f64
#
112f64
# Disabling NOOP test as it fails without internet connection
112f64
Patch191: 00191-disable-NOOP.patch
112f64
645b35
# 00192 #
645b35
#
645b35
# Fixing buffer overflow (upstream patch)
645b35
# rhbz#1062375
Matej Stuchlik ebcba8
# FIXED UPSTREAM
Matej Stuchlik ebcba8
#Patch192: 00192-buffer-overflow.patch
645b35
673992
# 00193 #
673992
#
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
cf9805
# 00194 #
cf9805
#
cf9805
# Fix tests with SQLite >= 3.8.4
cf9805
# http://bugs.python.org/issue20901
cf9805
# http://hg.python.org/cpython/raw-rev/1763e27a182d
Matej Stuchlik ebcba8
# FIXED UPSTREAM
Matej Stuchlik ebcba8
#Patch194: 00194-fix-tests-with-sqlite-3.8.4.patch
cf9805
Robert Kuska e0419e
# Since openssl-1.0.1h-5.fc21 SSLv2 and SSLV3 protocols
Robert Kuska e0419e
# are disabled by default in openssl, according the comment in openssl
Robert Kuska e0419e
# patch this affects only SSLv23_method, this patch enables SSLv2
Robert Kuska e0419e
# and SSLv3 when SSLv23_method is used
Robert Kuska 833dc3
# Update:
Robert Kuska 833dc3
# Patch disabled, Openssl reverted disabling sslv3 and now
Robert Kuska 833dc3
# disables only sslv2 all tests pass
Robert Kuska 833dc3
#Patch195: 00195-enable-sslv23-in-ssl.patch
Robert Kuska 833dc3
Robert Kuska 833dc3
# http://bugs.python.org/issue21308
Robert Kuska 833dc3
# Backport of ssl module from python3
Matej Stuchlik b1e5a4
# FIXED UPSTREAM
Matej Stuchlik b1e5a4
# Patch196: 00196-ssl-backport.patch
Robert Kuska 833dc3
Robert Kuska 833dc3
# http://bugs.python.org/issue22023
Robert Kuska 833dc3
# Patch seg fault in unicodeobject.c
Matej Stuchlik b1e5a4
# FIXED UPSTREAM
Matej Stuchlik b1e5a4
# Patch197: 00197-unicode_fromformat.patch
Matej Stuchlik b1e5a4
Matej Stuchlik b1e5a4
%if 0%{with_rewheel}
Matej Stuchlik b1e5a4
Patch198: 00198-add-rewheel-module.patch
Matej Stuchlik b1e5a4
%endif
Robert Kuska e0419e
Robert Kuska d48eef
# OpenSSL disabled SSLv3 in SSLv23 method
Robert Kuska d48eef
# This patch alters python tests to reflect this change
Robert Kuska d48eef
# Issue: http://bugs.python.org/issue22638 Upstream discussion about SSLv3 in Python
Robert Kuska d48eef
Patch199: 00199-alter-tests-to-reflect-sslv3-disabled.patch
Robert Kuska d48eef
866e92
# (New patches go here ^^^)
866e92
#
866e92
# When adding new patches to "python" and "python3" in Fedora 17 onwards,
866e92
# please try to keep the patch numbers in-sync between the two specfiles:
866e92
#
866e92
#   - use the same patch number across both specfiles for conceptually-equivalent
866e92
#     fixes, ideally with the same name
866e92
#
05e831
#   - when a patch is relevant to both specfiles, use the same introductory
866e92
#     comment in both specfiles where possible (to improve "diff" output when
866e92
#     comparing them)
866e92
#
866e92
#   - when a patch is only relevant for one of the two specfiles, leave a gap
866e92
#     in the patch numbering in the other specfile, adding a comment when
866e92
#     omitting a patch, both in the manifest section here, and in the "prep"
866e92
#     phase below
866e92
#
866e92
# Hopefully this will make it easier to ensure that all relevant fixes are
866e92
# applied to both versions.
866e92
c6247f
# This is the generated patch to "configure"; see the description of
c6247f
#   %{regenerate_autotooling_patch}
c6247f
# above:
498957
Patch5000: 05000-autotool-intermediates.patch
468e2b
4f38fe
# ======================================================
4f38fe
# Additional metadata, and subpackages
4f38fe
# ======================================================
4f38fe
cvsdist 64c8a9
%if %{main_python}
cvsdist 64c8a9
Obsoletes: Distutils
cvsdist 64c8a9
Provides: Distutils
8adf4f
Obsoletes: python2
cvsdist e0fde9
Provides: python2 = %{version}
bca257
Obsoletes: python-elementtree <= 1.2.6
f0ee29
Obsoletes: python-ordereddict <= 1.1-8
bca257
Obsoletes: python-sqlite < 2.3.2
bca257
Provides: python-sqlite = 2.3.2
7b2257
Obsoletes: python-ctypes < 1.0.1
7b2257
Provides: python-ctypes = 1.0.1
70aee9
Obsoletes: python-hashlib < 20081120
70aee9
Provides: python-hashlib = 20081120
cf9805
Obsoletes: python-unittest2 < 0.5.1-9
cf9805
Provides: python-unittest2 = 0.5.1-9
70aee9
Obsoletes: python-uuid < 1.31
70aee9
Provides: python-uuid = 1.31
337742
# obsolete, not provide PyXML as proposed in feature
337742
# https://fedoraproject.org/wiki/Features/RemovePyXML#How_To_Test
337742
Obsoletes: PyXML <= 0.8.4-29
f81cc6
f81cc6
# python-argparse is part of python as of version 2.7
f81cc6
# drop this Provides in F17
f81cc6
# (having Obsoletes here caused problems with multilib; see rhbz#667984)
f81cc6
Provides:   python-argparse = %{version}-%{release}
cvsdist e0fde9
%endif
cvsdist 20402f
f3e7a4
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
5ae15c
cvsdist 86d787
URL: http://www.python.org/
cvsdist e4efab
cvsdist e4efab
%description
cvsdist e4efab
Python is an interpreted, interactive, object-oriented programming
cvsdist e4efab
language often compared to Tcl, Perl, Scheme or Java. Python includes
cvsdist e4efab
modules, classes, exceptions, very high level dynamic data types and
cvsdist e4efab
dynamic typing. Python supports interfaces to many system calls and
cvsdist e4efab
libraries, as well as to various windowing systems (X11, Motif, Tk,
cvsdist e4efab
Mac and MFC).
cvsdist e4efab
cvsdist e4efab
Programmers can write new built-in modules for Python in C or C++.
cvsdist e4efab
Python can be used as an extension language for applications that need
2ec5b3
a programmable interface.
cvsdist e4efab
cvsdist e4efab
Note that documentation for Python is provided in the python-docs
cvsdist e4efab
package.
cvsdist e4efab
2ec5b3
This package provides the "python" executable; most of the actual
2ec5b3
implementation is within the "python-libs" package.
2ec5b3
87c8da
%package libs
2ec5b3
Summary: Runtime libraries for Python
87c8da
Group: Applications/System
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
87c8da
%description libs
2ec5b3
This package contains runtime libraries for use by Python:
2ec5b3
- the libpython dynamic library, for use by applications that embed Python as
2ec5b3
a scripting language, and by the main "python" executable
2ec5b3
- the Python standard library
87c8da
cvsdist e4efab
%package devel
791e9f
Summary: The libraries and header files needed for Python development
cvsdist e4efab
Group: Development/Libraries
0626de
Requires: %{python}%{?_isa} = %{version}-%{release}
c6247f
Requires: pkgconfig
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 64c8a9
%if %{main_python}
cvsdist e0fde9
Obsoletes: python2-devel
dc37a5
Provides: python2-devel = %{version}-%{release}
5b9116
Provides: python2-devel%{?_isa} = %{version}-%{release}
cvsdist e0fde9
%endif
cvsdist e4efab
cvsdist e4efab
%description devel
cvsdist e4efab
The Python programming language's interpreter can be extended with
cvsdist e4efab
dynamically loaded extensions and can be embedded in other programs.
cvsdist e4efab
This package contains the header files and libraries needed to do
cvsdist e4efab
these types of tasks.
cvsdist e4efab
cvsdist e4efab
Install python-devel if you want to develop Python extensions.  The
cvsdist e4efab
python package will also need to be installed.  You'll probably also
cvsdist e4efab
want to install the python-docs package, which contains Python
cvsdist e4efab
documentation.
cvsdist e4efab
cvsdist e4efab
%package tools
791e9f
Summary: A collection of development tools included with Python
cvsdist e4efab
Group: Development/Tools
cvsdist 8caa1f
Requires: %{name} = %{version}-%{release}
Mihai Ibanescu ce25e1
Requires: %{tkinter} = %{version}-%{release}
cvsdist 64c8a9
%if %{main_python}
cvsdist e0fde9
Obsoletes: python2-tools
cvsdist e0fde9
Provides: python2-tools = %{version}
cvsdist e0fde9
%endif
cvsdist e4efab
cvsdist e4efab
%description tools
8adf4f
This package includes several tools to help with the development of Python
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
cvsdist 64c8a9
%package -n %{tkinter}
c22243
Summary: A graphical user interface for the Python scripting language
cvsdist e4efab
Group: Development/Languages
cvsdist 8caa1f
Requires: %{name} = %{version}-%{release}
cvsdist 64c8a9
%if %{main_python}
cvsdist e0fde9
Obsoletes: tkinter2
cvsdist e0fde9
Provides: tkinter2 = %{version}
cvsdist e0fde9
%endif
cvsdist e4efab
cvsdist 64c8a9
%description -n %{tkinter}
cvsdist e0fde9
cvsdist e4efab
The Tkinter (Tk interface) program is an graphical user interface for
cvsdist e4efab
the Python scripting language.
cvsdist e4efab
cvsdist e4efab
You should install the tkinter package if you'd like to use a graphical
cvsdist e4efab
user interface for Python programming.
cvsdist e4efab
860ed4
%package test
860ed4
Summary: The test modules from the main python package
860ed4
Group: Development/Languages
860ed4
Requires: %{name} = %{version}-%{release}
860ed4
860ed4
%description test
860ed4
791e9f
The test modules from the main python package: %{name}
860ed4
These have been removed to save space, as they are never or almost
860ed4
never used in production.
860ed4
860ed4
You might want to install the python-test package if you're developing python
860ed4
code that uses more than just unittest and/or test_support.py.
860ed4
f078d6
%if 0%{?with_debug_build}
f020ab
%package debug
f020ab
Summary: Debug version of the Python runtime
f020ab
Group: Applications/System
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}
f020ab
Requires: tkinter%{?_isa} = %{version}-%{release}
f020ab
Requires: %{name}-tools%{?_isa} = %{version}-%{release}
f020ab
f020ab
%description debug
f020ab
python-debug provides a version of the Python runtime with numerous debugging
f020ab
features enabled, aimed at advanced Python users, such as developers of Python
f020ab
extension modules.
f020ab
f020ab
This version uses more memory and will be slower than the regular Python 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
f020ab
version of Python, but the debugging features mean that C/C++ extension modules
f020ab
are ABI-incompatible with those built for the standard runtime.
f020ab
f020ab
It shares installation directories with the standard Python runtime, so that
f020ab
.py and .pyc files can be shared.  All compiled extension modules gain a "_d"
f020ab
suffix ("foo_d.so" rather than "foo.so") so that each Python implementation can
f020ab
load its own extensions.
f078d6
%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
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)
991332
for f in md5module.c md5.c shamodule.c sha256module.c sha512module.c; do
991332
    rm Modules/$f
991332
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
860ed4
# Try not disabling egg-infos, bz#414711
860ed4
#patch50 -p1 -b .egginfo
12cb76
43e7c4
# patch101: upstream as of Python 2.7.4
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
b0a6ae
# patch11: upstream as of Python 2.7.3
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
b0a6ae
# patch115: upstream as of Python 2.7.3
96cf82
42d74b
%patch121 -p1
5810c5
%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
7b42f4
# 00126: upstream as of Python 2.7.5
7b42f4
# 00127: upstream as of Python 2.7.5
4b97ee
%patch128 -p1
e16547
73e351
%patch130 -p1
94e850
663654
%ifarch ppc %{power64}
e25252
%patch131 -p1
e25252
%endif
e25252
866e92
%patch132 -p1
866e92
%patch133 -p1
866e92
%patch134 -p1
866e92
%patch135 -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
866e92
%patch141 -p1
b64e81
%patch142 -p1 -b .tty-fail
e16547
%patch143 -p1 -b .tsc-on-ppc
5764ad
%if !%{with_gdbm}
5764ad
%patch144 -p1
5764ad
%endif
b0a6ae
# 00145: upstream as of Python 2.7.3
991332
%patch146 -p1
a43d18
%patch147 -p1
b0a6ae
# 00148: upstream as of Python 2.7.3
df914e
# 00149: not for python 2
cd5070
# 00150: not for python 2
b0a6ae
# 00151: upstream as of Python 2.7.3
b0a6ae
# 00152: not for python 2
b0a6ae
%patch153 -p0
7461fe
# 00154: not for python 2
7461fe
%patch155 -p1
926168
%patch156 -p1
899afa
%patch157 -p1
43e7c4
# 00158: upstream as of Python 2.7.4
4baa56
# 00160: not for python 2
4baa56
# 00161: not for python 2 yet
4baa56
# 00162: not for python 2 yet
4baa56
# 00163: not for python 2 yet
9fa4f3
# 00164: not for python 2 yet
9fa4f3
%patch165 -p1
9fa4f3
mv Modules/cryptmodule.c Modules/_cryptmodule.c
a0eea8
%patch166 -p1
d63f6b
%patch167 -p1
01cf2c
%patch168 -p1
41aa0d
%patch169 -p1
6a2708
%patch170 -p1
43e7c4
# 00171: upstream as of Python 2.7.4
43e7c4
# 00171: upstream as of Python 2.7.4
d542ba
%patch173 -p1
4e8ad3
%patch174 -p1 -b .fix-for-usr-move
7b42f4
# 00175: upstream as of Python 2.7.5
7b42f4
# 00176: not for python 2
7b42f4
# 00177: not for python 2
7b42f4
# 00178: not for python 2
7b42f4
# 00179: not for python 2
7b42f4
%patch180 -p1
7b42f4
%patch181 -p1
dfec9d
# 00182: not for python 2
dfec9d
# 00183: not for python 2
dfec9d
%patch184 -p1
Matej Stuchlik 6f6573
%patch185 -p1
a9f6e8
%patch187 -p1
c86b2c
%patch189 -p1
Matej Stuchlik ebcba8
# 00190: upstream as of Python 2.7.7
112f64
%patch191 -p1
Matej Stuchlik ebcba8
# 00192: upstream as of Python 2.7.7
673992
%patch193 -p1
Matej Stuchlik ebcba8
# 00194: upstream as of Python 2.7.7
Robert Kuska 833dc3
#%patch195 -p1
Matej Stuchlik b1e5a4
# 00196: upstream as of Python 2.7.9
Matej Stuchlik b1e5a4
# 00197: upstream as of Python 2.7.9
Matej Stuchlik b1e5a4
%if 0%{with_rewheel}
Matej Stuchlik b1e5a4
%patch198 -p1
Robert Kuska d48eef
%patch199 -p1
Matej Stuchlik b1e5a4
%endif
9fa4f3
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
b95f6c
  LD_LIBRARY_PATH="$topdir/$ConfDir" ./$BinaryName \
f020ab
    $topdir/Tools/scripts/pathfix.py \
f020ab
      -i "%{_bindir}/env $BinaryName" \
f020ab
      $topdir
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
f078d6
%if 0%{?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
f078d6
%endif # with_debug_build
f020ab
f020ab
BuildPython optimized \
f020ab
  python \
f020ab
  python%{pybasever} \
f020ab
  "" \
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}
f020ab
PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName.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
f078d6
%if 0%{?with_debug_build}
f020ab
InstallPython debug \
f020ab
  python%{pybasever}-debug \
f020ab
  %{py_INSTSONAME_debug}
f078d6
%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
Mihai Ibanescu f9962c
    sed 's,#!.*/python$,#!%{_bindir}/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 64c8a9
%if %{main_python}
cvsdist 64c8a9
%else
791e9f
mv %{buildroot}%{_bindir}/python %{buildroot}%{_bindir}/%{python}
f078d6
%if 0%{?with_debug_build}
f020ab
mv %{buildroot}%{_bindir}/python-debug %{buildroot}%{_bindir}/%{python}-debug
f078d6
%endif # with_debug_build
791e9f
mv %{buildroot}/%{_mandir}/man1/python.1 %{buildroot}/%{_mandir}/man1/python%{pybasever}.1
cvsdist e0fde9
%endif
cvsdist e4efab
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
cvsdist e0fde9
cvsdist 64c8a9
#make the binaries install side by side with the main python
cvsdist 64c8a9
%if !%{main_python}
791e9f
pushd %{buildroot}%{_bindir}
cvsdist 64c8a9
mv idle idle%{__python_ver}
cvsdist 64c8a9
mv pynche pynche%{__python_ver}
cvsdist 64c8a9
mv pygettext.py pygettext%{__python_ver}.py
cvsdist 64c8a9
mv msgfmt.py msgfmt%{__python_ver}.py
Mihai Ibanescu ce25e1
mv smtpd.py smtpd%{__python_ver}.py
cvsdist 64c8a9
mv pydoc pydoc%{__python_ver}
cvsdist e0fde9
popd
cvsdist e0fde9
%endif
cvsdist e4efab
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"
791e9f
install -d %{buildroot}/usr/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
8ac2b8
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64
0626de
%global _pyconfig_h %{_pyconfig64_h}
Mihai Ibanescu f1d253
%else
0626de
%global _pyconfig_h %{_pyconfig32_h}
Mihai Ibanescu f1d253
%endif
f078d6
f078d6
%if 0%{?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
85867c
# Install macros for rpm:
01c160
mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/
01c160
install -m 644 %{SOURCE6} %{buildroot}/%{_rpmconfigdir}/macros.d/
85867c
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}
8ac2b8
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64
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
f078d6
%if 0%{?with_debug_build}
f020ab
sed \
f020ab
   -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_debug}|" \
3dde1c
   %{SOURCE3} \
f020ab
   > %{buildroot}%{tapsetdir}/%{libpython_stp_debug}
f078d6
%endif # with_debug_build
3dde1c
%endif # with_systemtap
3dde1c
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
Matej Stuchlik 19530b
/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}_d.so.1.0
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
80188d
%ifarch s390 s390x %{power64}
cfa0d5
    EXTRATESTOPTS="$EXTRATESTOPTS -x test_gdb"
cfa0d5
%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
bc10ab
%if 0%{run_selftest_suite}
bc10ab
5810c5
# Check each of the configurations:
5810c5
%if 0%{?with_debug_build}
5810c5
CheckPython \
5810c5
  debug \
5810c5
  python%{pybasever}-debug
5810c5
%endif # with_debug_build
5810c5
CheckPython \
5810c5
  optimized \
5810c5
  python%{pybasever}
5810c5
bc10ab
%endif # run_selftest_suite
bc10ab
bc10ab
4f38fe
# ======================================================
4f38fe
# Cleaning up
4f38fe
# ======================================================
4f38fe
cvsdist e4efab
%clean
791e9f
rm -fr %{buildroot}
cvsdist e0fde9
4f38fe
4f38fe
# ======================================================
4f38fe
# Scriptlets
4f38fe
# ======================================================
4f38fe
5b28df
%post libs -p /sbin/ldconfig
87c8da
5b28df
%postun libs -p /sbin/ldconfig
87c8da
4f38fe
4f38fe
05912b
%files
791e9f
%defattr(-, root, root, -)
69a4fe
%{!?_licensedir:%global license %%doc}
69a4fe
%license LICENSE
69a4fe
%doc README
Mihai Ibanescu d6509b
%{_bindir}/pydoc*
1df0c9
%{_bindir}/%{python}
1df0c9
%if %{main_python}
f3e7a4
%{_bindir}/python2
1df0c9
%endif
1df0c9
%{_bindir}/python%{pybasever}
cvsdist e0fde9
%{_mandir}/*/*
cvsdist e0fde9
2ec5b3
%files libs
2ec5b3
%defattr(-,root,root,-)
69a4fe
%{!?_licensedir:%global license %%doc}
69a4fe
%license LICENSE
69a4fe
%doc README
05912b
%dir %{pylibdir}
05912b
%dir %{dynload_dir}
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
05912b
%{pylibdir}/idlelib
c6247f
%{pylibdir}/importlib
05912b
%dir %{pylibdir}/json
05912b
%{pylibdir}/json/*.py*
05912b
%{pylibdir}/lib2to3
8b8196
%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*
05912b
%dir %{pylibdir}/test
05912b
%{pylibdir}/test/test_support.py*
05912b
%{pylibdir}/test/__init__.py*
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*
Matej Stuchlik b1e5a4
%exclude %{pylibdir}/ensurepip/_bundled
Matej Stuchlik b1e5a4
Matej Stuchlik b1e5a4
%if 0%{?with_rewheel}
Matej Stuchlik b1e5a4
%dir %{pylibdir}/ensurepip/rewheel/
Matej Stuchlik b1e5a4
%{pylibdir}/ensurepip/rewheel/*.py*
Matej Stuchlik b1e5a4
%endif
Matej Stuchlik b1e5a4
Matej Stuchlik b1e5a4
cvsdist e4efab
%files devel
791e9f
%defattr(-,root,root,-)
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
c22243
%if %{main_python}
f3e7a4
%{_bindir}/python-config
9345b0
%{_bindir}/python2-config
c22243
%endif
1df0c9
%{_bindir}/python%{pybasever}-config
87c8da
%{_libdir}/libpython%{pybasever}.so
01c160
%{_rpmconfigdir}/macros.d/macros.python2
cvsdist e4efab
cvsdist e0fde9
%files tools
cvsdist e4efab
%defattr(-,root,root,755)
cvsdist e4efab
%doc Tools/pynche/README.pynche
05912b
%{site_packages}/pynche
Mihai Ibanescu ce25e1
%{_bindir}/smtpd*.py*
a7ef9c
%{_bindir}/2to3*
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
cvsdist 64c8a9
%files -n %{tkinter}
cvsdist d855cb
%defattr(-,root,root,755)
05912b
%{pylibdir}/lib-tk
05912b
%{dynload_dir}/_tkinter.so
cvsdist e4efab
860ed4
%files test
791e9f
%defattr(-, root, root, -)
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/*
c905a3
# These two are shipped in the main subpackage:
c905a3
%exclude %{pylibdir}/test/test_support.py*
c905a3
%exclude %{pylibdir}/test/__init__.py*
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
f078d6
%if 0%{?with_debug_build}
f020ab
%files debug
f020ab
%defattr(-,root,root,-)
f020ab
f020ab
# Analog of the core subpackage's files:
f020ab
%{_bindir}/%{python}-debug
f020ab
%if %{main_python}
f020ab
%{_bindir}/python2-debug
f020ab
%endif
f020ab
%{_bindir}/python%{pybasever}-debug
f020ab
2ec5b3
# Analog of the -libs subpackage's files, with debug builds of the built-in
2ec5b3
# "extension" modules:
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
%if %{main_python}
f020ab
%{_bindir}/python-debug-config
9345b0
%{_bindir}/python2-debug-config
f020ab
%endif
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
f020ab
# Analog  of the tkinter subpackage's files:
f020ab
%{dynload_dir}/_tkinter_d.so
f020ab
f020ab
# Analog  of the -test subpackage's files:
f020ab
%{dynload_dir}/_ctypes_test_d.so
f020ab
%{dynload_dir}/_testcapimodule_d.so
f020ab
f078d6
%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
4f38fe
4f38fe
# ======================================================
4f38fe
# Finally, the changelog:
4f38fe
# ======================================================
4f38fe
cvsdist e4efab
%changelog
8c96ef
* Sat Feb 21 2015 Till Maas <opensource@till.name> - 2.7.9-8
8c96ef
- Rebuilt for Fedora 23 Change
8c96ef
  https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
8c96ef
847e7c
* Sat Feb 21 2015 Till Maas <opensource@till.name> - 2.7.9-7
847e7c
- Rebuilt for Fedora 23 Change
847e7c
  https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
847e7c
a98848
* Tue Feb 17 2015 Ville Skyttä <ville.skytta@iki.fi> - 2.7.9-6
a98848
- Own systemtap dirs (#710733)
a98848
80188d
* Fri Feb 06 2015 Karsten Hopp <karsten@redhat.com> 2.7.9-5
80188d
- disable test_gdb on ppc64* until rhbz#1132488 is really resolved
80188d
dc37a5
* Tue Jan 20 2015 Slavek Kabrda <bkabrda@redhat.com> - 2.7.9-4
dc37a5
- We need to provide both arch specific and noarch Provide for python2-devel
dc37a5
in order not to break noarch builds.
dc37a5
5b9116
* Tue Jan 20 2015 Slavek Kabrda <bkabrda@redhat.com> - 2.7.9-3
5b9116
- Make python2-devel provide arch specific.
5b9116
Resolves: rhbz#1183530
5b9116
cfa0d5
* Mon Jan 12 2015 Dan Horák <dan[at]danny.cz> - 2.7.9-2
cfa0d5
- build with valgrind on ppc64le
cfa0d5
- disable test_gdb on s390(x) until rhbz#1181034 is resolved
cfa0d5
Matej Stuchlik b1e5a4
* Thu Dec 11 2014 Matej Stuchlik <mstuchli@redhat.com> - 2.7.9-1
Matej Stuchlik b1e5a4
- Update to 2.7.9
Matej Stuchlik b1e5a4
- Refreshed patches: #55, #137, #146, #153, #156, #198
Matej Stuchlik b1e5a4
- Dropped patches: #196, #197
Robert Kuska d48eef
- New patch: #199
Matej Stuchlik b1e5a4
- Added the rewheel module
Matej Stuchlik b1e5a4
Matej Stuchlik 3c4117
* Mon Nov 24 2014 Matej Stuchlik <mstuchli@redhat.com> - 2.7.8-10
Matej Stuchlik 3c4117
- Improve python2_version macros
Matej Stuchlik 3c4117
Matej Stuchlik 6875a6
* Thu Nov 13 2014 Matej Stuchlik <mstuchli@redhat.com> - 2.7.8-9
Matej Stuchlik 6875a6
- Add python2_version_nodots macro
Matej Stuchlik 6875a6
8cc233
* Mon Nov 10 2014 Slavek Kabrda <bkabrda@redhat.com> - 2.7.8-8
8cc233
- Revert previous change, see rhbz#1161166#c6.
8cc233
5322c8
* Fri Nov 07 2014 Slavek Kabrda <bkabrda@redhat.com> - 2.7.8-7
5322c8
- Provide importable unittest2
5322c8
Resolves: rhbz#1161166
5322c8
Robert Kuska cc9f6c
* Thu Aug 21 2014 Robert Kuska <rkuska@redhat.com> - 2.7.8-6
Robert Kuska cc9f6c
- Update patch 196 (ssl backport)
Robert Kuska cc9f6c
Robert Kuska 833dc3
* Tue Aug 19 2014 Robert Kuska <rkuska@redhat.com> - 2.7.8-5
Robert Kuska 833dc3
- Backport ssl module from python3
Robert Kuska 833dc3
e29cbd
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.8-4
e29cbd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
e29cbd
69a4fe
* Thu Jul 31 2014 Tom Callaway <spot@fedoraproject.org> - 2.7.8-3
69a4fe