public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
* [git.ipfire.org] IPFire 3.x development tree branch, master, updated. 48d9a6a01196688b2ab80df7fb014e476a404d2f
@ 2013-09-08 11:48 git
  0 siblings, 0 replies; only message in thread
From: git @ 2013-09-08 11:48 UTC (permalink / raw)
  To: ipfire-scm

[-- Attachment #1: Type: text/plain, Size: 104033 bytes --]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 3.x development tree".

The branch, master has been updated
       via  48d9a6a01196688b2ab80df7fb014e476a404d2f (commit)
      from  6bc6f781d7ab9d7164b6bd09a17222f8afbc0155 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 48d9a6a01196688b2ab80df7fb014e476a404d2f
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Sun Sep 8 13:46:04 2013 +0200

    python: Update to 2.7.5.
    
    Enable testsuite, but the result will not be evaluated.

-----------------------------------------------------------------------

Summary of changes:
 python/patches/00101-lib64-regex.patch             |  19 ++
 ...atch => 00104-lib64-fix-for-test_install.patch} |   0
 .../patches/00111-no-static-lib.patch              |  35 +--
 .../patches/00113-more-configuration-flags.patch   |  32 +--
 .../patches/00114-statvfs-f_flag-constants.patch   |  28 ++-
 .../patches/00121-add-Modules-to-build-path.patch  |  13 +
 .../patches/00125-less-verbose-COUNT_ALLOCS.patch  |   0
 .../patches/00131-disable-tests-in-test_io.patch   |   0
 python/patches/00133-skip-test_dl.patch            |  13 +
 ...0134-fix-COUNT_ALLOCS-failure-in-test_sys.patch |  14 ++
 ...6-skip-tests-of-seeking-stdin-in-rpmbuild.patch |  22 ++
 .../00141-fix-test_gc_with_COUNT_ALLOCS.patch      |  12 +-
 .../00142-skip-failing-pty-tests-in-rpmbuild.patch |   0
 .../patches/00155-avoid-ctypes-thunks.patch        |  12 +-
 python/patches/00157-uid-gid-overflows.patch       |  49 ++++
 python/patches/00168-distutils-cflags.patch        |  12 +
 ...-implicit-usage-of-md5-in-multiprocessing.patch |  41 +++
 python/patches/00170-gc-assertions.patch           | 276 +++++++++++++++++++++
 ...00173-workaround-ENOPROTOOPT-in-bind_port.patch |  13 +
 python/patches/00174-fix-for-usr-move.patch        |  28 +++
 ...allow-arbitrary-timeout-in-condition-wait.patch |  70 ++++++
 ...should-build-with-libffi-multilib-wrapper.patch |  12 +
 ...-4238-hostname-check-bypass-in-SSL-module.patch | 247 ++++++++++++++++++
 .../00185-urllib2-honors-noproxy-for-ftp.patch     |  12 +
 python/patches/00186-memory-leak-marshalc.patch    |  57 +++++
 python/patches/05000-autotool-intermediates.patch  | 216 ++++++++++++++++
 python/patches/python-2.5-cflags.patch             |   2 +-
 python/patches/python-2.5.1-plural-fix.patch       |  12 +
 python/patches/python-2.5.1-sqlite-encoding.patch  |  24 ++
 python/patches/python-2.6-rpath.patch              |   6 +-
 python/patches/python-2.7.1-config.patch           |  71 ++++--
 ...thon-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch |  27 ++
 python/patches/python-2.7.1-setup-db48.patch       |  13 -
 ...7.2-add-extension-suffix-to-python-config.patch |  18 ++
 python/patches/python-2.7rc1-binutils-no-dep.patch |  14 ++
 .../python-2.7rc1-socketmodule-constants.patch     |  64 +++++
 .../python-2.7rc1-socketmodule-constants2.patch    |  19 ++
 python/patches/python-2.7rc2-r79310.patch0R        |  27 --
 python/patches/x86_64/python-2.7.3-lib64.patch     |  99 ++++----
 python/python.nm                                   |  15 +-
 40 files changed, 1463 insertions(+), 181 deletions(-)
 create mode 100644 python/patches/00101-lib64-regex.patch
 rename python/patches/{python-lib64-fix-for-test_install.patch => 00104-lib64-fix-for-test_install.patch} (100%)
 copy {python3 => python}/patches/00111-no-static-lib.patch (50%)
 copy {python3 => python}/patches/00113-more-configuration-flags.patch (55%)
 copy {python3 => python}/patches/00114-statvfs-f_flag-constants.patch (59%)
 create mode 100644 python/patches/00121-add-Modules-to-build-path.patch
 copy {python3 => python}/patches/00125-less-verbose-COUNT_ALLOCS.patch (100%)
 copy {python3 => python}/patches/00131-disable-tests-in-test_io.patch (100%)
 create mode 100644 python/patches/00133-skip-test_dl.patch
 create mode 100644 python/patches/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
 create mode 100644 python/patches/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
 copy {python3 => python}/patches/00141-fix-test_gc_with_COUNT_ALLOCS.patch (51%)
 copy {python3 => python}/patches/00142-skip-failing-pty-tests-in-rpmbuild.patch (100%)
 copy {python3 => python}/patches/00155-avoid-ctypes-thunks.patch (54%)
 create mode 100644 python/patches/00157-uid-gid-overflows.patch
 create mode 100644 python/patches/00168-distutils-cflags.patch
 create mode 100644 python/patches/00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
 create mode 100644 python/patches/00170-gc-assertions.patch
 create mode 100644 python/patches/00173-workaround-ENOPROTOOPT-in-bind_port.patch
 create mode 100644 python/patches/00174-fix-for-usr-move.patch
 create mode 100644 python/patches/00181-allow-arbitrary-timeout-in-condition-wait.patch
 create mode 100644 python/patches/00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
 create mode 100644 python/patches/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
 create mode 100644 python/patches/00185-urllib2-honors-noproxy-for-ftp.patch
 create mode 100644 python/patches/00186-memory-leak-marshalc.patch
 create mode 100644 python/patches/05000-autotool-intermediates.patch
 create mode 100644 python/patches/python-2.5.1-plural-fix.patch
 create mode 100644 python/patches/python-2.5.1-sqlite-encoding.patch
 create mode 100644 python/patches/python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
 delete mode 100644 python/patches/python-2.7.1-setup-db48.patch
 create mode 100644 python/patches/python-2.7.2-add-extension-suffix-to-python-config.patch
 create mode 100644 python/patches/python-2.7rc1-binutils-no-dep.patch
 create mode 100644 python/patches/python-2.7rc1-socketmodule-constants.patch
 create mode 100644 python/patches/python-2.7rc1-socketmodule-constants2.patch
 delete mode 100644 python/patches/python-2.7rc2-r79310.patch0R

