From 285f5549c610fb22fc5bea4cc2c7bb203a600d7b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Tue, 7 May 2019 17:13:12 +0200
Subject: [PATCH] Update to 3.8.0a4

Patches rebased via git, see
https://github.com/fedora-python/cpython/tree/fedora-3.8.0a4

ABIFLAGS changed not to contain m, see https://bugs.python.org/issue36707
---
 00001-rpath.patch                             | 22 +++++--
 00102-lib64.patch                             | 59 +++++++++++++++----
 00111-no-static-lib.patch                     | 35 +++++++++--
 00178-dont-duplicate-flags-in-sysconfig.patch | 34 ++++++++---
 00189-use-rpm-wheels.patch                    | 16 ++++-
 00205-make-libpl-respect-lib64.patch          | 26 ++++++--
 00251-change-user-install-location.patch      | 30 ++++++++--
 00274-fix-arch-names.patch                    | 30 ++++++----
 00316-mark-bdist_wininst-unsupported.patch    | 16 ++++-
 python38.spec                                 | 24 +++++---
 sources                                       |  2 +-
 11 files changed, 231 insertions(+), 63 deletions(-)

diff --git a/00001-rpath.patch b/00001-rpath.patch
index 9fae54c..e18f37f 100644
--- a/00001-rpath.patch
+++ b/00001-rpath.patch
@@ -1,7 +1,18 @@
-diff -up Python-3.1.1/Lib/distutils/unixccompiler.py.rpath Python-3.1.1/Lib/distutils/unixccompiler.py
---- Python-3.1.1/Lib/distutils/unixccompiler.py.rpath	2009-09-04 17:29:34.000000000 -0400
-+++ Python-3.1.1/Lib/distutils/unixccompiler.py	2009-09-04 17:49:54.000000000 -0400
-@@ -141,6 +141,15 @@ class UnixCCompiler(CCompiler):
+From 39b5f58db91eea63fae2883c74f8a3f7fe49bc17 Mon Sep 17 00:00:00 2001
+From: David Malcolm <dmalcolm@redhat.com>
+Date: Wed, 13 Jan 2010 21:25:18 +0000
+Subject: [PATCH 1/9] 00001: Fixup distutils/unixccompiler.py to remove
+ standard library path from rpath Was Patch0 in ivazquez' python3000 specfile
+
+---
+ Lib/distutils/unixccompiler.py | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
+index d10a78da31..4df4b67810 100644
+--- a/Lib/distutils/unixccompiler.py
++++ b/Lib/distutils/unixccompiler.py
+@@ -82,6 +82,15 @@ class UnixCCompiler(CCompiler):
      if sys.platform == "cygwin":
          exe_extension = ".exe"
  
@@ -17,3 +28,6 @@ diff -up Python-3.1.1/Lib/distutils/unixccompiler.py.rpath Python-3.1.1/Lib/dist
      def preprocess(self, source, output_file=None, macros=None,
                     include_dirs=None, extra_preargs=None, extra_postargs=None):
          fixed_args = self._fix_compile_args(None, macros, include_dirs)
