diff --git a/python-json5.changes b/python-json5.changes index 16a0abf..f05bef1 100644 --- a/python-json5.changes +++ b/python-json5.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Tue Oct 5 16:04:01 UTC 2021 - Stefan Schubert + +- Added BuildRequires: alts + +------------------------------------------------------------------- +Fri Oct 1 08:16:33 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Tue Jun 22 08:52:38 UTC 2021 - Paolo Stivanin diff --git a/python-json5.spec b/python-json5.spec index 446027e..f7a23f0 100644 --- a/python-json5.spec +++ b/python-json5.spec @@ -16,6 +16,13 @@ # +# +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-json5 Version: 0.9.6 @@ -28,10 +35,15 @@ Source: https://github.com/dpranke/pyjson5/archive/v%{version}.tar.gz#/p 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 BuildArch: noarch %python_subpackages @@ -61,6 +73,10 @@ slightly more usable as a configuration language: %check %pytest +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative pyjson5 + %post %python_install_alternative pyjson5