From fc54b2a277c55deebd7a184c8acbc96517b632ae5aafcf45f471874da6e0c602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Thu, 21 Aug 2025 08:49:23 +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-invoke?expand=0&rev=51 --- python-invoke.changes | 5 +++++ python-invoke.spec | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/python-invoke.changes b/python-invoke.changes index c7eb4cf..ffc4687 100644 --- a/python-invoke.changes +++ b/python-invoke.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 21 08:47:08 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems only + ------------------------------------------------------------------- Thu Jul 10 13:21:17 UTC 2025 - Markéta Machová diff --git a/python-invoke.spec b/python-invoke.spec index 9affde3..6bea80d 100644 --- a/python-invoke.spec +++ b/python-invoke.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-invoke%{psuffix} Version: 2.2.0 @@ -39,14 +43,19 @@ Patch0: remove-icecream.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools > 56} BuildRequires: %{python_module wheel} -BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: alts Requires: python-PyYAML Requires: python-fluidity-sm Requires: python-lexicon BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif %if %{with test} BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module fluidity-sm} @@ -96,6 +105,12 @@ skiptests+=" or may_be_overridden_when_pty_True or uses_execve_for_pty_True or s %pytest -s -k "not ($skiptests)" tests %endif +%post +%python_install_alternative inv invoke + +%postun +%python_uninstall_alternative inv + %pre %python_libalternatives_reset_alternative inv