From 49e9ec500ae2904e71172d830cf768cc5a202f88c032482361ab7ef17b41afe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Monin?= Date: Fri, 5 Nov 2021 18:01:28 +0000 Subject: [PATCH] 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 --- python-Pygments.changes | 5 +++++ python-Pygments.spec | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/python-Pygments.changes b/python-Pygments.changes index c4e9699..2dff35e 100644 --- a/python-Pygments.changes +++ b/python-Pygments.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 9 08:48:02 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Thu Jul 15 05:11:04 UTC 2021 - Matej Cepl diff --git a/python-Pygments.spec b/python-Pygments.spec index fdd96a7..8c9357f 100644 --- a/python-Pygments.spec +++ b/python-Pygments.spec @@ -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}