From c1b97aee0c7dd872dff2decb67979e3a4c5b768061770c44b6f41de1b2fd780d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 19 Aug 2025 14:02:55 +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-flit?expand=0&rev=31 --- python-flit.changes | 5 +++++ python-flit.spec | 21 ++++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/python-flit.changes b/python-flit.changes index 59ca990..91c655b 100644 --- a/python-flit.changes +++ b/python-flit.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Aug 19 14:01:31 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems only + ------------------------------------------------------------------- Tue Jul 8 13:53:24 UTC 2025 - Markéta Machová diff --git a/python-flit.spec b/python-flit.spec index 4205fa7..f2a5db7 100644 --- a/python-flit.spec +++ b/python-flit.spec @@ -16,7 +16,11 @@ # +%if 0%{?suse_version} > 1500 %bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-flit Version: 3.12.0 @@ -31,16 +35,21 @@ BuildRequires: %{python_module flit-core >= %{version}} BuildRequires: %{python_module pip} BuildRequires: %{python_module requests} BuildRequires: %{python_module tomli-w} -BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: alts Requires: python-docutils Requires: python-flit-core >= %{version} Requires: python-pip Requires: python-requests Requires: python-tomli-w BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif # SECTION test requirements BuildRequires: %{python_module pytest >= 2.7.3} BuildRequires: %{python_module responses} @@ -64,7 +73,7 @@ Simplified packaging of Python modules %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%{python_expand # create python name interpreter for test_find_python_excutable" +%{python_expand # create $python name interpreter for test_find_python_excutable" mkdir build/testbin ln -s %{_bindir}/$python build/testbin/python } @@ -74,6 +83,12 @@ export PATH=$PWD/build/testbin/:$PATH # "The error you get on a train, going through Oregon, without wifi" %pytest -k "not (test_invalid_classifier or InstallTests)" +%post +%python_install_alternative flit + +%postun +%python_uninstall_alternative flit + %pre %python_libalternatives_reset_alternative flit