[python3] 3.2a1

dmalcolm dmalcolm at fedoraproject.org
Sat Aug 21 22:09:14 UTC 2010


commit 7eb10c8dbe3874eee9675c2cbc87a83342806cf7
Author: David Malcolm <dmalcolm at redhat.com>
Date:   Sat Aug 21 18:08:26 2010 -0400

    3.2a1
    
    * Sat Aug 21 2010 David Malcolm <dmalcolm at redhat.com> - 3.2-0.0.a1
    - 3.2a1; add alphatag
    - rework %%files in the light of PEP 3147 (__pycache__)
    - drop our configuration patch to Setup.dist (patch 0): setup.py should do a
    better job of things, and the %%files explicitly lists our modules (r82746
    appears to break the old way of doing things).  This leads to various modules
    changing from "foomodule.so" to "foo.so".  It also leads to the optimized build
    dropping the _sha1, _sha256 and _sha512 modules, but these are provided by
    _hashlib; _weakref becomes a builtin module; xxsubtype goes away (it's only for
    testing/devel purposes)
    - fixup patches 3, 4, 6, 8, 102, 103, 105, 111 for the rebase
    - remove upstream patches: 7 (system expat), 106, 107, 108 (audioop reformat
    plus CVE-2010-1634 and CVE-2010-2089), 109 (CVE-2008-5983)
    - add machinery for rebuilding "configure" and friends, using the correct
    version of autoconf (patch 300)
    - patch the debug build's usage of COUNT_ALLOCS to be less verbose (patch 125)
    - "modulator" was removed upstream
    - drop "-b" from patch applications affecting .py files to avoid littering the
    installation tree

 .gitignore                                         |    1 +
 autotool-intermediates.patch                       |  243 ++
 less-verbose-COUNT_ALLOCS.patch                    |   20 +
 python-2.6.5-statvfs-f_flag-constants.patch        |   62 -
 ...-changes-to-expected-shebang-for-test_imp.patch |   11 -
 python-3.1.1-config.patch                          |  226 --
 python-3.1.1-systemtap.patch                       |  322 ---
 python-3.1.1-with-system-expat.patch               |   67 -
 python-3.1.2-CVE-2008-5983.patch                   |  120 -
 python-3.1.2-CVE-2010-1634.patch                   |  209 --
 python-3.1.2-CVE-2010-2089.patch                   |  313 ---
 python-3.1.2-reformat-audioop.c.patch              | 2727 --------------------
 ...-changes-to-expected-shebang-for-test_imp.patch |   12 +
 ...g-build.patch => python-3.2a1-debug-build.patch |  147 +-
 ...e.patch => python-3.2a1-fix-parallel-make.patch |   13 +-
 ...n-3.1.1-lib64.patch => python-3.2a1-lib64.patch |  104 +-
 ...c-lib.patch => python-3.2a1-no-static-lib.patch |   18 +-
 ...ch => python-3.2a1-remove-mimeaudio-tests.patch |   10 +-
 python-3.2a1-statvfs-f_flag-constants.patch        |   47 +
 python-3.2a1-systemtap.patch                       |  222 ++
 python3.spec                                       |  324 ++-
 sources                                            |    2 +-
 22 files changed, 895 insertions(+), 4325 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 95c8574..43efa0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz
 Python-3.1.2.tar.bz2
+Python-3.2a1.tar.bz2
diff --git a/autotool-intermediates.patch b/autotool-intermediates.patch
new file mode 100644
index 0000000..efbf3bf
--- /dev/null
+++ b/autotool-intermediates.patch
@@ -0,0 +1,243 @@
+diff -up ./configure.autotool-intermediates ./configure
+--- ./configure.autotool-intermediates	2010-08-02 17:58:12.238002650 -0400
++++ ./configure	2010-08-02 17:58:20.151000507 -0400
+@@ -1,5 +1,5 @@
+ #! /bin/sh
+-# From configure.in Revision: 82090 .
++# From configure.in Revision: 82962 .
+ # Guess values for system-dependent variables and create Makefiles.
+ # Generated by GNU Autoconf 2.65 for python 3.2.
+ #
+@@ -610,6 +610,8 @@ TRUE
+ MACHDEP_OBJS
+ DYNLOADFILE
+ DLINCLDIR
++DTRACEHDRS
++DTRACEOBJS
+ THREADOBJ
+ LDLAST
+ USE_THREAD_MODULE
+@@ -630,6 +632,8 @@ OTHER_LIBTOOL_OPT
+ UNIVERSAL_ARCH_FLAGS
+ BASECFLAGS
+ OPT
++DEBUG_SUFFIX
++DEBUG_EXT
+ LN
+ INSTALL_DATA
+ INSTALL_SCRIPT
+@@ -743,8 +747,11 @@ with_thread
+ 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
+@@ -1414,8 +1421,11 @@ Optional Packages:
+                           deprecated; use --with(out)-threads
+   --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
+@@ -1929,11 +1939,11 @@ else
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ $ac_includes_default
+-	     enum { N = $2 / 2 - 1 };
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
++static int test_array [1 - 2 * !(enum { N = $2 / 2 - 1 };
++	     0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
+ test_array [0] = 0
+ 
+   ;
+@@ -1944,11 +1954,11 @@ if ac_fn_c_try_compile "$LINENO"; then :
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ $ac_includes_default
+-	        enum { N = $2 / 2 - 1 };
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
++static int test_array [1 - 2 * !(enum { N = $2 / 2 - 1 };
++		($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
+ 		 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))];
+ test_array [0] = 0
+ 
+@@ -4672,7 +4682,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; }
+@@ -4843,8 +4853,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+ 	  INSTSONAME="$LDLIBRARY".$SOVERSION
+           ;;
+     Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
+-	  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*)
+@@ -5237,6 +5247,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?
+ 
+@@ -8160,6 +8178,7 @@ fi
+ $as_echo "$with_system_expat" >&6; }
+ 
+ # Check for use of the system libffi library
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-ffi" >&5
+ $as_echo_n "checking for --with-system-ffi... " >&6; }
+ 
+@@ -9144,6 +9163,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; }
+@@ -9194,6 +9257,46 @@ fi
+     OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
+ 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	2010-08-02 17:58:12.236001348 -0400
++++ ./pyconfig.h.in	2010-08-02 17:58:20.000000000 -0400
+@@ -12,15 +12,15 @@
+    support for AIX C++ shared extension modules. */
+ #undef AIX_GENUINE_CPLUSPLUS
+ 
+-/* Define if you have the Mach cthreads package */
+-#undef C_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
++
+ /* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM
+    mixed-endian order (byte order 45670123) */
+ #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754
diff --git a/less-verbose-COUNT_ALLOCS.patch b/less-verbose-COUNT_ALLOCS.patch
new file mode 100644
index 0000000..8cef015
--- /dev/null
+++ b/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-3.2a1-apply-our-changes-to-expected-shebang-for-test_imp.patch b/python-3.2a1-apply-our-changes-to-expected-shebang-for-test_imp.patch
new file mode 100644
index 0000000..68eb618
--- /dev/null
+++ b/python-3.2a1-apply-our-changes-to-expected-shebang-for-test_imp.patch
@@ -0,0 +1,12 @@
+diff -up Python-3.2a1/Lib/test/test_imp.py.apply-our-changes-to-expected-shebang Python-3.2a1/Lib/test/test_imp.py
+--- Python-3.2a1/Lib/test/test_imp.py.apply-our-changes-to-expected-shebang	2010-08-02 15:57:49.151002176 -0400
++++ Python-3.2a1/Lib/test/test_imp.py	2010-08-02 15:58:40.428010729 -0400
+@@ -52,7 +52,7 @@ class ImportTests(unittest.TestCase):
+         self.assertNotEqual(fp, None)
+         self.assertEqual(fp.encoding, "iso-8859-1")
+         self.assertEqual(fp.tell(), 0)
+-        self.assertEqual(fp.readline(), '#!/usr/bin/env python3\n')
++        self.assertEqual(fp.readline(), '#!/usr/bin/python3.2\n')
+         fp.close()
+ 
+         fp, filename, info = imp.find_module("tokenize")
diff --git a/python-3.1.2-debug-build.patch b/python-3.2a1-debug-build.patch
similarity index 64%
rename from python-3.1.2-debug-build.patch
rename to python-3.2a1-debug-build.patch
index 2a71afe..49fb182 100644
--- a/python-3.1.2-debug-build.patch
+++ b/python-3.2a1-debug-build.patch
@@ -1,7 +1,7 @@
-diff -up Python-3.1.2/configure.in.debug-build Python-3.1.2/configure.in
---- Python-3.1.2/configure.in.debug-build	2010-05-20 22:48:14.573026391 -0400
-+++ Python-3.1.2/configure.in	2010-05-20 22:48:14.580902316 -0400
-@@ -569,7 +569,7 @@ AC_SUBST(LIBRARY)
+diff -up Python-3.2a1/configure.in.debug-build Python-3.2a1/configure.in
+--- Python-3.2a1/configure.in.debug-build	2010-08-20 16:06:24.616082276 -0400
++++ Python-3.2a1/configure.in	2010-08-20 16:06:24.632127011 -0400
+@@ -584,7 +584,7 @@ AC_SUBST(LIBRARY)
  AC_MSG_CHECKING(LIBRARY)
  if test -z "$LIBRARY"
  then
@@ -10,7 +10,7 @@ diff -up Python-3.1.2/configure.in.debug-build Python-3.1.2/configure.in
  fi
  AC_MSG_RESULT($LIBRARY)
  
-@@ -711,8 +711,8 @@ if test $enable_shared = "yes"; then
+@@ -726,8 +726,8 @@ if test $enable_shared = "yes"; then
  	  INSTSONAME="$LDLIBRARY".$SOVERSION
            ;;
      Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
