From 652b14b45c34972fe121b99fc529959291e607a86fe2c73379a1ff1b4fb4fd77 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Moreno Date: Thu, 23 Oct 2025 11:47:41 +0200 Subject: [PATCH] Convert to libalternatives, bsc#1245883 --- python-sure.changes | 5 +++++ python-sure.spec | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/python-sure.changes b/python-sure.changes index d160c18..df73c5c 100644 --- a/python-sure.changes +++ b/python-sure.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 25 14:05:31 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems + ------------------------------------------------------------------- Tue Mar 26 19:06:01 UTC 2024 - John Paul Adrian Glaubitz diff --git a/python-sure.spec b/python-sure.spec index 55bb2dc..0366a2f 100644 --- a/python-sure.spec +++ b/python-sure.spec @@ -1,7 +1,7 @@ # # spec file for package python-sure # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,11 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-sure Version: 2.0.1 @@ -34,9 +39,14 @@ BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-six >= 1.10.0 +BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else Requires(post): update-alternatives Requires(postun): update-alternatives -BuildArch: noarch +%endif %python_subpackages %description @@ -67,6 +77,9 @@ rm tests/test_old_api.py %postun %python_uninstall_alternative sure +%pre +%python_libalternatives_reset_alternative sure + %files %{python_files} %license COPYING %doc README.rst