From 471114f33c44726f4f49f6c0d8196faab88848bd611d0de9ac66205602c34e20 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 6 Nov 2021 10:28:18 +0000 Subject: [PATCH] Accepting request 923298 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/923298 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-waitress?expand=0&rev=49 --- python-waitress.changes | 5 +++++ python-waitress.spec | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/python-waitress.changes b/python-waitress.changes index 0cb438a..69d33c9 100644 --- a/python-waitress.changes +++ b/python-waitress.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Aug 27 12:27:31 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Fri Aug 27 11:27:31 UTC 2021 - pgajdos@suse.com diff --git a/python-waitress.spec b/python-waitress.spec index 16d6b78..bb6e0ca 100644 --- a/python-waitress.spec +++ b/python-waitress.spec @@ -1,5 +1,5 @@ # -# spec file +# spec file for package python-waitress # # Copyright (c) 2021 SUSE LLC # @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "doc" @@ -39,13 +45,18 @@ Source: https://files.pythonhosted.org/packages/source/w/waitress/waitre Source1: python3.inv Source2: fetch-intersphinx-inventories.sh BuildRequires: fdupes -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 %if "%{flavor}" == "" BuildRequires: %{python_module pytest-cov} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif %else # Documentation requirements BuildRequires: python3-Sphinx @@ -81,6 +92,10 @@ http://docs.pylonsproject.org/projects/waitress/en/latest/ . # disable one test, that requires network %pytest -k 'not test_service_port' +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative waitress-serve + %post %python_install_alternative waitress-serve