From a696184eb5a001902e95370993b214f3721ae67ffb4bc2f1ca4a0366c05ce506 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 17 Sep 2021 20:46:29 +0000 Subject: [PATCH 1/4] Accepting request 919796 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/919796 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Babel?expand=0&rev=59 --- python-Babel.changes | 5 +++++ python-Babel.spec | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/python-Babel.changes b/python-Babel.changes index b4c30aa..d0763c3 100644 --- a/python-Babel.changes +++ b/python-Babel.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 23 07:34:43 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Tue May 11 21:40:39 UTC 2021 - Dirk Müller diff --git a/python-Babel.spec b/python-Babel.spec index 7e93cd0..5509736 100644 --- a/python-Babel.spec +++ b/python-Babel.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 oldpython python Name: python-Babel @@ -33,8 +39,12 @@ BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-pytz >= 2015.7 +%if %{with libalternatives} +Requires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif BuildArch: noarch %ifpython2 Obsoletes: %{oldpython}-babel < %{version} @@ -57,7 +67,14 @@ A collection of tools for internationalizing Python applications. %install %python_install -%python_clone -a %{buildroot}%{_bindir}/pybabel +%if ! %{with libalternatives} + %python_clone -a %{buildroot}%{_bindir}/pybabel +%else + %python_clone %{buildroot}%{_bindir}/pybabel + ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/pybabel + mkdir -p %{buildroot}%{_datadir}/libalternatives/pybabel + %python_expand echo "binary=%{_bindir}/pybabel-%{$python_version}" > %{buildroot}%{_datadir}/libalternatives/pybabel/10%{$python_version_nodots}.conf +%endif %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -67,17 +84,31 @@ A collection of tools for internationalizing Python applications. # Since /usr/bin/pybabel became ghosted to be used with update-alternatives, we have to get rid # of the old binary resulting from the non-update-alternativies-ified package: [ -h %{_bindir}/pybabel ] || rm -f %{_bindir}/pybabel - +%if %{with libalternatives} +# removing old update-alternatives entries +if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ]; then + %python_uninstall_alternative pybabel +fi +%else %post %python_install_alternative pybabel %postun %python_uninstall_alternative pybabel +%endif %files %{python_files} %license LICENSE %doc CHANGES +%if ! 0%{with libalternatives} %python_alternative %{_bindir}/pybabel +%else +%dir %{_datadir}/libalternatives +%dir %{_datadir}/libalternatives/pybabel +%{_datadir}/libalternatives/pybabel/10%python_version_nodots.conf +%{_bindir}/pybabel +%{_bindir}/pybabel-%python_version +%endif %{python_sitelib}/babel %{python_sitelib}/Babel-%{version}-py%{python_version}.egg-info From 47fbb63c6c1ff66f8a289706b99eaf59c6155887f072ae034b4e06a0278508c2 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 19 Sep 2021 17:36:52 +0000 Subject: [PATCH 2/4] Accepting request 920175 from devel:languages:python revert OBS-URL: https://build.opensuse.org/request/show/920175 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Babel?expand=0&rev=60 --- python-Babel.changes | 5 ----- python-Babel.spec | 35 ++--------------------------------- 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/python-Babel.changes b/python-Babel.changes index d0763c3..b4c30aa 100644 --- a/python-Babel.changes +++ b/python-Babel.changes @@ -1,8 +1,3 @@ -------------------------------------------------------------------- -Mon Aug 23 07:34:43 UTC 2021 - Stefan Schubert - -- Use libalternatives instead of update-alternatives. - ------------------------------------------------------------------- Tue May 11 21:40:39 UTC 2021 - Dirk Müller diff --git a/python-Babel.spec b/python-Babel.spec index 5509736..7e93cd0 100644 --- a/python-Babel.spec +++ b/python-Babel.spec @@ -16,12 +16,6 @@ # -%if 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define oldpython python Name: python-Babel @@ -39,12 +33,8 @@ BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-pytz >= 2015.7 -%if %{with libalternatives} -Requires: alts -%else Requires(post): update-alternatives Requires(postun):update-alternatives -%endif BuildArch: noarch %ifpython2 Obsoletes: %{oldpython}-babel < %{version} @@ -67,14 +57,7 @@ A collection of tools for internationalizing Python applications. %install %python_install -%if ! %{with libalternatives} - %python_clone -a %{buildroot}%{_bindir}/pybabel -%else - %python_clone %{buildroot}%{_bindir}/pybabel - ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/pybabel - mkdir -p %{buildroot}%{_datadir}/libalternatives/pybabel - %python_expand echo "binary=%{_bindir}/pybabel-%{$python_version}" > %{buildroot}%{_datadir}/libalternatives/pybabel/10%{$python_version_nodots}.conf -%endif +%python_clone -a %{buildroot}%{_bindir}/pybabel %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -84,31 +67,17 @@ A collection of tools for internationalizing Python applications. # Since /usr/bin/pybabel became ghosted to be used with update-alternatives, we have to get rid # of the old binary resulting from the non-update-alternativies-ified package: [ -h %{_bindir}/pybabel ] || rm -f %{_bindir}/pybabel -%if %{with libalternatives} -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ]; then - %python_uninstall_alternative pybabel -fi -%else + %post %python_install_alternative pybabel %postun %python_uninstall_alternative pybabel -%endif %files %{python_files} %license LICENSE %doc CHANGES -%if ! 0%{with libalternatives} %python_alternative %{_bindir}/pybabel -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/pybabel -%{_datadir}/libalternatives/pybabel/10%python_version_nodots.conf -%{_bindir}/pybabel -%{_bindir}/pybabel-%python_version -%endif %{python_sitelib}/babel %{python_sitelib}/Babel-%{version}-py%{python_version}.egg-info From 528300e19677a86221112d1323a060e9e0fe83ace680e46397ab502279bcba91 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 3 Oct 2021 17:50:08 +0000 Subject: [PATCH 3/4] Accepting request 922593 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/922593 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Babel?expand=0&rev=61 --- python-Babel.changes | 5 +++++ python-Babel.spec | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/python-Babel.changes b/python-Babel.changes index b4c30aa..dc30ddc 100644 --- a/python-Babel.changes +++ b/python-Babel.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 30 15:35:45 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Tue May 11 21:40:39 UTC 2021 - Dirk Müller diff --git a/python-Babel.spec b/python-Babel.spec index 7e93cd0..8b2122e 100644 --- a/python-Babel.spec +++ b/python-Babel.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-%{**}} %define oldpython python Name: python-Babel @@ -31,10 +38,14 @@ BuildRequires: %{python_module pytest >= 2.3.5} BuildRequires: %{python_module pytz >= 2015.7} BuildRequires: %{python_module setuptools} BuildRequires: fdupes -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 Requires: python-pytz >= 2015.7 +%if %{with libalternatives} +Requires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif BuildArch: noarch %ifpython2 Obsoletes: %{oldpython}-babel < %{version} @@ -67,6 +78,8 @@ A collection of tools for internationalizing Python applications. # Since /usr/bin/pybabel became ghosted to be used with update-alternatives, we have to get rid # of the old binary resulting from the non-update-alternativies-ified package: [ -h %{_bindir}/pybabel ] || rm -f %{_bindir}/pybabel +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative pybabel %post %python_install_alternative pybabel From 57138b9b54ab910929fbe51273e176dbdba11d10117e50c35d0fc5e7b7723e58 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 6 Oct 2021 07:35:26 +0000 Subject: [PATCH 4/4] Accepting request 923278 from home:schubi2 - Added BuildRequires: alts OBS-URL: https://build.opensuse.org/request/show/923278 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Babel?expand=0&rev=62 --- python-Babel.changes | 5 +++++ python-Babel.spec | 1 + 2 files changed, 6 insertions(+) diff --git a/python-Babel.changes b/python-Babel.changes index dc30ddc..4255aa3 100644 --- a/python-Babel.changes +++ b/python-Babel.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Oct 5 14:53:29 UTC 2021 - Stefan Schubert + +- Added BuildRequires: alts + ------------------------------------------------------------------- Thu Sep 30 15:35:45 UTC 2021 - Stefan Schubert diff --git a/python-Babel.spec b/python-Babel.spec index 8b2122e..0a15c20 100644 --- a/python-Babel.spec +++ b/python-Babel.spec @@ -42,6 +42,7 @@ BuildRequires: python-rpm-macros >= 20210929 Requires: python-pytz >= 2015.7 %if %{with libalternatives} Requires: alts +BuildRequires: alts %else Requires(post): update-alternatives Requires(postun):update-alternatives