From ed4a6bb2770bee89a449b25e27f1d20df0fbc394951c998e219b3d95192e2c7a Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 25 Nov 2021 22:24:19 +0000 Subject: [PATCH 1/5] Accepting request 933934 from home:mcepl:branches:devel:languages:python - rpm-build-python dependency is available on the current Factory, not with SLE. OBS-URL: https://build.opensuse.org/request/show/933934 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python39?expand=0&rev=88 --- python39.changes | 6 ++++++ python39.spec | 2 ++ 2 files changed, 8 insertions(+) diff --git a/python39.changes b/python39.changes index 9edb8b3..c141a30 100644 --- a/python39.changes +++ b/python39.changes @@ -87,6 +87,12 @@ Wed Nov 17 09:49:22 UTC 2021 - Steve Kowalik + bpo-44751: Remove crypt.h include from the public Python.h header. - Drop patch incorrect-deprecation-warn-asyncio.patch, fix included. +------------------------------------------------------------------- +Sat Nov 6 13:45:01 UTC 2021 - Matej Cepl + +- rpm-build-python dependency is available on the current + Factory, not with SLE. + ------------------------------------------------------------------- Sat Oct 30 12:37:34 UTC 2021 - Matej Cepl diff --git a/python39.spec b/python39.spec index 97d2b28..2a098e5 100644 --- a/python39.spec +++ b/python39.spec @@ -159,8 +159,10 @@ BuildRequires: lzma-devel BuildRequires: netcfg BuildRequires: openssl-devel BuildRequires: pkgconfig +%if 0%{?suse_version} >= 1550 # The provider for python(abi) is in rpm-build-python BuildRequires: rpm-build-python +%endif BuildRequires: xz BuildRequires: pkgconfig(bzip2) BuildRequires: pkgconfig(expat) From 41195dffc1be082167a3bcbf9bdff725a55504051808bf06dcab10e63b459954 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 29 Nov 2021 00:33:07 +0000 Subject: [PATCH 2/5] - Don't collect automatic Requires from python-base libraries in %%_libdir. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python39?expand=0&rev=89 --- python39.changes | 6 ++++++ python39.spec | 2 ++ 2 files changed, 8 insertions(+) diff --git a/python39.changes b/python39.changes index c141a30..0e90632 100644 --- a/python39.changes +++ b/python39.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Nov 29 00:17:07 UTC 2021 - Matej Cepl + +- Don't collect automatic Requires from python-base libraries in + %%_libdir. + ------------------------------------------------------------------- Wed Nov 17 09:49:22 UTC 2021 - Steve Kowalik diff --git a/python39.spec b/python39.spec index 2a098e5..64b9f87 100644 --- a/python39.spec +++ b/python39.spec @@ -315,6 +315,8 @@ Provides: python3-typing = %{version} Obsoletes: python3-typing < %{version} Provides: python3-xml = %{version} Obsoletes: python3-xml < %{version} +%else +%define __requires_exclude_from ^%{_libdir}/python%{python_version}/.*$ %endif %description -n %{python_pkg_name}-base From b52e0022b1408d510e6a8520a71f0700d10f467085b7f92b32bc3a9563dd9ed7 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 29 Nov 2021 00:34:06 +0000 Subject: [PATCH 3/5] Fix changes OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python39?expand=0&rev=90 --- python39.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python39.changes b/python39.changes index 0e90632..78df483 100644 --- a/python39.changes +++ b/python39.changes @@ -2,7 +2,7 @@ Mon Nov 29 00:17:07 UTC 2021 - Matej Cepl - Don't collect automatic Requires from python-base libraries in - %%_libdir. + %_libdir (bsc#1192249). ------------------------------------------------------------------- Wed Nov 17 09:49:22 UTC 2021 - Steve Kowalik From 14c194c8856dfe54bfb25a75bda3f155132b6efd3ce4d4708b53791116c33747 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 29 Nov 2021 16:33:18 +0000 Subject: [PATCH 4/5] - Remove shebangs from from python-base libraries in _libdir (bsc#1193179). - Readjust patches: - bpo-31046_ensurepip_honours_prefix.patch - decimal.patch - python-3.3.0b1-fix_date_time_compiler.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python39?expand=0&rev=91 --- bpo-31046_ensurepip_honours_prefix.patch | 12 ++++++------ decimal.patch | 2 +- python-3.3.0b1-fix_date_time_compiler.patch | 2 +- python39.changes | 8 ++++++-- python39.spec | 10 ++++++++-- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/bpo-31046_ensurepip_honours_prefix.patch b/bpo-31046_ensurepip_honours_prefix.patch index 72eef97..f270184 100644 --- a/bpo-31046_ensurepip_honours_prefix.patch +++ b/bpo-31046_ensurepip_honours_prefix.patch @@ -55,7 +55,7 @@ Co-Authored-By: Xavier de Gaye .. note:: --- a/Lib/ensurepip/__init__.py +++ b/Lib/ensurepip/__init__.py -@@ -56,27 +56,27 @@ def _disable_pip_configuration_settings( +@@ -52,27 +52,27 @@ def _disable_pip_configuration_settings( os.environ['PIP_CONFIG_FILE'] = os.devnull @@ -88,7 +88,7 @@ Co-Authored-By: Xavier de Gaye Note that calling this function will alter both sys.path and os.environ. """ -@@ -119,6 +119,8 @@ def _bootstrap(*, root=None, upgrade=Fal +@@ -115,6 +115,8 @@ def _bootstrap(*, root=None, upgrade=Fal args = ["install", "--no-cache-dir", "--no-index", "--find-links", tmpdir] if root: args += ["--root", root] @@ -97,7 +97,7 @@ Co-Authored-By: Xavier de Gaye if upgrade: args += ["--upgrade"] if user: -@@ -191,6 +193,11 @@ def _main(argv=None): +@@ -187,6 +189,11 @@ def _main(argv=None): help="Install everything relative to this alternate root directory.", ) parser.add_argument( @@ -109,7 +109,7 @@ Co-Authored-By: Xavier de Gaye "--altinstall", action="store_true", default=False, -@@ -209,6 +216,7 @@ def _main(argv=None): +@@ -205,6 +212,7 @@ def _main(argv=None): return _bootstrap( root=args.root, @@ -139,7 +139,7 @@ Co-Authored-By: Xavier de Gaye --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1263,7 +1263,7 @@ install: @FRAMEWORKINSTALLFIRST@ commoni +@@ -1262,7 +1262,7 @@ install: @FRAMEWORKINSTALLFIRST@ commoni install|*) ensurepip="" ;; \ esac; \ $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \ @@ -148,7 +148,7 @@ Co-Authored-By: Xavier de Gaye fi altinstall: commoninstall -@@ -1273,7 +1273,7 @@ altinstall: commoninstall +@@ -1272,7 +1272,7 @@ altinstall: commoninstall install|*) ensurepip="--altinstall" ;; \ esac; \ $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \ diff --git a/decimal.patch b/decimal.patch index 0bc3bfc..0a7f154 100644 --- a/decimal.patch +++ b/decimal.patch @@ -25,7 +25,7 @@ if (sep == NULL) { --- a/setup.py +++ b/setup.py -@@ -2201,7 +2201,7 @@ class PyBuildExt(build_ext): +@@ -2203,7 +2203,7 @@ class PyBuildExt(build_ext): undef_macros = [] if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"): include_dirs = [] diff --git a/python-3.3.0b1-fix_date_time_compiler.patch b/python-3.3.0b1-fix_date_time_compiler.patch index a88b0f1..29586aa 100644 --- a/python-3.3.0b1-fix_date_time_compiler.patch +++ b/python-3.3.0b1-fix_date_time_compiler.patch @@ -4,7 +4,7 @@ --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -782,11 +782,18 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \ +@@ -781,11 +781,18 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \ $(DTRACE_OBJS) \ $(srcdir)/Modules/getbuildinfo.c $(CC) -c $(PY_CORE_CFLAGS) \ diff --git a/python39.changes b/python39.changes index 78df483..e2b8a57 100644 --- a/python39.changes +++ b/python39.changes @@ -1,8 +1,12 @@ ------------------------------------------------------------------- Mon Nov 29 00:17:07 UTC 2021 - Matej Cepl -- Don't collect automatic Requires from python-base libraries in - %_libdir (bsc#1192249). +- Remove shebangs from from python-base libraries in _libdir + (bsc#1193179). +- Readjust patches: + - bpo-31046_ensurepip_honours_prefix.patch + - decimal.patch + - python-3.3.0b1-fix_date_time_compiler.patch ------------------------------------------------------------------- Wed Nov 17 09:49:22 UTC 2021 - Steve Kowalik diff --git a/python39.spec b/python39.spec index 64b9f87..533b853 100644 --- a/python39.spec +++ b/python39.spec @@ -315,8 +315,6 @@ Provides: python3-typing = %{version} Obsoletes: python3-typing < %{version} Provides: python3-xml = %{version} Obsoletes: python3-xml < %{version} -%else -%define __requires_exclude_from ^%{_libdir}/python%{python_version}/.*$ %endif %description -n %{python_pkg_name}-base @@ -416,6 +414,7 @@ other applications. # drop Autoconf version requirement sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac +%if %{primary_interpreter} # fix shebangs - convert /usr/local/bin/python and /usr/bin/env/python to /usr/bin/python3 for dir in Lib Tools; do # find *.py, filter to files that contain bad shebangs @@ -424,6 +423,13 @@ for dir in Lib Tools; do | xargs -0 grep -lE '^#! *(/''usr/.*bin/(env +)?)?python' \ | xargs sed -r -i -e '1s@^#![[:space:]]*(/''usr/(local/)?bin/(env +)?)?python([0-9]+(\.[0-9]+)?)?@#!%{_bindir}/python3@' done +%else +# For non-primary Python, just don't bother (bsc#1193179) and remove all +# those shebangs +for dir in Lib Tools; do + find $dir -name '*.py' -type f -exec sed -i '1{/^#!.*python/ d}' '{}' \; +done +%endif # drop in-tree libffi and expat rm -r Modules/_ctypes/libffi* Modules/_ctypes/darwin From df2471a1fa1c27379565717a2d5cb28e43429ac61886a2dda59dad083503a164 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 29 Nov 2021 21:19:34 +0000 Subject: [PATCH 5/5] Run spec-cleaner OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python39?expand=0&rev=92 --- python39.spec | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python39.spec b/python39.spec index 533b853..a68a611 100644 --- a/python39.spec +++ b/python39.spec @@ -124,13 +124,13 @@ Source100: PACKAGING-NOTES # to /usr/local if executable is /usr/bin/python* and RPM build # is not detected to make pip and distutils install into separate location Patch02: F00251-change-user-install-location.patch -# PATCH-FEATURE-UPSTREAM distutils-reproducible-compile.patch gh#python/cpython#8057 mcepl@suse.com -# Improve reproduceability -Patch06: distutils-reproducible-compile.patch # PATCH-FEATURE-UPSTREAM decimal.patch bsc#1189356 mcepl@suse.com # fix building with mpdecimal # https://www.bytereef.org/contrib/decimal.diff Patch05: decimal.patch +# PATCH-FEATURE-UPSTREAM distutils-reproducible-compile.patch gh#python/cpython#8057 mcepl@suse.com +# Improve reproduceability +Patch06: distutils-reproducible-compile.patch # support finding packages in /usr/local, install to /usr/local by default Patch07: python-3.3.0b1-localpath.patch # replace DATE, TIME and COMPILER by fixed definitions to aid reproducible builds @@ -159,10 +159,6 @@ BuildRequires: lzma-devel BuildRequires: netcfg BuildRequires: openssl-devel BuildRequires: pkgconfig -%if 0%{?suse_version} >= 1550 -# The provider for python(abi) is in rpm-build-python -BuildRequires: rpm-build-python -%endif BuildRequires: xz BuildRequires: pkgconfig(bzip2) BuildRequires: pkgconfig(expat) @@ -170,6 +166,10 @@ BuildRequires: pkgconfig(libffi) BuildRequires: pkgconfig(uuid) BuildRequires: pkgconfig(zlib) #!BuildIgnore: gdk-pixbuf-loader-rsvg +%if 0%{?suse_version} >= 1550 +# The provider for python(abi) is in rpm-build-python +BuildRequires: rpm-build-python +%endif %if 0%{?suse_version} >= 1500 BuildRequires: pkgconfig(libnsl) BuildRequires: pkgconfig(libtirpc)