From ad87855b2b79e63420f5f0d2c3b95e4b831ae71ab036889f7a9b5dd65b418684 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 6 Nov 2021 10:27:39 +0000 Subject: [PATCH] Accepting request 923262 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/923262 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jsonpointer?expand=0&rev=30 --- python-jsonpointer.changes | 5 +++++ python-jsonpointer.spec | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/python-jsonpointer.changes b/python-jsonpointer.changes index bc31b22..98e1dff 100644 --- a/python-jsonpointer.changes +++ b/python-jsonpointer.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Aug 22 20:52:50 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Mon Mar 15 08:57:07 UTC 2021 - Dirk Müller diff --git a/python-jsonpointer.spec b/python-jsonpointer.spec index c9bcd21..8870122 100644 --- a/python-jsonpointer.spec +++ b/python-jsonpointer.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-%{**}} Name: python-jsonpointer Version: 2.1 @@ -27,9 +33,14 @@ URL: https://github.com/stefankoegl/python-json-pointer Source: https://files.pythonhosted.org/packages/source/j/jsonpointer/jsonpointer-%{version}.tar.gz BuildRequires: %{python_module setuptools} BuildRequires: fdupes -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else Requires(post): update-alternatives Requires(preun): update-alternatives +%endif BuildArch: noarch %python_subpackages @@ -50,6 +61,10 @@ A module to identify specific nodes in a JSON document (according to draft 08). %check %python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python tests.py +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative jsonpointer + %post %python_install_alternative jsonpointer