From eecd8bd4f81fac6598fa04f724ca55d4f05791fc15699049cce69fd536c3d3dd Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 5 Feb 2021 23:09:58 +0000 Subject: [PATCH 1/3] Accepting request 869854 from home:bnavigator:branches:devel:languages:python:Factory - Provide %have_ for all python flavors gh#openSUSE/python-rpm-macros#96 - Add %python3_default and %default_python3 for the primary python3 flavor OBS-URL: https://build.opensuse.org/request/show/869854 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python38?expand=0&rev=49 --- macros.python3 | 4 +++- python38.changes | 8 ++++++++ python38.spec | 11 +++++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/macros.python3 b/macros.python3 index 2bd193b..37a501e 100644 --- a/macros.python3 +++ b/macros.python3 @@ -1,3 +1,4 @@ +# macros for the primary python3 providing python flavor %have_python3 1 # commented out legacy macro definitions @@ -25,4 +26,5 @@ find %1 -name '*.pyo' -exec rm -f {} ";"\ python3 -O -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1\ } - +%python3_default %(s=$(rpm -qf /usr/bin/python3); echo ${s%%%%-*}) +%default_python3 %(s=$(rpm -qf /usr/bin/python3); echo ${s%%%%-*}) diff --git a/python38.changes b/python38.changes index f52daa2..d58f94f 100644 --- a/python38.changes +++ b/python38.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Feb 5 15:35:29 UTC 2021 - Ben Greiner + +- Provide %have_ for all python flavors + gh#openSUSE/python-rpm-macros#96 +- Add %python3_default and %default_python3 for the primary python3 + flavor + ------------------------------------------------------------------- Fri Jan 29 17:22:48 UTC 2021 - Matej Cepl diff --git a/python38.spec b/python38.spec index 8d95307..68a8f45 100644 --- a/python38.spec +++ b/python38.spec @@ -1,5 +1,5 @@ # -# spec file for package python38-core +# spec file for package python38 # # Copyright (c) 2021 SUSE LLC # @@ -698,10 +698,16 @@ install -m 755 -D Tools/gdb/libpython.py %{buildroot}%{_datadir}/gdb/auto-load/% #cp Makefile Makefile.pre.in Makefile.pre $RPM_BUILD_ROOT%{sitedir}/config-%{python_abi}/ # RPM macros -%if %{primary_interpreter} mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/ +# primary python3 macros +%if %{primary_interpreter} install -m 644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/macros.d/ # macros.python3 %endif +# flavor specific macros, only to be supplied "if we are in the buildset", e.g. installed. +echo ' +# macros for the %{python_pkg_name} flavor +%%have_%{python_pkg_name} 1 +' > %{buildroot}%{_rpmconfigdir}/macros.d/macros.%{python_pkg_name} # import_failed hooks FAILDIR=%{buildroot}/%{sitedir}/_import_failed @@ -860,6 +866,7 @@ echo %{sitedir}/_import_failed > %{buildroot}/%{sitedir}/site-packages/zzzz-impo %if %{primary_interpreter} %{_rpmconfigdir}/macros.d/macros.python3 %endif +%{_rpmconfigdir}/macros.d/macros.%{python_pkg_name} # binary parts %dir %{sitedir}/lib-dynload %{dynlib array} From 51990694faffa0d5f0397a5f425be5149f3fc3d238a3781503ce7f836241c543 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 9 Feb 2021 01:39:02 +0000 Subject: [PATCH 2/3] - Add Obsoletes for python3-base when primary interpreter is set to properly replace it during upgrades. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python38?expand=0&rev=50 --- python38.changes | 6 ++++++ python38.spec | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/python38.changes b/python38.changes index d58f94f..1c117f8 100644 --- a/python38.changes +++ b/python38.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Feb 9 01:37:01 UTC 2021 - Steve Kowalik + +- Add Obsoletes for python3-base when primary interpreter is set to + properly replace it during upgrades. + ------------------------------------------------------------------- Fri Feb 5 15:35:29 UTC 2021 - Ben Greiner diff --git a/python38.spec b/python38.spec index 68a8f45..da96ce4 100644 --- a/python38.spec +++ b/python38.spec @@ -307,8 +307,9 @@ Provides: %{python_pkg_name}-typing = %{version} Provides: %{python_pkg_name}-xml = %{version} %if %{primary_interpreter} Provides: python3-asyncio = %{version} -Provides: python3-base = %{version} Obsoletes: python3-asyncio < %{version} +Provides: python3-base = %{version} +Obsoletes: python3-base < %{version} Provides: python3-typing = %{version} Obsoletes: python3-typing < %{version} Provides: python3-xml = %{version} From 93edfc48712cd77dbaec0aa8be8e1bd5f646f54ccce59eb9602f00027213ef97 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 9 Feb 2021 01:43:14 +0000 Subject: [PATCH 3/3] Add bug reference OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python38?expand=0&rev=51 --- python38.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python38.changes b/python38.changes index 1c117f8..709555e 100644 --- a/python38.changes +++ b/python38.changes @@ -2,7 +2,7 @@ Tue Feb 9 01:37:01 UTC 2021 - Steve Kowalik - Add Obsoletes for python3-base when primary interpreter is set to - properly replace it during upgrades. + properly replace it during upgrades. (bsc#1181324) ------------------------------------------------------------------- Fri Feb 5 15:35:29 UTC 2021 - Ben Greiner