#5 Patch and %prep cleanup
Merged 6 years ago by pviktori. Opened 6 years ago by pviktori.
rpms/ pviktori/python3 patch-cleanup  into  master

00001-rpath.patch Python-3.1.1-rpath.patch
file renamed
file was moved with no change to the file
file modified
-60
@@ -25,66 +25,6 @@ 

   # -I${DLINCLDIR} is added to the compile rule for importdl.o

   AC_SUBST(DLINCLDIR)

   DLINCLDIR=.

- diff -up Python-3.3.0rc2/configure.systemtap Python-3.3.0rc2/configure

- --- Python-3.3.0rc2/configure.systemtap	2012-09-09 05:11:14.000000000 -0400

- +++ Python-3.3.0rc2/configure	2012-09-10 09:17:21.116511780 -0400

- @@ -618,6 +618,8 @@ TRUE

-  MACHDEP_OBJS

-  DYNLOADFILE

-  DLINCLDIR

- +SYSTEMTAPDEPS

- +SYSTEMTAPOBJS

-  THREADOBJ

-  LDLAST

-  USE_THREAD_MODULE

- @@ -779,6 +781,7 @@ with_doc_strings

-  with_tsc

-  with_pymalloc

-  with_valgrind

- +with_systemtap

-  with_fpectl

-  with_libm

-  with_libc

- @@ -1456,6 +1459,7 @@ Optional Packages:

-    --with(out)-tsc         enable/disable timestamp counter profile

-    --with(out)-pymalloc    disable/enable specialized mallocs

-    --with-valgrind         Enable Valgrind support

- +  --with(out)-systemtap   disable/enable SystemTap support

-    --with-fpectl           enable SIGFPE catching

-    --with-libm=STRING      math library

-    --with-libc=STRING      C library

- @@ -10065,6 +10069,31 @@ fi

-      OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"

-  fi

-  

- +# Check for systemtap support

- +# On Linux, /usr/bin/dtrace is in fact a shim to SystemTap

- +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-systemtap" >&5

- +$as_echo_n "checking for --with-systemtap... " >&6; }

- +

- +# Check whether --with-systemtap was given.

- +if test "${with_systemtap+set}" = set; then :

- +  withval=$with_systemtap;

- +else

- +  with_systemtap=no

- +fi

- +

- +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_systemtap" >&5

- +$as_echo "$with_systemtap" >&6; }

- +if test "$with_systemtap" != no; then

- +

- +$as_echo "#define WITH_SYSTEMTAP 1" >>confdefs.h

- +

- +    SYSTEMTAPOBJS="Python/pysystemtap.o"

- +    SYSTEMTAPDEPS="\$(srcdir)/Python/pysystemtap.h"

- +fi

- +

- +

- +

- +

-  # -I${DLINCLDIR} is added to the compile rule for importdl.o

-  

-  DLINCLDIR=.

  diff -up Python-3.3.0rc2/Doc/howto/index.rst.systemtap Python-3.3.0rc2/Doc/howto/index.rst

  --- Python-3.3.0rc2/Doc/howto/index.rst.systemtap	2012-09-09 05:10:51.000000000 -0400

  +++ Python-3.3.0rc2/Doc/howto/index.rst	2012-09-10 09:17:21.117511779 -0400

file modified
+14
@@ -37,6 +37,20 @@ 

           if standard_lib:

               return libpython

           else:

+ diff a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py

+ --- a/Lib/distutils/tests/test_install.py

+ +++ b/Lib/distutils/tests/test_install.py

+ @@ -57,8 +57,9 @@

+              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/Lib/site.py b/Lib/site.py

  index a84e3bb..ba0d3ea 100644

  --- a/Lib/site.py

@@ -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"))

@@ -1,12 +0,0 @@ 

- diff -up Python-3.2.2/Lib/distutils/tests/test_bdist_rpm.py.skip-distutils-tests-that-fail-in-rpmbuild Python-3.2.2/Lib/distutils/tests/test_bdist_rpm.py

