From 1cb2c60c34564d1c800dfddaabd611e019cefff01cf2a695d8fb9da74a3516d1 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 17 Sep 2021 21:26:38 +0000 Subject: [PATCH 1/4] Accepting request 919787 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/919787 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cheroot?expand=0&rev=35 --- python-cheroot.changes | 5 +++++ python-cheroot.spec | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/python-cheroot.changes b/python-cheroot.changes index d8cfc3e..ab5ab2f 100644 --- a/python-cheroot.changes +++ b/python-cheroot.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Aug 22 11:14:12 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Mon Mar 29 17:49:02 UTC 2021 - Ben Greiner diff --git a/python-cheroot.spec b/python-cheroot.spec index 07ad09e..25acf01 100644 --- a/python-cheroot.spec +++ b/python-cheroot.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 pypi_name cheroot %bcond_without python2 @@ -60,8 +66,12 @@ BuildRequires: %{python_module urllib3 >= 1.25} Requires: python-jaraco.functools Requires: python-more-itertools >= 2.6 Requires: python-six >= 1.11.0 +%if %{with libalternatives} +Requires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif # the package and distribution name is lowercase-cheroot, # but PyPI claims the name is capital-Cheroot # *smacks head against desk* @@ -86,7 +96,14 @@ sed -i '/--cov/ d' pytest.ini %install %python_install -%python_clone -a %{buildroot}%{_bindir}/cheroot +%if ! %{with libalternatives} + %python_clone -a %{buildroot}%{_bindir}/cheroot +%else + %python_clone %{buildroot}%{_bindir}/cheroot + ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/cheroot + mkdir -p %{buildroot}%{_datadir}/libalternatives/cheroot + %python_expand echo "binary=%{_bindir}/cheroot-%{$python_version}" > %{buildroot}%{_datadir}/libalternatives/cheroot/10%{$python_version_nodots}.conf +%endif %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -98,16 +115,32 @@ pytest_opts="--ignore cheroot/test/test_wsgi.py" # test_tls_client_auth[...-False-localhost-builtin] fails ocassionally on server-side OBS %pytest $pytest_opts -k "not (test_tls_client_auth and False-localhost-builtin)" +%if %{with libalternatives} +%pre +# removing old update-alternatives entries +if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then + %python_uninstall_alternative cheroot +fi +%else %post %python_install_alternative cheroot %postun %python_uninstall_alternative cheroot +%endif %files %{python_files} %license LICENSE.md %doc README.rst CHANGES.rst +%if ! 0%{with libalternatives} %python_alternative %{_bindir}/cheroot +%else +%dir %{_datadir}/libalternatives +%dir %{_datadir}/libalternatives/cheroot +%{_datadir}/libalternatives/cheroot/10%python_version_nodots.conf +%{_bindir}/cheroot +%{_bindir}/cheroot-%python_version +%endif %{python_sitelib}/cheroot %{python_sitelib}/cheroot-%{version}*-info From 7dd2effa9730dac5da366444c671b019af5723b37e27209a1e433fe0f4412d6f Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 19 Sep 2021 17:33:53 +0000 Subject: [PATCH 2/4] Accepting request 920173 from devel:languages:python revert OBS-URL: https://build.opensuse.org/request/show/920173 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cheroot?expand=0&rev=36 --- python-cheroot.changes | 5 ----- python-cheroot.spec | 35 +---------------------------------- 2 files changed, 1 insertion(+), 39 deletions(-) diff --git a/python-cheroot.changes b/python-cheroot.changes index ab5ab2f..d8cfc3e 100644 --- a/python-cheroot.changes +++ b/python-cheroot.changes @@ -1,8 +1,3 @@ -------------------------------------------------------------------- -Sun Aug 22 11:14:12 UTC 2021 - Stefan Schubert - -- Use libalternatives instead of update-alternatives. - ------------------------------------------------------------------- Mon Mar 29 17:49:02 UTC 2021 - Ben Greiner diff --git a/python-cheroot.spec b/python-cheroot.spec index 25acf01..07ad09e 100644 --- a/python-cheroot.spec +++ b/python-cheroot.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 pypi_name cheroot %bcond_without python2 @@ -66,12 +60,8 @@ BuildRequires: %{python_module urllib3 >= 1.25} Requires: python-jaraco.functools Requires: python-more-itertools >= 2.6 Requires: python-six >= 1.11.0 -%if %{with libalternatives} -Requires: alts -%else Requires(post): update-alternatives Requires(postun):update-alternatives -%endif # the package and distribution name is lowercase-cheroot, # but PyPI claims the name is capital-Cheroot # *smacks head against desk* @@ -96,14 +86,7 @@ sed -i '/--cov/ d' pytest.ini %install %python_install -%if ! %{with libalternatives} - %python_clone -a %{buildroot}%{_bindir}/cheroot -%else - %python_clone %{buildroot}%{_bindir}/cheroot - ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/cheroot - mkdir -p %{buildroot}%{_datadir}/libalternatives/cheroot - %python_expand echo "binary=%{_bindir}/cheroot-%{$python_version}" > %{buildroot}%{_datadir}/libalternatives/cheroot/10%{$python_version_nodots}.conf -%endif +%python_clone -a %{buildroot}%{_bindir}/cheroot %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -115,32 +98,16 @@ pytest_opts="--ignore cheroot/test/test_wsgi.py" # test_tls_client_auth[...-False-localhost-builtin] fails ocassionally on server-side OBS %pytest $pytest_opts -k "not (test_tls_client_auth and False-localhost-builtin)" -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - %python_uninstall_alternative cheroot -fi -%else %post %python_install_alternative cheroot %postun %python_uninstall_alternative cheroot -%endif %files %{python_files} %license LICENSE.md %doc README.rst CHANGES.rst -%if ! 0%{with libalternatives} %python_alternative %{_bindir}/cheroot -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/cheroot -%{_datadir}/libalternatives/cheroot/10%python_version_nodots.conf -%{_bindir}/cheroot -%{_bindir}/cheroot-%python_version -%endif %{python_sitelib}/cheroot %{python_sitelib}/cheroot-%{version}*-info From 3a9d584d361f02336c740592dfa2a7e8a91eeaab2578b9b897f8959c53090344 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 3 Oct 2021 20:09:17 +0000 Subject: [PATCH 3/4] Accepting request 922599 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/922599 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cheroot?expand=0&rev=37 --- python-cheroot.changes | 5 +++++ python-cheroot.spec | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/python-cheroot.changes b/python-cheroot.changes index d8cfc3e..1ac7941 100644 --- a/python-cheroot.changes +++ b/python-cheroot.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 30 08:50:54 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Mon Mar 29 17:49:02 UTC 2021 - Ben Greiner diff --git a/python-cheroot.spec b/python-cheroot.spec index 07ad09e..b549d07 100644 --- a/python-cheroot.spec +++ b/python-cheroot.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 pypi_name cheroot %bcond_without python2 @@ -34,7 +40,7 @@ BuildRequires: %{python_module setuptools_scm >= 1.15.0} BuildRequires: %{python_module setuptools_scm_git_archive >= 1.0} BuildRequires: %{python_module six >= 1.11.0} BuildRequires: fdupes -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 %if %{with python2} BuildRequires: python-backports.functools_lru_cache BuildRequires: python-selectors2 @@ -60,8 +66,12 @@ BuildRequires: %{python_module urllib3 >= 1.25} Requires: python-jaraco.functools Requires: python-more-itertools >= 2.6 Requires: python-six >= 1.11.0 +%if %{with libalternatives} +Requires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif # the package and distribution name is lowercase-cheroot, # but PyPI claims the name is capital-Cheroot # *smacks head against desk* @@ -98,6 +108,10 @@ pytest_opts="--ignore cheroot/test/test_wsgi.py" # test_tls_client_auth[...-False-localhost-builtin] fails ocassionally on server-side OBS %pytest $pytest_opts -k "not (test_tls_client_auth and False-localhost-builtin)" +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative cheroot + %post %python_install_alternative cheroot From 6aac4738188b211200ee724bb9c5c82f4d4d4ac84b4bc6ee2745b54cba18c3d7 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 6 Oct 2021 00:23:28 +0000 Subject: [PATCH 4/4] Accepting request 923251 from home:schubi2 - Added BuildRequires: alts OBS-URL: https://build.opensuse.org/request/show/923251 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cheroot?expand=0&rev=38 --- python-cheroot.changes | 5 +++++ python-cheroot.spec | 1 + 2 files changed, 6 insertions(+) diff --git a/python-cheroot.changes b/python-cheroot.changes index 1ac7941..748a2df 100644 --- a/python-cheroot.changes +++ b/python-cheroot.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Oct 5 13:46:46 UTC 2021 - Stefan Schubert + +- Added BuildRequires: alts + ------------------------------------------------------------------- Thu Sep 30 08:50:54 UTC 2021 - Stefan Schubert diff --git a/python-cheroot.spec b/python-cheroot.spec index b549d07..5ba5970 100644 --- a/python-cheroot.spec +++ b/python-cheroot.spec @@ -68,6 +68,7 @@ Requires: python-more-itertools >= 2.6 Requires: python-six >= 1.11.0 %if %{with libalternatives} Requires: alts +BuildRequires: alts %else Requires(post): update-alternatives Requires(postun):update-alternatives