From 754663fa763e5e4a669d941163d5c8136ea8d3877e0baac2096a88ae4ec339dc Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 17 Sep 2021 20:43:18 +0000 Subject: [PATCH 1/4] Accepting request 919839 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/919839 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-wheel?expand=0&rev=51 --- python-wheel.changes | 5 +++++ python-wheel.spec | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/python-wheel.changes b/python-wheel.changes index 50f4ed2..2780419 100644 --- a/python-wheel.changes +++ b/python-wheel.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 9 13:05:13 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Thu Jan 28 23:25:52 UTC 2021 - Dirk Müller diff --git a/python-wheel.spec b/python-wheel.spec index cf79cf8..48a9bae 100644 --- a/python-wheel.spec +++ b/python-wheel.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-%{**}} %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" @@ -37,8 +44,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 %if %{with test} BuildRequires: %{python_module devel} @@ -69,7 +80,15 @@ sed -i '/addopts = /d' setup.cfg %install %if !%{with test} %python_install -%python_clone -a %{buildroot}%{_bindir}/wheel +%if ! %{with libalternatives} + %python_clone -a %{buildroot}%{_bindir}/wheel +%else + %python_clone %{buildroot}%{_bindir}/wheel + ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/wheel + mkdir -p %{buildroot}%{_datadir}/libalternatives/wheel + %python_expand content="binary=%{_bindir}/wheel-%{$python_version}" + %python_expand echo -e $content > %{buildroot}%{_datadir}/libalternatives/wheel/10%{$python_version_nodots}.conf +%endif %python_expand %fdupes %{buildroot}%{$python_sitelib} %endif @@ -81,16 +100,32 @@ export PYTHONDONTWRITEBYTECODE=1 %endif %if !%{with test} +%if %{with libalternatives} +%pre +# removing old update-alternatives entries +if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then + %python_uninstall_alternative wheel +fi +%else %post %python_install_alternative wheel %postun %python_uninstall_alternative wheel +%endif %files %{python_files} %doc docs/news.rst README.rst %license LICENSE.txt +%if ! 0%{with libalternatives} %python_alternative %{_bindir}/wheel +%else +%dir %{_datadir}/libalternatives +%dir %{_datadir}/libalternatives/wheel +%{_datadir}/libalternatives/wheel/10%python_version_nodots.conf +%{_bindir}/wheel +%{_bindir}/wheel-%python_version +%endif %{python_sitelib}/wheel-%{version}-py%{python_version}.egg-info %{python_sitelib}/wheel/ %endif From b4c7a82cff7c93f76d292430c50ad4ecda8cde9b938a092abce81ffc0678f227 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 19 Sep 2021 17:12:23 +0000 Subject: [PATCH 2/4] Accepting request 920165 from devel:languages:python revert OBS-URL: https://build.opensuse.org/request/show/920165 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-wheel?expand=0&rev=52 --- python-wheel.changes | 5 ----- python-wheel.spec | 37 +------------------------------------ 2 files changed, 1 insertion(+), 41 deletions(-) diff --git a/python-wheel.changes b/python-wheel.changes index 2780419..50f4ed2 100644 --- a/python-wheel.changes +++ b/python-wheel.changes @@ -1,8 +1,3 @@ -------------------------------------------------------------------- -Thu Sep 9 13:05:13 UTC 2021 - Stefan Schubert - -- Use libalternatives instead of update-alternatives. - ------------------------------------------------------------------- Thu Jan 28 23:25:52 UTC 2021 - Dirk Müller diff --git a/python-wheel.spec b/python-wheel.spec index 48a9bae..cf79cf8 100644 --- a/python-wheel.spec +++ b/python-wheel.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-%{**}} %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" @@ -44,12 +37,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 %if %{with test} BuildRequires: %{python_module devel} @@ -80,15 +69,7 @@ sed -i '/addopts = /d' setup.cfg %install %if !%{with test} %python_install -%if ! %{with libalternatives} - %python_clone -a %{buildroot}%{_bindir}/wheel -%else - %python_clone %{buildroot}%{_bindir}/wheel - ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/wheel - mkdir -p %{buildroot}%{_datadir}/libalternatives/wheel - %python_expand content="binary=%{_bindir}/wheel-%{$python_version}" - %python_expand echo -e $content > %{buildroot}%{_datadir}/libalternatives/wheel/10%{$python_version_nodots}.conf -%endif +%python_clone -a %{buildroot}%{_bindir}/wheel %python_expand %fdupes %{buildroot}%{$python_sitelib} %endif @@ -100,32 +81,16 @@ export PYTHONDONTWRITEBYTECODE=1 %endif %if !%{with test} -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - %python_uninstall_alternative wheel -fi -%else %post %python_install_alternative wheel %postun %python_uninstall_alternative wheel -%endif %files %{python_files} %doc docs/news.rst README.rst %license LICENSE.txt -%if ! 0%{with libalternatives} %python_alternative %{_bindir}/wheel -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/wheel -%{_datadir}/libalternatives/wheel/10%python_version_nodots.conf -%{_bindir}/wheel -%{_bindir}/wheel-%python_version -%endif %{python_sitelib}/wheel-%{version}-py%{python_version}.egg-info %{python_sitelib}/wheel/ %endif From 952679d5c1630f46b941d0bbe2770c2dce3085ba7b7aa3004b63974988956233 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 3 Oct 2021 13:45:52 +0000 Subject: [PATCH 3/4] Accepting request 922627 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/922627 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-wheel?expand=0&rev=53 --- python-wheel.changes | 5 +++++ python-wheel.spec | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/python-wheel.changes b/python-wheel.changes index 50f4ed2..42167fb 100644 --- a/python-wheel.changes +++ b/python-wheel.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Oct 1 08:45:20 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Thu Jan 28 23:25:52 UTC 2021 - Dirk Müller diff --git a/python-wheel.spec b/python-wheel.spec index cf79cf8..8a5af9c 100644 --- a/python-wheel.spec +++ b/python-wheel.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-%{**}} %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" @@ -35,10 +41,14 @@ URL: https://github.com/pypa/wheel Source: https://github.com/pypa/wheel/archive/%{version}.tar.gz#/wheel-%{version}.tar.gz 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 %if %{with test} BuildRequires: %{python_module devel} @@ -81,6 +91,11 @@ export PYTHONDONTWRITEBYTECODE=1 %endif %if !%{with test} + +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative wheel + %post %python_install_alternative wheel From 0dc88a66a04df57490b80f2d0249fc6afcdcd620b16681330c2922204b960bc5 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 6 Oct 2021 09:49:43 +0000 Subject: [PATCH 4/4] Accepting request 923314 from home:schubi2 - Added BuildRequires: alts OBS-URL: https://build.opensuse.org/request/show/923314 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-wheel?expand=0&rev=54 --- python-wheel.changes | 5 +++++ python-wheel.spec | 1 + 2 files changed, 6 insertions(+) diff --git a/python-wheel.changes b/python-wheel.changes index 42167fb..fc1dac7 100644 --- a/python-wheel.changes +++ b/python-wheel.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Oct 5 16:06:03 UTC 2021 - Stefan Schubert + +- Added BuildRequires: alts + ------------------------------------------------------------------- Fri Oct 1 08:45:20 UTC 2021 - Stefan Schubert diff --git a/python-wheel.spec b/python-wheel.spec index 8a5af9c..2213d87 100644 --- a/python-wheel.spec +++ b/python-wheel.spec @@ -45,6 +45,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