diff --git a/python-pysmi.changes b/python-pysmi.changes index aced58e..c93a426 100644 --- a/python-pysmi.changes +++ b/python-pysmi.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 30 20:13:20 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Mon Oct 14 14:17:08 UTC 2019 - Matej Cepl diff --git a/python-pysmi.spec b/python-pysmi.spec index 1cf8cde..15d1c5e 100644 --- a/python-pysmi.spec +++ b/python-pysmi.spec @@ -1,7 +1,7 @@ # # spec file for package python-pysmi # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pysmi Version: 0.3.4 @@ -26,10 +32,14 @@ URL: http://pysmi.sourceforge.net/ Source: https://files.pythonhosted.org/packages/source/p/pysmi/pysmi-%{version}.tar.gz BuildRequires: %{python_module ply} BuildRequires: fdupes -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 Requires: python-ply +%if %{with libalternatives} +Requires: alts +%else Requires(post): update-alternatives Requires(postun): update-alternatives +%endif BuildArch: noarch %python_subpackages @@ -53,6 +63,10 @@ mv %{buildroot}%{_bindir}/mibcopy.py %{buildroot}%{_bindir}/mibcopy %python_clone -a %{buildroot}%{_bindir}/mibcopy %python_expand %fdupes %{buildroot}%{$python_sitelib} +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative mibdump + %post %python_install_alternative mibdump