+-- 
+2.21.0
+
diff --git a/00102-lib64.patch b/00102-lib64.patch
index 33b2422..a22ec7b 100644
--- a/00102-lib64.patch
+++ b/00102-lib64.patch
@@ -1,5 +1,37 @@
+From 972d1ce207285b7b29407b95ea6519c289c71d89 Mon Sep 17 00:00:00 2001
+From: David Malcolm <dmalcolm@redhat.com>
+Date: Wed, 13 Jan 2010 21:25:18 +0000
+Subject: [PATCH 2/9] 00102: Change the various install paths to use
+ /usr/lib64/ instead or /usr/lib/
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Only used when "%{_lib}" == "lib64".
+
+Co-authored-by: David Malcolm <dmalcolm@redhat.com>
+Co-authored-by: Thomas Spura <tomspur@fedoraproject.org>
+Co-authored-by: Slavek Kabrda <bkabrda@redhat.com>
+Co-authored-by: Matej Stuchlik <mstuchli@redhat.com>
+Co-authored-by: Tomas Orsava <torsava@redhat.com>
+Co-authored-by: Charalampos Stratakis <cstratak@redhat.com>
+Co-authored-by: Petr Viktorin <pviktori@redhat.com>
+Co-authored-by: Miro Hrončok <miro@hroncok.cz>
+Co-authored-by: Iryna Shcherbina <shcherbina.iryna@gmail.com>
+---
+ Lib/distutils/command/install.py    |  4 ++--
+ Lib/distutils/sysconfig.py          |  6 +++++-
+ Lib/distutils/tests/test_install.py |  3 ++-
+ Lib/site.py                         |  4 ++++
+ Lib/sysconfig.py                    | 12 ++++++------
+ Lib/test/test_site.py               |  4 ++--
+ Makefile.pre.in                     |  2 +-
+ Modules/getpath.c                   |  6 +++---
+ setup.py                            |  6 +++---
+ 9 files changed, 28 insertions(+), 19 deletions(-)
+
 diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