Difference in files:
diff --git a/python/patches/00101-lib64-regex.patch b/python/patches/00101-lib64-regex.patch
new file mode 100644
index 0000000..e399390
--- /dev/null
+++ b/python/patches/00101-lib64-regex.patch
@@ -0,0 +1,19 @@
+diff -up Python-2.7.3/Lib/test/test_re.py.lib64-regex Python-2.7.3/Lib/test/test_re.py
+--- Python-2.7.3/Lib/test/test_re.py.lib64-regex	2012-04-09 19:07:32.000000000 -0400
++++ Python-2.7.3/Lib/test/test_re.py	2013-02-19 13:53:57.624033102 -0500
+@@ -757,6 +757,15 @@ class ReTests(unittest.TestCase):
+         self.assertRaises(TypeError, re.finditer, "a", {})
+         self.assertRaises(OverflowError, _sre.compile, "abc", 0, [long_overflow])
+ 
++    def test_bug_931848(self):
++        try:
++            unicode
++        except NameError:
++            pass
++        pattern = eval('u"[\u002E\u3002\uFF0E\uFF61]"')
++        self.assertEqual(re.compile(pattern).split("a.b.c"),
++                         ['a','b','c'])
++
+ def run_re_tests():
+     from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
+     if verbose:
diff --git a/python/patches/00104-lib64-fix-for-test_install.patch b/python/patches/00104-lib64-fix-for-test_install.patch
new file mode 100644
index 0000000..7852bf6
--- /dev/null
+++ b/python/patches/00104-lib64-fix-for-test_install.patch
@@ -0,0 +1,13 @@
+--- Python-2.7.2/Lib/distutils/tests/test_install.py.lib64	2011-09-08 17:51:57.851405376 -0400
++++ Python-2.7.2/Lib/distutils/tests/test_install.py	2011-09-08 18:40:46.754205096 -0400
+@@ -41,8 +41,9 @@ class InstallTestCase(support.TempdirMan
+             self.assertEqual(got, expected)
+ 
+         libdir = os.path.join(destination, "lib", "python")
++        platlibdir = os.path.join(destination, "lib64", "python")
+         check_path(cmd.install_lib, libdir)
+-        check_path(cmd.install_platlib, libdir)
++        check_path(cmd.install_platlib, platlibdir)
+         check_path(cmd.install_purelib, libdir)
+         check_path(cmd.install_headers,
+                    os.path.join(destination, "include", "python", "foopkg"))
diff --git a/python/patches/00111-no-static-lib.patch b/python/patches/00111-no-static-lib.patch
new file mode 100644
index 0000000..f71117f
--- /dev/null
+++ b/python/patches/00111-no-static-lib.patch
@@ -0,0 +1,50 @@
+diff -up Python-2.7.3/Makefile.pre.in.no-static-lib Python-2.7.3/Makefile.pre.in
+--- Python-2.7.3/Makefile.pre.in.no-static-lib	2013-02-19 14:03:40.801993224 -0500
++++ Python-2.7.3/Makefile.pre.in	2013-02-19 14:04:44.070988898 -0500
+@@ -397,7 +397,7 @@ coverage:
+ 
+ 
+ # Build the interpreter
+-$(BUILDPYTHON):	Modules/python.o $(LIBRARY) $(LDLIBRARY)
++$(BUILDPYTHON):	Modules/python.o $(LDLIBRARY)
+ 		$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
+ 			Modules/python.o \
+ 			$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+@@ -413,18 +413,6 @@ sharedmods: $(BUILDPYTHON)
+ 	$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ 		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
+ 
+-# Build static library
+-# avoid long command lines, same as LIBRARY_OBJS
+-$(LIBRARY): $(LIBRARY_OBJS)
+-	-rm -f $@
+-	$(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o
+-	$(AR) $(ARFLAGS) $@ $(PARSER_OBJS)
+-	$(AR) $(ARFLAGS) $@ $(OBJECT_OBJS)
+-	$(AR) $(ARFLAGS) $@ $(PYTHON_OBJS)
+-	$(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
+-	$(AR) $(ARFLAGS) $@ $(MODOBJS)
+-	$(RANLIB) $@
+-
+ libpython$(VERSION).so: $(LIBRARY_OBJS)
+ 	if test $(INSTSONAME) != $(LDLIBRARY); then \
+ 		$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+@@ -1021,18 +1009,6 @@ libainstall:	all python-config
+ 		else	true; \
+ 		fi; \
+ 	done
+-	@if test -d $(LIBRARY); then :; else \
+-		if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
+-			if test "$(SO)" = .dll; then \
+-				$(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
+-			else \
+-				$(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+-				$(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+-			fi; \
+-		else \
+-			echo Skip install of $(LIBRARY) - use make frameworkinstall; \
+-		fi; \
+-	fi
+ 	$(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
+ 	$(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
+ 	$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
diff --git a/python/patches/00113-more-configuration-flags.patch b/python/patches/00113-more-configuration-flags.patch
new file mode 100644
index 0000000..2d447b2
--- /dev/null
+++ b/python/patches/00113-more-configuration-flags.patch
@@ -0,0 +1,50 @@
+diff -up Python-2.6.5/configure.ac.more-configuration-flags Python-2.6.5/configure.ac
+--- Python-2.6.5/configure.ac.more-configuration-flags	2010-05-24 18:51:25.410111792 -0400
++++ Python-2.6.5/configure.ac	2010-05-24 18:59:23.954986388 -0400
+@@ -2515,6 +2515,30 @@ else AC_MSG_RESULT(no)
+ fi],
+ [AC_MSG_RESULT(no)])
+ 
++AC_MSG_CHECKING(for --with-count-allocs)
++AC_ARG_WITH(count-allocs,
++[  --with(out)count-allocs  enable/disable per-type instance accounting], [
++if test "$withval" != no
++then 
++  AC_DEFINE(COUNT_ALLOCS, 1,
++    [Define to keep records of the number of instances of each type]) 
++    AC_MSG_RESULT(yes)
++else AC_MSG_RESULT(no)
++fi],
++[AC_MSG_RESULT(no)])
++
++AC_MSG_CHECKING(for --with-call-profile)
++AC_ARG_WITH(call-profile,
++[  --with(out)-call-profile  enable/disable statistics on function call invocation], [
++if test "$withval" != no
++then 
++  AC_DEFINE(CALL_PROFILE, 1, 
++    [Define to keep records on function call invocation]) 
++    AC_MSG_RESULT(yes)
++else AC_MSG_RESULT(no)
++fi],
++[AC_MSG_RESULT(no)])
++
+ # Check for Python-specific malloc support
+ AC_MSG_CHECKING(for --with-pymalloc)
+ AC_ARG_WITH(pymalloc,
+diff -up Python-2.6.5/pyconfig.h.in.more-configuration-flags Python-2.6.5/pyconfig.h.in
+--- Python-2.6.5/pyconfig.h.in.more-configuration-flags	2010-05-24 18:51:45.677988086 -0400
++++ Python-2.6.5/pyconfig.h.in	2010-05-24 19:00:44.163987730 -0400
+@@ -1019,6 +1019,12 @@
+ /* Define to profile with the Pentium timestamp counter */
+ #undef WITH_TSC
+ 
++/* Define to keep records of the number of instances of each type */
++#undef COUNT_ALLOCS
++
++/* Define to keep records on function call invocation */
++#undef CALL_PROFILE
++
+ /* Define if you want pymalloc to be disabled when running under valgrind */
+ #undef WITH_VALGRIND
+ 
diff --git a/python/patches/00114-statvfs-f_flag-constants.patch b/python/patches/00114-statvfs-f_flag-constants.patch
new file mode 100644
index 0000000..83e7b59
--- /dev/null
+++ b/python/patches/00114-statvfs-f_flag-constants.patch
@@ -0,0 +1,47 @@
+diff -up Python-2.7rc1/Modules/posixmodule.c.statvfs-f-flag-constants Python-2.7rc1/Modules/posixmodule.c
+--- Python-2.7rc1/Modules/posixmodule.c.statvfs-f-flag-constants	2010-05-15 17:45:30.000000000 -0400
++++ Python-2.7rc1/Modules/posixmodule.c	2010-06-07 22:54:16.162068624 -0400
+@@ -9174,6 +9174,43 @@ all_ins(PyObject *d)
+ #endif
+ #endif
+ 
++    /* These came from statvfs.h */
++#ifdef ST_RDONLY
++    if (ins(d, "ST_RDONLY", (long)ST_RDONLY)) return -1;
++#endif /* ST_RDONLY */
++#ifdef ST_NOSUID
++    if (ins(d, "ST_NOSUID", (long)ST_NOSUID)) return -1;
++#endif /* ST_NOSUID */
++    
++    /* GNU extensions */
++#ifdef ST_NODEV
++    if (ins(d, "ST_NODEV", (long)ST_NODEV)) return -1;
++#endif /* ST_NODEV */
++#ifdef ST_NOEXEC
++    if (ins(d, "ST_NOEXEC", (long)ST_NOEXEC)) return -1;
++#endif /* ST_NOEXEC */
++#ifdef ST_SYNCHRONOUS
++    if (ins(d, "ST_SYNCHRONOUS", (long)ST_SYNCHRONOUS)) return -1;
++#endif /* ST_SYNCHRONOUS */
++#ifdef ST_MANDLOCK
++    if (ins(d, "ST_MANDLOCK", (long)ST_MANDLOCK)) return -1;
++#endif /* ST_MANDLOCK */
++#ifdef ST_WRITE
++    if (ins(d, "ST_WRITE", (long)ST_WRITE)) return -1;
++#endif /* ST_WRITE */
++#ifdef ST_APPEND
++    if (ins(d, "ST_APPEND", (long)ST_APPEND)) return -1;
++#endif /* ST_APPEND */
++#ifdef ST_NOATIME
++    if (ins(d, "ST_NOATIME", (long)ST_NOATIME)) return -1;
++#endif /* ST_NOATIME */
++#ifdef ST_NODIRATIME
++    if (ins(d, "ST_NODIRATIME", (long)ST_NODIRATIME)) return -1;
++#endif /* ST_NODIRATIME */
++#ifdef ST_RELATIME
++    if (ins(d, "ST_RELATIME", (long)ST_RELATIME)) return -1;
++#endif /* ST_RELATIME */
++    
+ #if defined(PYOS_OS2)
+     if (insertvalues(d)) return -1;
+ #endif
diff --git a/python/patches/00121-add-Modules-to-build-path.patch b/python/patches/00121-add-Modules-to-build-path.patch
new file mode 100644
index 0000000..6e3294d
--- /dev/null
+++ b/python/patches/00121-add-Modules-to-build-path.patch
@@ -0,0 +1,13 @@
+--- Python-2.7.5/Lib/site.py.orig	2013-05-16 12:47:55.000000000 +0200
++++ Python-2.7.5/Lib/site.py	2013-05-16 12:56:20.089058109 +0200
+@@ -529,6 +529,10 @@ def main():
+ 
+     abs__file__()
+     known_paths = removeduppaths()
++    from sysconfig import is_python_build
++    if is_python_build():
++        from _sysconfigdata import build_time_vars
++        sys.path.append(os.path.join(build_time_vars['abs_builddir'], 'Modules'))
+     if ENABLE_USER_SITE is None:
+         ENABLE_USER_SITE = check_enableusersite()
+     known_paths = addusersitepackages(known_paths)
diff --git a/python/patches/00125-less-verbose-COUNT_ALLOCS.patch b/python/patches/00125-less-verbose-COUNT_ALLOCS.patch
new file mode 100644
index 0000000..8cef015
--- /dev/null
+++ b/python/patches/00125-less-verbose-COUNT_ALLOCS.patch
@@ -0,0 +1,20 @@
+diff -up Python-2.7/Python/pythonrun.c.less-verbose-COUNT_ALLOCS Python-2.7/Python/pythonrun.c
+--- Python-2.7/Python/pythonrun.c.less-verbose-COUNT_ALLOCS	2010-08-17 14:49:33.321913909 -0400
++++ Python-2.7/Python/pythonrun.c	2010-08-17 14:54:48.750910403 -0400
+@@ -470,7 +470,15 @@ Py_Finalize(void)
+ 
+     /* Debugging stuff */
+ #ifdef COUNT_ALLOCS
+-    dump_counts(stdout);
++    /* This is a downstream Fedora modification.
++       The upstream default with COUNT_ALLOCS is to always dump the counts to
++       stdout on exit.  For our debug builds its useful to have the info from
++       COUNT_ALLOCS available, but the stdout info here gets in the way, so
++       we make it optional, wrapping it in an environment variable (modelled
++       on the other PYTHONDUMP* env variables):
++    */
++    if (Py_GETENV("PYTHONDUMPCOUNTS"))
++        dump_counts(stdout);
+ #endif
+ 
+     PRINT_TOTAL_REFS();
diff --git a/python/patches/00131-disable-tests-in-test_io.patch b/python/patches/00131-disable-tests-in-test_io.patch
new file mode 100644
index 0000000..d81a2d0
--- /dev/null
+++ b/python/patches/00131-disable-tests-in-test_io.patch
@@ -0,0 +1,11 @@
+diff -up Python-2.7.2/Lib/test/test_io.py.disable-tests-in-test_io Python-2.7.2/Lib/test/test_io.py
+--- Python-2.7.2/Lib/test/test_io.py.disable-tests-in-test_io	2011-09-01 14:18:45.963304089 -0400
++++ Python-2.7.2/Lib/test/test_io.py	2011-09-01 15:08:53.796098413 -0400
+@@ -2669,6 +2669,7 @@ class SignalsTest(unittest.TestCase):
+         self.check_interrupted_read_retry(lambda x: x,
+                                           mode="r")
+ 
++    @unittest.skip('rhbz#732998')
+     @unittest.skipUnless(threading, 'Threading required for this test.')
+     def check_interrupted_write_retry(self, item, **fdopen_kwargs):
+         """Check that a buffered write, when it gets interrupted (either
diff --git a/python/patches/00133-skip-test_dl.patch b/python/patches/00133-skip-test_dl.patch
new file mode 100644
index 0000000..04ad05b
--- /dev/null
+++ b/python/patches/00133-skip-test_dl.patch
@@ -0,0 +1,13 @@
+diff -up Python-2.7.2/Lib/test/test_dl.py.skip-test_dl Python-2.7.2/Lib/test/test_dl.py
+--- Python-2.7.2/Lib/test/test_dl.py.skip-test_dl	2011-09-08 15:18:40.529034289 -0400
++++ Python-2.7.2/Lib/test/test_dl.py	2011-09-08 16:29:45.184742670 -0400
+@@ -13,6 +13,9 @@ sharedlibs = [
+     ('/usr/lib/libc.dylib', 'getpid'),
+     ]
+ 
++# (also, "dl" is deprecated in favor of ctypes)
++(a)unittest._skipInRpmBuild('fails on 64-bit builds: '
++    'module dl requires sizeof(int) == sizeof(long) == sizeof(char*)')
+ def test_main():
+     for s, func in sharedlibs:
+         try:
diff --git a/python/patches/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch b/python/patches/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
new file mode 100644
index 0000000..38381ef
--- /dev/null
+++ b/python/patches/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
@@ -0,0 +1,14 @@
+--- Python-2.7.2/Lib/test/test_sys.py.mark-tests-that-fail-in-rpmbuild	2011-09-08 18:02:31.627362039 -0400
++++ Python-2.7.2/Lib/test/test_sys.py	2011-09-08 18:15:29.450308851 -0400
+@@ -734,6 +734,11 @@ class SizeofTest(unittest.TestCase):
+         # (PyTypeObject + PyNumberMethods +  PyMappingMethods +
+         #  PySequenceMethods + PyBufferProcs)
+         s = vsize('P2P15Pl4PP9PP11PI') + struct.calcsize('41P 10P 3P 6P')
++
++        # COUNT_ALLOCS adds further fields to the end of a PyTypeObject:
++        if hasattr(sys, 'getcounts'):
++            s += size('P')
++
+         class newstyleclass(object):
+             pass
+         check(newstyleclass, s)
diff --git a/python/patches/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch b/python/patches/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
new file mode 100644
index 0000000..845fb2a
--- /dev/null
+++ b/python/patches/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
@@ -0,0 +1,22 @@
+diff -up Python-2.7.2/Lib/test/test_file2k.py.skip-tests-of-seeking-stdin-in-rpmbuild Python-2.7.2/Lib/test/test_file2k.py
+--- Python-2.7.2/Lib/test/test_file2k.py.skip-tests-of-seeking-stdin-in-rpmbuild	2011-09-08 17:23:50.922520729 -0400
++++ Python-2.7.2/Lib/test/test_file2k.py	2011-09-08 17:24:41.368517277 -0400
+@@ -213,6 +213,7 @@ class OtherFileTests(unittest.TestCase):
+             else:
+                 f.close()
+ 
++    @unittest._skipInRpmBuild('seems not to raise the exception when run in Koji')
+     def testStdin(self):
+         # This causes the interpreter to exit on OSF1 v5.1.
+         if sys.platform != 'osf1V5':
+diff -up Python-2.7.2/Lib/test/test_file.py.skip-tests-of-seeking-stdin-in-rpmbuild Python-2.7.2/Lib/test/test_file.py
+--- Python-2.7.2/Lib/test/test_file.py.skip-tests-of-seeking-stdin-in-rpmbuild	2011-09-08 17:20:31.146534389 -0400
++++ Python-2.7.2/Lib/test/test_file.py	2011-09-08 17:24:45.016517030 -0400
+@@ -154,6 +154,7 @@ class OtherFileTests(unittest.TestCase):
+                 f.close()
+                 self.fail('%r is an invalid file mode' % mode)
+ 
++    @unittest._skipInRpmBuild('seems not to raise the exception when run in Koji')
+     def testStdin(self):
+         # This causes the interpreter to exit on OSF1 v5.1.
+         if sys.platform != 'osf1V5':
diff --git a/python/patches/00141-fix-test_gc_with_COUNT_ALLOCS.patch b/python/patches/00141-fix-test_gc_with_COUNT_ALLOCS.patch
new file mode 100644
index 0000000..d5bf3c9
--- /dev/null
+++ b/python/patches/00141-fix-test_gc_with_COUNT_ALLOCS.patch
@@ -0,0 +1,24 @@
+diff -up Python-2.7.2/Lib/test/test_gc.py.fix-test_gc_with_COUNT_ALLOCS Python-2.7.2/Lib/test/test_gc.py
+--- Python-2.7.2/Lib/test/test_gc.py.fix-test_gc_with_COUNT_ALLOCS	2011-09-08 19:49:13.045924309 -0400
++++ Python-2.7.2/Lib/test/test_gc.py	2011-09-08 19:50:07.035920617 -0400
+@@ -102,11 +102,17 @@ class GCTests(unittest.TestCase):
+         del a
+         self.assertNotEqual(gc.collect(), 0)
+         del B, C
+-        self.assertNotEqual(gc.collect(), 0)
++        if hasattr(sys, 'getcounts'):
++            self.assertEqual(gc.collect(), 0)
++        else:
++            self.assertNotEqual(gc.collect(), 0)
+         A.a = A()
+         del A
+-        self.assertNotEqual(gc.collect(), 0)
+-        self.assertEqual(gc.collect(), 0)
++        if hasattr(sys, 'getcounts'):
++            self.assertEqual(gc.collect(), 0)
++        else:
++            self.assertNotEqual(gc.collect(), 0)
++            self.assertEqual(gc.collect(), 0)
+ 
+     def test_method(self):
+         # Tricky: self.__init__ is a bound method, it references the instance.
diff --git a/python/patches/00142-skip-failing-pty-tests-in-rpmbuild.patch b/python/patches/00142-skip-failing-pty-tests-in-rpmbuild.patch
new file mode 100644
index 0000000..414ffcd
--- /dev/null
+++ b/python/patches/00142-skip-failing-pty-tests-in-rpmbuild.patch
@@ -0,0 +1,22 @@
+diff -up Python-2.7.2/Lib/test/test_openpty.py.skip-failing-pty-tests-in-rpmbuild Python-2.7.2/Lib/test/test_openpty.py
+--- Python-2.7.2/Lib/test/test_openpty.py.skip-failing-pty-tests-in-rpmbuild	2011-09-09 05:09:28.698920379 -0400
++++ Python-2.7.2/Lib/test/test_openpty.py	2011-09-09 05:10:54.805914490 -0400
+@@ -8,6 +8,7 @@ if not hasattr(os, "openpty"):
+ 
+ 
+ class OpenptyTest(unittest.TestCase):
++    @unittest._skipInRpmBuild('sometimes fails in Koji, possibly due to a mock issue (rhbz#714627)')
+     def test(self):
+         master, slave = os.openpty()
+         if not os.isatty(slave):
+diff -up Python-2.7.2/Lib/test/test_pty.py.skip-failing-pty-tests-in-rpmbuild Python-2.7.2/Lib/test/test_pty.py
+--- Python-2.7.2/Lib/test/test_pty.py.skip-failing-pty-tests-in-rpmbuild	2011-09-09 05:09:36.781919825 -0400
++++ Python-2.7.2/Lib/test/test_pty.py	2011-09-09 05:11:14.741913127 -0400
+@@ -109,6 +109,7 @@ class PtyTest(unittest.TestCase):
+         os.close(master_fd)
+ 
+ 
++    @unittest._skipInRpmBuild('sometimes fails in Koji, possibly due to a mock issue (rhbz#714627)')
+     def test_fork(self):
+         debug("calling pty.fork()")
+         pid, master_fd = pty.fork()
diff --git a/python/patches/00155-avoid-ctypes-thunks.patch b/python/patches/00155-avoid-ctypes-thunks.patch
new file mode 100644
index 0000000..92dd668
--- /dev/null
+++ b/python/patches/00155-avoid-ctypes-thunks.patch
@@ -0,0 +1,15 @@
+diff -up Python-2.7.3/Lib/ctypes/__init__.py.rhbz814391 Python-2.7.3/Lib/ctypes/__init__.py
+--- Python-2.7.3/Lib/ctypes/__init__.py.rhbz814391	2012-04-20 14:51:19.390990244 -0400
++++ Python-2.7.3/Lib/ctypes/__init__.py	2012-04-20 14:51:45.141668316 -0400
+@@ -272,11 +272,6 @@ def _reset_cache():
+     # _SimpleCData.c_char_p_from_param
+     POINTER(c_char).from_param = c_char_p.from_param
+     _pointer_type_cache[None] = c_void_p
+-    # XXX for whatever reasons, creating the first instance of a callback
+-    # function is needed for the unittests on Win64 to succeed.  This MAY
+-    # be a compiler bug, since the problem occurs only when _ctypes is
+-    # compiled with the MS SDK compiler.  Or an uninitialized variable?
+-    CFUNCTYPE(c_int)(lambda: None)
+ 
+ try:
+     from _ctypes import set_conversion_mode
diff --git a/python/patches/00157-uid-gid-overflows.patch b/python/patches/00157-uid-gid-overflows.patch
new file mode 100644
index 0000000..13546bb
--- /dev/null
+++ b/python/patches/00157-uid-gid-overflows.patch
@@ -0,0 +1,49 @@
+diff -up Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows Python-2.7.3/Lib/test/test_os.py
+--- Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows	2012-04-09 19:07:32.000000000 -0400
++++ Python-2.7.3/Lib/test/test_os.py	2012-06-26 14:51:36.000817929 -0400
+@@ -677,30 +677,36 @@ if sys.platform != 'win32':
+             def test_setuid(self):
+                 if os.getuid() != 0:
+                     self.assertRaises(os.error, os.setuid, 0)
++                self.assertRaises(TypeError, os.setuid, 'not an int')
+                 self.assertRaises(OverflowError, os.setuid, 1<<32)
+ 
+         if hasattr(os, 'setgid'):
+             def test_setgid(self):
+                 if os.getuid() != 0:
+                     self.assertRaises(os.error, os.setgid, 0)
++                self.assertRaises(TypeError, os.setgid, 'not an int')
+                 self.assertRaises(OverflowError, os.setgid, 1<<32)
+ 
+         if hasattr(os, 'seteuid'):
+             def test_seteuid(self):
+                 if os.getuid() != 0:
+                     self.assertRaises(os.error, os.seteuid, 0)
++                self.assertRaises(TypeError, os.seteuid, 'not an int')
+                 self.assertRaises(OverflowError, os.seteuid, 1<<32)
+ 
+         if hasattr(os, 'setegid'):
+             def test_setegid(self):
+                 if os.getuid() != 0:
+                     self.assertRaises(os.error, os.setegid, 0)
++                self.assertRaises(TypeError, os.setegid, 'not an int')
+                 self.assertRaises(OverflowError, os.setegid, 1<<32)
+ 
+         if hasattr(os, 'setreuid'):
+             def test_setreuid(self):
+                 if os.getuid() != 0:
+                     self.assertRaises(os.error, os.setreuid, 0, 0)
++                self.assertRaises(TypeError, os.setreuid, 'not an int', 0)
++                self.assertRaises(TypeError, os.setreuid, 0, 'not an int')
+                 self.assertRaises(OverflowError, os.setreuid, 1<<32, 0)
+                 self.assertRaises(OverflowError, os.setreuid, 0, 1<<32)
+ 
+@@ -715,6 +721,8 @@ if sys.platform != 'win32':
+             def test_setregid(self):
+                 if os.getuid() != 0:
+                     self.assertRaises(os.error, os.setregid, 0, 0)
++                self.assertRaises(TypeError, os.setregid, 'not an int', 0)
++                self.assertRaises(TypeError, os.setregid, 0, 'not an int')
+                 self.assertRaises(OverflowError, os.setregid, 1<<32, 0)
+                 self.assertRaises(OverflowError, os.setregid, 0, 1<<32)
+ 
diff --git a/python/patches/00168-distutils-cflags.patch b/python/patches/00168-distutils-cflags.patch
new file mode 100644
index 0000000..0c4a8df
--- /dev/null
+++ b/python/patches/00168-distutils-cflags.patch
@@ -0,0 +1,12 @@
+diff -up Python-2.6.6/Lib/distutils/sysconfig.py.distutils-cflags Python-2.6.6/Lib/distutils/sysconfig.py
+--- Python-2.6.6/Lib/distutils/sysconfig.py.distutils-cflags	2011-08-12 17:18:17.833091153 -0400
++++ Python-2.6.6/Lib/distutils/sysconfig.py	2011-08-12 17:18:27.449106938 -0400
+@@ -187,7 +187,7 @@ def customize_compiler(compiler):
+         if 'LDFLAGS' in os.environ:
+             ldshared = ldshared + ' ' + os.environ['LDFLAGS']
+         if 'CFLAGS' in os.environ:
+-            cflags = opt + ' ' + os.environ['CFLAGS']
++            cflags = cflags + ' ' + os.environ['CFLAGS']
+             ldshared = ldshared + ' ' + os.environ['CFLAGS']
+         if 'CPPFLAGS' in os.environ:
+             cpp = cpp + ' ' + os.environ['CPPFLAGS']
diff --git a/python/patches/00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch b/python/patches/00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
new file mode 100644
index 0000000..debf92f
--- /dev/null
+++ b/python/patches/00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
@@ -0,0 +1,41 @@
+diff --git a/Lib/multiprocessing/connection.py b/Lib/multiprocessing/connection.py
+--- a/Lib/multiprocessing/connection.py
++++ b/Lib/multiprocessing/connection.py
+@@ -41,6 +41,10 @@
+ # A very generous timeout when it comes to local connections...
+ CONNECTION_TIMEOUT = 20.
+ 
++# The hmac module implicitly defaults to using MD5.
++# Support using a stronger algorithm for the challenge/response code:
++HMAC_DIGEST_NAME='sha256'
++
+ _mmap_counter = itertools.count()
+ 
+ default_family = 'AF_INET'
+@@ -700,12 +704,16 @@
+ WELCOME = b'#WELCOME#'
+ FAILURE = b'#FAILURE#'
+ 
++def get_digestmod_for_hmac():
++    import hashlib
++    return getattr(hashlib, HMAC_DIGEST_NAME)
++
+ def deliver_challenge(connection, authkey):
+     import hmac
+     assert isinstance(authkey, bytes)
+     message = os.urandom(MESSAGE_LENGTH)
+     connection.send_bytes(CHALLENGE + message)
+-    digest = hmac.new(authkey, message).digest()
++    digest = hmac.new(authkey, message, get_digestmod_for_hmac()).digest()
+     response = connection.recv_bytes(256)        # reject large message
+     if response == digest:
+         connection.send_bytes(WELCOME)
+@@ -719,7 +727,7 @@
+     message = connection.recv_bytes(256)         # reject large message
+     assert message[:len(CHALLENGE)] == CHALLENGE, 'message = %r' % message
+     message = message[len(CHALLENGE):]
+-    digest = hmac.new(authkey, message).digest()
++    digest = hmac.new(authkey, message, get_digestmod_for_hmac()).digest()
+     connection.send_bytes(digest)
+     response = connection.recv_bytes(256)        # reject large message
+     if response != WELCOME:
diff --git a/python/patches/00170-gc-assertions.patch b/python/patches/00170-gc-assertions.patch
new file mode 100644
index 0000000..3fb37ff
--- /dev/null
+++ b/python/patches/00170-gc-assertions.patch
@@ -0,0 +1,276 @@
+diff -up Python-2.7.3/Lib/test/test_gc.py.gc-assertions Python-2.7.3/Lib/test/test_gc.py
+--- Python-2.7.3/Lib/test/test_gc.py.gc-assertions	2013-02-20 16:28:20.890536607 -0500
++++ Python-2.7.3/Lib/test/test_gc.py	2013-02-20 16:39:52.720489297 -0500
+@@ -1,6 +1,7 @@
+ import unittest
+-from test.test_support import verbose, run_unittest
++from test.test_support import verbose, run_unittest, import_module
+ import sys
++import sysconfig
+ import time
+ import gc
+ import weakref
+@@ -32,6 +33,8 @@ class GC_Detector(object):
+         self.wr = weakref.ref(C1055820(666), it_happened)
+ 
+ 
++BUILT_WITH_NDEBUG = ('-DNDEBUG' in sysconfig.get_config_vars()['PY_CFLAGS'])
++
+ ### Tests
+ ###############################################################################
+ 
+@@ -476,6 +479,49 @@ class GCTests(unittest.TestCase):
+             # would be damaged, with an empty __dict__.
+             self.assertEqual(x, None)
+ 
++    @unittest.skipIf(BUILT_WITH_NDEBUG,
++                     'built with -NDEBUG')
++    def test_refcount_errors(self):
++        # Verify the "handling" of objects with broken refcounts
++ 
++        import_module("ctypes") #skip if not supported
++
++        import subprocess
++        code = '''if 1:
++        a = []
++        b = [a]
++
++        # Simulate the refcount of "a" being too low (compared to the
++        # references held on it by live data), but keeping it above zero
++        # (to avoid deallocating it):
++        import ctypes
++        ctypes.pythonapi.Py_DecRef(ctypes.py_object(a))
++
++        # The garbage collector should now have a fatal error when it reaches
++        # the broken object:
++        import gc
++        gc.collect()
++        '''
++        p = subprocess.Popen([sys.executable, "-c", code],
++                             stdout=subprocess.PIPE,
++                             stderr=subprocess.PIPE)
++        stdout, stderr = p.communicate()
++        p.stdout.close()
++        p.stderr.close()
++        # Verify that stderr has a useful error message:
++        self.assertRegexpMatches(stderr,
++            b'Modules/gcmodule.c:[0-9]+: visit_decref: Assertion "gc->gc.gc_refs != 0" failed.')
++        self.assertRegexpMatches(stderr,
++            b'refcount was too small')
++        self.assertRegexpMatches(stderr,
++            b'object  : \[\]')
++        self.assertRegexpMatches(stderr,
++            b'type    : list')
++        self.assertRegexpMatches(stderr,
++            b'refcount: 1')
++        self.assertRegexpMatches(stderr,
++            b'address : 0x[0-9a-f]+')
++
+ class GCTogglingTests(unittest.TestCase):
+     def setUp(self):
+         gc.enable()
+diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmodule.c
+--- Python-2.7.3/Modules/gcmodule.c.gc-assertions	2012-04-09 19:07:34.000000000 -0400
++++ Python-2.7.3/Modules/gcmodule.c	2013-02-20 16:28:21.029536600 -0500
+@@ -21,6 +21,73 @@
+ #include "Python.h"
+ #include "frameobject.h"        /* for PyFrame_ClearFreeList */
+ 
++/* 
++   Define a pair of assertion macros.
++
++   These work like the regular C assert(), in that they will abort the
++   process with a message on stderr if the given condition fails to hold,
++   but compile away to nothing if NDEBUG is defined.
++
++   However, before aborting, Python will also try to call _PyObject_Dump() on
++   the given object.  This may be of use when investigating bugs in which a
++   particular object is corrupt (e.g. buggy a tp_visit method in an extension
++   module breaking the garbage collector), to help locate the broken objects.
++
++   The WITH_MSG variant allows you to supply an additional message that Python
++   will attempt to print to stderr, after the object dump.
++*/
++#ifdef NDEBUG
++/* No debugging: compile away the assertions: */
++#define PyObject_ASSERT_WITH_MSG(obj, expr, msg) ((void)0)
++#else
++/* With debugging: generate checks: */
++#define PyObject_ASSERT_WITH_MSG(obj, expr, msg) \
++  ((expr)                                           \
++   ? (void)(0)                                      \
++   : _PyObject_AssertFailed((obj),                  \
++                            (msg),                  \
++                            (__STRING(expr)),       \
++                            (__FILE__),             \
++                            (__LINE__),             \
++                            (__PRETTY_FUNCTION__)))
++#endif
++
++#define PyObject_ASSERT(obj, expr) \
++  PyObject_ASSERT_WITH_MSG(obj, expr, NULL)
++
++static void _PyObject_AssertFailed(PyObject *,  const char *,
++				   const char *, const char *, int,
++				   const char *);
++
++static void
++_PyObject_AssertFailed(PyObject *obj, const char *msg, const char *expr,
++		       const char *file, int line, const char *function)
++{
++    fprintf(stderr,
++            "%s:%d: %s: Assertion \"%s\" failed.\n",
++            file, line, function, expr);
++    if (msg) {
++        fprintf(stderr, "%s\n", msg);
++    }
++
++    fflush(stderr);
++
++    if (obj) {
++        /* This might succeed or fail, but we're about to abort, so at least
++           try to provide any extra info we can: */
++        _PyObject_Dump(obj);
++    }
++    else {
++        fprintf(stderr, "NULL object\n");
++    }
++
++    fflush(stdout);
++    fflush(stderr);
++
++    /* Terminate the process: */
++    abort();
++}
++
+ /* Get an object's GC head */
+ #define AS_GC(o) ((PyGC_Head *)(o)-1)
+ 
+@@ -288,7 +355,8 @@ update_refs(PyGC_Head *containers)
+ {
+     PyGC_Head *gc = containers->gc.gc_next;
+     for (; gc != containers; gc = gc->gc.gc_next) {
+-        assert(gc->gc.gc_refs == GC_REACHABLE);
++        PyObject_ASSERT(FROM_GC(gc),
++                        gc->gc.gc_refs == GC_REACHABLE);
+         gc->gc.gc_refs = Py_REFCNT(FROM_GC(gc));
+         /* Python's cyclic gc should never see an incoming refcount
+          * of 0:  if something decref'ed to 0, it should have been
+@@ -308,7 +376,8 @@ update_refs(PyGC_Head *containers)
+          * so serious that maybe this should be a release-build
+          * check instead of an assert?
+          */
+-        assert(gc->gc.gc_refs != 0);
++        PyObject_ASSERT(FROM_GC(gc),
++                        gc->gc.gc_refs != 0);
+     }
+ }
+ 
+@@ -323,7 +392,9 @@ visit_decref(PyObject *op, void *data)
+          * generation being collected, which can be recognized
+          * because only they have positive gc_refs.
+          */
+-        assert(gc->gc.gc_refs != 0); /* else refcount was too small */
++        PyObject_ASSERT_WITH_MSG(FROM_GC(gc),
++                                 gc->gc.gc_refs != 0,
++                                 "refcount was too small");
+         if (gc->gc.gc_refs > 0)
+             gc->gc.gc_refs--;
+     }
+@@ -383,9 +454,10 @@ visit_reachable(PyObject *op, PyGC_Head
+          * If gc_refs == GC_UNTRACKED, it must be ignored.
+          */
+          else {
+-            assert(gc_refs > 0
+-                   || gc_refs == GC_REACHABLE
+-                   || gc_refs == GC_UNTRACKED);
++             PyObject_ASSERT(FROM_GC(gc),
++                             gc_refs > 0
++                             || gc_refs == GC_REACHABLE
++                             || gc_refs == GC_UNTRACKED);
+          }
+     }
+     return 0;
+@@ -427,7 +499,7 @@ move_unreachable(PyGC_Head *young, PyGC_
+              */
+             PyObject *op = FROM_GC(gc);
+             traverseproc traverse = Py_TYPE(op)->tp_traverse;
+-            assert(gc->gc.gc_refs > 0);
++            PyObject_ASSERT(op, gc->gc.gc_refs > 0);
+             gc->gc.gc_refs = GC_REACHABLE;
+             (void) traverse(op,
+                             (visitproc)visit_reachable,
+@@ -494,7 +566,8 @@ move_finalizers(PyGC_Head *unreachable,
+     for (gc = unreachable->gc.gc_next; gc != unreachable; gc = next) {
+         PyObject *op = FROM_GC(gc);
+ 
+-        assert(IS_TENTATIVELY_UNREACHABLE(op));
++        PyObject_ASSERT(op, IS_TENTATIVELY_UNREACHABLE(op));
++
+         next = gc->gc.gc_next;
+ 
+         if (has_finalizer(op)) {
+@@ -570,7 +643,7 @@ handle_weakrefs(PyGC_Head *unreachable,
+         PyWeakReference **wrlist;
+ 
+         op = FROM_GC(gc);
+-        assert(IS_TENTATIVELY_UNREACHABLE(op));
++        PyObject_ASSERT(op, IS_TENTATIVELY_UNREACHABLE(op));
+         next = gc->gc.gc_next;
+ 
+         if (! PyType_SUPPORTS_WEAKREFS(Py_TYPE(op)))
+@@ -591,9 +664,9 @@ handle_weakrefs(PyGC_Head *unreachable,
+              * the callback pointer intact.  Obscure:  it also
+              * changes *wrlist.
+              */
+-            assert(wr->wr_object == op);
++            PyObject_ASSERT(wr->wr_object, wr->wr_object == op);
+             _PyWeakref_ClearRef(wr);
+-            assert(wr->wr_object == Py_None);
++            PyObject_ASSERT(wr->wr_object, wr->wr_object == Py_None);
+             if (wr->wr_callback == NULL)
+                 continue;                       /* no callback */
+ 
+@@ -627,7 +700,7 @@ handle_weakrefs(PyGC_Head *unreachable,
+      */
+             if (IS_TENTATIVELY_UNREACHABLE(wr))
+                 continue;
+-            assert(IS_REACHABLE(wr));
++            PyObject_ASSERT(op, IS_REACHABLE(wr));
+ 
+             /* Create a new reference so that wr can't go away
+              * before we can process it again.
+@@ -636,7 +709,8 @@ handle_weakrefs(PyGC_Head *unreachable,
+ 
+             /* Move wr to wrcb_to_call, for the next pass. */
+             wrasgc = AS_GC(wr);
+-            assert(wrasgc != next); /* wrasgc is reachable, but
++            PyObject_ASSERT(op, wrasgc != next);
++                                    /* wrasgc is reachable, but
+                                        next isn't, so they can't
+                                        be the same */
+             gc_list_move(wrasgc, &wrcb_to_call);
+@@ -652,11 +726,11 @@ handle_weakrefs(PyGC_Head *unreachable,
+ 
+         gc = wrcb_to_call.gc.gc_next;
+         op = FROM_GC(gc);
+-        assert(IS_REACHABLE(op));
+-        assert(PyWeakref_Check(op));
++        PyObject_ASSERT(op, IS_REACHABLE(op));
++        PyObject_ASSERT(op, PyWeakref_Check(op));
+         wr = (PyWeakReference *)op;
+         callback = wr->wr_callback;
+-        assert(callback != NULL);
++        PyObject_ASSERT(op, callback != NULL);
+ 
+         /* copy-paste of weakrefobject.c's handle_callback() */
+         temp = PyObject_CallFunctionObjArgs(callback, wr, NULL);
+@@ -759,7 +833,7 @@ delete_garbage(PyGC_Head *collectable, P
+         PyGC_Head *gc = collectable->gc.gc_next;
+         PyObject *op = FROM_GC(gc);
+ 
+-        assert(IS_TENTATIVELY_UNREACHABLE(op));
++        PyObject_ASSERT(op, IS_TENTATIVELY_UNREACHABLE(op));
+         if (debug & DEBUG_SAVEALL) {
+             PyList_Append(garbage, op);
+         }
diff --git a/python/patches/00173-workaround-ENOPROTOOPT-in-bind_port.patch b/python/patches/00173-workaround-ENOPROTOOPT-in-bind_port.patch
new file mode 100644
index 0000000..eb34610
--- /dev/null
+++ b/python/patches/00173-workaround-ENOPROTOOPT-in-bind_port.patch
@@ -0,0 +1,13 @@
+diff -up Python-2.7.3/Lib/test/test_support.py.rhbz913732 Python-2.7.3/Lib/test/test_support.py
+--- Python-2.7.3/Lib/test/test_support.py.rhbz913732	2013-03-04 16:11:53.757315921 -0500
++++ Python-2.7.3/Lib/test/test_support.py	2013-03-04 16:12:11.331314722 -0500
+@@ -304,7 +304,8 @@ def bind_port(sock, host=HOST):
+             if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1:
+                 raise TestFailed("tests should never set the SO_REUSEADDR "   \
+                                  "socket option on TCP/IP sockets!")
+-        if hasattr(socket, 'SO_REUSEPORT'):
++        if hasattr(socket, 'SO_REUSEPORT') \
++                and 'WITHIN_PYTHON_RPM_BUILD' not in os.environ: # rhbz#913732
+             if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
+                 raise TestFailed("tests should never set the SO_REUSEPORT "   \
+                                  "socket option on TCP/IP sockets!")
diff --git a/python/patches/00174-fix-for-usr-move.patch b/python/patches/00174-fix-for-usr-move.patch
new file mode 100644
index 0000000..b48dc5c
--- /dev/null
+++ b/python/patches/00174-fix-for-usr-move.patch
@@ -0,0 +1,28 @@
+diff -up Python-2.7.3/Modules/getpath.c.fix-for-usr-move Python-2.7.3/Modules/getpath.c
+--- Python-2.7.3/Modules/getpath.c.fix-for-usr-move	2013-03-06 14:25:32.801828698 -0500
++++ Python-2.7.3/Modules/getpath.c	2013-03-06 15:59:30.872443168 -0500
+@@ -510,6 +510,24 @@ calculate_path(void)
+        MAXPATHLEN bytes long.
+     */
+ 
++    /*
++      Workaround for rhbz#817554, where an empty argv0_path erroneously
++      locates "prefix" as "/lib[64]/python2.7" due to it finding
++      "/lib[64]/python2.7/os.py" via the /lib -> /usr/lib symlink for
++      https://fedoraproject.org/wiki/Features/UsrMove
++    */
++    if (argv0_path[0] == '\0' && 0 == strcmp(prog, "cmpi_swig")) {
++        /*
++          We have an empty argv0_path, presumably because prog aka
++          Py_GetProgramName() was not found on $PATH.
++
++          Set argv0_path to "/usr/" so that search_for_prefix() and
++          search_for_exec_prefix() don't erroneously pick up
++          on /lib/ via the UsrMove symlink:
++        */
++        strcpy(argv0_path, "/usr/");
++    }
++
+     if (!(pfound = search_for_prefix(argv0_path, home))) {
+         if (!Py_FrozenFlag)
+             fprintf(stderr,
diff --git a/python/patches/00181-allow-arbitrary-timeout-in-condition-wait.patch b/python/patches/00181-allow-arbitrary-timeout-in-condition-wait.patch
new file mode 100644
index 0000000..665965d
--- /dev/null
+++ b/python/patches/00181-allow-arbitrary-timeout-in-condition-wait.patch
@@ -0,0 +1,70 @@
+diff --git a/Lib/threading.py b/Lib/threading.py
+index cb49c4a..c9795a5 100644
+--- a/Lib/threading.py
++++ b/Lib/threading.py
+@@ -305,7 +305,7 @@ class _Condition(_Verbose):
+         else:
+             return True
+ 
+-    def wait(self, timeout=None):
++    def wait(self, timeout=None, balancing=True):
+         """Wait until notified or until a timeout occurs.
+ 
+         If the calling thread has not acquired the lock when this method is
+@@ -354,7 +354,10 @@ class _Condition(_Verbose):
+                     remaining = endtime - _time()
+                     if remaining <= 0:
+                         break
+-                    delay = min(delay * 2, remaining, .05)
++                    if balancing:
++                        delay = min(delay * 2, remaining, 0.05)
++                    else:
++                        delay = remaining
+                     _sleep(delay)
+                 if not gotit:
+                     if __debug__:
+@@ -599,7 +602,7 @@ class _Event(_Verbose):
+         finally:
+             self.__cond.release()
+ 
+-    def wait(self, timeout=None):
++    def wait(self, timeout=None, balancing=True):
+         """Block until the internal flag is true.
+ 
+         If the internal flag is true on entry, return immediately. Otherwise,
+@@ -617,7 +620,7 @@ class _Event(_Verbose):
+         self.__cond.acquire()
+         try:
+             if not self.__flag:
+-                self.__cond.wait(timeout)
++                self.__cond.wait(timeout, balancing)
+             return self.__flag
+         finally:
+             self.__cond.release()
+@@ -908,7 +911,7 @@ class Thread(_Verbose):
+             if 'dummy_threading' not in _sys.modules:
+                 raise
+ 
+-    def join(self, timeout=None):
++    def join(self, timeout=None, balancing=True):
+         """Wait until the thread terminates.
+ 
+         This blocks the calling thread until the thread whose join() method is
+@@ -957,7 +960,7 @@ class Thread(_Verbose):
+                         if __debug__:
+                             self._note("%s.join(): timed out", self)
+                         break
+-                    self.__block.wait(delay)
++                    self.__block.wait(delay, balancing)
+                 else:
+                     if __debug__:
+                         self._note("%s.join(): thread stopped", self)
+@@ -1143,7 +1146,7 @@ class _DummyThread(Thread):
+     def _set_daemon(self):
+         return True
+ 
+-    def join(self, timeout=None):
++    def join(self, timeout=None, balancing=True):
+         assert False, "cannot join a dummy thread"
+ 
+ 
diff --git a/python/patches/00184-ctypes-should-build-with-libffi-multilib-wrapper.patch b/python/patches/00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
new file mode 100644
index 0000000..53d9dae
--- /dev/null
+++ b/python/patches/00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
@@ -0,0 +1,12 @@
+--- Python-3.3.2/setup.py.orig	2013-07-01 15:23:24.377711044 +0200
++++ Python-3.3.2/setup.py	2013-07-01 15:23:34.094676496 +0200
+@@ -1882,7 +1882,8 @@
+                 if not line:
+                     ffi_inc = None
+                     break
+-                if line.startswith('#define LIBFFI_H'):
++                if line.startswith('#define LIBFFI_H') or \
++                   line.startswith('#define ffi_wrapper_h'):
+                     break
+         ffi_lib = None
+         if ffi_inc is not None:
diff --git a/python/patches/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch b/python/patches/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
new file mode 100644
index 0000000..e215589
--- /dev/null
+++ b/python/patches/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
@@ -0,0 +1,247 @@
+diff -r 9ddc63c039ba Lib/test/nullbytecert.pem
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/Lib/test/nullbytecert.pem	Sun Aug 11 18:13:17 2013 +0200
+@@ -0,0 +1,90 @@
++Certificate:
++    Data:
++        Version: 3 (0x2)
++        Serial Number: 0 (0x0)
++    Signature Algorithm: sha1WithRSAEncryption
++        Issuer: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python Core Development, CN=null.python.org\x00example.org/emailAddress=python-dev(a)python.org
++        Validity
++            Not Before: Aug  7 13:11:52 2013 GMT
++            Not After : Aug  7 13:12:52 2013 GMT
++        Subject: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python Core Development, CN=null.python.org\x00example.org/emailAddress=python-dev(a)python.org
++        Subject Public Key Info:
++            Public Key Algorithm: rsaEncryption
++                Public-Key: (2048 bit)
++                Modulus:
++                    00:b5:ea:ed:c9:fb:46:7d:6f:3b:76:80:dd:3a:f3:
++                    03:94:0b:a7:a6:db:ec:1d:df:ff:23:74:08:9d:97:
++                    16:3f:a3:a4:7b:3e:1b:0e:96:59:25:03:a7:26:e2:
++                    88:a9:cf:79:cd:f7:04:56:b0:ab:79:32:6e:59:c1:
++                    32:30:54:eb:58:a8:cb:91:f0:42:a5:64:27:cb:d4:
++                    56:31:88:52:ad:cf:bd:7f:f0:06:64:1f:cc:27:b8:
++                    a3:8b:8c:f3:d8:29:1f:25:0b:f5:46:06:1b:ca:02:
++                    45:ad:7b:76:0a:9c:bf:bb:b9:ae:0d:16:ab:60:75:
++                    ae:06:3e:9c:7c:31:dc:92:2f:29:1a:e0:4b:0c:91:
++                    90:6c:e9:37:c5:90:d7:2a:d7:97:15:a3:80:8f:5d:
++                    7b:49:8f:54:30:d4:97:2c:1c:5b:37:b5:ab:69:30:
++                    68:43:d3:33:78:4b:02:60:f5:3c:44:80:a1:8f:e7:
++                    f0:0f:d1:5e:87:9e:46:cf:62:fc:f9:bf:0c:65:12:
++                    f1:93:c8:35:79:3f:c8:ec:ec:47:f5:ef:be:44:d5:
++                    ae:82:1e:2d:9a:9f:98:5a:67:65:e1:74:70:7c:cb:
++                    d3:c2:ce:0e:45:49:27:dc:e3:2d:d4:fb:48:0e:2f:
++                    9e:77:b8:14:46:c0:c4:36:ca:02:ae:6a:91:8c:da:
++                    2f:85
++                Exponent: 65537 (0x10001)
++        X509v3 extensions:
++            X509v3 Basic Constraints: critical
++                CA:FALSE
++            X509v3 Subject Key Identifier:
++                88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C
++            X509v3 Key Usage:
++                Digital Signature, Non Repudiation, Key Encipherment
++            X509v3 Subject Alternative Name:
++                *************************************************************
++                WARNING: The values for DNS, email and URI are WRONG. OpenSSL
++                         doesn't print the text after a NULL byte.
++                *************************************************************
++                DNS:altnull.python.org, email:null(a)python.org, URI:http://null.python.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1
++    Signature Algorithm: sha1WithRSAEncryption
++         ac:4f:45:ef:7d:49:a8:21:70:8e:88:59:3e:d4:36:42:70:f5:
++         a3:bd:8b:d7:a8:d0:58:f6:31:4a:b1:a4:a6:dd:6f:d9:e8:44:
++         3c:b6:0a:71:d6:7f:b1:08:61:9d:60:ce:75:cf:77:0c:d2:37:
++         86:02:8d:5e:5d:f9:0f:71:b4:16:a8:c1:3d:23:1c:f1:11:b3:
++         56:6e:ca:d0:8d:34:94:e6:87:2a:99:f2:ae:ae:cc:c2:e8:86:
++         de:08:a8:7f:c5:05:fa:6f:81:a7:82:e6:d0:53:9d:34:f4:ac:
++         3e:40:fe:89:57:7a:29:a4:91:7e:0b:c6:51:31:e5:10:2f:a4:
++         60:76:cd:95:51:1a:be:8b:a1:b0:fd:ad:52:bd:d7:1b:87:60:
++         d2:31:c7:17:c4:18:4f:2d:08:25:a3:a7:4f:b7:92:ca:e2:f5:
++         25:f1:54:75:81:9d:b3:3d:61:a2:f7:da:ed:e1:c6:6f:2c:60:
++         1f:d8:6f:c5:92:05:ab:c9:09:62:49:a9:14:ad:55:11:cc:d6:
++         4a:19:94:99:97:37:1d:81:5f:8b:cf:a3:a8:96:44:51:08:3d:
++         0b:05:65:12:eb:b6:70:80:88:48:72:4f:c6:c2:da:cf:cd:8e:
++         5b:ba:97:2f:60:b4:96:56:49:5e:3a:43:76:63:04:be:2a:f6:
++         c1:ca:a9:94
++-----BEGIN CERTIFICATE-----
++MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx
++DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ
++eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg
++RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y
++ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw
++NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI
++DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv
++ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt
++ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq
++hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB
++BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j
++pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P
++vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv
++KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA
++oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL
++08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV
++HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E
++BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu
++Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251
++bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA
++AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9
++i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j
++HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk
++kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx
++VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW
++RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ=
++-----END CERTIFICATE-----
+diff -r 9ddc63c039ba Lib/test/test_ssl.py
+--- a/Lib/test/test_ssl.py	Sun Aug 11 13:04:50 2013 +0300
++++ b/Lib/test/test_ssl.py	Sun Aug 11 18:13:17 2013 +0200
+@@ -25,6 +25,7 @@
+ HOST = test_support.HOST
+ CERTFILE = None
+ SVN_PYTHON_ORG_ROOT_CERT = None
++NULLBYTECERT = None
+ 
+ def handle_error(prefix):
+     exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
+@@ -123,6 +124,27 @@
+                           ('DNS', 'projects.forum.nokia.com'))
+                         )
+ 
++    def test_parse_cert_CVE_2013_4073(self):
++        p = ssl._ssl._test_decode_cert(NULLBYTECERT)
++        if test_support.verbose:
++            sys.stdout.write("\n" + pprint.pformat(p) + "\n")
++        subject = ((('countryName', 'US'),),
++                   (('stateOrProvinceName', 'Oregon'),),
++                   (('localityName', 'Beaverton'),),
++                   (('organizationName', 'Python Software Foundation'),),
++                   (('organizationalUnitName', 'Python Core Development'),),
++                   (('commonName', 'null.python.org\x00example.org'),),
++                   (('emailAddress', 'python-dev(a)python.org'),))
++        self.assertEqual(p['subject'], subject)
++        self.assertEqual(p['issuer'], subject)
++        self.assertEqual(p['subjectAltName'],
++                         (('DNS', 'altnull.python.org\x00example.com'),
++                         ('email', 'null(a)python.org\x00user(a)example.org'),
++                         ('URI', 'http://null.python.org\x00http://example.org'),
++                         ('IP Address', '192.0.2.1'),
++                         ('IP Address', '2001:DB8:0:0:0:0:0:1\n'))
++                        )
++
+     def test_DER_to_PEM(self):
+         with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f:
+             pem = f.read()
+@@ -1360,7 +1382,7 @@
+ 
+ 
+ def test_main(verbose=False):
+-    global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT
++    global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT, NULLBYTECERT
+     CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
+                             "keycert.pem")
+     SVN_PYTHON_ORG_ROOT_CERT = os.path.join(
+@@ -1368,10 +1390,13 @@
+         "https_svn_python_org_root.pem")
+     NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir,
+                              "nokia.pem")
++    NULLBYTECERT = os.path.join(os.path.dirname(__file__) or os.curdir,
++                                "nullbytecert.pem")
+ 
+     if (not os.path.exists(CERTFILE) or
+         not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or
+-        not os.path.exists(NOKIACERT)):
++        not os.path.exists(NOKIACERT) or
++        not os.path.exists(NULLBYTECERT)):
+         raise test_support.TestFailed("Can't read certificate files!")
+ 
+     tests = [BasicTests, BasicSocketTests]
+diff -r 9ddc63c039ba Modules/_ssl.c
+--- a/Modules/_ssl.c	Sun Aug 11 13:04:50 2013 +0300
++++ b/Modules/_ssl.c	Sun Aug 11 18:13:17 2013 +0200
+@@ -741,8 +741,13 @@
+ 
+             /* get a rendering of each name in the set of names */
+ 
++            int gntype;
++            ASN1_STRING *as = NULL;
++
+             name = sk_GENERAL_NAME_value(names, j);
+-            if (name->type == GEN_DIRNAME) {
++            gntype = name-> type;
++            switch (gntype) {
++            case GEN_DIRNAME:
+ 
+                 /* we special-case DirName as a tuple of tuples of attributes */
+ 
+@@ -764,11 +769,61 @@
+                     goto fail;
+                 }
+                 PyTuple_SET_ITEM(t, 1, v);
++                break;
+ 
+-            } else {
++            case GEN_EMAIL:
++            case GEN_DNS:
++            case GEN_URI:
++                /* GENERAL_NAME_print() doesn't handle NUL bytes in ASN1_string
++                   correctly. */
++                t = PyTuple_New(2);
++                if (t == NULL)
++                    goto fail;
++                switch (gntype) {
++                case GEN_EMAIL:
++                    v = PyUnicode_FromString("email");
++                    as = name->d.rfc822Name;
++                    break;
++                case GEN_DNS:
++                    v = PyUnicode_FromString("DNS");
++                    as = name->d.dNSName;
++                    break;
++                case GEN_URI:
++                    v = PyUnicode_FromString("URI");
++                    as = name->d.uniformResourceIdentifier;
++                    break;
++                }
++                if (v == NULL) {
++                    Py_DECREF(t);
++                    goto fail;
++                }
++                PyTuple_SET_ITEM(t, 0, v);
++                v = PyString_FromStringAndSize((char *)ASN1_STRING_data(as),
++                                               ASN1_STRING_length(as));
++                if (v == NULL) {
++                    Py_DECREF(t);
++                    goto fail;
++                }
++                PyTuple_SET_ITEM(t, 1, v);
++                break;
+ 
++            default:
+                 /* for everything else, we use the OpenSSL print form */
+-
++                switch (gntype) {
++                    /* check for new general name type */
++                    case GEN_OTHERNAME:
++                    case GEN_X400:
++                    case GEN_EDIPARTY:
++                    case GEN_IPADD:
++                    case GEN_RID:
++                        break;
++                    default:
++                        if (PyErr_Warn(PyExc_RuntimeWarning,
++				       "Unknown general name type") == -1) {
++                            goto fail;
++                        }
++                        break;
++                }
+                 (void) BIO_reset(biobuf);
+                 GENERAL_NAME_print(biobuf, name);
+                 len = BIO_gets(biobuf, buf, sizeof(buf)-1);
+@@ -794,6 +849,7 @@
+                     goto fail;
+                 }
+                 PyTuple_SET_ITEM(t, 1, v);
++		break;
+             }
+ 
+             /* and add that rendering to the list */
diff --git a/python/patches/00185-urllib2-honors-noproxy-for-ftp.patch b/python/patches/00185-urllib2-honors-noproxy-for-ftp.patch
new file mode 100644
index 0000000..b26c4d4
--- /dev/null
+++ b/python/patches/00185-urllib2-honors-noproxy-for-ftp.patch
@@ -0,0 +1,12 @@
+diff -up Python-2.7.5/Lib/urllib2.py.orig Python-2.7.5/Lib/urllib2.py
+--- Python-2.7.5/Lib/urllib2.py.orig	2013-07-17 12:22:58.595525622 +0200
++++ Python-2.7.5/Lib/urllib2.py	2013-07-17 12:19:59.875898030 +0200
+@@ -728,6 +728,8 @@ class ProxyHandler(BaseHandler):
+         if proxy_type is None:
+             proxy_type = orig_type
+ 
++        req.get_host()
++
+         if req.host and proxy_bypass(req.host):
+             return None
+ 
diff --git a/python/patches/00186-memory-leak-marshalc.patch b/python/patches/00186-memory-leak-marshalc.patch
new file mode 100644
index 0000000..19fb175
--- /dev/null
+++ b/python/patches/00186-memory-leak-marshalc.patch
@@ -0,0 +1,57 @@
+--- Python-2.7.5/Python/marshal.c	2013-05-12 05:32:53.000000000 +0200
++++ /home/rkuska/hg/cpython/Python/marshal.c	2013-07-18 10:33:26.392486235 +0200
+@@ -88,7 +88,7 @@
+ }
+ 
+ static void
+-w_string(char *s, Py_ssize_t n, WFILE *p)
++w_string(const char *s, Py_ssize_t n, WFILE *p)
+ {
+     if (p->fp != NULL) {
+         fwrite(s, 1, n, p->fp);
+@@ -141,6 +141,13 @@
+ # define W_SIZE  w_long
+ #endif
+ 
++static void
++w_pstring(const char *s, Py_ssize_t n, WFILE *p)
++{
++        W_SIZE(n, p);
++        w_string(s, n, p);
++}
++
+ /* We assume that Python longs are stored internally in base some power of
+    2**15; for the sake of portability we'll always read and write them in base
+    exactly 2**15. */
+@@ -338,9 +345,7 @@
+         else {
+             w_byte(TYPE_STRING, p);
+         }
+-        n = PyString_GET_SIZE(v);
+-        W_SIZE(n, p);
+-        w_string(PyString_AS_STRING(v), n, p);
++        w_pstring(PyBytes_AS_STRING(v), PyString_GET_SIZE(v), p);
+     }
+ #ifdef Py_USING_UNICODE
+     else if (PyUnicode_CheckExact(v)) {
+@@ -352,9 +357,7 @@
+             return;
+         }
+         w_byte(TYPE_UNICODE, p);
+-        n = PyString_GET_SIZE(utf8);
+-        W_SIZE(n, p);
+-        w_string(PyString_AS_STRING(utf8), n, p);
++        w_pstring(PyString_AS_STRING(utf8), PyString_GET_SIZE(utf8), p);
+         Py_DECREF(utf8);
+     }
+ #endif
+@@ -441,8 +444,7 @@
+         PyBufferProcs *pb = v->ob_type->tp_as_buffer;
+         w_byte(TYPE_STRING, p);
+         n = (*pb->bf_getreadbuffer)(v, 0, (void **)&s);
+-        W_SIZE(n, p);
+-        w_string(s, n, p);
++        w_pstring(s, n, p);
+     }
+     else {
+         w_byte(TYPE_UNKNOWN, p);
diff --git a/python/patches/05000-autotool-intermediates.patch b/python/patches/05000-autotool-intermediates.patch
new file mode 100644
index 0000000..cfedc25
--- /dev/null
+++ b/python/patches/05000-autotool-intermediates.patch
@@ -0,0 +1,216 @@
+diff -up ./configure.autotool-intermediates ./configure
+--- ./configure.autotool-intermediates	2013-04-09 11:24:01.024185796 +0200
++++ ./configure	2013-04-09 11:24:01.780183954 +0200
+@@ -639,6 +639,8 @@ TRUE
+ MACHDEP_OBJS
+ DYNLOADFILE
+ DLINCLDIR
++DTRACEHDRS
++DTRACEOBJS
+ THREADOBJ
+ LDLAST
+ USE_THREAD_MODULE
+@@ -659,6 +661,8 @@ OTHER_LIBTOOL_OPT
+ UNIVERSAL_ARCH_FLAGS
+ BASECFLAGS
+ OPT
++DEBUG_SUFFIX
++DEBUG_EXT
+ LN
+ MKDIR_P
+ INSTALL_DATA
+@@ -795,8 +799,11 @@ with_pth
+ enable_ipv6
+ with_doc_strings
+ with_tsc
++with_count_allocs
++with_call_profile
+ with_pymalloc
+ with_valgrind
++with_dtrace
+ with_wctype_functions
+ with_fpectl
+ with_libm
+@@ -1472,8 +1479,11 @@ Optional Packages:
+   --with-pth              use GNU pth threading libraries
+   --with(out)-doc-strings disable/enable documentation strings
+   --with(out)-tsc         enable/disable timestamp counter profile
++  --with(out)count-allocs  enable/disable per-type instance accounting
++  --with(out)-call-profile  enable/disable statistics on function call invocation
+   --with(out)-pymalloc    disable/enable specialized mallocs
+   --with-valgrind         Enable Valgrind support
++  --with(out)-dtrace      disable/enable dtrace support
+   --with-wctype-functions use wctype.h functions
+   --with-fpectl           enable SIGFPE catching
+   --with-libm=STRING      math library
+@@ -5171,7 +5181,7 @@ esac
+ $as_echo_n "checking LIBRARY... " >&6; }
+ if test -z "$LIBRARY"
+ then
+-	LIBRARY='libpython$(VERSION).a'
++	LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5
+ $as_echo "$LIBRARY" >&6; }
+@@ -5343,8 +5353,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+ 	  INSTSONAME="$LDLIBRARY".$SOVERSION
+           ;;
+     Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
+-	  LDLIBRARY='libpython$(VERSION).so'
+-	  BLDLIBRARY='-L. -lpython$(VERSION)'
++	  LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
++	  BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
+ 	  RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ 	  case $ac_sys_system in
+ 	      FreeBSD*)
+@@ -5367,7 +5377,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+ 	  ;;
+     OSF*)
+ 	  LDLIBRARY='libpython$(VERSION).so'
+-	  BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
++	  BLDLIBRARY='-L. -lpython$(VERSION)'
+ 	  RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ 	  ;;
+     atheos*)
+@@ -5894,6 +5904,14 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
++if test "$Py_DEBUG" = 'true'
++then
++	DEBUG_EXT=_d
++	DEBUG_SUFFIX=-debug
++fi
++
++
++
+ # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
+ # merged with this chunk of code?
+ 
+@@ -9958,6 +9976,50 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-count-allocs" >&5
++$as_echo_n "checking for --with-count-allocs... " >&6; }
++
++# Check whether --with-count-allocs was given.
++if test "${with_count_allocs+set}" = set; then :
++  withval=$with_count_allocs;
++if test "$withval" != no
++then
++
++$as_echo "#define COUNT_ALLOCS 1" >>confdefs.h
++
++    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-call-profile" >&5
++$as_echo_n "checking for --with-call-profile... " >&6; }
++
++# Check whether --with-call-profile was given.
++if test "${with_call_profile+set}" = set; then :
++  withval=$with_call_profile;
++if test "$withval" != no
++then
++
++$as_echo "#define CALL_PROFILE 1" >>confdefs.h
++
++    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
+ # Check for Python-specific malloc support
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pymalloc" >&5
+ $as_echo_n "checking for --with-pymalloc... " >&6; }
+@@ -10007,6 +10069,46 @@ fi
+ 
+ fi
+ 
++# Check for dtrace support
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-dtrace" >&5
++$as_echo_n "checking for --with-dtrace... " >&6; }
++
++# Check whether --with-dtrace was given.
++if test "${with_dtrace+set}" = set; then :
++  withval=$with_dtrace;
++fi
++
++
++if test ! -z "$with_dtrace"
++then
++    if dtrace -G -o /dev/null -s $srcdir/Include/pydtrace.d 2>/dev/null
++    then
++
++$as_echo "#define WITH_DTRACE 1" >>confdefs.h
++
++	with_dtrace="Sun"
++	DTRACEOBJS="Python/dtrace.o"
++	DTRADEHDRS=""
++    elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d
++    then
++
++$as_echo "#define WITH_DTRACE 1" >>confdefs.h
++
++	with_dtrace="Apple"
++	DTRACEOBJS=""
++	DTRADEHDRS="pydtrace.h"
++    else
++	with_dtrace="no"
++    fi
++else
++    with_dtrace="no"
++fi
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_dtrace" >&5
++$as_echo "$with_dtrace" >&6; }
++
++
++
+ # Check for --with-wctype-functions
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-wctype-functions" >&5
+ $as_echo_n "checking for --with-wctype-functions... " >&6; }
+diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
+--- ./pyconfig.h.in.autotool-intermediates	2013-04-09 11:24:01.020185806 +0200
++++ ./pyconfig.h.in	2013-04-09 11:24:02.088183204 +0200
+@@ -18,6 +18,12 @@
+ /* Define this if you have BeOS threads. */
+ #undef BEOS_THREADS
+ 
++/* Define to keep records on function call invocation */
++#undef CALL_PROFILE
++
++/* Define to keep records of the number of instances of each type */
++#undef COUNT_ALLOCS
++
+ /* Define if you have the Mach cthreads package */
+ #undef C_THREADS
+ 
+@@ -1119,12 +1125,6 @@
+ /* Define to profile with the Pentium timestamp counter */
+ #undef WITH_TSC
+ 
+-/* Define to keep records of the number of instances of each type */
+-#undef COUNT_ALLOCS
+-
+-/* Define to keep records on function call invocation */
+-#undef CALL_PROFILE
+-
+ /* Define if you want pymalloc to be disabled when running under valgrind */
+ #undef WITH_VALGRIND
+ 
diff --git a/python/patches/python-2.5-cflags.patch b/python/patches/python-2.5-cflags.patch
index 32243bf..7d7459c 100644
--- a/python/patches/python-2.5-cflags.patch
+++ b/python/patches/python-2.5-cflags.patch
@@ -3,7 +3,7 @@
 @@ -334,7 +334,7 @@
  
  # Build the interpreter
