Accepting request 923312 from home:schubi2

- Use libalternatives instead of update-alternatives.

OBS-URL: https://build.opensuse.org/request/show/923312
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pygments?expand=0&rev=78
This commit is contained in:
Benoît Monin 2021-11-05 18:01:28 +00:00 committed by Git OBS Bridge
parent 3ee1378582
commit 49e9ec500a
2 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Sep 9 08:48:02 UTC 2021 - Stefan Schubert <schubi@suse.de>
- Use libalternatives instead of update-alternatives.
-------------------------------------------------------------------
Thu Jul 15 05:11:04 UTC 2021 - Matej Cepl <mcepl@suse.com>

View File

@ -16,6 +16,13 @@
#
#
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-Pygments
@ -33,10 +40,15 @@ BuildRequires: %{python_module base >= 3.5}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python-rpm-macros >= 20210929
Requires: python-setuptools
%if %{with libalternatives}
Requires: alts
BuildRequires: alts
%else
Requires(post): update-alternatives
Requires(postun):update-alternatives
%endif
Provides: python-pygments = %{version}
Obsoletes: python-pygments < %{version}
BuildArch: noarch
@ -74,6 +86,10 @@ install -Dm0644 doc/pygmentize.1 %{buildroot}%{_mandir}/man1/pygmentize.1
%prepare_alternative pygmentize
%pre
# If libalternatives is used: Removing old update-alternatives entries.
%python_libalternatives_reset_alternative pygmentize
%post
%{python_install_alternative pygmentize pygmentize.1}