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..709555e 100644 --- a/python38.changes +++ b/python38.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +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. (bsc#1181324) + +------------------------------------------------------------------- +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..da96ce4 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 # @@ -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} @@ -698,10 +699,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 +867,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}