- $(BUILDPYTHON):	Modules/python.o $(LIBRARY) $(LDLIBRARY)
+ $(BUILDPYTHON):	Modules/python.o $(LDLIBRARY)
 -		$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
 +		$(LINKCC) $(CFLAGS) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
  			Modules/python.o \
diff --git a/python/patches/python-2.5.1-plural-fix.patch b/python/patches/python-2.5.1-plural-fix.patch
new file mode 100644
index 0000000..040adaf
--- /dev/null
+++ b/python/patches/python-2.5.1-plural-fix.patch
@@ -0,0 +1,12 @@
+diff -up Python-2.5.1/Lib/gettext.py.plural Python-2.5.1/Lib/gettext.py
+--- Python-2.5.1/Lib/gettext.py.plural	2007-09-10 11:38:57.000000000 -0400
++++ Python-2.5.1/Lib/gettext.py	2007-09-10 11:39:00.000000000 -0400
+@@ -299,6 +299,8 @@ class GNUTranslations(NullTranslations):
+                     item = item.strip()
+                     if not item:
+                         continue
++                    if item.startswith("#"):
++                        continue
+                     if ':' in item:
+                         k, v = item.split(':', 1)
+                         k = k.strip().lower()
diff --git a/python/patches/python-2.5.1-sqlite-encoding.patch b/python/patches/python-2.5.1-sqlite-encoding.patch
new file mode 100644
index 0000000..ff2a3f8
--- /dev/null
+++ b/python/patches/python-2.5.1-sqlite-encoding.patch
@@ -0,0 +1,24 @@
+diff -up Python-2.5.1/Lib/sqlite3/dbapi2.py.encoding Python-2.5.1/Lib/sqlite3/dbapi2.py
+--- Python-2.5.1/Lib/sqlite3/dbapi2.py.encoding	2007-09-14 10:41:50.000000000 -0400
++++ Python-2.5.1/Lib/sqlite3/dbapi2.py	2007-09-14 10:42:00.000000000 -0400
+@@ -1,7 +1,6 @@
+-# -*- coding: iso-8859-1 -*-
+ # pysqlite2/dbapi2.py: the DB-API 2.0 interface
+ #
+-# Copyright (C) 2004-2005 Gerhard Häring <gh(a)ghaering.de>
++# Copyright (C) 2004-2005 Gerhard Haering <gh(a)ghaering.de>
+ #
+ # This file is part of pysqlite.
+ #
+diff -up Python-2.5.1/Lib/sqlite3/__init__.py.encoding Python-2.5.1/Lib/sqlite3/__init__.py
+--- Python-2.5.1/Lib/sqlite3/__init__.py.encoding	2007-09-14 10:41:47.000000000 -0400
++++ Python-2.5.1/Lib/sqlite3/__init__.py	2007-09-14 10:42:06.000000000 -0400
+@@ -1,7 +1,6 @@
+-#-*- coding: ISO-8859-1 -*-
+ # pysqlite2/__init__.py: the pysqlite2 package.
+ #
+-# Copyright (C) 2005 Gerhard Häring <gh(a)ghaering.de>
++# Copyright (C) 2005 Gerhard Haering <gh(a)ghaering.de>
+ #
+ # This file is part of pysqlite.
+ #
diff --git a/python/patches/python-2.6-rpath.patch b/python/patches/python-2.6-rpath.patch
index a668926..43e3ec4 100644
--- a/python/patches/python-2.6-rpath.patch
+++ b/python/patches/python-2.6-rpath.patch
@@ -1,6 +1,6 @@
-diff -up Python-2.6/configure.in.rpath Python-2.6/configure.in
---- Python-2.6/configure.in.rpath	2008-11-24 02:51:06.000000000 -0500
-+++ Python-2.6/configure.in	2008-11-24 02:51:21.000000000 -0500
+diff -up Python-2.6/configure.ac.rpath Python-2.6/configure.ac
+--- Python-2.6/configure.ac.rpath	2008-11-24 02:51:06.000000000 -0500
++++ Python-2.6/configure.ac	2008-11-24 02:51:21.000000000 -0500
 @@ -729,7 +729,7 @@ if test $enable_shared = "yes"; then
  	  ;;
      OSF*)