@@ -21,7 +21,7 @@ diff -up Python-3.1.2/configure.in.debug-build Python-3.1.2/configure.in
  	  RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
  	  case $ac_sys_system in
  	      FreeBSD*)
-@@ -816,6 +816,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
+@@ -825,6 +825,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
  fi],
  [AC_MSG_RESULT(no)])
  
@@ -36,9 +36,9 @@ diff -up Python-3.1.2/configure.in.debug-build Python-3.1.2/configure.in
  # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
  # merged with this chunk of code?
  
-diff -up Python-3.1.2/Lib/distutils/command/build_ext.py.debug-build Python-3.1.2/Lib/distutils/command/build_ext.py
---- Python-3.1.2/Lib/distutils/command/build_ext.py.debug-build	2010-03-19 17:56:34.000000000 -0400
-+++ Python-3.1.2/Lib/distutils/command/build_ext.py	2010-05-20 22:48:14.581902928 -0400
+diff -up Python-3.2a1/Lib/distutils/command/build_ext.py.debug-build Python-3.2a1/Lib/distutils/command/build_ext.py
+--- Python-3.2a1/Lib/distutils/command/build_ext.py.debug-build	2010-07-22 08:50:05.000000000 -0400
++++ Python-3.2a1/Lib/distutils/command/build_ext.py	2010-08-20 16:06:24.633125472 -0400
 @@ -673,7 +673,10 @@ class build_ext(Command):
          so_ext = get_config_var('SO')
          if os.name == 'nt' and self.debug:
@@ -60,9 +60,9 @@ diff -up Python-3.1.2/Lib/distutils/command/build_ext.py.debug-build Python-3.1.
                  return ext.libraries + [pythonlib]
              else:
                  return ext.libraries
