From e46f4877e9c7c11349729bd090e6543dfb46eabc113b1bf35197c4b3e68a534c Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Sat, 2 Oct 2021 04:19:11 +0000 Subject: [PATCH] Accepting request 922595 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/922595 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:flask/python-Flask?expand=0&rev=16 --- python-Flask.changes | 5 +++++ python-Flask.spec | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/python-Flask.changes b/python-Flask.changes index 58712f4..a9f9e03 100644 --- a/python-Flask.changes +++ b/python-Flask.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Aug 22 19:07:48 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Sat Jun 19 07:28:01 UTC 2021 - Michael Ströder diff --git a/python-Flask.spec b/python-Flask.spec index 1408ffa..5a3c57f 100644 --- a/python-Flask.spec +++ b/python-Flask.spec @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + %define oldpython python %define skip_python2 1 %{?!python_module:%define python_module() python-%{**} python3-%{**}} @@ -35,13 +41,17 @@ BuildRequires: %{python_module itsdangerous >= 2.0} BuildRequires: %{python_module pytest >= 6.2.4} BuildRequires: %{python_module setuptools} BuildRequires: fdupes -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 Requires: python-Jinja2 >= 3.0 Requires: python-Werkzeug >= 2.0 Requires: python-click >= 7.1.2 Requires: python-itsdangerous >= 2.0 +%if %{with libalternatives} +Requires: alts +%else Requires(post): update-alternatives Requires(postun):update-alternatives +%endif BuildArch: noarch %if %{?suse_version} < 1500 BuildRequires: python @@ -71,13 +81,16 @@ reference for python-Flask. %install %python_install %python_clone -a %{buildroot}%{_bindir}/flask - %fdupes %{buildroot}%{python_sitelib} %check export LANG=en_US.UTF-8 %pytest +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative flask + %post %python_install_alternative flask