diff --git a/python/patches/python-2.7.1-config.patch b/python/patches/python-2.7.1-config.patch
index c1939a1..82fec2c 100644
--- a/python/patches/python-2.7.1-config.patch
+++ b/python/patches/python-2.7.1-config.patch
@@ -1,6 +1,5 @@
-diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dist
---- Python-2.7.1/Modules/Setup.dist.rhconfig	2010-08-21 07:40:30.000000000 -0400
-+++ Python-2.7.1/Modules/Setup.dist	2010-12-23 15:47:12.111059967 -0500
+--- Python-2.7.4/Modules/Setup.dist.rhconfig	2013-04-06 16:02:34.000000000 +0200
++++ Python-2.7.4/Modules/Setup.dist	2013-04-08 10:05:16.369985654 +0200
 @@ -153,7 +153,7 @@ GLHACK=-Dclear=__GLclear
  # modules are to be built as shared libraries (see above for more
  # detail; also note that *static* reverses this effect):
@@ -10,7 +9,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
  
  # GNU readline.  Unlike previous Python incarnations, GNU readline is
  # now incorporated in an optional module, configured in the Setup file
-@@ -163,73 +163,73 @@ GLHACK=-Dclear=__GLclear
+@@ -163,77 +163,77 @@ GLHACK=-Dclear=__GLclear
  # it, depending on your system -- see the GNU readline instructions.
  # It's okay for this to be a shared library, too.
  
