From b37a614a143f88cbf10e12dcbbbbd22fdf29fa5ccc37b610f6b8926b4200a67f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Thu, 21 Aug 2025 15:34:08 +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-peewee?expand=0&rev=73 --- python-peewee.changes | 5 +++++ python-peewee.spec | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/python-peewee.changes b/python-peewee.changes index 1538d7e..903583b 100644 --- a/python-peewee.changes +++ b/python-peewee.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 21 15:33:41 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems only + ------------------------------------------------------------------- Mon Jul 21 03:14:08 UTC 2025 - Steve Kowalik diff --git a/python-peewee.spec b/python-peewee.spec index 3cb0e33..451cdd7 100644 --- a/python-peewee.spec +++ b/python-peewee.spec @@ -16,7 +16,11 @@ # +%if 0%{?suse_version} > 1500 %bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-peewee Version: 3.18.2 @@ -32,13 +36,18 @@ BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module wheel} BuildRequires: %{pythons} -BuildRequires: alts BuildRequires: fdupes BuildRequires: pkgconfig BuildRequires: python-rpm-macros BuildRequires: unzip BuildRequires: pkgconfig(sqlite3) +%if %{with libalternatives} +BuildRequires: alts Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif %if 0%{?suse_version} > 1500 BuildRequires: %{python_module apsw} %endif @@ -65,6 +74,12 @@ sed -i -e '1{\@^#! *%{_bindir}.*python@d}' %{buildroot}%{$python_sitearch}/pwiz. %check %pytest_arch tests +%post +%python_install_alternative pwiz.py + +%postun +%python_uninstall_alternative pwiz.py + %pre %python_libalternatives_reset_alternative pwiz.py