From ab23a4b7961bd0341ec4eba7c36fc908a1b51fa74fe9d1b5430f5f541e8ddd84 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 6 Nov 2021 10:35:34 +0000 Subject: [PATCH] Accepting request 923263 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/923263 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jsonschema?expand=0&rev=48 --- python-jsonschema.changes | 5 +++++ python-jsonschema.spec | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/python-jsonschema.changes b/python-jsonschema.changes index c4a8c85..f771acc 100644 --- a/python-jsonschema.changes +++ b/python-jsonschema.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Aug 22 21:08:31 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Tue May 25 07:59:29 UTC 2021 - pgajdos@suse.com diff --git a/python-jsonschema.spec b/python-jsonschema.spec index ebf6a20..26a96e5 100644 --- a/python-jsonschema.spec +++ b/python-jsonschema.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-jsonschema @@ -40,13 +46,18 @@ BuildRequires: %{python_module six >= 1.11.0} BuildRequires: %{python_module strict-rfc3339} BuildRequires: %{python_module webcolors} BuildRequires: fdupes -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 Requires: python-attrs >= 17.4.0 Requires: python-importlib-metadata Requires: python-pyrsistent >= 0.14.0 Requires: python-six >= 1.11.0 +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else Requires(post): update-alternatives Requires(preun):update-alternatives +%endif BuildArch: noarch %python_subpackages @@ -74,6 +85,10 @@ for Python (supporting 2.6+ including Python 3). %check %pytest jsonschema/tests +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative jsonschema + %post %python_install_alternative jsonschema