From 61a62d9e88691fcf5f74d2b7ce0e1cf48e2833d53a10193d84a0aa5fb3e7f0cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 12 Aug 2025 12:48:27 +0000 Subject: [PATCH] - Make the libalternatives transition conditional OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyproject-parser?expand=0&rev=10 --- python-pyproject-parser.changes | 5 +++++ python-pyproject-parser.spec | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/python-pyproject-parser.changes b/python-pyproject-parser.changes index 18e858d..2537a35 100644 --- a/python-pyproject-parser.changes +++ b/python-pyproject-parser.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Aug 12 12:47:41 UTC 2025 - Markéta Machová + +- Make the libalternatives transition conditional + ------------------------------------------------------------------- Fri Jun 27 15:03:31 UTC 2025 - Markéta Machová diff --git a/python-pyproject-parser.spec b/python-pyproject-parser.spec index 1d10eca..ec2cd3b 100644 --- a/python-pyproject-parser.spec +++ b/python-pyproject-parser.spec @@ -25,7 +25,11 @@ %bcond_with test %endif %{?sle15_python_module_pythons} +%if 0%{?suse_version} > 1500 %bcond_without libalternatives +%else +%bcond_with libalternatives +%endif Name: python-pyproject-parser%{psuffix} Version: 0.13.0 Release: 0 @@ -35,10 +39,8 @@ URL: https://github.com/repo-helper/pyproject-parser Source: https://github.com/repo-helper/pyproject-parser/archive/refs/tags/v%{version}.tar.gz#/pyproject-parser-%{version}.tar.gz BuildRequires: %{python_module hatch-requirements-txt} BuildRequires: %{python_module pip} -BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: alts Requires: python-apeye-core >= 1.0.0 Requires: python-attrs >= 20.3.0 Requires: python-dom-toml >= 2.0.0 @@ -53,6 +55,13 @@ Suggests: python-docutils >= 0.16 Suggests: python-readme-renderer >= 27.0 Suggests: python-sdjson >= 0.3.1 BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif # SECTION test requirements %if %{with test} BuildRequires: %{python_module coincidence} @@ -88,6 +97,12 @@ Parser for 'pyproject.toml' %pre %python_libalternatives_reset_alternative pyproject-parser + +%post +%python_install_alternative pyproject-parser check-pyproject pyproject-fmt pyproject-info + +%postun +%python_uninstall_alternative pyproject-parser %endif %check