@@ -29,9 +28,6 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
 -#_testcapi _testcapimodule.c    # Python C API test module
 -#_random _randommodule.c	# Random number generator
 -#_collections _collectionsmodule.c # Container types
--#itertools itertoolsmodule.c	# Functions creating iterators for efficient looping 
--#strop stropmodule.c		# String manipulations
--#_functools _functoolsmodule.c	# Tools for working with functions and callable objects
 +array arraymodule.c	# array objects
 +cmath cmathmodule.c _math.c # -lm # complex math library functions
 +math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
@@ -41,6 +37,10 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
 +_testcapi _testcapimodule.c    # Python C API test module
 +_random _randommodule.c	# Random number generator
 +_collections _collectionsmodule.c # Container types
+ #_heapq _heapqmodule.c		# Heapq type
+-#itertools itertoolsmodule.c	# Functions creating iterators for efficient looping 
+-#strop stropmodule.c		# String manipulations
+-#_functools _functoolsmodule.c	# Tools for working with functions and callable objects
 +itertools itertoolsmodule.c	# Functions creating iterators for efficient looping 
 +strop stropmodule.c		# String manipulations
 +_functools _functoolsmodule.c	# Tools for working with functions and callable objects
@@ -57,6 +57,9 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
 -#_locale _localemodule.c  # -lintl
 +_locale _localemodule.c  # -lintl
  
