From 0aa7d493a9151f1ba448be1e7cf8f3939fd77a7a03dafad80cbad65b1a9b8a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Wed, 20 Aug 2025 08:52:11 +0000 Subject: [PATCH] - Convert to libalternatives on SLE-16+ only OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-gunicorn?expand=0&rev=67 --- python-gunicorn.changes | 5 +++++ python-gunicorn.spec | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/python-gunicorn.changes b/python-gunicorn.changes index 14e8c32..58277dd 100644 --- a/python-gunicorn.changes +++ b/python-gunicorn.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Aug 20 08:51:10 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16+ only + ------------------------------------------------------------------- Tue Jul 8 14:22:13 UTC 2025 - Markéta Machová diff --git a/python-gunicorn.spec b/python-gunicorn.spec index 164a819..9fadf70 100644 --- a/python-gunicorn.spec +++ b/python-gunicorn.spec @@ -24,7 +24,11 @@ %define psuffix %{nil} %bcond_with test %endif +%if 0%{?suse_version} > 1500 %bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-gunicorn%{psuffix} Version: 23.0.0 @@ -37,10 +41,8 @@ Source: https://files.pythonhosted.org/packages/source/g/gunicorn/gunico BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools >= 3.0} BuildRequires: %{python_module wheel} -BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: alts Requires: python-packaging Requires: (python-importlib_metadata if python-base < 3.8) Suggests: python-evenlet @@ -49,6 +51,13 @@ Suggests: python-gthread Suggests: python-setproctitle Suggests: python-tornado BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif %if 0%{?sle_version} >= 150500 # Fixes the build on Leap BuildRequires: %{python_module Sphinx} @@ -111,6 +120,12 @@ sphinx-build -b html -d docs/build/doctrees docs/source docs/build/html %pre %python_libalternatives_reset_alternative gunicorn +%post +%python_install_alternative gunicorn + +%postun +%python_uninstall_alternative gunicorn + %files %{python_files} %license LICENSE %python_alternative %{_bindir}/gunicorn