From c931021909bef7aa8aaba1a0d55fe086546527668cad6308b0e013a335da08cb Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 17 Sep 2021 20:43:30 +0000 Subject: [PATCH 1/4] Accepting request 919838 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/919838 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-json5?expand=0&rev=9 --- python-json5.changes | 5 +++++ python-json5.spec | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/python-json5.changes b/python-json5.changes index 16a0abf..efe91e2 100644 --- a/python-json5.changes +++ b/python-json5.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 9 11:01:05 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..81d1222 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 @@ -30,8 +37,12 @@ BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-setuptools +%if %{with libalternatives} +Requires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif BuildArch: noarch %python_subpackages @@ -54,23 +65,47 @@ slightly more usable as a configuration language: %install %python_install -%python_clone -a %{buildroot}%{_bindir}/pyjson5 +%if ! %{with libalternatives} + %python_clone -a %{buildroot}%{_bindir}/pyjson5 +%else + %python_clone %{buildroot}%{_bindir}/pyjson5 + ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/pyjson5 + mkdir -p %{buildroot}%{_datadir}/libalternatives/pyjson5 + %python_expand content="binary=%{_bindir}/pyjson5-%{$python_version}" + %python_expand echo -e $content > %{buildroot}%{_datadir}/libalternatives/pyjson5/10%{$python_version_nodots}.conf +%endif %python_expand rm -rf %{buildroot}%{$python_sitelib}/tests %python_expand %fdupes %{buildroot}%{$python_sitelib} %check %pytest +%if %{with libalternatives} +%pre +# removing old update-alternatives entries +if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then + %python_uninstall_alternative pyjson5 +fi +%else %post %python_install_alternative pyjson5 %postun %python_uninstall_alternative pyjson5 +%endif %files %{python_files} %doc README.md %license LICENSE +%if ! 0%{with libalternatives} %python_alternative %{_bindir}/pyjson5 +%else +%dir %{_datadir}/libalternatives +%dir %{_datadir}/libalternatives/pyjson5 +%{_datadir}/libalternatives/pyjson5/10%python_version_nodots.conf +%{_bindir}/pyjson5 +%{_bindir}/pyjson5-%python_version +%endif %{python_sitelib}/* %changelog From a574f01dc970218115207ca9241b0b05cb9a193ab5ef10f91085f1571f111462 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 19 Sep 2021 17:32:29 +0000 Subject: [PATCH 2/4] Accepting request 920172 from devel:languages:python revert OBS-URL: https://build.opensuse.org/request/show/920172 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-json5?expand=0&rev=10 --- python-json5.changes | 5 ----- python-json5.spec | 37 +------------------------------------ 2 files changed, 1 insertion(+), 41 deletions(-) diff --git a/python-json5.changes b/python-json5.changes index efe91e2..16a0abf 100644 --- a/python-json5.changes +++ b/python-json5.changes @@ -1,8 +1,3 @@ -------------------------------------------------------------------- -Thu Sep 9 11:01:05 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 81d1222..446027e 100644 --- a/python-json5.spec +++ b/python-json5.spec @@ -16,13 +16,6 @@ # -# -%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 @@ -37,12 +30,8 @@ BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-setuptools -%if %{with libalternatives} -Requires: alts -%else Requires(post): update-alternatives Requires(postun):update-alternatives -%endif BuildArch: noarch %python_subpackages @@ -65,47 +54,23 @@ slightly more usable as a configuration language: %install %python_install -%if ! %{with libalternatives} - %python_clone -a %{buildroot}%{_bindir}/pyjson5 -%else - %python_clone %{buildroot}%{_bindir}/pyjson5 - ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/pyjson5 - mkdir -p %{buildroot}%{_datadir}/libalternatives/pyjson5 - %python_expand content="binary=%{_bindir}/pyjson5-%{$python_version}" - %python_expand echo -e $content > %{buildroot}%{_datadir}/libalternatives/pyjson5/10%{$python_version_nodots}.conf -%endif +%python_clone -a %{buildroot}%{_bindir}/pyjson5 %python_expand rm -rf %{buildroot}%{$python_sitelib}/tests %python_expand %fdupes %{buildroot}%{$python_sitelib} %check %pytest -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - %python_uninstall_alternative pyjson5 -fi -%else %post %python_install_alternative pyjson5 %postun %python_uninstall_alternative pyjson5 -%endif %files %{python_files} %doc README.md %license LICENSE -%if ! 0%{with libalternatives} %python_alternative %{_bindir}/pyjson5 -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/pyjson5 -%{_datadir}/libalternatives/pyjson5/10%python_version_nodots.conf -%{_bindir}/pyjson5 -%{_bindir}/pyjson5-%python_version -%endif %{python_sitelib}/* %changelog From 3c2981636ab32e4ef3dc8b74f2831b39fa90dcb34eb0bcd39135ddbe633a8449 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 3 Oct 2021 17:49:36 +0000 Subject: [PATCH 3/4] Accepting request 922604 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/922604 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-json5?expand=0&rev=11 --- python-json5.changes | 5 +++++ python-json5.spec | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/python-json5.changes b/python-json5.changes index 16a0abf..8414c8f 100644 --- a/python-json5.changes +++ b/python-json5.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +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..ba22876 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,14 @@ 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 +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif BuildArch: noarch %python_subpackages @@ -61,6 +72,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 From 8e3ea8a5b2d94074d488cf560cd89ef16f63306877902924a663d04520b8beb9 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 6 Oct 2021 09:48:45 +0000 Subject: [PATCH 4/4] Accepting request 923313 from home:schubi2 - Added BuildRequires: alts OBS-URL: https://build.opensuse.org/request/show/923313 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-json5?expand=0&rev=12 --- python-json5.changes | 5 +++++ python-json5.spec | 1 + 2 files changed, 6 insertions(+) diff --git a/python-json5.changes b/python-json5.changes index 8414c8f..f05bef1 100644 --- a/python-json5.changes +++ b/python-json5.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Oct 5 16:04:01 UTC 2021 - Stefan Schubert + +- Added BuildRequires: alts + ------------------------------------------------------------------- Fri Oct 1 08:16:33 UTC 2021 - Stefan Schubert diff --git a/python-json5.spec b/python-json5.spec index ba22876..f7a23f0 100644 --- a/python-json5.spec +++ b/python-json5.spec @@ -39,6 +39,7 @@ BuildRequires: python-rpm-macros >= 20210929 Requires: python-setuptools %if %{with libalternatives} Requires: alts +BuildRequires: alts %else Requires(post): update-alternatives Requires(postun):update-alternatives