From dcf9795dea9abb8bbfacfc777fd4284d3db431e2e8995dd2cf36b4019eaaa511 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 16 Jan 2025 00:38:21 +0000 Subject: [PATCH] Accepting request 1238066 from home:nkrapp:branches:devel:languages:python - Use libalternatives instead of update-alternatives, bsc#1235783 OBS-URL: https://build.opensuse.org/request/show/1238066 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docutils?expand=0&rev=96 --- python-docutils.changes | 5 +++++ python-docutils.spec | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/python-docutils.changes b/python-docutils.changes index 26a5360..ce568dc 100644 --- a/python-docutils.changes +++ b/python-docutils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jan 15 13:51:33 UTC 2025 - Nico Krapp + +- Use libalternatives instead of update-alternatives, bsc#1235783 + ------------------------------------------------------------------- Sun Nov 3 05:32:05 UTC 2024 - Steve Kowalik diff --git a/python-docutils.spec b/python-docutils.spec index ddd4cc5..992e471 100644 --- a/python-docutils.spec +++ b/python-docutils.spec @@ -1,7 +1,7 @@ # # spec file for package python-docutils # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,6 +25,13 @@ %define psuffix %{nil} %bcond_with test %endif + +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + Name: python-docutils%{psuffix} Version: 0.21.2 Release: 0 @@ -38,9 +45,14 @@ BuildRequires: %{python_module flit-core} BuildRequires: %{python_module pip} BuildRequires: fdupes BuildRequires: python-rpm-macros +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else Requires(pre): update-alternatives Requires(post): update-alternatives Requires(postun): update-alternatives +%endif Recommends: python-Pillow Recommends: python-Pygments Recommends: python-roman @@ -102,6 +114,8 @@ done # sometime ago rst2html was the master which would let fail the upgrade with master docutils in post below %pre update-alternatives --query rst2html >/dev/null 2>&1 && update-alternatives --quiet --remove-all rst2html ||: +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative normalizer %post %python_install_alternative docutils rst2html rst2latex rst2man rst2odt rst2pseudoxml rst2s5 rst2xetex rst2xml rst2html4 rst2html5