-index 0258d3d..4b969bf 100644
+index c625c95bf7..ae4f915669 100644
 --- a/Lib/distutils/command/install.py
 +++ b/Lib/distutils/command/install.py
 @@ -30,14 +30,14 @@ WINDOWS_SCHEME = {
@@ -20,10 +52,10 @@ index 0258d3d..4b969bf 100644
          'scripts': '$base/bin',
          'data'   : '$base',
 diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
-index e07a6c8..554740d 100644
+index b51629eb94..9a4892a737 100644
 --- a/Lib/distutils/sysconfig.py
 +++ b/Lib/distutils/sysconfig.py
-@@ -140,8 +140,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+@@ -146,8 +146,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
              prefix = plat_specific and EXEC_PREFIX or PREFIX
  
      if os.name == "posix":
@@ -38,7 +70,7 @@ index e07a6c8..554740d 100644
              return libpython
          else:
 diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py
-index 287ab19..d4c05e0 100644
+index 287ab1989e..d4c05e0ab1 100644
 --- a/Lib/distutils/tests/test_install.py
 +++ b/Lib/distutils/tests/test_install.py
 @@ -57,8 +57,9 @@ class InstallTestCase(support.TempdirManager,
@@ -53,7 +85,7 @@ index 287ab19..d4c05e0 100644
          check_path(cmd.install_headers,
                     os.path.join(destination, "include", "python", "foopkg"))
 diff --git a/Lib/site.py b/Lib/site.py
-index 7dc1b04..85016b4 100644
+index ad1146332b..99149a564f 100644
 --- a/Lib/site.py
 +++ b/Lib/site.py
 @@ -334,11 +334,15 @@ def getsitepackages(prefixes=None):
@@ -73,7 +105,7 @@ index 7dc1b04..85016b4 100644
      return sitepackages
  
 diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
-index 9ee4d31..53c8606 100644
+index 8446c8deb2..cf64d79c4d 100644
 --- a/Lib/sysconfig.py
 +++ b/Lib/sysconfig.py
 @@ -20,10 +20,10 @@ __all__ = [
@@ -105,7 +137,7 @@ index 9ee4d31..53c8606 100644
          'scripts': '{userbase}/bin',
          'data': '{userbase}',
 diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
-index 266adf0..e8513b6 100644
+index 41c4229919..543c88432a 100644
 --- a/Lib/test/test_site.py
 +++ b/Lib/test/test_site.py
 @@ -266,8 +266,8 @@ class HelperFunctionsTests(unittest.TestCase):
@@ -120,10 +152,10 @@ index 266adf0..e8513b6 100644
                                    'site-packages')
              self.assertEqual(dirs[0], wanted)
 diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 59ba9d4..5780ed8 100644
+index 75eb66be3c..f1e21784af 100644
 --- a/Makefile.pre.in
 +++ b/Makefile.pre.in
-@@ -140,7 +140,7 @@ LIBDIR=		@libdir@
+@@ -143,7 +143,7 @@ LIBDIR=		@libdir@
  MANDIR=		@mandir@
  INCLUDEDIR=	@includedir@
  CONFINCLUDEDIR=	$(exec_prefix)/include
@@ -133,7 +165,7 @@ index 59ba9d4..5780ed8 100644
  
  # Detailed destination directories
 diff --git a/Modules/getpath.c b/Modules/getpath.c
-index dd188c6..6e69eed 100644
+index 3991ad719c..1baf8a2ff4 100644
 --- a/Modules/getpath.c
 +++ b/Modules/getpath.c
 @@ -688,7 +688,7 @@ calculate_exec_prefix(const _PyCoreConfig *core_config,
@@ -164,7 +196,7 @@ index dd188c6..6e69eed 100644
          return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
      }
 diff --git a/setup.py b/setup.py
-index 0258d3d..4b969bf 100644
+index 96a49b4e35..64420838af 100644
 --- a/setup.py
 +++ b/setup.py
 @@ -610,7 +610,7 @@ class PyBuildExt(build_ext):
@@ -176,7 +208,7 @@ index 0258d3d..4b969bf 100644
              add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
          # only change this for cross builds for 3.3, issues on Mageia
          if CROSS_COMPILING:
-@@ -902,11 +902,11 @@ class PyBuildExt(build_ext):
+@@ -906,11 +906,11 @@ class PyBuildExt(build_ext):
              elif curses_library:
                  readline_libs.append(curses_library)
              elif self.compiler.find_library_file(self.lib_dirs +
@@ -190,3 +222,6 @@ index 0258d3d..4b969bf 100644
                                 extra_link_args=readline_extra_link_args,
                                 libraries=readline_libs))
          else:
+-- 
+2.21.0
+
diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch
index 3d667e9..d89455d 100644
--- a/00111-no-static-lib.patch
+++ b/00111-no-static-lib.patch
@@ -1,8 +1,30 @@
+From 031249155111abf6e971fff6516c4e828c394c05 Mon Sep 17 00:00:00 2001
+From: David Malcolm <dmalcolm@redhat.com>
+Date: Mon, 18 Jan 2010 17:59:07 +0000
+Subject: [PATCH 3/9] 00111: Don't try to build a libpythonMAJOR.MINOR.a
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Downstream only: not appropriate for upstream.
+
+See https://bugzilla.redhat.com/show_bug.cgi?id=556092
+
+Co-authored-by: David Malcolm <dmalcolm@redhat.com>
+Co-authored-by: Bohuslav Kabrda <bkabrda@redhat.com>
+Co-authored-by: Matej Stuchlik <mstuchli@redhat.com>
+Co-authored-by: Robert Kuska <rkuska@redhat.com>
+Co-authored-by: Charalampos Stratakis <cstratak@redhat.com>
+Co-authored-by: Miro Hrončok <miro@hroncok.cz>
+---
+ Makefile.pre.in | 21 ++-------------------
+ 1 file changed, 2 insertions(+), 19 deletions(-)
+
 diff --git a/Makefile.pre.in b/Makefile.pre.in
-index f8ff1ce..f297d05 100644
+index f1e21784af..414aa96008 100644
 --- a/Makefile.pre.in
 +++ b/Makefile.pre.in
-@@ -573,7 +573,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c
+@@ -559,7 +559,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c
  	$(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir)
  
  # Build the interpreter
@@ -11,7 +33,7 @@ index f8ff1ce..f297d05 100644
  	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
  
  platform: $(BUILDPYTHON) pybuilddir.txt
-@@ -621,12 +621,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
+@@ -607,12 +607,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
  		_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
  		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
  
@@ -24,7 +46,7 @@ index f8ff1ce..f297d05 100644
  libpython$(LDVERSION).so: $(LIBRARY_OBJS) $(DTRACE_OBJS)
  	if test $(INSTSONAME) != $(LDLIBRARY); then \
  		$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \
-@@ -704,7 +698,7 @@ Makefile Modules/config.c: Makefile.pre \
+@@ -690,7 +684,7 @@ Makefile Modules/config.c: Makefile.pre \
  	@echo "The Makefile was updated, you may need to re-run make."
  
  
@@ -33,7 +55,7 @@ index f8ff1ce..f297d05 100644
  	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
  
  ############################################################################
-@@ -1545,17 +1539,6 @@ libainstall:	@DEF_MAKE_RULE@ python-config
+@@ -1532,17 +1526,6 @@ libainstall:	@DEF_MAKE_RULE@ python-config
  		else	true; \
  		fi; \
  	done
@@ -51,3 +73,6 @@ index f8ff1ce..f297d05 100644
  	$(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
  	$(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o
  	$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
+-- 
+2.21.0
+
diff --git a/00178-dont-duplicate-flags-in-sysconfig.patch b/00178-dont-duplicate-flags-in-sysconfig.patch
index fc49b30..4bbfed3 100644
--- a/00178-dont-duplicate-flags-in-sysconfig.patch
+++ b/00178-dont-duplicate-flags-in-sysconfig.patch
@@ -1,7 +1,21 @@
-diff -r 39b9b05c3085 Lib/distutils/sysconfig.py
---- a/Lib/distutils/sysconfig.py	Wed Apr 10 00:27:23 2013 +0200
-+++ b/Lib/distutils/sysconfig.py	Wed Apr 10 10:14:18 2013 +0200
-@@ -362,7 +362,10 @@
+From b9a703e3d37e325defe5baec111e1fbf5d42bede Mon Sep 17 00:00:00 2001
+From: Bohuslav Kabrda <bkabrda@redhat.com>
+Date: Wed, 10 Apr 2013 14:30:09 +0200
+Subject: [PATCH 4/9] 00178: Don't duplicate various FLAGS in sysconfig values
+
+http://bugs.python.org/issue17679
+
+Does not affect python2 AFAICS (different sysconfig values initialization)
+---
+ Lib/distutils/sysconfig.py | 5 ++++-
+ Lib/sysconfig.py           | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 9a4892a737..ad4cef088b 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -373,7 +373,10 @@ def parse_makefile(fn, g=None):
                      done[n] = item = ""
                  if found:
                      after = value[m.end():]
@@ -13,10 +27,11 @@ diff -r 39b9b05c3085 Lib/distutils/sysconfig.py
                      if "$" in after:
                          notdone[name] = value
                      else:
-diff -r 39b9b05c3085 Lib/sysconfig.py
---- a/Lib/sysconfig.py	Wed Apr 10 00:27:23 2013 +0200
-+++ b/Lib/sysconfig.py	Wed Apr 10 10:14:18 2013 +0200
-@@ -296,7 +296,10 @@
+diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
+index cf64d79c4d..fd972d658c 100644
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -295,7 +295,10 @@ def _parse_makefile(filename, vars=None):
  
                  if found:
                      after = value[m.end():]
@@ -28,3 +43,6 @@ diff -r 39b9b05c3085 Lib/sysconfig.py
                      if "$" in after:
                          notdone[name] = value
                      else:
+-- 
+2.21.0
+
diff --git a/00189-use-rpm-wheels.patch b/00189-use-rpm-wheels.patch
index ffb80af..91cdb01 100644
--- a/00189-use-rpm-wheels.patch
+++ b/00189-use-rpm-wheels.patch
@@ -1,5 +1,16 @@
+From 0f59810bb72d2092729346c17e96bf0c23120ee1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Wed, 15 Aug 2018 15:36:29 +0200
+Subject: [PATCH 5/9] 00189: Instead of bundled wheels, use our RPM packaged
+ wheels
+
+We keep them in /usr/share/python-wheels
+---
+ Lib/ensurepip/__init__.py | 26 +++++++++++++++++---------
+ 1 file changed, 17 insertions(+), 9 deletions(-)
+
 diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
-index 4748ba4..fc02255 100644
+index 526dfd004a..fc02255feb 100644
 --- a/Lib/ensurepip/__init__.py
 +++ b/Lib/ensurepip/__init__.py
 @@ -1,16 +1,27 @@
@@ -49,3 +60,6 @@ index 4748ba4..fc02255 100644
  
              additional_paths.append(os.path.join(tmpdir, wheel_name))
  
+-- 
+2.21.0
+
diff --git a/00205-make-libpl-respect-lib64.patch b/00205-make-libpl-respect-lib64.patch
index 3e7c797..ddd0021 100644
--- a/00205-make-libpl-respect-lib64.patch
+++ b/00205-make-libpl-respect-lib64.patch
@@ -1,7 +1,22 @@
-diff -up Python-3.5.0/Makefile.pre.in.lib Python-3.5.0/Makefile.pre.in
---- Python-3.5.0/Makefile.pre.in.lib	2015-09-21 15:39:47.928286620 +0200
-+++ Python-3.5.0/Makefile.pre.in	2015-09-21 15:42:58.004042762 +0200
-@@ -1340,7 +1340,7 @@ inclinstall:
+From 5ee8362bd5cc991b956efa9cf06eb6ad2607f57c Mon Sep 17 00:00:00 2001
+From: Robert Kuska <rkuska@redhat.com>
+Date: Mon, 21 Sep 2015 15:55:00 +0200
+Subject: [PATCH 6/9] 00205: Make LIBPL variable respect the libdir macro
+
+LIBPL variable in Makefile takes LIBPL from configure.ac,
+but the LIBPL variable defined there doesn't respect the libdir macro.
+
+Co-authored-by: Robert Kuska <rkuska@redhat.com>
+Co-authored-by: Charalampos Stratakis <cstratak@redhat.com>
+---
+ Makefile.pre.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 414aa96008..a07bd6718d 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1512,7 +1512,7 @@ inclinstall:
  
  # Install the library and miscellaneous stuff needed for extending/embedding
  # This goes into $(exec_prefix)
@@ -10,3 +25,6 @@ diff -up Python-3.5.0/Makefile.pre.in.lib Python-3.5.0/Makefile.pre.in
  
  # pkgconfig directory
  LIBPC=		$(LIBDIR)/pkgconfig
+-- 
+2.21.0
+
diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch
index 4104449..1775b6c 100644
--- a/00251-change-user-install-location.patch
+++ b/00251-change-user-install-location.patch
@@ -1,11 +1,26 @@
+From e9d8db2d243cf27b66083e0c6a9bb5d28866f937 Mon Sep 17 00:00:00 2001
+From: Michal Cyprian <m.cyprian@gmail.com>
+Date: Mon, 26 Jun 2017 16:32:56 +0200
+Subject: [PATCH 7/9] 00251: Change user install location
+
+Set values of prefix and exec_prefix in distutils install command
+to /usr/local if executable is /usr/bin/python* and RPM build
+is not detected to make pip and distutils install into separate location.
+
+Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
+---
+ Lib/distutils/command/install.py | 15 +++++++++++++--
+ Lib/site.py                      |  9 ++++++++-
+ 2 files changed, 21 insertions(+), 3 deletions(-)
+
 diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
-index 0258d3d..4ebf50a 100644
+index ae4f915669..0e4fd5b74a 100644
 --- a/Lib/distutils/command/install.py
 +++ b/Lib/distutils/command/install.py
 @@ -418,8 +418,19 @@ class install(Command):
                      raise DistutilsOptionError(
                            "must not supply exec-prefix without prefix")
-
+ 
 -                self.prefix = os.path.normpath(sys.prefix)
 -                self.exec_prefix = os.path.normpath(sys.exec_prefix)
 +                # self.prefix is set to sys.prefix + /local/
@@ -21,16 +36,16 @@ index 0258d3d..4ebf50a 100644
 +
 +                self.prefix = os.path.normpath(sys.prefix) + addition
 +                self.exec_prefix = os.path.normpath(sys.exec_prefix) + addition
-
+ 
              else:
                  if self.exec_prefix is None:
 diff --git a/Lib/site.py b/Lib/site.py
-index 0fc9200..c95202e 100644
+index 99149a564f..1107324848 100644
 --- a/Lib/site.py
 +++ b/Lib/site.py
-@@ -322,7 +322,14 @@ def getsitepackages(prefixes=None):
+@@ -347,7 +347,14 @@ def getsitepackages(prefixes=None):
      return sitepackages
-
+ 
  def addsitepackages(known_paths, prefixes=None):
 -    """Add site-packages to sys.path"""
 +    """Add site-packages to sys.path
@@ -44,3 +59,6 @@ index 0fc9200..c95202e 100644
      for sitedir in getsitepackages(prefixes):
          if os.path.isdir(sitedir):
              addsitedir(sitedir, known_paths)
+-- 
+2.21.0
+
diff --git a/00274-fix-arch-names.patch b/00274-fix-arch-names.patch
index ee15930..b8453a2 100644
--- a/00274-fix-arch-names.patch
+++ b/00274-fix-arch-names.patch
@@ -1,19 +1,25 @@
-From 3b0d3a25576e74c2ac1eb25136ae811bdbdd7c6c Mon Sep 17 00:00:00 2001
-From: Tomas Orsava <torsava@redhat.com>
-Date: Thu, 14 Feb 2019 16:08:57 +0100
-Subject: [PATCH] Upstream uses Debian-style architecture naming. Change to
- match Fedora / RHEL
+From e108d7026aab241d89ff3a90d6421af3e9ee8e12 Mon Sep 17 00:00:00 2001
+From: Petr Viktorin <pviktori@redhat.com>
+Date: Mon, 28 Aug 2017 17:16:46 +0200
+Subject: [PATCH 8/9] 00274: Upstream uses Debian-style architecture naming,
+ change to match Fedora
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
 
+Co-authored-by: Petr Viktorin <pviktori@redhat.com>
+Co-authored-by: Miro Hrončok <miro@hroncok.cz>
+Co-authored-by: Tomas Orsava <torsava@redhat.com>
 ---
  config.sub   |  2 +-
  configure.ac | 16 ++++++++--------
  2 files changed, 9 insertions(+), 9 deletions(-)
 
 diff --git a/config.sub b/config.sub
-index 40ea5df..932128b 100755
+index ba37cf99e2..52a9ec6662 100755
 --- a/config.sub
 +++ b/config.sub
-@@ -1045,7 +1045,7 @@ case $basic_machine in
+@@ -1042,7 +1042,7 @@ case $basic_machine in
  		;;
  	ppc64)	basic_machine=powerpc64-unknown
  		;;
@@ -23,10 +29,10 @@ index 40ea5df..932128b 100755
  	ppc64le | powerpc64little)
  		basic_machine=powerpc64le-unknown
 diff --git a/configure.ac b/configure.ac
-index a075ce3..b7f2ee3 100644
+index a02597da2d..5742ef4176 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -788,9 +788,9 @@ cat >> conftest.c <<EOF
+@@ -740,9 +740,9 @@ cat >> conftest.c <<EOF
          alpha-linux-gnu
  # elif defined(__ARM_EABI__) && defined(__ARM_PCS_VFP)
  #  if defined(__ARMEL__)
@@ -38,7 +44,7 @@ index a075ce3..b7f2ee3 100644
  #  endif
  # elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP)
  #  if defined(__ARMEL__)
-@@ -810,7 +810,7 @@ cat >> conftest.c <<EOF
+@@ -782,7 +782,7 @@ cat >> conftest.c <<EOF
  #  elif _MIPS_SIM == _ABIN32
          mips64el-linux-gnuabin32
  #  elif _MIPS_SIM == _ABI64
@@ -47,7 +53,7 @@ index a075ce3..b7f2ee3 100644
  #  else
  #   error unknown platform triplet
  #  endif
-@@ -820,22 +820,22 @@ cat >> conftest.c <<EOF
+@@ -792,22 +792,22 @@ cat >> conftest.c <<EOF
  #  elif _MIPS_SIM == _ABIN32
          mips64-linux-gnuabin32
  #  elif _MIPS_SIM == _ABI64
@@ -76,5 +82,5 @@ index a075ce3..b7f2ee3 100644
          s390x-linux-gnu
  # elif defined(__s390__)
 -- 
-2.20.1
+2.21.0
 
diff --git a/00316-mark-bdist_wininst-unsupported.patch b/00316-mark-bdist_wininst-unsupported.patch
index a6a3faf..b6174c8 100644
--- a/00316-mark-bdist_wininst-unsupported.patch
+++ b/00316-mark-bdist_wininst-unsupported.patch
@@ -1,5 +1,16 @@
+From 1ef328c38ad0ef7fad1652edddd3710885b0a778 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Thu, 20 Dec 2018 12:46:25 +0100
+Subject: [PATCH 9/9] 00316: Mark bdist_wininst unsupported
+
+We remove the exe files from distutil's bdist_wininst.
+So we mark the command as unsupported - and the tests are skipped.
+---
+ Lib/distutils/command/bdist_wininst.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
 diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py
-index 0871a4f..8796b68 100644
+index 3a616883be..ba299a4028 100644
 --- a/Lib/distutils/command/bdist_wininst.py
 +++ b/Lib/distutils/command/bdist_wininst.py
 @@ -12,6 +12,8 @@ from distutils.sysconfig import get_python_version
@@ -11,3 +22,6 @@ index 0871a4f..8796b68 100644
  
      description = "create an executable installer for MS Windows"
  
+-- 
+2.21.0
+
diff --git a/python38.spec b/python38.spec
index 7329aa6..49041de 100644
--- a/python38.spec
+++ b/python38.spec
@@ -14,7 +14,7 @@ URL: https://www.python.org/
 #  WARNING  When rebasing to a new Python version,
 #           remember to update the python3-docs package as well
 %global general_version %{pybasever}.0
-%global prerel a3
+%global prerel a4
 %global upstream_version %{general_version}%{?prerel}
 Version: %{general_version}%{?prerel:~%{prerel}}
 Release: 1%{?dist}
@@ -97,8 +97,8 @@ License: Python
 
 # ABIFLAGS, LDVERSION and SOABI are in the upstream configure.ac
 # See PEP 3149 for some background: http://www.python.org/dev/peps/pep-3149/
-%global ABIFLAGS_optimized m
-%global ABIFLAGS_debug     dm
+%global ABIFLAGS_optimized %{nil}
+%global ABIFLAGS_debug     d
 
 %global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized}
 %global LDVERSION_debug     %{pybasever}%{ABIFLAGS_debug}
@@ -279,6 +279,10 @@ Patch316: 00316-mark-bdist_wininst-unsupported.patch
 # More information, and a patch number catalog, is at:
 #
 #     https://fedoraproject.org/wiki/SIGs/Python/PythonPatches
+#
+# The patches are stored and rebased at:
+#
+#     https://github.com/fedora-python/cpython
 
 
 # ==========================================
@@ -868,9 +872,6 @@ ln -s \
 # See https://bugzilla.redhat.com/show_bug.cgi?id=1111275
 mv %{buildroot}%{_bindir}/2to3-%{pybasever} %{buildroot}%{_bindir}/2to3
 
-# make man python3.Xm work https://bugzilla.redhat.com/show_bug.cgi?id=1612241
-ln -s ./python%{pybasever}.1 %{buildroot}%{_mandir}/man1/python%{pybasever}m.1
-
 %if %{with flatpackage}
 # Remove stuff that would conflict with python3 package
 rm %{buildroot}%{_bindir}/python3
@@ -992,7 +993,7 @@ CheckPython optimized
 %endif
 
 %{_bindir}/python%{pybasever}
-%{_bindir}/python%{pybasever}m
+%{_bindir}/python%{LDVERSION_optimized}
 %{_mandir}/*/*
 
 
@@ -1131,7 +1132,6 @@ CheckPython optimized
 %{dynload_dir}/spwd.%{SOABI_optimized}.so
 %{dynload_dir}/syslog.%{SOABI_optimized}.so
 %{dynload_dir}/termios.%{SOABI_optimized}.so
-%{dynload_dir}/_testmultiphase.%{SOABI_optimized}.so
 %{dynload_dir}/unicodedata.%{SOABI_optimized}.so
 %{dynload_dir}/_uuid.%{SOABI_optimized}.so
 %{dynload_dir}/xxlimited.%{SOABI_optimized}.so
@@ -1308,6 +1308,8 @@ CheckPython optimized
 %{dynload_dir}/_testbuffer.%{SOABI_optimized}.so
 %{dynload_dir}/_testcapi.%{SOABI_optimized}.so
 %{dynload_dir}/_testimportmultiple.%{SOABI_optimized}.so
+%{dynload_dir}/_testinternalcapi.%{SOABI_optimized}.so
+%{dynload_dir}/_testmultiphase.%{SOABI_optimized}.so
 %{dynload_dir}/_xxtestfuzz.%{SOABI_optimized}.so
 %{pylibdir}/lib2to3/tests
 %{pylibdir}/tkinter/test
@@ -1405,7 +1407,6 @@ CheckPython optimized
 %{dynload_dir}/spwd.%{SOABI_debug}.so
 %{dynload_dir}/syslog.%{SOABI_debug}.so
 %{dynload_dir}/termios.%{SOABI_debug}.so
-%{dynload_dir}/_testmultiphase.%{SOABI_debug}.so
 %{dynload_dir}/unicodedata.%{SOABI_debug}.so
 %{dynload_dir}/_uuid.%{SOABI_debug}.so
 %{dynload_dir}/_xxsubinterpreters.%{SOABI_debug}.so
@@ -1439,6 +1440,8 @@ CheckPython optimized
 %{dynload_dir}/_testbuffer.%{SOABI_debug}.so
 %{dynload_dir}/_testcapi.%{SOABI_debug}.so
 %{dynload_dir}/_testimportmultiple.%{SOABI_debug}.so
+%{dynload_dir}/_testinternalcapi.%{SOABI_debug}.so
+%{dynload_dir}/_testmultiphase.%{SOABI_debug}.so
 
 %endif # with debug_build
 
@@ -1463,6 +1466,9 @@ CheckPython optimized
 # ======================================================
 
 %changelog
+* Tue May 07 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.0~a4-1
+- Update to 3.8.0a4
+
 * Tue Mar 26 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.0~a3-1
 - Update to 3.8.0a3
 
diff --git a/sources b/sources
index 4f6b5c4..4536033 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (Python-3.8.0a3.tar.xz) = 2348416c3118d1ff6b88b1ee823046de6a26305c10dd900fcb59fbc5b37a8f54db7afcd2f8e7c927c50c4f317a8c20370478030f996f93c63381d2167247e6fd
+SHA512 (Python-3.8.0a4.tar.xz) = 76088206e3eb4ff0b9060f35e0bf994018452cc98d7f576bf7d6842158a6f6ae173b281c442f1175402428c683667b7bacebb2b989a561a9f12db1ad5f0f42cb