+ # Standard I/O baseline
+ #_io -I$(srcdir)/Modules/_io _io/bufferedio.c _io/bytesio.c _io/fileio.c _io/iobase.c _io/_iomodule.c _io/stringio.c _io/textio.c
+ 
  
  # Modules with some UNIX dependencies -- on by default:
  # (If you have a really backward UNIX, select and socket may not be
@@ -80,8 +83,8 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
 +_csv _csv.c
  
  # Socket module helper for socket(2)
--#_socket socketmodule.c
-+_socket socketmodule.c
+-#_socket socketmodule.c timemodule.c
++_socket socketmodule.c timemodule.c
  
  # Socket module helper for SSL support; you must comment out the other
  # socket line above, and possibly edit the SSL variable:
@@ -99,7 +102,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
  # First, look at Setup.config; configure may have set this for you.
  
 -#crypt cryptmodule.c # -lcrypt	# crypt(3); needs -lcrypt on some systems
-+crypt cryptmodule.c -lcrypt	# crypt(3); needs -lcrypt on some systems
++crypt cryptmodule.c # -lcrypt	# crypt(3); needs -lcrypt on some systems
  
  
  # Some more UNIX dependent modules -- off by default, since these
@@ -114,7 +117,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
  
  
  # Multimedia modules -- off by default.
-@@ -237,8 +237,8 @@ GLHACK=-Dclear=__GLclear
+@@ -238,8 +238,8 @@ GLHACK=-Dclear=__GLclear
  # #993173 says audioop works on 64-bit platforms, though.
  # These represent audio samples or images as strings:
  
@@ -125,7 +128,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
  
  
  # Note that the _md5 and _sha modules are normally only built if the
-@@ -248,14 +248,14 @@ GLHACK=-Dclear=__GLclear
+@@ -249,14 +249,14 @@ GLHACK=-Dclear=__GLclear
  # Message-Digest Algorithm, described in RFC 1321.  The necessary files
  # md5.c and md5.h are included here.
  
@@ -144,7 +147,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
  
  
  # SGI IRIX specific modules -- off by default.
-@@ -302,12 +302,12 @@ GLHACK=-Dclear=__GLclear
+@@ -303,12 +303,12 @@ GLHACK=-Dclear=__GLclear
  # A Linux specific module -- off by default; this may also work on 
  # some *BSDs.
  
@@ -159,7 +162,25 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
  
  
  # The _tkinter module.
-@@ -373,7 +373,7 @@ GLHACK=-Dclear=__GLclear
+@@ -333,7 +333,7 @@ GLHACK=-Dclear=__GLclear
+ # *** Or uncomment this for Solaris:
+ #	-I/usr/openwin/include \
+ # *** Uncomment and edit for Tix extension only:
+-#	-DWITH_TIX -ltix8.1.8.2 \
++	-DWITH_TIX -ltix \
+ # *** Uncomment and edit for BLT extension only:
+ #	-DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
+ # *** Uncomment and edit for PIL (TkImaging) extension only:
+@@ -352,7 +352,7 @@ GLHACK=-Dclear=__GLclear
+ # *** Uncomment for AIX:
+ #	-lld \
+ # *** Always uncomment this; X11 libraries to link with:
+-#	-lX11
++	-lX11
+ 
+ # Lance Ellinghaus's syslog module
+ #syslog syslogmodule.c		# syslog daemon interface
+@@ -374,7 +374,7 @@ GLHACK=-Dclear=__GLclear
  # it is a highly experimental and dangerous device for calling
  # *arbitrary* C functions in *arbitrary* shared libraries:
  