-diff -up Python-3.1.2/Lib/distutils/sysconfig.py.debug-build Python-3.1.2/Lib/distutils/sysconfig.py
---- Python-3.1.2/Lib/distutils/sysconfig.py.debug-build	2010-05-20 22:48:14.577026372 -0400
-+++ Python-3.1.2/Lib/distutils/sysconfig.py	2010-05-20 22:48:14.581902928 -0400
+diff -up Python-3.2a1/Lib/distutils/sysconfig.py.debug-build Python-3.2a1/Lib/distutils/sysconfig.py
+--- Python-3.2a1/Lib/distutils/sysconfig.py.debug-build	2010-08-20 16:06:24.623083865 -0400
++++ Python-3.2a1/Lib/distutils/sysconfig.py	2010-08-20 16:06:24.633125472 -0400
 @@ -83,7 +83,8 @@ def get_python_inc(plat_specific=0, pref
              else:
                  incdir = os.path.join(get_config_var('srcdir'), 'Include')
@@ -82,10 +82,10 @@ diff -up Python-3.1.2/Lib/distutils/sysconfig.py.debug-build Python-3.1.2/Lib/di
  
  
  def parse_config_h(fp, g=None):
-diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in
---- Python-3.1.2/Makefile.pre.in.debug-build	2010-05-20 22:48:14.577901061 -0400
-+++ Python-3.1.2/Makefile.pre.in	2010-05-20 22:48:14.581902928 -0400
-@@ -99,8 +99,8 @@ SCRIPTDIR=	$(prefix)/lib64
+diff -up Python-3.2a1/Makefile.pre.in.debug-build Python-3.2a1/Makefile.pre.in
+--- Python-3.2a1/Makefile.pre.in.debug-build	2010-08-20 16:06:24.624081000 -0400
++++ Python-3.2a1/Makefile.pre.in	2010-08-20 16:06:57.287084214 -0400
+@@ -105,8 +105,8 @@ SCRIPTDIR=	$(prefix)/lib64
  # Detailed destination directories
  BINLIBDEST=	$(LIBDIR)/python$(VERSION)
  LIBDEST=	$(SCRIPTDIR)/python$(VERSION)
@@ -96,7 +96,7 @@ diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in
  LIBP=		$(LIBDIR)/python$(VERSION)
  
  # Symbols used for using shared libraries
-@@ -113,6 +113,12 @@ DESTSHARED=	$(BINLIBDEST)/lib-dynload
+@@ -120,6 +120,12 @@ DESTSHARED=	$(BINLIBDEST)/lib-dynload
  EXE=		@EXEEXT@
  BUILDEXE=	@BUILDEXEEXT@
  
@@ -109,7 +109,7 @@ diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in
  # Short name and location for Mac OS X Python framework
  UNIVERSALSDK=@UNIVERSALSDK@
  PYTHONFRAMEWORK=	@PYTHONFRAMEWORK@
-@@ -176,7 +182,7 @@ LIBOBJDIR=	Python/
+@@ -183,7 +189,7 @@ LIBOBJDIR=	Python/
  LIBOBJS=	@LIBOBJS@
  
  PYTHON=		python$(EXE)
@@ -118,16 +118,16 @@ diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in
  
  # The task to run while instrument when building the profile-opt target
  PROFILE_TASK=	$(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
-@@ -422,7 +428,7 @@ sharedmods: $(BUILDPYTHON)
- 	*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
+@@ -433,7 +439,7 @@ sharedmods: $(BUILDPYTHON)
+ 	*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(PY_LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
  	esac
  
 -libpython$(VERSION).so: $(LIBRARY_OBJS)
 +libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
  	if test $(INSTSONAME) != $(LDLIBRARY); then \
- 		$(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+ 		$(LDSHARED) $(PY_LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
  		$(LN) -f $(INSTSONAME) $@; \
-@@ -793,7 +799,7 @@ altbininstall: $(BUILDPYTHON)
+@@ -817,7 +823,7 @@ altbininstall: $(BUILDPYTHON)
  		else	true; \
  		fi; \
  	done
@@ -136,7 +136,7 @@ diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in
  	if test -f $(LDLIBRARY); then \
  		if test -n "$(DLLLIBRARY)" ; then \
  			$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
-@@ -807,15 +813,15 @@ altbininstall: $(BUILDPYTHON)
+@@ -831,15 +837,15 @@ altbininstall: $(BUILDPYTHON)
  	fi
  
  bininstall: altbininstall
@@ -159,7 +159,20 @@ diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in
  
  # Install the manual page
  maninstall:
-@@ -960,7 +966,7 @@ inclinstall:
+@@ -965,10 +971,10 @@ $(srcdir)/Lib/$(PLATDIR):
+ 	export EXE; EXE="$(BUILDEXE)"; \
+ 	cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
+ 
+-python-config: $(srcdir)/Misc/python-config.in
++python$(DEBUG_SUFFIX)-config: $(srcdir)/Misc/python-config.in
+ 	# Substitution happens here, as the completely-expanded BINDIR
+ 	# is not available in configure
+-	sed -e "s, at EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
++	sed -e "s, at EXENAME@,$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)," < $(srcdir)/Misc/python-config.in >python$(DEBUG_SUFFIX)-config
+ 
+ # Install the include files
+ INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
+@@ -990,12 +996,12 @@ inclinstall:
  
  # Install the library and miscellaneous stuff needed for extending/embedding
  # This goes into $(exec_prefix)
@@ -168,7 +181,13 @@ diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in
  
  # pkgconfig directory
  LIBPC=		$(LIBDIR)/pkgconfig
-@@ -981,14 +987,14 @@ libainstall:	all
+ 
+-libainstall:	all python-config
++libainstall:	all python$(DEBUG_SUFFIX)-config
+ 	@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
+ 	do \
+ 		if test ! -d $(DESTDIR)$$i; then \
+@@ -1011,11 +1017,11 @@ libainstall:	all python-config
  	$(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
  	$(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
  	$(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
@@ -176,32 +195,28 @@ diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in
 +	$(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)$(DEBUG_SUFFIX).pc
  	$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
  	$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
- 	# Substitution happens here, as the completely-expanded BINDIR
- 	# is not available in configure
--	sed -e "s, at EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
 -	$(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
 -	rm python-config
-+	sed -e "s, at EXENAME@,$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)," < $(srcdir)/Misc/python-config.in >python$(DEBUG_SUFFIX)-config
 +	$(INSTALL_SCRIPT) python$(DEBUG_SUFFIX)-config $(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)-config
 +	rm python$(DEBUG_SUFFIX)-config
  	@if [ -s Modules/python.exp -a \
  		"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
  		echo; echo "Installing support files for building shared extension modules on AIX:"; \
-diff -up Python-3.1.2/Misc/python-config.in.debug-build Python-3.1.2/Misc/python-config.in
---- Python-3.1.2/Misc/python-config.in.debug-build	2007-09-01 03:27:37.000000000 -0400
-+++ Python-3.1.2/Misc/python-config.in	2010-05-20 22:48:14.582902254 -0400
-@@ -44,7 +44,7 @@ elif opt in ('--includes', '--cflags'):
+diff -up Python-3.2a1/Misc/python-config.in.debug-build Python-3.2a1/Misc/python-config.in
+--- Python-3.2a1/Misc/python-config.in.debug-build	2010-04-06 17:30:42.000000000 -0400
++++ Python-3.2a1/Misc/python-config.in	2010-08-20 16:06:24.635124366 -0400
+@@ -45,7 +45,7 @@ for opt in opt_flags:
  
- elif opt in ('--libs', '--ldflags'):
-     libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
--    libs.append('-lpython'+pyver)
-+    libs.append('-lpython' + pyver + (sys.pydebug and "_d" or ""))
-     # add the prefix/lib/pythonX.Y/config dir, but only if there is no
-     # shared library in prefix/lib/.
-     if opt == '--ldflags' and not getvar('Py_ENABLE_SHARED'):
-diff -up Python-3.1.2/Modules/makesetup.debug-build Python-3.1.2/Modules/makesetup
---- Python-3.1.2/Modules/makesetup.debug-build	2008-06-11 01:26:20.000000000 -0400
-+++ Python-3.1.2/Modules/makesetup	2010-05-20 22:48:14.582902254 -0400
+     elif opt in ('--libs', '--ldflags'):
+         libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
+-        libs.append('-lpython'+pyver)
++        libs.append('-lpython' + pyver + (sys.pydebug and "_d" or ""))
+         # add the prefix/lib/pythonX.Y/config dir, but only if there is no
+         # shared library in prefix/lib/.
+         if opt == '--ldflags':
+diff -up Python-3.2a1/Modules/makesetup.debug-build Python-3.2a1/Modules/makesetup
+--- Python-3.2a1/Modules/makesetup.debug-build	2010-07-09 12:30:58.000000000 -0400
++++ Python-3.2a1/Modules/makesetup	2010-08-20 16:06:24.635124366 -0400
 @@ -233,7 +233,7 @@ sed -e 's/[ 	]*#.*//' -e '/^[ 	]*$/d' |
  			*$mod.o*)	base=$mod;;
  			*)		base=${mod}module;;
@@ -211,19 +226,19 @@ diff -up Python-3.1.2/Modules/makesetup.debug-build Python-3.1.2/Modules/makeset
  			case $doconfig in
  			no)	SHAREDMODS="$SHAREDMODS $file";;
  			esac
-diff -up Python-3.1.2/Python/dynload_shlib.c.debug-build Python-3.1.2/Python/dynload_shlib.c
---- Python-3.1.2/Python/dynload_shlib.c.debug-build	2008-06-11 01:26:20.000000000 -0400
-+++ Python-3.1.2/Python/dynload_shlib.c	2010-05-20 22:48:14.582902254 -0400
+diff -up Python-3.2a1/Python/dynload_shlib.c.debug-build Python-3.2a1/Python/dynload_shlib.c
+--- Python-3.2a1/Python/dynload_shlib.c.debug-build	2010-05-09 11:52:27.000000000 -0400
++++ Python-3.2a1/Python/dynload_shlib.c	2010-08-20 16:06:24.635124366 -0400
 @@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoad
-         {"module.exe", "rb", C_EXTENSION},
-         {"MODULE.EXE", "rb", C_EXTENSION},
+     {"module.exe", "rb", C_EXTENSION},
+     {"MODULE.EXE", "rb", C_EXTENSION},
  #else
 +#ifdef Py_DEBUG
-+	{"_d.so", "rb", C_EXTENSION},
-+	{"module_d.so", "rb", C_EXTENSION},
++    {"_d.so", "rb", C_EXTENSION},
++    {"module_d.so", "rb", C_EXTENSION},
 +#else
- 	{".so", "rb", C_EXTENSION},
- 	{"module.so", "rb", C_EXTENSION},
+     {".so", "rb", C_EXTENSION},
+     {"module.so", "rb", C_EXTENSION},
 -#endif
 -#endif
 -#endif
@@ -231,28 +246,28 @@ diff -up Python-3.1.2/Python/dynload_shlib.c.debug-build Python-3.1.2/Python/dyn
 +#endif /* __VMS */
 +#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
 +#endif /* __CYGWIN__ */
- 	{0, 0}
+     {0, 0}
  };
  
-diff -up Python-3.1.2/Python/sysmodule.c.debug-build Python-3.1.2/Python/sysmodule.c
---- Python-3.1.2/Python/sysmodule.c.debug-build	2010-03-03 06:55:53.000000000 -0500
-+++ Python-3.1.2/Python/sysmodule.c	2010-05-20 22:48:14.582902254 -0400
-@@ -1429,6 +1429,12 @@ _PySys_Init(void)
- 	FlagsType.tp_init = NULL;
- 	FlagsType.tp_new = NULL;
+diff -up Python-3.2a1/Python/sysmodule.c.debug-build Python-3.2a1/Python/sysmodule.c
+--- Python-3.2a1/Python/sysmodule.c.debug-build	2010-07-06 06:53:30.000000000 -0400
++++ Python-3.2a1/Python/sysmodule.c	2010-08-20 16:06:24.636251716 -0400
+@@ -1598,6 +1598,12 @@ _PySys_Init(void)
+     WindowsVersionType.tp_new = NULL;
+ #endif
  
 +#ifdef Py_DEBUG
-+	PyDict_SetItemString(sysdict, "pydebug", Py_True);
++    PyDict_SetItemString(sysdict, "pydebug", Py_True);
 +#else
-+	PyDict_SetItemString(sysdict, "pydebug", Py_False);
++    PyDict_SetItemString(sysdict, "pydebug", Py_False);
 +#endif
 +
- 	/* float repr style: 0.03 (short) vs 0.029999999999999999 (legacy) */
+     /* float repr style: 0.03 (short) vs 0.029999999999999999 (legacy) */
  #ifndef PY_NO_SHORT_FLOAT_REPR
- 	SET_SYS_FROM_STRING("float_repr_style",
-diff -up Python-3.1.2/runtests.sh.debug-build Python-3.1.2/runtests.sh
---- Python-3.1.2/runtests.sh.debug-build	2010-05-22 00:42:41.950889054 -0400
-+++ Python-3.1.2/runtests.sh	2010-05-22 00:54:47.503851503 -0400
+     SET_SYS_FROM_STRING("float_repr_style",
+diff -up Python-3.2a1/runtests.sh.debug-build Python-3.2a1/runtests.sh
+--- Python-3.2a1/runtests.sh.debug-build	2008-10-17 08:05:40.000000000 -0400
++++ Python-3.2a1/runtests.sh	2010-08-20 16:06:24.637251276 -0400
 @@ -16,11 +16,14 @@ Flags (arguments starting with '-') are 
  regrtest.py, except for -x, which is processed here."
  
diff --git a/python-3.1-fix-parallel-make.patch b/python-3.2a1-fix-parallel-make.patch
similarity index 74%
rename from python-3.1-fix-parallel-make.patch
rename to python-3.2a1-fix-parallel-make.patch
index 3c75b10..b6189b5 100644
--- a/python-3.1-fix-parallel-make.patch
+++ b/python-3.2a1-fix-parallel-make.patch
@@ -1,8 +1,7 @@
-Index: Python-3.1.2/Makefile.pre.in
-===================================================================
---- Python-3.1.2.orig/Makefile.pre.in
-+++ Python-3.1.2/Makefile.pre.in
-@@ -215,6 +215,7 @@ IO_OBJS=	\
+diff -up Python-3.2a1/Makefile.pre.in.parallel-grammar Python-3.2a1/Makefile.pre.in
+--- Python-3.2a1/Makefile.pre.in.parallel-grammar	2010-08-20 15:09:13.613527156 -0400
++++ Python-3.2a1/Makefile.pre.in	2010-08-20 15:10:31.428135355 -0400
+@@ -222,6 +222,7 @@ IO_OBJS=	\
  
  ##########################################################################
  # Grammar
@@ -10,7 +9,7 @@ Index: Python-3.1.2/Makefile.pre.in
  GRAMMAR_H=	$(srcdir)/Include/graminit.h
  GRAMMAR_C=	$(srcdir)/Python/graminit.c
  GRAMMAR_INPUT=	$(srcdir)/Grammar/Grammar
-@@ -535,9 +536,24 @@ Modules/python.o: $(srcdir)/Modules/pyth
+@@ -557,9 +558,24 @@ Modules/python.o: $(srcdir)/Modules/pyth
  
  $(IO_OBJS): $(IO_H)
  
@@ -35,4 +34,4 @@ Index: Python-3.1.2/Makefile.pre.in
 +		touch $(GRAMMAR_STAMP)
  
  $(PGEN):	$(PGENOBJS)
- 		$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
+ 		$(CC) $(OPT) $(PY_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
diff --git a/python-3.1.1-lib64.patch b/python-3.2a1-lib64.patch
similarity index 57%
rename from python-3.1.1-lib64.patch
rename to python-3.2a1-lib64.patch
index 3053a92..d778b5a 100644
--- a/python-3.1.1-lib64.patch
+++ b/python-3.2a1-lib64.patch
@@ -1,7 +1,7 @@
-diff -ur Python-3.1.1.orig/Lib/distutils/command/install.py Python-3.1.1/Lib/distutils/command/install.py
---- Python-3.1.1.orig/Lib/distutils/command/install.py	2009-09-24 15:28:57.000000000 -0600
-+++ Python-3.1.1/Lib/distutils/command/install.py	2009-09-24 15:34:18.000000000 -0600
-@@ -47,14 +47,14 @@
+diff -up Python-3.2a1/Lib/distutils/command/install.py.lib64 Python-3.2a1/Lib/distutils/command/install.py
+--- Python-3.2a1/Lib/distutils/command/install.py.lib64	2010-07-22 08:50:05.000000000 -0400
++++ Python-3.2a1/Lib/distutils/command/install.py	2010-08-02 18:33:15.667001759 -0400
+@@ -47,14 +47,14 @@ else:
  INSTALL_SCHEMES = {
      'unix_prefix': {
          'purelib': '$base/lib/python$py_version_short/site-packages',
@@ -18,10 +18,10 @@ diff -ur Python-3.1.1.orig/Lib/distutils/command/install.py Python-3.1.1/Lib/dis
          'headers': '$base/include/python/$dist_name',
          'scripts': '$base/bin',
          'data'   : '$base',
-diff -ur Python-3.1.1.orig/Lib/distutils/sysconfig.py Python-3.1.1/Lib/distutils/sysconfig.py
---- Python-3.1.1.orig/Lib/distutils/sysconfig.py	2009-09-24 15:29:00.000000000 -0600
-+++ Python-3.1.1/Lib/distutils/sysconfig.py	2009-09-24 15:34:18.000000000 -0600
-@@ -117,8 +117,12 @@
+diff -up Python-3.2a1/Lib/distutils/sysconfig.py.lib64 Python-3.2a1/Lib/distutils/sysconfig.py
+--- Python-3.2a1/Lib/distutils/sysconfig.py.lib64	2010-07-23 05:43:17.000000000 -0400
++++ Python-3.2a1/Lib/distutils/sysconfig.py	2010-08-02 18:33:15.669000547 -0400
+@@ -117,8 +117,12 @@ def get_python_lib(plat_specific=0, stan
          prefix = plat_specific and EXEC_PREFIX or PREFIX
  
      if os.name == "posix":
@@ -35,35 +35,30 @@ diff -ur Python-3.1.1.orig/Lib/distutils/sysconfig.py Python-3.1.1/Lib/distutils
          if standard_lib:
              return libpython
          else:
-diff -ur Python-3.1.1.orig/Lib/site.py Python-3.1.1/Lib/site.py
---- Python-3.1.1.orig/Lib/site.py	2009-09-24 15:28:56.000000000 -0600
-+++ Python-3.1.1/Lib/site.py	2009-09-24 15:34:18.000000000 -0600
-@@ -258,12 +258,16 @@
+diff -up Python-3.2a1/Lib/site.py.lib64 Python-3.2a1/Lib/site.py
+--- Python-3.2a1/Lib/site.py.lib64	2010-06-27 17:45:24.000000000 -0400
++++ Python-3.2a1/Lib/site.py	2010-08-02 18:34:30.584001242 -0400
+@@ -283,12 +283,16 @@ def getsitepackages():
          if sys.platform in ('os2emx', 'riscos'):
-             sitedirs.append(os.path.join(prefix, "Lib", "site-packages"))
+             sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
          elif os.sep == '/':
-+            sitedirs.append(os.path.join(prefix, "lib64",
++            sitepackages.append(os.path.join(prefix, "lib64",
 +                                        "python" + sys.version[:3],
 +                                        "site-packages"))
-             sitedirs.append(os.path.join(prefix, "lib",
+             sitepackages.append(os.path.join(prefix, "lib",
                                          "python" + sys.version[:3],
                                          "site-packages"))
-             sitedirs.append(os.path.join(prefix, "lib", "site-python"))
+             sitepackages.append(os.path.join(prefix, "lib", "site-python"))
          else:
-             sitedirs.append(prefix)
-+            sitedirs.append(os.path.join(prefix, "lib64", "site-packages"))
-             sitedirs.append(os.path.join(prefix, "lib", "site-packages"))
- 
+             sitepackages.append(prefix)
++            sitepackages.append(os.path.join(prefix, "lib64", "site-packages"))
+             sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
          if sys.platform == "darwin":
-diff -ur Python-3.1.1.orig/Makefile.pre.in Python-3.1.1/Makefile.pre.in
---- Python-3.1.1.orig/Makefile.pre.in	2009-09-24 15:26:58.000000000 -0600
-+++ Python-3.1.1/Makefile.pre.in	2009-09-24 15:34:18.000000000 -0600
-@@ -90,11 +90,11 @@
- 
- # Expanded directories
- BINDIR=		$(exec_prefix)/bin
--LIBDIR=		$(exec_prefix)/lib
-+LIBDIR=		$(exec_prefix)/lib64
+             # for framework builds *only* we add the standard Apple
+diff -up Python-3.2a1/Makefile.pre.in.lib64 Python-3.2a1/Makefile.pre.in
+--- Python-3.2a1/Makefile.pre.in.lib64	2010-08-02 18:33:15.000000000 -0400
++++ Python-3.2a1/Makefile.pre.in	2010-08-02 18:35:07.147000664 -0400
+@@ -100,7 +100,7 @@ LIBDIR=		@libdir@
  MANDIR=		@mandir@
  INCLUDEDIR=	@includedir@
  CONFINCLUDEDIR=	$(exec_prefix)/include
@@ -72,9 +67,9 @@ diff -ur Python-3.1.1.orig/Makefile.pre.in Python-3.1.1/Makefile.pre.in
  
  # Detailed destination directories
  BINLIBDEST=	$(LIBDIR)/python$(VERSION)
-diff -ur Python-3.1.1.orig/Modules/getpath.c Python-3.1.1/Modules/getpath.c
---- Python-3.1.1.orig/Modules/getpath.c	2009-09-24 15:27:15.000000000 -0600
-+++ Python-3.1.1/Modules/getpath.c	2009-09-24 15:36:58.000000000 -0600
+diff -up Python-3.2a1/Modules/getpath.c.lib64 Python-3.2a1/Modules/getpath.c
+--- Python-3.2a1/Modules/getpath.c.lib64	2010-07-23 12:05:35.000000000 -0400
++++ Python-3.2a1/Modules/getpath.c	2010-08-02 18:35:50.857000717 -0400
 @@ -117,8 +117,8 @@
  #endif
  
@@ -86,25 +81,25 @@ diff -ur Python-3.1.1.orig/Modules/getpath.c Python-3.1.1/Modules/getpath.c
  #endif
  
  #ifndef LANDMARK
-@@ -129,7 +129,7 @@
+@@ -129,7 +129,7 @@ static wchar_t prefix[MAXPATHLEN+1];
  static wchar_t exec_prefix[MAXPATHLEN+1];
  static wchar_t progpath[MAXPATHLEN+1];
  static wchar_t *module_search_path = NULL;
--static wchar_t lib_python[] = L"lib/python" VERSION;
-+static wchar_t lib_python[] = L"lib64/python" VERSION;
+-static wchar_t *lib_python = L"lib/python" VERSION;
++static wchar_t *lib_python = L"lib64/python" VERSION;
  
  /* In principle, this should use HAVE__WSTAT, and _wstat
     should be detected by autoconf. However, no current
-@@ -603,7 +603,7 @@
+@@ -603,7 +603,7 @@ calculate_path(void)
      }
      else
          wcsncpy(zip_path, L"" PREFIX, MAXPATHLEN);
 -    joinpath(zip_path, L"lib/python00.zip");
 +    joinpath(zip_path, L"lib64/python00.zip");
-     bufsz = wcslen(zip_path);	/* Replace "00" with version */
+     bufsz = wcslen(zip_path);   /* Replace "00" with version */
      zip_path[bufsz - 6] = VERSION[0];
      zip_path[bufsz - 5] = VERSION[2];
-@@ -613,7 +613,7 @@
+@@ -613,7 +613,7 @@ calculate_path(void)
              fprintf(stderr,
                  "Could not find platform dependent libraries <exec_prefix>\n");
          wcsncpy(exec_prefix, L"" EXEC_PREFIX, MAXPATHLEN);
@@ -113,22 +108,9 @@ diff -ur Python-3.1.1.orig/Modules/getpath.c Python-3.1.1/Modules/getpath.c
      }
      /* If we found EXEC_PREFIX do *not* reduce it!  (Yet.) */
  
-diff -ur Python-3.1.1.orig/Modules/Setup.dist Python-3.1.1/Modules/Setup.dist
---- Python-3.1.1.orig/Modules/Setup.dist	2009-09-24 15:27:30.000000000 -0600
-+++ Python-3.1.1/Modules/Setup.dist	2009-09-24 15:45:49.000000000 -0600
-@@ -351,7 +351,7 @@
- # Andrew Kuchling's zlib module.
- # This require zlib 1.1.3 (or later).
- # See http://www.gzip.org/zlib/
--zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
- 
- # Interface to the Expat XML parser
- #
-diff -ur Python-3.1.1.orig/setup.py Python-3.1.1/setup.py
---- Python-3.1.1.orig/setup.py	2009-09-24 15:26:58.000000000 -0600
-+++ Python-3.1.1/setup.py	2009-09-24 15:34:18.000000000 -0600
-@@ -295,7 +295,7 @@
+--- Python-3.2a1/setup.py.lib64	2010-07-23 15:25:47.000000000 -0400
++++ Python-3.2a1/setup.py	2010-08-02 18:36:51.521000448 -0400
+@@ -343,7 +343,7 @@ class PyBuildExt(build_ext):
  
      def detect_modules(self):
          # Ensure that /usr/local is always used
@@ -137,13 +119,13 @@ diff -ur Python-3.1.1.orig/setup.py Python-3.1.1/setup.py
          add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
  
          # Add paths specified in the environment variables LDFLAGS and
-@@ -522,11 +522,11 @@
-             elif self.compiler.find_library_file(lib_dirs, 'curses'):
-                 readline_libs.append('curses')
+@@ -587,11 +587,11 @@ class PyBuildExt(build_ext):
+             elif curses_library:
+                 readline_libs.append(curses_library)
              elif self.compiler.find_library_file(lib_dirs +
--                                               ['/usr/lib/termcap'],
-+                                               ['/usr/lib64/termcap'],
-                                                'termcap'):
+-                                                     ['/usr/lib/termcap'],
++                                                     ['/usr/lib64/termcap'],
+                                                      'termcap'):
                  readline_libs.append('termcap')
              exts.append( Extension('readline', ['readline.c'],
 -                                   library_dirs=['/usr/lib/termcap'],
@@ -151,7 +133,7 @@ diff -ur Python-3.1.1.orig/setup.py Python-3.1.1/setup.py
                                     extra_link_args=readline_extra_link_args,
                                     libraries=readline_libs) )
          else:
-@@ -563,8 +563,8 @@
+@@ -628,8 +628,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-3.1.1-no-static-lib.patch b/python-3.2a1-no-static-lib.patch
similarity index 66%
rename from python-3.1.1-no-static-lib.patch
rename to python-3.2a1-no-static-lib.patch
index 325636e..6dd8147 100644
--- a/python-3.1.1-no-static-lib.patch
+++ b/python-3.2a1-no-static-lib.patch
@@ -1,17 +1,17 @@
-diff -up Python-3.1.1/Makefile.pre.in.no-static-lib Python-3.1.1/Makefile.pre.in
---- Python-3.1.1/Makefile.pre.in.no-static-lib	2010-01-17 15:42:11.945858717 -0500
-+++ Python-3.1.1/Makefile.pre.in	2010-01-17 16:44:32.788859363 -0500
-@@ -405,7 +405,7 @@ coverage:
+diff -up Python-3.2a1/Makefile.pre.in.no-static-lib Python-3.2a1/Makefile.pre.in
+--- Python-3.2a1/Makefile.pre.in.no-static-lib	2010-07-17 16:39:23.000000000 -0400
++++ Python-3.2a1/Makefile.pre.in	2010-08-02 16:02:28.378010008 -0400
+@@ -416,7 +416,7 @@ coverage:
  
  
  # Build the interpreter
 -$(BUILDPYTHON):	Modules/python.o $(LIBRARY) $(LDLIBRARY)
 +$(BUILDPYTHON):	Modules/python.o $(LDLIBRARY)
- 		$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
+ 		$(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ \
  			Modules/python.o \
  			$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
-@@ -421,18 +421,6 @@ sharedmods: $(BUILDPYTHON)
- 	*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
+@@ -432,18 +432,6 @@ sharedmods: $(BUILDPYTHON)
+ 	*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(PY_LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
  	esac
  
 -# Build static library
@@ -28,8 +28,8 @@ diff -up Python-3.1.1/Makefile.pre.in.no-static-lib Python-3.1.1/Makefile.pre.in
 -
  libpython$(VERSION).so: $(LIBRARY_OBJS)
  	if test $(INSTSONAME) != $(LDLIBRARY); then \
- 		$(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
-@@ -973,18 +961,6 @@ libainstall:	all
+ 		$(LDSHARED) $(PY_LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+@@ -1003,18 +991,6 @@ libainstall:	all python-config
  		else	true; \
  		fi; \
  	done
diff --git a/python-3.1.1-remove-mimeaudio-tests.patch b/python-3.2a1-remove-mimeaudio-tests.patch
similarity index 82%
rename from python-3.1.1-remove-mimeaudio-tests.patch
rename to python-3.2a1-remove-mimeaudio-tests.patch
index 487ad3e..ff67690 100644
--- a/python-3.1.1-remove-mimeaudio-tests.patch
+++ b/python-3.2a1-remove-mimeaudio-tests.patch
@@ -1,6 +1,7 @@
---- Python-3.1.1/Lib/email/test/test_email.py.remove_mimeaudio_tests	2009-10-27 14:31:09.483539561 -0400
-+++ Python-3.1.1/Lib/email/test/test_email.py	2009-10-27 14:31:27.663548053 -0400
-@@ -926,52 +926,6 @@ Blah blah blah
+diff -up Python-3.2a1/Lib/email/test/test_email.py.remove-mimeaudio-tests Python-3.2a1/Lib/email/test/test_email.py
+--- Python-3.2a1/Lib/email/test/test_email.py.remove-mimeaudio-tests	2010-08-02 15:52:12.397002172 -0400
++++ Python-3.2a1/Lib/email/test/test_email.py	2010-08-02 15:52:38.132999850 -0400
+@@ -952,53 +952,6 @@ Blah blah blah
  
  
  
@@ -22,7 +23,8 @@
 -
 -    def test_encoding(self):
 -        payload = self._au.get_payload()
--        self.assertEqual(base64.decodebytes(payload), self._audiodata)
+-        self.assertEqual(base64.decodebytes(bytes(payload, 'ascii')),
+-                self._audiodata)
 -
 -    def test_checkSetMinor(self):
 -        au = MIMEAudio(self._audiodata, 'fish')
diff --git a/python-3.2a1-statvfs-f_flag-constants.patch b/python-3.2a1-statvfs-f_flag-constants.patch
new file mode 100644
index 0000000..b666c1b
--- /dev/null
+++ b/python-3.2a1-statvfs-f_flag-constants.patch
@@ -0,0 +1,47 @@
+diff -up Python-3.2a1/Modules/posixmodule.c.statvfs-f-flag-constants Python-3.2a1/Modules/posixmodule.c
+--- Python-3.2a1/Modules/posixmodule.c.statvfs-f-flag-constants	2010-07-23 09:53:51.000000000 -0400
++++ Python-3.2a1/Modules/posixmodule.c	2010-08-02 16:39:38.756000423 -0400
+@@ -8173,6 +8173,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-3.2a1-systemtap.patch b/python-3.2a1-systemtap.patch
new file mode 100644
index 0000000..6770b58
--- /dev/null
+++ b/python-3.2a1-systemtap.patch
@@ -0,0 +1,222 @@
+diff -up Python-3.2a1/configure.in.systemtap Python-3.2a1/configure.in
+--- Python-3.2a1/configure.in.systemtap	2010-07-19 03:31:40.000000000 -0400
++++ Python-3.2a1/configure.in	2010-08-02 16:19:43.809000621 -0400
+@@ -1987,6 +1987,7 @@ AC_ARG_WITH(system_expat,
+ AC_MSG_RESULT($with_system_expat)
+ 
+ # Check for use of the system libffi library
++
+ AC_MSG_CHECKING(for --with-system-ffi)
+ AC_ARG_WITH(system_ffi,
+             AS_HELP_STRING([--with-system-ffi], [build _ctypes module using an installed ffi library]))
+@@ -2500,6 +2501,38 @@ if test "$with_valgrind" != no; then
+     OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
+ fi
+ 
++# Check for dtrace support
++AC_MSG_CHECKING(for --with-dtrace)
++AC_ARG_WITH(dtrace,
++            AC_HELP_STRING(--with(out)-dtrace, disable/enable dtrace support))
++
++if test ! -z "$with_dtrace"
++then
++    if dtrace -G -o /dev/null -s $srcdir/Include/pydtrace.d 2>/dev/null
++    then
++	AC_DEFINE(WITH_DTRACE, 1, 
++	 [Define if you want to compile in Dtrace support])
++	with_dtrace="Sun"
++	DTRACEOBJS="Python/dtrace.o"
++	DTRADEHDRS=""
++    elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d
++   then
++	AC_DEFINE(WITH_DTRACE, 1, 
++	 [Define if you want to compile in Dtrace support])
++	with_dtrace="Apple"
++	DTRACEOBJS=""
++	DTRADEHDRS="pydtrace.h"
++    else
++	with_dtrace="no"
++    fi
++else
++    with_dtrace="no"
++fi
++
++AC_MSG_RESULT($with_dtrace)
++AC_SUBST(DTRACEOBJS)
++AC_SUBST(DTRACEHDRS)
++
+ # Check for --with-wctype-functions
+ AC_MSG_CHECKING(for --with-wctype-functions)
+ AC_ARG_WITH(wctype-functions, 
+diff -up Python-3.2a1/Include/pydtrace.d.systemtap Python-3.2a1/Include/pydtrace.d
+--- Python-3.2a1/Include/pydtrace.d.systemtap	2010-08-02 16:17:04.249000540 -0400
++++ Python-3.2a1/Include/pydtrace.d	2010-08-02 16:17:04.249000540 -0400
+@@ -0,0 +1,10 @@
++provider python {
++	probe function__entry(const char *, const char *, int);
++	probe function__return(const char *, const char *, int);
++};
++
++#pragma D attributes Evolving/Evolving/Common provider python provider
++#pragma D attributes Private/Private/Common provider python module
++#pragma D attributes Private/Private/Common provider python function
++#pragma D attributes Evolving/Evolving/Common provider python name
++#pragma D attributes Evolving/Evolving/Common provider python args
+diff -up Python-3.2a1/Makefile.pre.in.systemtap Python-3.2a1/Makefile.pre.in
+--- Python-3.2a1/Makefile.pre.in.systemtap	2010-08-02 16:17:04.243000614 -0400
++++ Python-3.2a1/Makefile.pre.in	2010-08-02 16:20:41.617000527 -0400
+@@ -324,6 +324,7 @@ PYTHON_OBJS=	\
+ 		Python/dtoa.o \
+ 		Python/formatter_unicode.o \
+ 		Python/$(DYNLOADFILE) \
++		@DTRACEOBJS@ \
+ 		$(LIBOBJS) \
+ 		$(MACHDEP_OBJS) \
+ 		$(THREADOBJ)
+@@ -615,6 +616,18 @@ Python/formatter_unicode.o: $(srcdir)/Py
+ 				$(srcdir)/Objects/stringlib/formatter.h
+ 
+ 
++# Only needed with --with-dtrace
++buildinclude:
++	mkdir -p Include
++
++Include/pydtrace.h: buildinclude $(srcdir)/Include/pydtrace.d
++	dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Include/pydtrace.d
++
++Python/ceval.o: Include/pydtrace.h
++
++Python/dtrace.o: buildinclude $(srcdir)/Include/pydtrace.d Python/ceval.o
++	dtrace -o $@ $(DFLAGS) -C -G -s $(srcdir)/Include/pydtrace.d Python/ceval.o
++
+ ############################################################################
+ # Header files
+ 
+@@ -1248,7 +1261,7 @@ Python/thread.o: @THREADHEADERS@
+ .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
+ .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
+ .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean 
+-.PHONY: smelly funny patchcheck
++.PHONY: smelly funny patchcheck buildinclude
+ .PHONY: gdbhooks
+ 
+ # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+diff -up Python-3.2a1/pyconfig.h.in.systemtap Python-3.2a1/pyconfig.h.in
+--- Python-3.2a1/pyconfig.h.in.systemtap	2010-08-02 16:18:33.696001964 -0400
++++ Python-3.2a1/pyconfig.h.in	2010-08-02 16:21:48.566001832 -0400
+@@ -1078,6 +1078,9 @@
+ /* Define if you want documentation strings in extension modules */
+ #undef WITH_DOC_STRINGS
+ 
++/* Define if you want to compile in Dtrace support */
++#undef WITH_DTRACE
++
+ /* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic
+    linker (dyld) instead of the old-style (NextStep) dynamic linker (rld).
+    Dyld is necessary to support frameworks. */
+diff -up Python-3.2a1/Python/ceval.c.systemtap Python-3.2a1/Python/ceval.c
+--- Python-3.2a1/Python/ceval.c.systemtap	2010-07-20 18:39:34.000000000 -0400
++++ Python-3.2a1/Python/ceval.c	2010-08-02 16:23:58.703001000 -0400
+@@ -19,6 +19,10 @@
+ 
+ #include <ctype.h>
+ 
++#ifdef WITH_DTRACE
++#include "pydtrace.h"
++#endif
++
+ #ifndef WITH_TSC
+ 
+ #define READ_TIMESTAMP(var)
+@@ -752,6 +756,70 @@ PyEval_EvalCode(PyCodeObject *co, PyObje
+ }
+ 
+ 
++#ifdef WITH_DTRACE
++struct frame_marker_info
++{
++	char *filename;
++	char *name;
++	int lineno;
++
++	PyObject *utf8_filename;
++	PyObject *utf8_name;
++};
++
++static void
++get_frame_marker_info(PyFrameObject *f, struct frame_marker_info *fmi)
++{
++	fmi->utf8_filename = PyUnicode_AsUTF8String(f->f_code->co_filename);
++	if (fmi->utf8_filename) {
++		fmi->filename = PyBytes_AsString(fmi->utf8_filename);
++	} else {
++		fmi->filename = NULL;
++		/* FIXME: clear the exception? */
++	}
++
++	fmi->utf8_name = PyUnicode_AsUTF8String(f->f_code->co_name);
++	if (fmi->utf8_name) {
++		fmi->name = PyBytes_AsString(fmi->utf8_name);
++	} else {
++		fmi->name = NULL;
++		/* FIXME: clear the exception? */
++	}
++
++	fmi->lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
++}
++
++static void
++release_frame_marker_info(struct frame_marker_info *fmi)
++{
++	Py_XDECREF(fmi->utf8_filename);
++	Py_XDECREF(fmi->utf8_name);
++}
++
++static void
++dtrace_entry(PyFrameObject *f)
++{
++	struct frame_marker_info fmi;
++	get_frame_marker_info(f, &fmi);
++	PYTHON_FUNCTION_ENTRY(fmi.filename, fmi.name, fmi.lineno);
++	release_frame_marker_info(&fmi);
++}
++
++static void
++dtrace_return(PyFrameObject *f)
++{
++	struct frame_marker_info fmi;
++	get_frame_marker_info(f, &fmi);
++	PYTHON_FUNCTION_RETURN(fmi.filename, fmi.name, fmi.lineno);
++	release_frame_marker_info(&fmi);
++}
++#else
++#define	PYTHON_FUNCTION_ENTRY_ENABLED() 0
++#define	PYTHON_FUNCTION_RETURN_ENABLED() 0
++#define	dtrace_entry(f)
++#define	dtrace_return(f)
++#endif
++ 
+ /* Interpreter main loop */
+ 
+ PyObject *
+@@ -1156,6 +1224,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
+         }
+     }
+ 
++    if (PYTHON_FUNCTION_ENTRY_ENABLED()) {
++        dtrace_entry(f);
++    }
++
+     co = f->f_code;
+     names = co->co_names;
+     consts = co->co_consts;
+@@ -3046,6 +3118,9 @@ fast_yield:
+ 
+     /* pop frame */
+ exit_eval_frame:
++    if (PYTHON_FUNCTION_RETURN_ENABLED()) {
++        dtrace_return(f);
++    }
+     Py_LeaveRecursiveCall();
+     tstate->frame = f->f_back;
+ 
diff --git a/python3.spec b/python3.spec
index 3c8f9ef..15a8549 100644
--- a/python3.spec
+++ b/python3.spec
@@ -1,7 +1,20 @@
-%global pybasever 3.1
+%global pybasever 3.2
+%global alphatag  a1
+
 %global pylibdir %{_libdir}/python%{pybasever}
 %global dynload_dir %{pylibdir}/lib-dynload
 
+# All bytecode files are now in a __pycache__ subdirectory, with a name
+# reflecting the version of the bytecode (to permit sharing of python libraries
+# between different runtimes)
+# See http://www.python.org/dev/peps/pep-3147/
+# For example,
+#   foo/bar.py
+# now has bytecode at:
+#   foo/__pycache__/bar.cpython-32.pyc
+#   foo/__pycache__/bar.cpython-32.pyo
+%global bytecode_suffixes .cpython-32.py?
+
 # Python's configure script defines SOVERSION, and this is used in the Makefile
 # to determine INSTSONAME, the name of the libpython DSO:
 #   LDLIBRARY='libpython$(VERSION).so'
@@ -42,13 +55,43 @@
 # invocation of brp-python-hardlink (since this should still work for python3
 # pyc/pyo files)
 
+
+# We need to get a newer configure generated out of configure.in for the following
+# patches:
+#   patch 55 (systemtap)
+#   patch 103 (debug build)
+#   patch 104 (more config flags)
+#
+# For patch 55 (systemtap), we need to get a new header for configure to use
+#
+# configure.in requires autoconf-2.65, but the version in Fedora is currently
+# autoconf-2.66
+#
+# For now, we'll generate a patch to the generated configure script and
+# pyconfig.h.in on a machine that has a local copy of autoconf 2.65
+#
+# Instructions on obtaining such a copy can be seen at
+#   http://bugs.python.org/issue7997
+#
+# To make it easy to regenerate the patch, this specfile can be run in two
+# ways:
+# (i) regenerate_autotooling_patch  0 : the normal approach: prep the
+# source tree using a pre-generated patch to the "configure" script, and do a
+# full build
+# (ii) regenerate_autotooling_patch 1 : intended to be run on a developer's
+# workstation: prep the source tree without patching configure, then rerun a
+# local copy of autoconf-2.65, regenerate the patch, then exit, without doing
+# the rest of the build
+%global regenerate_autotooling_patch 0
+
+
 Summary: Version 3 of the Python programming language aka Python 3000
 Name: python3
-Version: %{pybasever}.2
-Release: 13%{?dist}
+Version: %{pybasever}
+Release: 0.0.%{alphatag}%{?dist}
 License: Python
 Group: Development/Languages
-Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
+Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2
 
 # Avoid having various bogus auto-generated Provides lines for the various
 # python c modules' SONAMEs:
@@ -100,40 +143,33 @@ Source6: systemtap-example.stp
 Source7: pyfuntop.stp
 
 
-Patch0: python-3.1.1-config.patch
-
-
 # Fixup distutils/unixccompiler.py to remove standard library path from rpath:
 # Was Patch0 in ivazquez' python3000 specfile:
 Patch1:         Python-3.1.1-rpath.patch
 
 # The four TestMIMEAudio tests fail due to "audiotest.au" not being packaged.
 # It's simplest to remove them:
-Patch3: python-3.1.1-remove-mimeaudio-tests.patch
+Patch3: python-3.2a1-remove-mimeaudio-tests.patch
 
 # ImportTests.test_issue1267 in test_imp.py reads pydoc.py's shebang line and
 # checks that it read it correctly.
 #
 # Since we modify the shebang lines in our packaging, we also need to modify
 # the expected value in this test:
-Patch4: python-3.1.1-apply-our-changes-to-expected-shebang-for-test_imp.patch
+Patch4: python-3.2a1-apply-our-changes-to-expected-shebang-for-test_imp.patch
 
 # Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
 # a libpythonMAJOR.MINOR.a (bug 550692):
-Patch6: python-3.1.1-no-static-lib.patch
-
-# Fixup configure.in and setup.py to build against system expat library.
-# Adapted from http://svn.python.org/view?view=rev&revision=77170
-Patch7: python-3.1.1-with-system-expat.patch
+Patch6: python-3.2a1-no-static-lib.patch
 
 # Systemtap support: add statically-defined probe points
 # Patch based on upstream bug: http://bugs.python.org/issue4111
 # fixed up by mjw and wcohen for 2.6.2, then fixed up by dmalcolm for 2.6.4
 # then rewritten by mjw (attachment 390110 of rhbz 545179); ported to 3.1.1 by
 # dmalcolm
-Patch8: python-3.1.1-systemtap.patch
+Patch8: python-3.2a1-systemtap.patch
 
-Patch102: python-3.1.1-lib64.patch
+Patch102: python-3.2a1-lib64.patch
 
 # Patch to support building both optimized vs debug stacks DSO ABIs, sharing
 # the same .py and .pyc files, using "_d.so" to signify a debug build of an
@@ -197,7 +233,7 @@ Patch102: python-3.1.1-lib64.patch
 #  * Patch runtests.sh to support supplying a value for PYTHON, so that we can
 # run the tests against each of the builds
 
-Patch103: python-3.1.2-debug-build.patch
+Patch103: python-3.2a1-debug-build.patch
 
 # Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options
 # described at http://svn.python.org/projects/python/trunk/Misc/SpecialBuilds.txt
@@ -207,22 +243,7 @@ Patch104: python-3.1.2-more-configuration-flags.patch
 
 # Add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
 # (rhbz:553020); partially upstream as http://bugs.python.org/issue7647
-Patch105: python-2.6.5-statvfs-f_flag-constants.patch
-
-# This is the Modules/audioop.c part of the whitespace cleanup in r81032, to make it
-# easier to apply subsequent security fixes:
-Patch106: python-3.1.2-reformat-audioop.c.patch
-
-# CVE-2010-1634: fix various integer overflow checks in the audioop module
-# This is the difference from r81032 to r81081 (i.e r81047 and r81081)
-Patch107: python-3.1.2-CVE-2010-1634.patch
-
-# CVE-2010-2089: verify sizes/lengths within audioop module:
-Patch108: python-3.1.2-CVE-2010-2089.patch
-
-# CVE-2008-5983: the new PySys_SetArgvEx entry point from r81400 (backported to
-# the old layout before the whitespace cleanup of release31-maint in r81033):
-Patch109: python-3.1.2-CVE-2008-5983.patch
+Patch105: python-3.2a1-statvfs-f_flag-constants.patch
 
 # Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to
 # a segfault running test_pyexpat.py (rhbz:610312)
@@ -233,7 +254,19 @@ Patch110: python-3.1.2-fix-expat-issue9054.patch
 # to compile, or linker errors with "undefined reference to
 # `_PyParser_Grammar'":
 # Not yet sent upstream:
-Patch111: python-3.1-fix-parallel-make.patch
+Patch111: python-3.2a1-fix-parallel-make.patch
+
+# COUNT_ALLOCS is useful for debugging, but the upstream behaviour of always
+# emitting debug info to stdout on exit is too verbose and makes it harder to
+# use the debug build.  Add a "PYTHONDUMPCOUNTS" environment variable which
+# must be set to enable the output on exit
+# Not yet sent upstream:
+Patch125: less-verbose-COUNT_ALLOCS.patch
+
+# This is the generated patch to "configure"; see the description of
+#   %{regenerate_autotooling_patch}
+# above:
+Patch300: autotool-intermediates.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 BuildRequires: readline-devel, openssl-devel, gmp-devel
@@ -343,9 +376,10 @@ It shares installation directories with the standard Python 3 runtime, so that
 .py and .pyc files can be shared.  All compiled extension modules gain a "_d"
 suffix ("foo_d.so" rather than "foo.so") so that each Python 3 implementation
 can load its own extensions.
+%endif # with_debug_build
 
 %prep
-%setup -q -n Python-%{version}
+%setup -q -n Python-%{version}%{alphatag}
 chmod +x %{SOURCE1}
 
 %if 0%{?with_systemtap}
@@ -370,34 +404,31 @@ rm -r Modules/zlib || exit 1
 #
 # Apply patches:
 #
-%patch0 -p1 -b .config
-%patch1 -p1 -b .rpath
+%patch1 -p1
 %patch3 -p1 -b .remove-mimeaudio-tests
 %patch4 -p1 -b .apply-our-changes-to-expected-shebang
 %patch6 -p1 -b .no-static-lib
-%patch7 -p1 -b .expat
+
 %if 0%{?with_systemtap}
 %patch8 -p1 -b .systemtap
 %endif
 
 %if "%{_lib}" == "lib64"
-%patch102 -p1 -b .lib64
+%patch102 -p1
 %endif
 
-%patch103 -p1 -b .debug-build
+%patch103 -p1
+
 %patch104 -p1 -b .more-configuration-flags
 
 %patch105 -p1 -b .statvfs-f-flag-constants
 
-%patch106 -p3 -b .reformat-audioop
-%patch107 -p3 -b .CVE-2010-1634
-%patch108 -p1 -b .CVE-2010-2089
-%patch109 -p1 -b .CVE-2008-5983
-
 %patch110 -p0 -b .fix-expat-issue9054
 
 %patch111 -p1 -b .parallel-grammar
 
+%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
+
 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there
 # are many differences between 2.6 and the Python 3 library.
 #
@@ -408,6 +439,12 @@ sed --in-place \
     --expression="s|http://docs.python.org/library|http://docs.python.org/%{pybasever}/library|g" \
     Lib/pydoc.py || exit 1
 
+%if ! 0%{regenerate_autotooling_patch}
+# Normally we apply the patch to "configure"
+# We don't apply the patch if we're working towards regenerating it
+%patch300 -p0 -b .autotool-intermediates
+%endif
+
 %build
 topdir=$(pwd)
 export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
@@ -418,10 +455,28 @@ export LINKCC="gcc"
 export CFLAGS="$CFLAGS `pkg-config --cflags openssl`"
 export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`"
 
-autoconf
+%if 0%{regenerate_autotooling_patch}
+# If enabled, this code regenerates the patch to "configure", using a
+# local copy of autoconf-2.65, then exits the build
+#
+# The following assumes that the copy is installed to ~/autoconf-2.65/bin
+# as per these instructions:
+#   http://bugs.python.org/issue7997
+
+for f in pyconfig.h.in configure ; do
+    cp $f $f.autotool-intermediates ;
+done
+
+# Rerun the autotools:
+PATH=~/autoconf-2.65/bin:$PATH autoreconf
 
-# For patch 8 (systemtap), we need to get a new header for configure to use:
-autoheader
+# Regenerate the patch:
+gendiff . .autotool-intermediates > %{PATCH300}
+
+
+# Exit the build
+exit 1
+%endif
 
 # Define a function, for how to perform a "build" of python for a given
 # configuration:
@@ -548,7 +603,6 @@ install -m755 -d ${RPM_BUILD_ROOT}%{pylibdir}/Tools
 install Tools/README ${RPM_BUILD_ROOT}%{pylibdir}/Tools/
 cp -ar Tools/freeze ${RPM_BUILD_ROOT}%{pylibdir}/Tools/
 cp -ar Tools/i18n ${RPM_BUILD_ROOT}%{pylibdir}/Tools/
-cp -ar Tools/modulator ${RPM_BUILD_ROOT}%{pylibdir}/Tools/
 cp -ar Tools/pynche ${RPM_BUILD_ROOT}%{pylibdir}/Tools/
 cp -ar Tools/scripts ${RPM_BUILD_ROOT}%{pylibdir}/Tools/
 
@@ -804,93 +858,95 @@ rm -fr %{buildroot}
 %{_mandir}/*/*
 %dir %{pylibdir}
 %dir %{dynload_dir}
-%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
-%{dynload_dir}/_bisectmodule.so
+%{dynload_dir}/Python-%{version}%{alphatag}-py%{pybasever}.egg-info
+%{dynload_dir}/_bisect.so
 %{dynload_dir}/_codecs_cn.so
 %{dynload_dir}/_codecs_hk.so
 %{dynload_dir}/_codecs_iso2022.so
 %{dynload_dir}/_codecs_jp.so
 %{dynload_dir}/_codecs_kr.so
 %{dynload_dir}/_codecs_tw.so
-%{dynload_dir}/_collectionsmodule.so
+%{dynload_dir}/_collections.so
 %{dynload_dir}/_csv.so
 %{dynload_dir}/_ctypes.so
 %{dynload_dir}/_curses.so
 %{dynload_dir}/_curses_panel.so
 %{dynload_dir}/_dbm.so
 %{dynload_dir}/_elementtree.so
-%{dynload_dir}/_gdbmmodule.so
+%{dynload_dir}/_gdbm.so
 %{dynload_dir}/_hashlib.so
-%{dynload_dir}/_heapqmodule.so
+%{dynload_dir}/_heapq.so
 %{dynload_dir}/_json.so
 %{dynload_dir}/_lsprof.so
-%{dynload_dir}/_multibytecodecmodule.so
+%{dynload_dir}/_multibytecodec.so
 %{dynload_dir}/_multiprocessing.so
 %{dynload_dir}/_pickle.so
-%{dynload_dir}/_randommodule.so
-%{dynload_dir}/_sha1module.so
-%{dynload_dir}/_sha256module.so
-%{dynload_dir}/_sha512module.so
-%{dynload_dir}/_socketmodule.so
+%{dynload_dir}/_posixsubprocess.so
+%{dynload_dir}/_random.so
+%{dynload_dir}/_socket.so
 %{dynload_dir}/_sqlite3.so
 %{dynload_dir}/_ssl.so
 %{dynload_dir}/_struct.so
-%{dynload_dir}/_weakref.so
-%{dynload_dir}/arraymodule.so
-%{dynload_dir}/atexitmodule.so
+%{dynload_dir}/array.so
+%{dynload_dir}/atexit.so
 %{dynload_dir}/audioop.so
 %{dynload_dir}/binascii.so
 %{dynload_dir}/bz2.so
-%{dynload_dir}/cmathmodule.so
-%{dynload_dir}/cryptmodule.so
-%{dynload_dir}/datetime.so
-%{dynload_dir}/fcntlmodule.so
-%{dynload_dir}/grpmodule.so
-%{dynload_dir}/itertoolsmodule.so
-%{dynload_dir}/mathmodule.so
-%{dynload_dir}/mmapmodule.so
-%{dynload_dir}/nismodule.so
+%{dynload_dir}/cmath.so
+%{dynload_dir}/crypt.so
+%{dynload_dir}/_datetime.so
+%{dynload_dir}/fcntl.so
+%{dynload_dir}/grp.so
+%{dynload_dir}/itertools.so
+%{dynload_dir}/math.so
+%{dynload_dir}/mmap.so
+%{dynload_dir}/nis.so
 %{dynload_dir}/operator.so
 %{dynload_dir}/ossaudiodev.so
-%{dynload_dir}/parsermodule.so
+%{dynload_dir}/parser.so
 %{dynload_dir}/pyexpat.so
 %{dynload_dir}/readline.so
 %{dynload_dir}/resource.so
-%{dynload_dir}/selectmodule.so
-%{dynload_dir}/spwdmodule.so
-%{dynload_dir}/syslogmodule.so
+%{dynload_dir}/select.so
+%{dynload_dir}/spwd.so
+%{dynload_dir}/syslog.so
 %{dynload_dir}/termios.so
-%{dynload_dir}/timemodule.so
+%{dynload_dir}/time.so
 %{dynload_dir}/unicodedata.so
-%{dynload_dir}/xxsubtype.so
-%{dynload_dir}/zlibmodule.so
+%{dynload_dir}/zlib.so
 
 %dir %{pylibdir}/site-packages
 %{pylibdir}/site-packages/README
-%{pylibdir}/*.py*
-%{pylibdir}/*.doc
+%{pylibdir}/*.py
+%{pylibdir}/__pycache__/*%{bytecode_suffixes}
 %{pylibdir}/wsgiref.egg-info
 %dir %{pylibdir}/ctypes
-%{pylibdir}/ctypes/*.py*
+%{pylibdir}/ctypes/*.py
+%{pylibdir}/ctypes/__pycache__/*%{bytecode_suffixes}
 %{pylibdir}/ctypes/macholib
 %{pylibdir}/curses
 %dir %{pylibdir}/dbm
-%{pylibdir}/dbm/*.py*
+%{pylibdir}/dbm/*.py
+%{pylibdir}/dbm/__pycache__/*%{bytecode_suffixes}
 %dir %{pylibdir}/distutils
-%{pylibdir}/distutils/*.py*
+%{pylibdir}/distutils/*.py
+%{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes}
 %{pylibdir}/distutils/README
 %{pylibdir}/distutils/command
 %dir %{pylibdir}/email
-%{pylibdir}/email/*.py*
+%{pylibdir}/email/*.py
+%{pylibdir}/email/__pycache__/*%{bytecode_suffixes}
 %{pylibdir}/email/mime
 %{pylibdir}/encodings
 %{pylibdir}/html
 %{pylibdir}/http
 %{pylibdir}/idlelib
 %dir %{pylibdir}/importlib
-%{pylibdir}/importlib/*.py*
+%{pylibdir}/importlib/*.py
+%{pylibdir}/importlib/__pycache__/*%{bytecode_suffixes}
 %dir %{pylibdir}/json
-%{pylibdir}/json/*.py*
+%{pylibdir}/json/*.py
+%{pylibdir}/json/__pycache__/*%{bytecode_suffixes}
 %{pylibdir}/lib2to3
 %exclude %{pylibdir}/lib2to3/tests
 %{pylibdir}/logging
@@ -898,9 +954,14 @@ rm -fr %{buildroot}
 %{pylibdir}/plat-linux2
 %{pylibdir}/pydoc_data
 %dir %{pylibdir}/sqlite3
-%{pylibdir}/sqlite3/*.py*
+%{pylibdir}/sqlite3/*.py
+%{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes}
 %dir %{pylibdir}/test
-%{pylibdir}/test/__init__.py*
+%{pylibdir}/test/__init__.py
+%{pylibdir}/test/__pycache__/__init__%{bytecode_suffixes}
+%dir %{pylibdir}/unittest
+%{pylibdir}/unittest/*.py
+%{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes}
 %{pylibdir}/urllib
 %{pylibdir}/wsgiref
 %{pylibdir}/xml
@@ -967,11 +1028,14 @@ rm -fr %{buildroot}
 %{pylibdir}/sqlite3/test
 %{pylibdir}/test
 %{dynload_dir}/_ctypes_test.so
-%{dynload_dir}/_testcapimodule.so
+%{dynload_dir}/_testcapi.so
 %{pylibdir}/lib2to3/tests
 %doc %{pylibdir}/Demo/distutils
 %doc %{pylibdir}/Demo/md5test
 %{pylibdir}/tkinter/test
+%dir %{pylibdir}/unittest/test
+%{pylibdir}/unittest/test/*.py
+%{pylibdir}/unittest/test/__pycache__/*%{bytecode_suffixes}
 
 
 # We don't bother splitting the debug build out into further subpackages:
@@ -989,65 +1053,65 @@ rm -fr %{buildroot}
 %{_bindir}/python%{pybasever}-debug
 
 # ...with debug builds of the built-in "extension" modules:
-%{dynload_dir}/_bisectmodule_d.so
+%{dynload_dir}/_bisect_d.so
 %{dynload_dir}/_codecs_cn_d.so
 %{dynload_dir}/_codecs_hk_d.so
 %{dynload_dir}/_codecs_iso2022_d.so
 %{dynload_dir}/_codecs_jp_d.so
 %{dynload_dir}/_codecs_kr_d.so
 %{dynload_dir}/_codecs_tw_d.so
-%{dynload_dir}/_collectionsmodule_d.so
+%{dynload_dir}/_collections_d.so
 %{dynload_dir}/_csv_d.so
 %{dynload_dir}/_ctypes_d.so
 %{dynload_dir}/_curses_d.so
 %{dynload_dir}/_curses_panel_d.so
 %{dynload_dir}/_dbm_d.so
 %{dynload_dir}/_elementtree_d.so
-%{dynload_dir}/_gdbmmodule_d.so
+%{dynload_dir}/_gdbm_d.so
 %{dynload_dir}/_hashlib_d.so
-%{dynload_dir}/_heapqmodule_d.so
+%{dynload_dir}/_heapq_d.so
 %{dynload_dir}/_json_d.so
 %{dynload_dir}/_lsprof_d.so
-%{dynload_dir}/_multibytecodecmodule_d.so
+%{dynload_dir}/_md5_d.so
+%{dynload_dir}/_multibytecodec_d.so
 %{dynload_dir}/_multiprocessing_d.so
 %{dynload_dir}/_pickle_d.so
-%{dynload_dir}/_randommodule_d.so
-%{dynload_dir}/_sha1module_d.so
-%{dynload_dir}/_sha256module_d.so
-%{dynload_dir}/_sha512module_d.so
-%{dynload_dir}/_socketmodule_d.so
+%{dynload_dir}/_posixsubprocess_d.so
+%{dynload_dir}/_random_d.so
+%{dynload_dir}/_sha1_d.so
+%{dynload_dir}/_sha256_d.so
+%{dynload_dir}/_sha512_d.so
+%{dynload_dir}/_socket_d.so
 %{dynload_dir}/_sqlite3_d.so
 %{dynload_dir}/_ssl_d.so
 %{dynload_dir}/_struct_d.so
-%{dynload_dir}/_weakref_d.so
-%{dynload_dir}/arraymodule_d.so
-%{dynload_dir}/atexitmodule_d.so
+%{dynload_dir}/array_d.so
+%{dynload_dir}/atexit_d.so
 %{dynload_dir}/audioop_d.so
 %{dynload_dir}/binascii_d.so
 %{dynload_dir}/bz2_d.so
-%{dynload_dir}/cmathmodule_d.so
-%{dynload_dir}/cryptmodule_d.so
-%{dynload_dir}/datetime_d.so
-%{dynload_dir}/fcntlmodule_d.so
-%{dynload_dir}/grpmodule_d.so
-%{dynload_dir}/itertoolsmodule_d.so
-%{dynload_dir}/mathmodule_d.so
-%{dynload_dir}/mmapmodule_d.so
-%{dynload_dir}/nismodule_d.so
+%{dynload_dir}/cmath_d.so
+%{dynload_dir}/crypt_d.so
+%{dynload_dir}/_datetime_d.so
+%{dynload_dir}/fcntl_d.so
+%{dynload_dir}/grp_d.so
+%{dynload_dir}/itertools_d.so
+%{dynload_dir}/math_d.so
+%{dynload_dir}/mmap_d.so
+%{dynload_dir}/nis_d.so
 %{dynload_dir}/operator_d.so
 %{dynload_dir}/ossaudiodev_d.so
-%{dynload_dir}/parsermodule_d.so
+%{dynload_dir}/parser_d.so
 %{dynload_dir}/pyexpat_d.so
 %{dynload_dir}/readline_d.so
 %{dynload_dir}/resource_d.so
-%{dynload_dir}/selectmodule_d.so
-%{dynload_dir}/spwdmodule_d.so
-%{dynload_dir}/syslogmodule_d.so
+%{dynload_dir}/select_d.so
+%{dynload_dir}/spwd_d.so
+%{dynload_dir}/syslog_d.so
 %{dynload_dir}/termios_d.so
-%{dynload_dir}/timemodule_d.so
+%{dynload_dir}/time_d.so
 %{dynload_dir}/unicodedata_d.so
-%{dynload_dir}/xxsubtype_d.so
-%{dynload_dir}/zlibmodule_d.so
+%{dynload_dir}/zlib_d.so
 
 # No need to split things out the "Makefile" and the config-32/64.h file as we
 # do for the regular build above (bug 531901), since they're all in one package
@@ -1078,7 +1142,7 @@ rm -fr %{buildroot}
 
 # Analog  of the -test subpackage's files:
 %{dynload_dir}/_ctypes_test_d.so
-%{dynload_dir}/_testcapimodule_d.so
+%{dynload_dir}/_testcapi_d.so
 
 %endif # with_debug_build
 
@@ -1097,6 +1161,26 @@ rm -fr %{buildroot}
 
 
 %changelog
+* Sat Aug 21 2010 David Malcolm <dmalcolm at redhat.com> - 3.2-0.0.a1
+- 3.2a1; add alphatag
+- rework %%files in the light of PEP 3147 (__pycache__)
+- drop our configuration patch to Setup.dist (patch 0): setup.py should do a
+better job of things, and the %%files explicitly lists our modules (r82746
+appears to break the old way of doing things).  This leads to various modules
+changing from "foomodule.so" to "foo.so".  It also leads to the optimized build
+dropping the _sha1, _sha256 and _sha512 modules, but these are provided by
+_hashlib; _weakref becomes a builtin module; xxsubtype goes away (it's only for
+testing/devel purposes)
+- fixup patches 3, 4, 6, 8, 102, 103, 105, 111 for the rebase
+- remove upstream patches: 7 (system expat), 106, 107, 108 (audioop reformat
+plus CVE-2010-1634 and CVE-2010-2089), 109 (CVE-2008-5983)
+- add machinery for rebuilding "configure" and friends, using the correct
+version of autoconf (patch 300)
+- patch the debug build's usage of COUNT_ALLOCS to be less verbose (patch 125)
+- "modulator" was removed upstream
+- drop "-b" from patch applications affecting .py files to avoid littering the
+installation tree
+
 * Thu Aug 19 2010 Toshio Kuratomi <toshio at fedoraproject.org> - 3.1.2-13
 - Turn on computed-gotos.
 - Fix for parallel make and graminit.c
diff --git a/sources b/sources
index 30f03d2..c49803c 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-45350b51b58a46b029fb06c61257e350  Python-3.1.2.tar.bz2
+b371e1f7a0e98e7a0d1792823fd0f58c  Python-3.2a1.tar.bz2


More information about the scm-commits mailing list