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