@@ -168,7 +189,16 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
  
  
  # Modules that provide persistent dictionary-like semantics.  You will
-@@ -411,11 +411,10 @@ GLHACK=-Dclear=__GLclear
+@@ -397,7 +397,7 @@ GLHACK=-Dclear=__GLclear
+ #
+ # First, look at Setup.config; configure may have set this for you.
+ 
+-#gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
++gdbm gdbmmodule.c -lgdbm
+ 
+ 
+ # Sleepycat Berkeley DB interface.
+@@ -412,11 +412,9 @@ GLHACK=-Dclear=__GLclear
  #
  # Edit the variables DB and DBLIBVERto point to the db top directory
  # and the subdirectory of PORT where you built it.
@@ -177,14 +207,13 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
 -#DBINC=$(DB)/include
 -#DBLIB=$(DB)/lib
 -#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-+DBLIBVER=4.7
-+DBINC=/usr/include/db4
++DBINC=/usr/include/libdb
 +DBLIB=/usr/lib
-+_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
++_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb
  
  # Historical Berkeley DB 1.85
  #
-@@ -430,14 +429,14 @@ GLHACK=-Dclear=__GLclear
+@@ -431,14 +430,14 @@ GLHACK=-Dclear=__GLclear
  
  
  # Helper module for various ascii-encoders
@@ -203,7 +232,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
  
  
  # Lee Busby's SIGFPE modules.
-@@ -460,7 +459,7 @@ GLHACK=-Dclear=__GLclear
+@@ -461,7 +460,7 @@ GLHACK=-Dclear=__GLclear
  # Andrew Kuchling's zlib module.
  # This require zlib 1.1.3 (or later).
  # See http://www.gzip.org/zlib/
@@ -212,7 +241,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
  
  # Interface to the Expat XML parser
  #
-@@ -479,14 +478,14 @@ GLHACK=-Dclear=__GLclear
+@@ -480,14 +479,14 @@ GLHACK=-Dclear=__GLclear
  # Hye-Shik Chang's CJKCodecs
  
  # multibytecodec is required for all the other CJK codec modules
