From ceb55f253bd5a377bd574fb2400a7a61b505e82d1e11a64f84d7df8eabbce026 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 3 Oct 2021 17:47:00 +0000 Subject: [PATCH] Accepting request 922615 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/922615 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pecan?expand=0&rev=58 --- python-pecan.changes | 5 +++++ python-pecan.spec | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/python-pecan.changes b/python-pecan.changes index 485878f..bc09c0b 100644 --- a/python-pecan.changes +++ b/python-pecan.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Oct 1 09:26:15 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Thu May 27 06:49:51 UTC 2021 - pgajdos@suse.com diff --git a/python-pecan.spec b/python-pecan.spec index 02575de..0a79f07 100644 --- a/python-pecan.spec +++ b/python-pecan.spec @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-pecan @@ -44,15 +50,19 @@ BuildRequires: uwsgi # we need sqlite module BuildRequires: %{pythons} BuildRequires: fdupes -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 Requires: python-Mako >= 0.4.0 Requires: python-WebOb >= 1.8 Requires: python-WebTest >= 1.3.1 Requires: python-logutils >= 0.3 Requires: python-setuptools Requires: python-six +%if %{with libalternatives} +Requires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif BuildArch: noarch %if 0%{?suse_version} Suggests: python-Genshi @@ -84,6 +94,11 @@ sed -ie "/^pep8$/d" test-requirements.txt %check %pyunittest discover -v +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative pecan +%python_libalternatives_reset_alternative gunicorn_pecan + %post %python_install_alternative pecan %python_install_alternative gunicorn_pecan