From 3e0e915738329b2f9919b30ff19e1f0547de433ab3b585b7ba05a779d28cd4ce Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 17 Sep 2021 20:48:26 +0000 Subject: [PATCH 1/4] Accepting request 919785 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/919785 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tempora?expand=0&rev=26 --- python-tempora.changes | 5 +++++ python-tempora.spec | 36 +++++++++++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/python-tempora.changes b/python-tempora.changes index b73804c..8d766ad 100644 --- a/python-tempora.changes +++ b/python-tempora.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Sep 1 12:24:10 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Wed Sep 1 11:24:10 UTC 2021 - John Paul Adrian Glaubitz diff --git a/python-tempora.spec b/python-tempora.spec index 1d0825a..4ca250a 100644 --- a/python-tempora.spec +++ b/python-tempora.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-tempora @@ -37,8 +43,12 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-jaraco.functools >= 1.20 Requires: python-pytz +%if %{with libalternatives} +Requires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif BuildArch: noarch %python_subpackages @@ -59,23 +69,47 @@ sed -i '/--mypy/d' pytest.ini %install %python_install -%python_clone -a %{buildroot}%{_bindir}/calc-prorate +%if ! %{with libalternatives} + %python_clone -a %{buildroot}%{_bindir}/calc-prorate +%else + %python_clone %{buildroot}%{_bindir}/calc-prorate + ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/calc-prorate + mkdir -p %{buildroot}%{_datadir}/libalternatives/calc-prorate + %python_expand echo "binary=%{_bindir}/calc-prorate-%{$python_version}" > %{buildroot}%{_datadir}/libalternatives/calc-prorate/10%{$python_version_nodots}.conf +%endif + %python_expand %fdupes %{buildroot}%{$python_sitelib} %check sed -i -e 's:--black::' -e 's:--cov::' -e 's/--flake8//g' pytest.ini %pytest +%if %{with libalternatives} +%pre +# removing old update-alternatives entries +if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then + %python_uninstall_alternative calc-prorate +fi +%else %post %python_install_alternative calc-prorate %postun %python_uninstall_alternative calc-prorate +%endif %files %{python_files} %license LICENSE %doc CHANGES.rst README.rst docs/*rst +%if ! 0%{with libalternatives} %python_alternative %{_bindir}/calc-prorate +%else +%dir %{_datadir}/libalternatives +%dir %{_datadir}/libalternatives/calc-prorate +%{_datadir}/libalternatives/calc-prorate/10%python_version_nodots.conf +%{_bindir}/calc-prorate +%{_bindir}/calc-prorate-%python_version +%endif %{python_sitelib}/tempora %{python_sitelib}/tempora-%{version}-py*.egg-info From 692fce84c37671aa9de5e22fc928603b823ed45a13b53643441479058cd1221e Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 19 Sep 2021 17:22:37 +0000 Subject: [PATCH 2/4] Accepting request 920166 from devel:languages:python revert OBS-URL: https://build.opensuse.org/request/show/920166 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tempora?expand=0&rev=27 --- python-tempora.changes | 5 ----- python-tempora.spec | 36 +----------------------------------- 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/python-tempora.changes b/python-tempora.changes index 8d766ad..b73804c 100644 --- a/python-tempora.changes +++ b/python-tempora.changes @@ -1,8 +1,3 @@ -------------------------------------------------------------------- -Wed Sep 1 12:24:10 UTC 2021 - Stefan Schubert - -- Use libalternatives instead of update-alternatives. - ------------------------------------------------------------------- Wed Sep 1 11:24:10 UTC 2021 - John Paul Adrian Glaubitz diff --git a/python-tempora.spec b/python-tempora.spec index 4ca250a..1d0825a 100644 --- a/python-tempora.spec +++ b/python-tempora.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 skip_python2 1 Name: python-tempora @@ -43,12 +37,8 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-jaraco.functools >= 1.20 Requires: python-pytz -%if %{with libalternatives} -Requires: alts -%else Requires(post): update-alternatives Requires(postun):update-alternatives -%endif BuildArch: noarch %python_subpackages @@ -69,47 +59,23 @@ sed -i '/--mypy/d' pytest.ini %install %python_install -%if ! %{with libalternatives} - %python_clone -a %{buildroot}%{_bindir}/calc-prorate -%else - %python_clone %{buildroot}%{_bindir}/calc-prorate - ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/calc-prorate - mkdir -p %{buildroot}%{_datadir}/libalternatives/calc-prorate - %python_expand echo "binary=%{_bindir}/calc-prorate-%{$python_version}" > %{buildroot}%{_datadir}/libalternatives/calc-prorate/10%{$python_version_nodots}.conf -%endif - +%python_clone -a %{buildroot}%{_bindir}/calc-prorate %python_expand %fdupes %{buildroot}%{$python_sitelib} %check sed -i -e 's:--black::' -e 's:--cov::' -e 's/--flake8//g' pytest.ini %pytest -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - %python_uninstall_alternative calc-prorate -fi -%else %post %python_install_alternative calc-prorate %postun %python_uninstall_alternative calc-prorate -%endif %files %{python_files} %license LICENSE %doc CHANGES.rst README.rst docs/*rst -%if ! 0%{with libalternatives} %python_alternative %{_bindir}/calc-prorate -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/calc-prorate -%{_datadir}/libalternatives/calc-prorate/10%python_version_nodots.conf -%{_bindir}/calc-prorate -%{_bindir}/calc-prorate-%python_version -%endif %{python_sitelib}/tempora %{python_sitelib}/tempora-%{version}-py*.egg-info From 31e86ca3943188ed5088692fd517ba94685ede952f39ee044cd7f610c4c99006 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 3 Oct 2021 17:23:54 +0000 Subject: [PATCH 3/4] Accepting request 922624 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/922624 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tempora?expand=0&rev=28 --- python-tempora.changes | 5 +++++ python-tempora.spec | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/python-tempora.changes b/python-tempora.changes index b73804c..b22940a 100644 --- a/python-tempora.changes +++ b/python-tempora.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 30 07:54:19 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Wed Sep 1 11:24:10 UTC 2021 - John Paul Adrian Glaubitz diff --git a/python-tempora.spec b/python-tempora.spec index 1d0825a..88b06df 100644 --- a/python-tempora.spec +++ b/python-tempora.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-tempora @@ -34,11 +40,15 @@ BuildRequires: %{python_module setuptools_scm >= 3.4.1} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module toml} BuildRequires: fdupes -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 Requires: python-jaraco.functools >= 1.20 Requires: python-pytz +%if %{with libalternatives} +Requires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif BuildArch: noarch %python_subpackages @@ -66,6 +76,10 @@ sed -i '/--mypy/d' pytest.ini sed -i -e 's:--black::' -e 's:--cov::' -e 's/--flake8//g' pytest.ini %pytest +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative calc-prorate + %post %python_install_alternative calc-prorate From d2e45c56c5aabb6e1ea32fdc44cc9b97109105ea8f8ed38691b3d942c2b29265 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 5 Oct 2021 13:48:04 +0000 Subject: [PATCH 4/4] Accepting request 923242 from home:schubi2 - Added BuildRequires: alts OBS-URL: https://build.opensuse.org/request/show/923242 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tempora?expand=0&rev=29 --- python-tempora.changes | 5 +++++ python-tempora.spec | 1 + 2 files changed, 6 insertions(+) diff --git a/python-tempora.changes b/python-tempora.changes index b22940a..13cc8b4 100644 --- a/python-tempora.changes +++ b/python-tempora.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Oct 5 13:30:13 UTC 2021 - Stefan Schubert + +- Added BuildRequires: alts + ------------------------------------------------------------------- Thu Sep 30 07:54:19 UTC 2021 - Stefan Schubert diff --git a/python-tempora.spec b/python-tempora.spec index 88b06df..54864a2 100644 --- a/python-tempora.spec +++ b/python-tempora.spec @@ -45,6 +45,7 @@ Requires: python-jaraco.functools >= 1.20 Requires: python-pytz %if %{with libalternatives} Requires: alts +BuildRequires: alts %else Requires(post): update-alternatives Requires(postun):update-alternatives