- --- Python-3.2.2/Lib/distutils/tests/test_bdist_rpm.py.skip-distutils-tests-that-fail-in-rpmbuild	2011-09-03 12:16:40.000000000 -0400

- +++ Python-3.2.2/Lib/distutils/tests/test_bdist_rpm.py	2011-09-10 05:04:56.328852558 -0400

- @@ -23,6 +23,7 @@ setup(name='foo', version='0.1', py_modu

-  

-  """

-  

- +@unittest._skipInRpmBuild("don't try to nest one rpm build inside another rpm build")

-  class BuildRpmTestCase(support.TempdirManager,

-                         support.EnvironGuard,

-                         support.LoggingSilencer,

- diff -up Python-3.2.2/Lib/distutils/tests/test_build_ext.py.skip-distutils-tests-that-fail-in-rpmbuild Python-3.2.2/Lib/distutils/tests/test_build_ext.py

@@ -1,68 +0,0 @@ 

- diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py

- index e9fdb07..ea60e6e 100644

- --- a/Lib/test/test_os.py

- +++ b/Lib/test/test_os.py

- @@ -1723,30 +1723,36 @@ class PosixUidGidTests(unittest.TestCase):

-      def test_setuid(self):

-          if os.getuid() != 0:

-              self.assertRaises(OSError, os.setuid, 0)

- +        self.assertRaises(TypeError, os.setuid, 'not an int')

-          self.assertRaises(OverflowError, os.setuid, 1<<32)

-  

-      @unittest.skipUnless(hasattr(os, 'setgid'), 'test needs os.setgid()')

-      def test_setgid(self):

-          if os.getuid() != 0 and not HAVE_WHEEL_GROUP:

-              self.assertRaises(OSError, os.setgid, 0)

- +        self.assertRaises(TypeError, os.setgid, 'not an int')

-          self.assertRaises(OverflowError, os.setgid, 1<<32)

-  

-      @unittest.skipUnless(hasattr(os, 'seteuid'), 'test needs os.seteuid()')

-      def test_seteuid(self):

-          if os.getuid() != 0:

-              self.assertRaises(OSError, os.seteuid, 0)

- +        self.assertRaises(TypeError, os.seteuid, 'not an int')

-          self.assertRaises(OverflowError, os.seteuid, 1<<32)

-  

-      @unittest.skipUnless(hasattr(os, 'setegid'), 'test needs os.setegid()')

-      def test_setegid(self):

-          if os.getuid() != 0 and not HAVE_WHEEL_GROUP:

-              self.assertRaises(OSError, os.setegid, 0)

- +        self.assertRaises(TypeError, os.setegid, 'not an int')

-          self.assertRaises(OverflowError, os.setegid, 1<<32)

-  

-      @unittest.skipUnless(hasattr(os, 'setreuid'), 'test needs os.setreuid()')

-      def test_setreuid(self):

-          if os.getuid() != 0:

-              self.assertRaises(OSError, 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)

-  

- @@ -1762,6 +1768,8 @@ class PosixUidGidTests(unittest.TestCase):

-      def test_setregid(self):

-          if os.getuid() != 0 and not HAVE_WHEEL_GROUP:

-              self.assertRaises(OSError, 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/Lib/test/test_pwd.py b/Lib/test/test_pwd.py

- index ac9cff7..db98159 100644

- --- a/Lib/test/test_pwd.py

- +++ b/Lib/test/test_pwd.py

- @@ -104,11 +104,11 @@ class PwdTest(unittest.TestCase):

-          # In some cases, byuids isn't a complete list of all users in the

-          # system, so if we try to pick a value not in byuids (via a perturbing

-          # loop, say), pwd.getpwuid() might still be able to find data for that

- -        # uid. Using sys.maxint may provoke the same problems, but hopefully

- +        # uid. Using 2**32 - 2 may provoke the same problems, but hopefully

-          # it will be a more repeatable failure.

-          # Android accepts a very large span of uids including sys.maxsize and

-          # -1; it raises KeyError with 1 or 2 for example.

- -        fakeuid = sys.maxsize

- +        fakeuid = 2**32 - 2

-          self.assertNotIn(fakeuid, byuids)

-          if not support.is_android:

-              self.assertRaises(KeyError, pwd.getpwuid, fakeuid)

@@ -1,13 +0,0 @@ 

- diff --git a/config.sub b/config.sub

- index 40ea5df..932128b 100755

- --- a/config.sub

- +++ b/config.sub

- @@ -1045,7 +1045,7 @@ case $basic_machine in

-  		;;

-  	ppc64)	basic_machine=powerpc64-unknown

-  		;;

- -	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`

- +	ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`

-  		;;

-  	ppc64le | powerpc64little)

-  		basic_machine=powerpc64le-unknown

@@ -1,14 +0,0 @@ 

- diff -r 7fa3e824a4ee Lib/test/test_py_compile.py

- --- a/Lib/test/test_py_compile.py	Tue Oct 29 22:25:06 2013 -0400

- +++ b/Lib/test/test_py_compile.py	Wed Oct 30 11:08:31 2013 +0100

- @@ -54,6 +54,10 @@

-          self.assertTrue(os.path.exists(self.pyc_path))

-          self.assertFalse(os.path.exists(self.cache_path))

-  

- +    def test_bad_coding(self):

- +        bad_coding = os.path.join(os.path.dirname(__file__), 'bad_coding2.py')

- +        self.assertIsNone(py_compile.compile(bad_coding, doraise=False))

- +

-      def test_relative_path(self):

-          py_compile.compile(os.path.relpath(self.source_path),

-                             os.path.relpath(self.pyc_path))

@@ -1,11 +0,0 @@ 

- diff -r 28c04e954bb6 Lib/lib2to3/main.py

- --- a/Lib/lib2to3/main.py	Tue Oct 29 22:25:55 2013 -0400

- +++ b/Lib/lib2to3/main.py	Wed Nov 06 14:33:07 2013 +0100

- @@ -213,6 +213,7 @@

-  

-      # Set up logging handler

-      level = logging.DEBUG if options.verbose else logging.INFO

- +    logging.root.handlers = []

-      logging.basicConfig(format='%(name)s: %(message)s', level=level)

-      logger = logging.getLogger('lib2to3.main')

-  

@@ -1,15 +0,0 @@ 

- diff -up Python-3.5.0/configure.ac.eabi Python-3.5.0/configure.ac

- --- Python-3.5.0/configure.eabi	2015-09-23 13:52:20.756909744 +0200

- +++ Python-3.5.0/configure	2015-09-23 13:52:46.859163629 +0200

- @@ -762,9 +762,9 @@ cat >> conftest.c <<EOF

-          alpha-linux-gnu

-  # elif defined(__ARM_EABI__) && defined(__ARM_PCS_VFP)

-  #  if defined(__ARMEL__)

- -        arm-linux-gnueabihf

- +        arm-linux-gnueabi

-  #  else

- -        armeb-linux-gnueabihf

- +        armeb-linux-gnueabi

-  #  endif

-  # elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP)

-  #  if defined(__ARMEL__)

@@ -1,42 +0,0 @@ 

- diff -urp Python-3.5.0/configure p/configure

- --- Python-3.5.0/configure	2016-02-25 16:12:12.615184011 +0000

- +++ p/configure	2016-02-25 16:13:01.293412517 +0000

- @@ -5133,7 +5133,7 @@ cat >> conftest.c <<EOF

-  #  elif _MIPS_SIM == _ABIN32

-          mips64el-linux-gnuabin32

-  #  elif _MIPS_SIM == _ABI64

- -        mips64el-linux-gnuabi64

- +        mips64el-linux-gnu

-  #  else

-  #   error unknown platform triplet

-  #  endif

- @@ -5143,7 +5143,7 @@ cat >> conftest.c <<EOF

-  #  elif _MIPS_SIM == _ABIN32

-          mips64-linux-gnuabin32

-  #  elif _MIPS_SIM == _ABI64

- -        mips64-linux-gnuabi64

- +        mips64-linux-gnu

-  #  else

-  #   error unknown platform triplet

-  #  endif

- diff -urp Python-3.5.0/configure.ac p/configure.ac

- --- Python-3.5.0/configure.ac	2016-02-25 16:12:11.663159985 +0000

- +++ p/configure.ac	2016-02-25 16:13:18.814854710 +0000

- @@ -784,7 +784,7 @@ cat >> conftest.c <<EOF

-  #  elif _MIPS_SIM == _ABIN32

-          mips64el-linux-gnuabin32

-  #  elif _MIPS_SIM == _ABI64

- -        mips64el-linux-gnuabi64

- +        mips64el-linux-gnu

-  #  else

-  #   error unknown platform triplet

-  #  endif

- @@ -794,7 +794,7 @@ cat >> conftest.c <<EOF

-  #  elif _MIPS_SIM == _ABIN32

-          mips64-linux-gnuabin32

-  #  elif _MIPS_SIM == _ABI64

- -        mips64-linux-gnuabi64

- +        mips64-linux-gnu

-  #  else

-  #   error unknown platform triplet

-  #  endif

@@ -0,0 +1,58 @@ 

+ diff -up Python-3.5.0/configure.ac.than Python-3.5.0/configure.ac

+ --- Python-3.5.0/configure.ac.than	2015-11-13 11:51:32.039560172 -0500

+ +++ Python-3.5.0/configure.ac	2015-11-13 11:52:11.670168157 -0500

+ @@ -788,9 +788,9 @@ cat >> conftest.c <<EOF

+          alpha-linux-gnu

+  # elif defined(__ARM_EABI__) && defined(__ARM_PCS_VFP)

+  #  if defined(__ARMEL__)

+ -        arm-linux-gnueabihf

+ +        arm-linux-gnueabi

+  #  else

+ -        armeb-linux-gnueabihf

+ +        armeb-linux-gnueabi

+  #  endif

+  # elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP)

+  #  if defined(__ARMEL__)

+ @@ -810,7 +810,7 @@ cat >> conftest.c <<EOF

+  #  elif _MIPS_SIM == _ABIN32

+          mips64el-linux-gnuabin32

+  #  elif _MIPS_SIM == _ABI64

+ -        mips64el-linux-gnuabi64

+ +        mips64el-linux-gnu

+  #  else

+  #   error unknown platform triplet

+  #  endif

+ @@ -820,7 +820,7 @@ cat >> conftest.c <<EOF

+  #  elif _MIPS_SIM == _ABIN32

+          mips64-linux-gnuabin32

+  #  elif _MIPS_SIM == _ABI64

+ -        mips64-linux-gnuabi64

+ +        mips64-linux-gnu

+  #  else

+  #   error unknown platform triplet

+  #  endif

+ @@ -830,9 +830,9 @@ cat >> conftest.c <<EOF

+          powerpc-linux-gnuspe

+  # elif defined(__powerpc64__)

+  #  if defined(__LITTLE_ENDIAN__)

+ -        powerpc64le-linux-gnu

+ +        ppc64le-linux-gnu

+  #  else

+ -        powerpc64-linux-gnu

+ +        ppc64-linux-gnu

+  #  endif

+  # elif defined(__powerpc__)

+          powerpc-linux-gnu

+ diff --git a/config.sub b/config.sub

+ index 40ea5df..932128b 100755

+ --- a/config.sub

+ +++ b/config.sub

+ @@ -1045,7 +1045,7 @@ case $basic_machine in

+  		;;

+  	ppc64)	basic_machine=powerpc64-unknown

+  		;;

+ -	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`

+ +	ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`

+  		;;

+  	ppc64le | powerpc64little)

+  		basic_machine=powerpc64le-unknown

@@ -1,30 +0,0 @@ 

- diff -up Python-3.5.0/configure.ac.than Python-3.5.0/configure.ac

- --- Python-3.5.0/configure.ac.than	2015-11-13 11:51:32.039560172 -0500

- +++ Python-3.5.0/configure.ac	2015-11-13 11:52:11.670168157 -0500

- @@ -804,9 +804,9 @@ cat >> conftest.c <<EOF

-          powerpc-linux-gnuspe

-  # elif defined(__powerpc64__)

-  #  if defined(__LITTLE_ENDIAN__)

- -        powerpc64le-linux-gnu

- +        ppc64le-linux-gnu

-  #  else

- -        powerpc64-linux-gnu

- +        ppc64-linux-gnu

-  #  endif

-  # elif defined(__powerpc__)

-          powerpc-linux-gnu

- diff -up Python-3.5.0/configure.than Python-3.5.0/configure

- --- Python-3.5.0/configure.than	2015-11-13 12:13:19.039658399 -0500

- +++ Python-3.5.0/configure	2015-11-13 12:13:35.199906857 -0500

- @@ -5153,9 +5153,9 @@ cat >> conftest.c <<EOF

-          powerpc-linux-gnuspe

-  # elif defined(__powerpc64__)

-  #  if defined(__LITTLE_ENDIAN__)

- -        powerpc64le-linux-gnu

- +        ppc64le-linux-gnu

-  #  else

- -        powerpc64-linux-gnu

- +        ppc64-linux-gnu

-  #  endif

-  # elif defined(__powerpc__)

-          powerpc-linux-gnu

file modified
+52 -127
@@ -14,7 +14,7 @@ 

  #  WARNING  When rebasing to a new Python version,

  #           remember to update the python3-docs package as well

  Version: %{pybasever}.2

- Release: 12%{?dist}

+ Release: 13%{?dist}

  License: Python

  

  
@@ -247,9 +247,10 @@ 

  # AppData file for idle3

  Source11: idle3.appdata.xml

  

+ # 00001 #

  # Fixup distutils/unixccompiler.py to remove standard library path from rpath:

  # Was Patch0 in ivazquez' python3000 specfile:

- Patch1:         Python-3.1.1-rpath.patch

+ Patch1:         00001-rpath.patch

  

  # 00055 #

  # Systemtap support: add statically-defined probe points
@@ -258,16 +259,16 @@ 

  # (where sys.getfilesystemencoding() == 'ascii')

  Patch55: 00055-systemtap.patch

  

- Patch102: 00102-lib64.patch

- 

- # 00104 #

+ # 00102 #

+ # Change the various install paths to use /usr/lib64/ instead or /usr/lib

  # Only used when "%{_lib}" == "lib64"

- # Another lib64 fix, for distutils/tests/test_install.py; not upstream:

- Patch104: 00104-lib64-fix-for-test_install.patch

+ # Not yet sent upstream.

+ Patch102: 00102-lib64.patch

  

  # 00111 #

  # Patch the Makefile.pre.in so that the generated Makefile doesn't try to build

- # a libpythonMAJOR.MINOR.a (bug 550692):

+ # a libpythonMAJOR.MINOR.a

+ # See https://bugzilla.redhat.com/show_bug.cgi?id=556092

  # Downstream only: not appropriate for upstream

  Patch111: 00111-no-static-lib.patch

  
@@ -285,32 +286,13 @@ 

  # these unittest hooks in their own "check" phases)

  Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch

  

- # 00137 #

- # Some tests within distutils fail when run in an rpmbuild:

- Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch

- 

  # 00155 #

  # Avoid allocating thunks in ctypes unless absolutely necessary, to avoid

  # generating SELinux denials on "import ctypes" and "import uuid" when

- # embedding Python within httpd (rhbz#814391)

+ # embedding Python within httpd

+ # See https://bugzilla.redhat.com/show_bug.cgi?id=814391

  Patch155: 00155-avoid-ctypes-thunks.patch

  

- # 00157 #

- # Update uid/gid handling throughout the standard library: uid_t and gid_t are

- # unsigned 32-bit values, but existing code often passed them through C long

- # values, which are signed 32-bit values on 32-bit architectures, leading to

- # negative int objects for uid/gid values >= 2^31 on 32-bit architectures.

- #

- # Introduce _PyObject_FromUid/Gid to convert uid_t/gid_t values to python

- # objects, using int objects where the value will fit (long objects otherwise),

- # and _PyArg_ParseUid/Gid to convert int/long to uid_t/gid_t, with -1 allowed

- # as a special case (since this is given special meaning by the chown syscall)

- #

- # Update standard library to use this throughout for uid/gid values, so that

- # very large uid/gid values are round-trippable, and -1 remains usable.

- # (rhbz#697470)

- Patch157: 00157-uid-gid-overflows.patch

- 

  # 00160 #

  # Python 3.3 added os.SEEK_DATA and os.SEEK_HOLE, which may be present in the

  # header files in the build chroot, but may not be supported in the running
@@ -329,11 +311,10 @@ 

  # In debug builds, try to print repr() when a C-level assert fails in the

  # garbage collector (typically indicating a reference-counting error

  # somewhere else e.g in an extension module)

- # Backported to 2.7 from a patch I sent upstream for py3k

- #   http://bugs.python.org/issue9263  (rhbz#614680)

- # hiding the proposed new macros/functions within gcmodule.c to avoid exposing

+ # The new macros/functions within gcmodule.c are hidden to avoid exposing

  # them within the extension API.

- # (rhbz#850013

+ # Sent upstream: http://bugs.python.org/issue9263

+ # See https://bugzilla.redhat.com/show_bug.cgi?id=614680

  Patch170: 00170-gc-assertions.patch

  

  # 00178 #
@@ -342,35 +323,6 @@ 

  # Does not affect python2 AFAICS (different sysconfig values initialization)

  Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch

  

- # 00180 #

- # Enable building on ppc64p7

- # Not appropriate for upstream, Fedora-specific naming

- Patch180: 00180-python-add-support-for-ppc64p7.patch

- 

- # 00186 #

- # Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1023607

- # Previously, this fixed a problem where some *.py files were not being

- # bytecompiled properly during build. This was result of py_compile.compile

- # raising exception when trying to convert test file with bad encoding, and

- # thus not continuing bytecompilation for other files.

- # This was fixed upstream, but the test hasn't been merged yet, so we keep it

- Patch186: 00186-dont-raise-from-py_compile.patch

- 

- # 00188 #

- # Downstream only patch that should be removed when we compile all guaranteed

- # hashlib algorithms properly. The problem is this:

- # - during tests, test_hashlib is imported and executed before test_lib2to3

- # - if at least one hash function has failed, trying to import it triggers an

- #   exception that is being caught and exception is logged:

- #   http://hg.python.org/cpython/file/2de806c8b070/Lib/hashlib.py#l217

- # - logging the exception makes logging module run basicConfig

- # - when lib2to3 tests are run again, lib2to3 runs basicConfig again, which

- #   doesn't do anything, because it was run previously

- #   (logging.root.handlers != []), which means that the default setup

- #   (most importantly logging level) is not overriden. That means that a test

- #   relying on this will fail (test_filename_changing_on_output_single_dir)

- Patch188: 00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch

- 

  # 00189 #

  # Add the rewheel module, allowing to recreate wheels from already installed

  # ones
@@ -382,18 +334,6 @@ 

  # but the LIBPL variable defined there doesn't respect libdir macro

  Patch205: 00205-make-libpl-respect-lib64.patch

  

- # 00206 #

- # Remove hf flag from arm triplet which is used

- # by debian but fedora infra uses only eabi without hf

- Patch206: 00206-remove-hf-from-arm-triplet.patch

- 

- # 00243 #

- # Fix the triplet used on 64-bit MIPS

- # rhbz#1322526: https://bugzilla.redhat.com/show_bug.cgi?id=1322526

- # Upstream uses Debian-like style mips64-linux-gnuabi64

- # Fedora needs the default mips64-linux-gnu

- Patch243: 00243-fix-mips64-triplet.patch

- 

  # 00251

  # Set values of prefix and exec_prefix in distutils install command

  # to /usr/local if executable is /usr/bin/python* and RPM build
@@ -430,15 +370,19 @@ 

  # 00272 #

  # Reject newline characters in ftplib.FTP.putline() arguments to

  # avoid FTP protocol stream injection via malicious URLs.

- # rhbz#1478916

+ # See https://bugzilla.redhat.com/show_bug.cgi?id=1478916

  # Fixed upstream: http://bugs.python.org/issue30119

  Patch272: 00272-fix-ftplib-to-reject-newlines.patch

  

  # 00273 #

  # Skip test_float_with_comma, which fails in Koji with UnicodeDecodeError

- # https://bugzilla.redhat.com/show_bug.cgi?id=1484497

+ # See https://bugzilla.redhat.com/show_bug.cgi?id=1484497

  Patch273: 00273-skip-float-test.patch

  

+ # 00274 #

+ # Upstream uses Debian-style architecture naming. Change to match Fedora.

+ Patch274: 00274-fix-arch-names.patch

+ 

  # (New patches go here ^^^)

  #

  # When adding new patches to "python" and "python3" in Fedora, EL, etc.,
@@ -448,12 +392,6 @@ 

  #

  #     https://fedoraproject.org/wiki/SIGs/Python/PythonPatches

  

- # add correct arch for ppc64/ppc64le

- # it should be ppc64le-linux-gnu/ppc64-linux-gnu instead powerpc64le-linux-gnu/powerpc64-linux-gnu

- Patch5001: python3-powerppc-arch.patch

- 

- BuildRoot: %{_tmppath}/%{name}-%{version}-root

- 

  

  # ==========================================

  # Descriptions, and metadata for subpackages
@@ -648,26 +586,9 @@ 

  cp -a %{SOURCE7} .

  %endif # with systemtap

  

- # Ensure that we're using the system copy of various libraries, rather than

- # copies shipped by upstream in the tarball:

- #   Remove embedded copy of expat:

- rm -r Modules/expat || exit 1

- 

- #   Remove embedded copy of zlib:

- rm -r Modules/zlib || exit 1

- 

- ## Disabling hashlib patch for now as it needs to be reimplemented

- ## for OpenSSL 1.1.0.

- # Don't build upstream Python's implementation of these crypto algorithms;

- # instead rely on _hashlib and OpenSSL.

- #

- # For example, in our builds hashlib.md5 is implemented within _hashlib via

- # OpenSSL (and thus respects FIPS mode), and does not fall back to _md5

- # TODO: there seems to be no OpenSSL support in Python for sha3 so far

- # when it is there, also remove _sha3/ dir

- #for f in md5module.c sha1module.c sha256module.c sha512module.c; do

- #    rm Modules/$f

- #done

+ # Remove bundled libraries to ensure that we're using the system copy.

+ rm -r Modules/expat

+ rm -r Modules/zlib

  

  %if %{with rewheel}

  %global pip_version 9.0.1
@@ -685,28 +606,20 @@ 

  

  %if "%{_lib}" == "lib64"

  %patch102 -p1

- %patch104 -p1

  %endif

  %patch111 -p1

  %patch132 -p1

- %patch137 -p1

  %patch155 -p1

- %patch157 -p1

  %patch160 -p1

  %patch163 -p1

  %patch170 -p1

  %patch178 -p1

- %patch180 -p1

- %patch186 -p1

- %patch188 -p1

  

  %if %{with rewheel}

  %patch189 -p1

  %endif

  

  %patch205 -p1

- %patch206 -p1

- %patch243 -p1

  %patch251 -p1

  %patch262 -p1

  
@@ -718,24 +631,24 @@ 

  %patch271 -p1

  %patch272 -p1

  %patch273 -p1

+ %patch274 -p1

  

- # 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.

- #

- # Fix up the URLs within pydoc to point at the documentation for this

- # MAJOR.MINOR version:

- #

- sed --in-place \

-     --expression="s|http://docs.python.org/library|http://docs.python.org/%{pybasever}/library|g" \

-     Lib/pydoc.py || exit 1

  

- %patch5001 -p1

+ # Remove files that should be generated by the build

+ # (This is after patching, so that we can use patches directly from upstream)

+ rm configure pyconfig.h.in

+ 

  

  # ======================================================

  # Configuring and building the code:

  # ======================================================

  

  %build

+ 

+ # Regenerate the configure script and pyconfig.h.in

+ autoconf

+ autoheader

+ 

  topdir=$(pwd)

  export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"

  export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
@@ -878,7 +791,8 @@ 

    #

    # Initially I tried:

    #  /usr/lib/libpython3.1.so.1.0-gdb.py

-   # but doing so generated noise when ldconfig was rerun (rhbz:562980)

+   # but doing so generated noise when ldconfig was rerun

+   # (see https://bugzilla.redhat.com/show_bug.cgi?id=562980)

    #

  %if %{with gdb_hooks}

    DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
@@ -1072,8 +986,8 @@ 

  done

  

  # Create "/usr/bin/python3-debug", a symlink to the python3 debug binary, to

- # avoid the user having to know the precise version and ABI flags.  (see

- # e.g. rhbz#676748):

+ # avoid the user having to know the precise version and ABI flags.

+ # See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=676748

  %if %{with debug_build}

  ln -s \

    %{_bindir}/python%{LDVERSION_debug} \
@@ -1149,7 +1063,8 @@ 

      PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \

      xargs -0 %{buildroot}%{_bindir}/python%{pybasever} %{SOURCE8}

  

- # For ppc64 we need a larger stack than default (rhbz#1292462)

+ # For ppc64 we need a larger stack than default

+ # See https://bugzilla.redhat.com/show_bug.cgi?id=1292462

  %ifarch %{power64}

    ulimit -a

    ulimit -s 16384
@@ -1175,6 +1090,7 @@ 

    LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \

      -wW --slowest --findleaks \

      -x test_distutils \

+     -x test_bdist_rpm \

      %ifarch ppc64le aarch64

      -x test_faulthandler \

      %endif
@@ -1644,8 +1560,8 @@ 

  

  %endif # with debug_build

  

- # We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from

- # ldconfig (rhbz:562980).

+ # We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from ldconfig

+ # See https://bugzilla.redhat.com/show_bug.cgi?id=562980

  #

  # The /usr/lib/rpm/redhat/macros defines %__debug_package to use

  # debugfiles.list, and it appears that everything below /usr/lib/debug and
@@ -1657,7 +1573,7 @@ 

  # (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py

  # payload file would be unpackaged)

  

- # Workaround for rhbz#1476593

+ # Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1476593

  %undefine _debuginfo_subpackages

  

  # ======================================================
@@ -1665,6 +1581,15 @@ 

  # ======================================================

  

  %changelog

+ * Mon Aug 28 2017 Petr Viktorin <pviktori@redhat.com> - 3.6.2-13

+ - Rename patch files to be consistent

+ - Run autotools to generate the configure script before building

+ - Merge lib64 patches (104 into 102)

+ - Skip test_bdist_rpm using test config rather than a patch (removes patch 137)

+ - Remove patches 157 and 186, which had test changes left over after upstreaming

+ - Remove patch 188, a temporary workaround for hashlib tests

+ - Merge patches 180, 206, 243, 5001 (architecture naming) into new patch 274.

+ 

  * Mon Aug 28 2017 Michal Cyprian <mcyprian@redhat.com> - 3.6.2-12

  - Use python3 style of calling super() without arguments in rpath

    patch to prevent recursion in UnixCCompiler subclasses

Here's a cleanup for our patches and the %prep section. See the individual commits.

Scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=21528721

wow that's a huge cleanup, thanks for working on this.

From a fast glimpse it LGTM and also tested in mock and I did not notice any regressions. I can't comment though on Commit 2ed2a9. @torsava would you be able to check that out?

rebased

6 years ago

Pull-Request has been merged by pviktori

6 years ago