From 061e027d72ab7bd5ded3d7262d1a38f34426045f73c3839c5c077a9415df48dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 19 Aug 2025 13:15:03 +0000 Subject: [PATCH] - Convert to libalternatives on SLE-16-based and newer systems only OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fastapi?expand=0&rev=97 --- python-fastapi.changes | 5 +++++ python-fastapi.spec | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/python-fastapi.changes b/python-fastapi.changes index e7334ec..1bffb01 100644 --- a/python-fastapi.changes +++ b/python-fastapi.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Aug 19 13:10:16 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems only + ------------------------------------------------------------------- Tue Jul 8 13:26:46 UTC 2025 - Markéta Machová diff --git a/python-fastapi.spec b/python-fastapi.spec index 443b30c..8e2e504 100644 --- a/python-fastapi.spec +++ b/python-fastapi.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-fastapi%{psuffix} Version: 0.115.13 @@ -38,14 +42,19 @@ Patch0: support-starlette-0.47.patch BuildRequires: %{python_module hatchling} BuildRequires: %{python_module pdm-backend} BuildRequires: %{python_module pip} -BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: alts Requires: python-pydantic >= 1.8.2 Requires: python-typing_extensions >= 4.8.0 Requires: (python-starlette >= 0.40.0 with python-starlette < 0.48.0) BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif # SECTION test requirements %if %{with test} BuildRequires: %{python_module Flask >= 1.1.2} @@ -106,6 +115,12 @@ donttest+=" or test_openapi" %pre %python_libalternatives_reset_alternative fastapi +%post +%python_install_alternative fastapi + +%postun +%python_uninstall_alternative fastapi + %if !%{with test} %files %{python_files} %doc README.md