diff --git a/python/patches/python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch b/python/patches/python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
new file mode 100644
index 0000000..bb38281
--- /dev/null
+++ b/python/patches/python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
@@ -0,0 +1,27 @@
+diff -up Python-2.7.1/Lib/test/test_abc.py.cache_leak Python-2.7.1/Lib/test/test_abc.py
+--- Python-2.7.1/Lib/test/test_abc.py.cache_leak	2010-12-28 18:06:35.551938356 -0500
++++ Python-2.7.1/Lib/test/test_abc.py	2010-12-28 18:09:09.021059202 -0500
+@@ -3,6 +3,8 @@
+ 
+ """Unit tests for abc.py."""
+ 
++import sys
++
+ import unittest, weakref
+ from test import test_support
+ 
+@@ -229,8 +231,12 @@ class TestABC(unittest.TestCase):
+         # Trigger cache.
+         C().f()
+         del C
+-        test_support.gc_collect()
+-        self.assertEqual(r(), None)
++        # This doesn't work in our debug build, presumably due to its use
++        # of COUNT_ALLOCS, which makes heap-allocated types immortal (once
++        # they've ever had an instance):
++        if not hasattr(sys, 'getcounts'):
++            test_support.gc_collect()
++            self.assertEqual(r(), None)
+ 
+ def test_main():
+     test_support.run_unittest(TestABC)
diff --git a/python/patches/python-2.7.1-setup-db48.patch b/python/patches/python-2.7.1-setup-db48.patch
deleted file mode 100644
index c9f5f5c..0000000
--- a/python/patches/python-2.7.1-setup-db48.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -up Python-2.6.4/Modules/Setup.dist.setup-db48 Python-2.6.4/Modules/Setup.dist
---- Python-2.6.4/Modules/Setup.dist.setup-db48	2009-12-17 22:05:07.000020150 -0500
-+++ Python-2.6.4/Modules/Setup.dist	2009-12-17 22:05:12.545015367 -0500
-@@ -411,7 +411,7 @@ gdbm gdbmmodule.c -lgdbm
- #
- # Edit the variables DB and DBLIBVERto point to the db top directory
- # and the subdirectory of PORT where you built it.
--DBLIBVER=4.7
-+DBLIBVER=4.8
- DBINC=/usr/include/db4
- DBLIB=/usr/lib
- _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-
diff --git a/python/patches/python-2.7.2-add-extension-suffix-to-python-config.patch b/python/patches/python-2.7.2-add-extension-suffix-to-python-config.patch
new file mode 100644
index 0000000..d1ff052
--- /dev/null
+++ b/python/patches/python-2.7.2-add-extension-suffix-to-python-config.patch
@@ -0,0 +1,18 @@
+diff -up Python-2.7.2/Misc/python-config.in.add-extension-suffix-to-python-config Python-2.7.2/Misc/python-config.in
+--- Python-2.7.2/Misc/python-config.in.add-extension-suffix-to-python-config	2011-08-23 18:15:41.832497124 -0400
++++ Python-2.7.2/Misc/python-config.in	2011-08-23 18:17:25.854490011 -0400
+@@ -6,7 +6,7 @@ import getopt
+ from distutils import sysconfig
+ 
+ valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
+-              'ldflags', 'help']
++              'ldflags', 'extension-suffix', 'help']
+ 
+ def exit_with_usage(code=1):
+     print >>sys.stderr, "Usage: %s [%s]" % (sys.argv[0],
+@@ -54,3 +54,5 @@ for opt in opt_flags:
+                 libs.extend(getvar('LINKFORSHARED').split())
+         print ' '.join(libs)
+ 
++    elif opt == '--extension-suffix':
++        print (sys.pydebug and "_d" or "") + sysconfig.get_config_var('SO')
diff --git a/python/patches/python-2.7rc1-binutils-no-dep.patch b/python/patches/python-2.7rc1-binutils-no-dep.patch
new file mode 100644
index 0000000..ee6157c
--- /dev/null
+++ b/python/patches/python-2.7rc1-binutils-no-dep.patch
@@ -0,0 +1,14 @@
+diff -up Python-2.7rc1/Lib/ctypes/util.py.binutils-no-dep Python-2.7rc1/Lib/ctypes/util.py
+--- Python-2.7rc1/Lib/ctypes/util.py.binutils-no-dep	2010-03-15 09:42:23.000000000 -0400
++++ Python-2.7rc1/Lib/ctypes/util.py	2010-06-06 05:03:02.155975210 -0400
+@@ -140,7 +140,9 @@ elif os.name == "posix":
+             dump = f.read()
+             rv = f.close()
+             if rv == 10:
+-                raise OSError, 'objdump command not found'
++                return os.path.basename(f) #  This is good for GLibc, I think,
++                                           # and a dep on binutils is big (for
++                                           # live CDs).
+             f = os.popen(cmd)
+             try:
+                 data = f.read()
diff --git a/python/patches/python-2.7rc1-socketmodule-constants.patch b/python/patches/python-2.7rc1-socketmodule-constants.patch
new file mode 100644
index 0000000..c32e103
--- /dev/null
+++ b/python/patches/python-2.7rc1-socketmodule-constants.patch
@@ -0,0 +1,64 @@
+--- Python-2.7rc1/Modules/socketmodule.c.socketmodule	2010-05-09 10:46:46.000000000 -0400
++++ Python-2.7rc1/Modules/socketmodule.c	2010-06-07 23:04:19.374234780 -0400
+@@ -4783,6 +4783,61 @@ init_socket(void)
+     PyModule_AddIntConstant(m, "SO_SETFIB", SO_SETFIB);
+ #endif
+ 
++#ifdef	SO_SNDBUFFORCE
++    PyModule_AddIntConstant(m, "SO_SNDBUFFORCE", SO_SNDBUFFORCE);
++#endif
++#ifdef	SO_RCVBUFFORCE
++    PyModule_AddIntConstant(m, "SO_RCVBUFFORCE", SO_RCVBUFFORCE);
++#endif
++#ifdef	SO_NO_CHECK
++    PyModule_AddIntConstant(m, "SO_NO_CHECK", SO_NO_CHECK);
++#endif
++#ifdef	SO_PRIORITY
++    PyModule_AddIntConstant(m, "SO_PRIORITY", SO_PRIORITY);
++#endif
++#ifdef	SO_BSDCOMPAT
++    PyModule_AddIntConstant(m, "SO_BSDCOMPAT", SO_BSDCOMPAT);
++#endif
++#ifdef	SO_PASSCRED
++    PyModule_AddIntConstant(m, "SO_PASSCRED", SO_PASSCRED);
++#endif
++#ifdef	SO_PEERCRED
++    PyModule_AddIntConstant(m, "SO_PEERCRED", SO_PEERCRED);
++#endif
++#ifdef	SO_SECURITY_AUTHENTICATION
++    PyModule_AddIntConstant(m, "SO_SECURITY_AUTHENTICATION", SO_SECURITY_AUTHENTICATION);
++#endif
++#ifdef	SO_SECURITY_ENCRYPTION_TRANSPORT
++    PyModule_AddIntConstant(m, "SO_SECURITY_ENCRYPTION_TRANSPORT", SO_SECURITY_ENCRYPTION_TRANSPORT);
++#endif
++#ifdef	SO_SECURITY_ENCRYPTION_NETWORK
++    PyModule_AddIntConstant(m, "SO_SECURITY_ENCRYPTION_NETWORK", SO_SECURITY_ENCRYPTION_NETWORK);
++#endif
++#ifdef	SO_BINDTODEVICE
++    PyModule_AddIntConstant(m, "SO_BINDTODEVICE", SO_BINDTODEVICE);
++#endif
++#ifdef	SO_ATTACH_FILTER
++    PyModule_AddIntConstant(m, "SO_ATTACH_FILTER", SO_ATTACH_FILTER);
++#endif
++#ifdef	SO_DETACH_FILTER
++    PyModule_AddIntConstant(m, "SO_DETACH_FILTER", SO_DETACH_FILTER);
++#endif
++#ifdef	SO_PEERNAME
++    PyModule_AddIntConstant(m, "SO_PEERNAME", SO_PEERNAME);
++#endif
++#ifdef	SO_TIMESTAMP
++    PyModule_AddIntConstant(m, "SO_TIMESTAMP", SO_TIMESTAMP);
++#endif
++#ifdef	SO_PEERSEC
++    PyModule_AddIntConstant(m, "SO_PEERSEC", SO_PEERSEC);
++#endif
++#ifdef	SO_PASSSEC
++    PyModule_AddIntConstant(m, "SO_PASSSEC", SO_PASSSEC);
++#endif
++#ifdef	SO_TIMESTAMPNS
++    PyModule_AddIntConstant(m, "SO_TIMESTAMPNS", SO_TIMESTAMPNS);
++#endif
++
+     /* Maximum number of connections for "listen" */
+ #ifdef  SOMAXCONN
+     PyModule_AddIntConstant(m, "SOMAXCONN", SOMAXCONN);
diff --git a/python/patches/python-2.7rc1-socketmodule-constants2.patch b/python/patches/python-2.7rc1-socketmodule-constants2.patch
new file mode 100644
index 0000000..896ac88
--- /dev/null
+++ b/python/patches/python-2.7rc1-socketmodule-constants2.patch
@@ -0,0 +1,19 @@
+diff -up Python-2.7rc1/Modules/socketmodule.c.socketmodule2 Python-2.7rc1/Modules/socketmodule.c
+--- Python-2.7rc1/Modules/socketmodule.c.socketmodule2	2010-06-07 23:06:59.133498087 -0400
++++ Python-2.7rc1/Modules/socketmodule.c	2010-06-07 23:11:51.249520087 -0400
+@@ -5253,6 +5253,15 @@ init_socket(void)
+ #ifdef  TCP_QUICKACK
+     PyModule_AddIntConstant(m, "TCP_QUICKACK", TCP_QUICKACK);
+ #endif
++#ifdef	TCP_CONGESTION
++    PyModule_AddIntConstant(m, "TCP_CONGESTION", TCP_CONGESTION);
++#endif
++#ifdef	TCP_MD5SIG
++    PyModule_AddIntConstant(m, "TCP_MD5SIG", TCP_MD5SIG);
++#endif
++#ifdef	TCP_MD5SIG_MAXKEYLEN
++    PyModule_AddIntConstant(m, "TCP_MD5SIG_MAXKEYLEN", TCP_MD5SIG_MAXKEYLEN);
++#endif
+ 
+ 
+     /* IPX options */
diff --git a/python/patches/python-2.7rc2-r79310.patch0R b/python/patches/python-2.7rc2-r79310.patch0R
deleted file mode 100644
index ee92932..0000000
--- a/python/patches/python-2.7rc2-r79310.patch0R
+++ /dev/null
@@ -1,27 +0,0 @@
-Index: Misc/NEWS
-===================================================================
---- Misc/NEWS	(revision 79309)
-+++ Misc/NEWS	(revision 79310)
-@@ -29,6 +29,9 @@
- Library
- -------
- 
-+- Issue #8205: Remove the "Modules" directory from sys.path when Python is
-+  running from the build directory (POSIX only).
-+
- - Issue #7667: Fix doctest failures with non-ASCII paths.
- 
- - Issue #7512: shutil.copystat() could raise an OSError when the filesystem
-Index: Lib/site.py
-===================================================================
---- Lib/site.py	(revision 79309)
-+++ Lib/site.py	(revision 79310)
-@@ -118,7 +118,7 @@
-     s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
-     if hasattr(sys, 'gettotalrefcount'):
-         s += '-pydebug'
--    s = os.path.join(os.path.dirname(sys.path[-1]), s)
-+    s = os.path.join(os.path.dirname(sys.path.pop()), s)
-     sys.path.append(s)
- 
- 
diff --git a/python/patches/python-lib64-fix-for-test_install.patch b/python/patches/python-lib64-fix-for-test_install.patch
deleted file mode 100644
index 7852bf6..0000000
--- a/python/patches/python-lib64-fix-for-test_install.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- Python-2.7.2/Lib/distutils/tests/test_install.py.lib64	2011-09-08 17:51:57.851405376 -0400
-+++ Python-2.7.2/Lib/distutils/tests/test_install.py	2011-09-08 18:40:46.754205096 -0400
-@@ -41,8 +41,9 @@ class InstallTestCase(support.TempdirMan
-             self.assertEqual(got, expected)
- 
-         libdir = os.path.join(destination, "lib", "python")
-+        platlibdir = os.path.join(destination, "lib64", "python")
-         check_path(cmd.install_lib, libdir)
--        check_path(cmd.install_platlib, libdir)
-+        check_path(cmd.install_platlib, platlibdir)
-         check_path(cmd.install_purelib, libdir)
-         check_path(cmd.install_headers,
-                    os.path.join(destination, "include", "python", "foopkg"))
diff --git a/python/patches/x86_64/python-2.7.3-lib64.patch b/python/patches/x86_64/python-2.7.3-lib64.patch
index b3d5d91..71f32c5 100644
--- a/python/patches/x86_64/python-2.7.3-lib64.patch
+++ b/python/patches/x86_64/python-2.7.3-lib64.patch
@@ -1,6 +1,6 @@
-diff -up Python-2.7.1/Lib/distutils/command/install.py.lib64 Python-2.7.1/Lib/distutils/command/install.py
---- Python-2.7.1/Lib/distutils/command/install.py.lib64	2010-05-05 15:09:31.000000000 -0400
-+++ Python-2.7.1/Lib/distutils/command/install.py	2010-12-23 15:51:19.422062062 -0500
+diff -up Python-2.7.3/Lib/distutils/command/install.py.lib64 Python-2.7.3/Lib/distutils/command/install.py
+--- Python-2.7.3/Lib/distutils/command/install.py.lib64	2012-04-09 19:07:29.000000000 -0400
++++ Python-2.7.3/Lib/distutils/command/install.py	2013-02-19 13:58:20.446015129 -0500
 @@ -42,14 +42,14 @@ else:
  INSTALL_SCHEMES = {
      'unix_prefix': {
@@ -18,9 +18,9 @@ diff -up Python-2.7.1/Lib/distutils/command/install.py.lib64 Python-2.7.1/Lib/di
          'headers': '$base/include/python/$dist_name',
          'scripts': '$base/bin',
          'data'   : '$base',
-diff -up Python-2.7.1/Lib/distutils/sysconfig.py.lib64 Python-2.7.1/Lib/distutils/sysconfig.py
---- Python-2.7.1/Lib/distutils/sysconfig.py.lib64	2010-11-06 10:16:30.000000000 -0400
-+++ Python-2.7.1/Lib/distutils/sysconfig.py	2010-12-23 15:51:19.423063652 -0500
+diff -up Python-2.7.3/Lib/distutils/sysconfig.py.lib64 Python-2.7.3/Lib/distutils/sysconfig.py
+--- Python-2.7.3/Lib/distutils/sysconfig.py.lib64	2012-04-09 19:07:29.000000000 -0400
++++ Python-2.7.3/Lib/distutils/sysconfig.py	2013-02-19 13:58:20.446015129 -0500
 @@ -114,8 +114,12 @@ def get_python_lib(plat_specific=0, stan
          prefix = plat_specific and EXEC_PREFIX or PREFIX
  
@@ -35,10 +35,10 @@ diff -up Python-2.7.1/Lib/distutils/sysconfig.py.lib64 Python-2.7.1/Lib/distutil
          if standard_lib:
              return libpython
          else:
-diff -up Python-2.7.1/Lib/site.py.lib64 Python-2.7.1/Lib/site.py
---- Python-2.7.1/Lib/site.py.lib64	2010-10-12 18:53:51.000000000 -0400
-+++ Python-2.7.1/Lib/site.py	2010-12-23 15:51:19.424063606 -0500
-@@ -290,12 +290,16 @@ def getsitepackages():
+diff -up Python-2.7.3/Lib/site.py.lib64 Python-2.7.3/Lib/site.py
+--- Python-2.7.3/Lib/site.py.lib64	2012-04-09 19:07:31.000000000 -0400
++++ Python-2.7.3/Lib/site.py	2013-02-19 13:58:20.447015128 -0500
+@@ -300,12 +300,16 @@ def getsitepackages():
          if sys.platform in ('os2emx', 'riscos'):
              sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
          elif os.sep == '/':
@@ -55,43 +55,38 @@ diff -up Python-2.7.1/Lib/site.py.lib64 Python-2.7.1/Lib/site.py
              sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
          if sys.platform == "darwin":
              # for framework builds *only* we add the standard Apple
-diff -up Python-2.7.1/Lib/test/test_site.py.lib64 Python-2.7.1/Lib/test/test_site.py
---- Python-2.7.1/Lib/test/test_site.py.lib64	2010-11-21 08:34:58.000000000 -0500
-+++ Python-2.7.1/Lib/test/test_site.py	2010-12-23 15:55:19.782935931 -0500
-@@ -241,18 +241,22 @@
+diff -up Python-2.7.3/Lib/test/test_site.py.lib64 Python-2.7.3/Lib/test/test_site.py
+--- Python-2.7.3/Lib/test/test_site.py.lib64	2012-04-09 19:07:32.000000000 -0400
++++ Python-2.7.3/Lib/test/test_site.py	2013-02-19 13:58:20.447015128 -0500
+@@ -241,17 +241,20 @@ class HelperFunctionsTests(unittest.Test
              self.assertEqual(dirs[2], wanted)
          elif os.sep == '/':
              # OS X non-framwework builds, Linux, FreeBSD, etc
 -            self.assertEqual(len(dirs), 2)
-+            self.assertEquals(len(dirs), 3)
+-            wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
++            self.assertEqual(len(dirs), 3)
 +            wanted = os.path.join('xoxo', 'lib64', 'python' + sys.version[:3],
-+                                  'site-packages')
-+            self.assertEquals(dirs[0], wanted)
-             wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
                                    'site-packages')
--            self.assertEqual(dirs[0], wanted)
-+            self.assertEquals(dirs[1], wanted)
-             wanted = os.path.join('xoxo', 'lib', 'site-python')
--            self.assertEqual(dirs[1], wanted)
-+            self.assertEquals(dirs[2], wanted)
+             self.assertEqual(dirs[0], wanted)
+-            wanted = os.path.join('xoxo', 'lib', 'site-python')
++            wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
++                                  'site-packages')
+             self.assertEqual(dirs[1], wanted)
++            wanted = os.path.join('xoxo', 'lib', 'site-python')
++            self.assertEqual(dirs[2], wanted)
          else:
              # other platforms
--            self.assertEqual(len(dirs), 2)
--            self.assertEqual(dirs[0], 'xoxo')
+             self.assertEqual(len(dirs), 2)
+             self.assertEqual(dirs[0], 'xoxo')
 -            wanted = os.path.join('xoxo', 'lib', 'site-packages')
--            self.assertEqual(dirs[1], wanted)
-+            self.assertEquals(len(dirs), 2)
-+            self.assertEquals(dirs[0], 'xoxo')
 +            wanted = os.path.join('xoxo', 'lib64', 'site-packages')
-+            self.assertEquals(dirs[1], wanted)
-+
+             self.assertEqual(dirs[1], wanted)
  
  class PthFile(object):
-     """Helper class for handling testing of .pth files"""
-diff -up Python-2.7.1/Makefile.pre.in.lib64 Python-2.7.1/Makefile.pre.in
---- Python-2.7.1/Makefile.pre.in.lib64	2010-12-23 15:51:19.407063264 -0500
-+++ Python-2.7.1/Makefile.pre.in	2010-12-23 15:51:19.426063917 -0500
-@@ -94,7 +94,7 @@ LIBDIR=		@libdir@
+diff -up Python-2.7.3/Makefile.pre.in.lib64 Python-2.7.3/Makefile.pre.in
+--- Python-2.7.3/Makefile.pre.in.lib64	2013-02-19 13:58:20.435015131 -0500
++++ Python-2.7.3/Makefile.pre.in	2013-02-19 13:58:20.447015128 -0500
+@@ -97,7 +97,7 @@ LIBDIR=		@libdir@
  MANDIR=		@mandir@
  INCLUDEDIR=	@includedir@
  CONFINCLUDEDIR=	$(exec_prefix)/include
@@ -100,9 +95,9 @@ diff -up Python-2.7.1/Makefile.pre.in.lib64 Python-2.7.1/Makefile.pre.in
  
  # Detailed destination directories
  BINLIBDEST=	$(LIBDIR)/python$(VERSION)
-diff -up Python-2.7.1/Modules/getpath.c.lib64 Python-2.7.1/Modules/getpath.c
---- Python-2.7.1/Modules/getpath.c.lib64	2010-10-07 19:37:08.000000000 -0400
-+++ Python-2.7.1/Modules/getpath.c	2010-12-23 15:51:19.427063291 -0500
+diff -up Python-2.7.3/Modules/getpath.c.lib64 Python-2.7.3/Modules/getpath.c
+--- Python-2.7.3/Modules/getpath.c.lib64	2012-04-09 19:07:34.000000000 -0400
++++ Python-2.7.3/Modules/getpath.c	2013-02-19 13:58:20.448015128 -0500
 @@ -117,8 +117,8 @@
  #endif
  
@@ -141,16 +136,16 @@ diff -up Python-2.7.1/Modules/getpath.c.lib64 Python-2.7.1/Modules/getpath.c
      }
      /* If we found EXEC_PREFIX do *not* reduce it!  (Yet.) */
  
-diff -up Python-2.7.1/Modules/Setup.dist.lib64 Python-2.7.1/Modules/Setup.dist
---- Python-2.7.1/Modules/Setup.dist.lib64	2010-12-23 15:51:19.400104130 -0500
-+++ Python-2.7.1/Modules/Setup.dist	2010-12-23 15:51:19.427063291 -0500
+diff -up Python-2.7.3/Modules/Setup.dist.lib64 Python-2.7.3/Modules/Setup.dist
+--- Python-2.7.3/Modules/Setup.dist.lib64	2013-02-19 13:58:20.442015131 -0500
++++ Python-2.7.3/Modules/Setup.dist	2013-02-19 14:02:25.255998391 -0500
 @@ -413,7 +413,7 @@ gdbm gdbmmodule.c -lgdbm
+ # Edit the variables DB and DBLIBVERto point to the db top directory
  # and the subdirectory of PORT where you built it.
- DBLIBVER=4.7
- DBINC=/usr/include/db4
+ DBINC=/usr/include/libdb
 -DBLIB=/usr/lib
 +DBLIB=/usr/lib64
- _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+ _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb
  
  # Historical Berkeley DB 1.85
 @@ -459,7 +459,7 @@ cPickle cPickle.c
@@ -162,19 +157,19 @@ diff -up Python-2.7.1/Modules/Setup.dist.lib64 Python-2.7.1/Modules/Setup.dist
  
  # Interface to the Expat XML parser
  #
-diff -up Python-2.7.1/setup.py.lib64 Python-2.7.1/setup.py
---- Python-2.7.1/setup.py.lib64	2010-10-31 12:40:21.000000000 -0400
-+++ Python-2.7.1/setup.py	2010-12-23 15:51:19.428064129 -0500
-@@ -347,7 +347,7 @@ class PyBuildExt(build_ext):
+diff -up Python-2.7.3/setup.py.lib64 Python-2.7.3/setup.py
+--- Python-2.7.3/setup.py.lib64	2012-04-09 19:07:36.000000000 -0400
++++ Python-2.7.3/setup.py	2013-02-19 13:58:20.449015129 -0500
+@@ -369,7 +369,7 @@ class PyBuildExt(build_ext):
  
      def detect_modules(self):
          # Ensure that /usr/local is always used
 -        add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
 +        add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
          add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
- 
-         # Add paths specified in the environment variables LDFLAGS and
-@@ -654,11 +654,11 @@ class PyBuildExt(build_ext):
+         self.add_gcc_paths()
+         self.add_multiarch_paths()
+@@ -677,11 +677,11 @@ class PyBuildExt(build_ext):
              elif curses_library:
                  readline_libs.append(curses_library)
              elif self.compiler.find_library_file(lib_dirs +
@@ -188,7 +183,7 @@ diff -up Python-2.7.1/setup.py.lib64 Python-2.7.1/setup.py
                                     extra_link_args=readline_extra_link_args,
                                     libraries=readline_libs) )
          else:
-@@ -692,8 +692,8 @@ class PyBuildExt(build_ext):
+@@ -715,8 +715,8 @@ class PyBuildExt(build_ext):
              if krb5_h:
                  ssl_incs += krb5_h
          ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
diff --git a/python/python.nm b/python/python.nm
index 8aff924..52adceb 100644
--- a/python/python.nm
+++ b/python/python.nm
@@ -5,8 +5,8 @@
 
 name       = python
 major_ver  = 2.7
-version    = %{major_ver}.3
-release    = 2
+version    = %{major_ver}.5
+release    = 1
 thisapp    = Python-%{version}
 
 groups     = Development/Languages
@@ -30,9 +30,10 @@ build
 		autoconf
 		automake
 		bzip2-devel
-		db4-devel >= 1:4.8
 		expat-devel
+		gdbm-devel
 		glibc-headers >= 2.16-4
+		libdb-devel
 		libffi-devel
 		libselinux-devel
 		ncurses-devel
@@ -41,6 +42,7 @@ build
 		readline-devel
 		sqlite-devel
 		tar
+		util-linux
 		zlib-devel
 	end
 
@@ -51,8 +53,7 @@ build
 		rm -rf Modules/{expat,zlib}
 		rm -rf Modules/_ctypes/{darwin,libffi,libffi_arm_wince,libffi_msvc,libffi_osx}
 
-		# Remove autoconf version check and reconfigure
-		sed -e "s/^version_required.*//" -i configure.in
+		# Reconfigure
 		autoreconf --force
 	end
 
@@ -73,6 +74,10 @@ build
 		make %{PARALLELISMFLAGS}
 	end
 
+	test
+		WITHIN_PYTHON_RPM_BUILD= EXTRATESTOPTS="--verbose" make test || :
+	end
+
 	install_cmds
 		# All *.py files don't need to be executeable...
 		find %{BUILDROOT}%{libdir}/python*/ -name "*.py" | xargs -r chmod a-x -v


hooks/post-receive
--
IPFire 3.x development tree

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-08 11:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-08 11:48 [git.ipfire.org] IPFire 3.x development tree branch, master, updated. 48d9a6a01196688b2ab80df7fb014e476a404d2f git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox