diff --git a/python-py-cpuinfo.changes b/python-py-cpuinfo.changes index 8de5cea..4d4b04a 100644 --- a/python-py-cpuinfo.changes +++ b/python-py-cpuinfo.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Aug 13 09:53:29 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems only + ------------------------------------------------------------------- Mon Jun 9 15:08:49 UTC 2025 - Markéta Machová diff --git a/python-py-cpuinfo.spec b/python-py-cpuinfo.spec index 00fdb30..4adc3ff 100644 --- a/python-py-cpuinfo.spec +++ b/python-py-cpuinfo.spec @@ -17,7 +17,11 @@ %bcond_without tests +%if 0%{?suse_version} > 1500 %bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-py-cpuinfo Version: 9.0.0 @@ -30,10 +34,15 @@ Source: https://files.pythonhosted.org/packages/source/p/py-cpuinfo/py-c BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} -BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros +%if %{with libalternatives} +BuildRequires: alts Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif BuildArch: noarch %python_subpackages @@ -77,6 +86,12 @@ sed -i '1{ /^#!/d; }' cpuinfo/*.py %pre %python_libalternatives_reset_alternative cpuinfo +%post +%python_install_alternative cpuinfo + +%postun +%python_uninstall_alternative cpuinfo + %files %{python_files} %license LICENSE %doc README.rst ChangeLog