diff --git a/python-netaddr.changes b/python-netaddr.changes index a4d187f..4e48d22 100644 --- a/python-netaddr.changes +++ b/python-netaddr.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 21 10:00:05 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems only + ------------------------------------------------------------------- Wed Jul 16 10:07:02 UTC 2025 - Markéta Machová diff --git a/python-netaddr.spec b/python-netaddr.spec index 162a7f5..8c1351c 100644 --- a/python-netaddr.spec +++ b/python-netaddr.spec @@ -16,7 +16,11 @@ # +%if 0%{?suse_version} > 1500 %bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-netaddr Version: 1.3.0 @@ -29,11 +33,16 @@ Source: https://files.pythonhosted.org/packages/source/n/netaddr/netaddr BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} -BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: alts BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif # SECTION test BuildRequires: %{python_module iniconfig} BuildRequires: %{python_module packaging} @@ -74,6 +83,12 @@ sed -i "1{\@%{_bindir}/env python@d}" netaddr/{cli,ip/iana,eui/ieee}.py # Fix no %check %pytest +%post +%python_install_alternative netaddr + +%postun +%python_uninstall_alternative netaddr + %pre %python_libalternatives_reset_alternative netaddr