From 3ce537812d3238b948889c6bee2e0832e7b16b32f86400f1fe451d10a2291c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 19 Aug 2025 12:17:09 +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-Faker?expand=0&rev=127 --- python-Faker.changes | 5 +++++ python-Faker.spec | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/python-Faker.changes b/python-Faker.changes index ce1b3a8..841f0d1 100644 --- a/python-Faker.changes +++ b/python-Faker.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Aug 19 12:11:40 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems only + ------------------------------------------------------------------- Tue Jul 8 13:18:02 UTC 2025 - Markéta Machová diff --git a/python-Faker.spec b/python-Faker.spec index 6b1415b..4ebb047 100644 --- a/python-Faker.spec +++ b/python-Faker.spec @@ -16,7 +16,11 @@ # +%if 0%{?suse_version} > 1500 %bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-Faker Version: 26.1.0 @@ -32,14 +36,19 @@ BuildRequires: %{python_module python-dateutil >= 2.4} BuildRequires: %{python_module text-unidecode >= 1.3} BuildRequires: %{python_module validators >= 0.13.0} BuildRequires: %{python_module wheel} -BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: alts Requires: python-python-dateutil >= 2.4 Requires: python-text-unidecode >= 1.3 Obsoletes: python3-fake-factory < %{version}-%{release} Provides: python3-fake-factory = %{version}-%{release} +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif BuildArch: noarch %python_subpackages @@ -66,6 +75,12 @@ sed -i -e 's:==:>=:g' setup.py %pre %python_libalternatives_reset_alternative faker +%post +%python_install_alternative faker + +%postun +%python_uninstall_alternative faker + %check %pytest