From 31e86ca3943188ed5088692fd517ba94685ede952f39ee044cd7f610c4c99006 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 3 Oct 2021 17:23:54 +0000 Subject: [PATCH] Accepting request 922624 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/922624 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tempora?expand=0&rev=28 --- python-tempora.changes | 5 +++++ python-tempora.spec | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/python-tempora.changes b/python-tempora.changes index b73804c..b22940a 100644 --- a/python-tempora.changes +++ b/python-tempora.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 30 07:54:19 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Wed Sep 1 11:24:10 UTC 2021 - John Paul Adrian Glaubitz diff --git a/python-tempora.spec b/python-tempora.spec index 1d0825a..88b06df 100644 --- a/python-tempora.spec +++ b/python-tempora.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-tempora @@ -34,11 +40,15 @@ BuildRequires: %{python_module setuptools_scm >= 3.4.1} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module toml} BuildRequires: fdupes -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 Requires: python-jaraco.functools >= 1.20 Requires: python-pytz +%if %{with libalternatives} +Requires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif BuildArch: noarch %python_subpackages @@ -66,6 +76,10 @@ sed -i '/--mypy/d' pytest.ini sed -i -e 's:--black::' -e 's:--cov::' -e 's/--flake8//g' pytest.ini %pytest +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative calc-prorate + %post %python_install_alternative calc-prorate