From 22a014799533966e8f1929c0fce82d1d8933e9f1e525ac663b77ea31b0c60d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 12 Aug 2025 08:10:37 +0000 Subject: [PATCH] - Make the libalternatives transition conditional OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cchardet?expand=0&rev=23 --- python-cchardet.changes | 5 +++++ python-cchardet.spec | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/python-cchardet.changes b/python-cchardet.changes index e94d30d..0fc22f2 100644 --- a/python-cchardet.changes +++ b/python-cchardet.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Aug 12 08:09:49 UTC 2025 - Markéta Machová + +- Make the libalternatives transition conditional + ------------------------------------------------------------------- Wed Jun 25 11:45:06 UTC 2025 - Markéta Machová diff --git a/python-cchardet.spec b/python-cchardet.spec index cee2f8c..71941de 100644 --- a/python-cchardet.spec +++ b/python-cchardet.spec @@ -18,7 +18,11 @@ %define skip_python2 1 %define modname faust-cchardet +%if 0%{?suse_version} > 1500 %bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-cchardet Version: 2.1.19 @@ -32,13 +36,18 @@ BuildRequires: %{python_module devel} BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module wheel} -BuildRequires: alts BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: pkgconfig BuildRequires: python-rpm-macros BuildRequires: pkgconfig(uchardet) +%if %{with libalternatives} +BuildRequires: alts Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif %python_subpackages %description @@ -61,6 +70,12 @@ cChardet is high speed universal character encoding detector. - binding to `ucha %pre %python_libalternatives_reset_alternative cchardetect +%post +%python_install_alternative cchardetect + +%postun +%python_uninstall_alternative cchardetect + %files %{python_files} %license COPYING %doc README.rst