From fef3cef174252e61f3257799bb223d95f80f485fce02caaa422f323b5c9458a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 25 Aug 2025 13:07:55 +0000 Subject: [PATCH] - Convert to libalternatives on SLE-16-based and newer systems OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Sphinx?expand=0&rev=284 --- python-Sphinx.changes | 4 ++-- python-Sphinx.spec | 24 +++++++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/python-Sphinx.changes b/python-Sphinx.changes index 360abb6..3ca6d0b 100644 --- a/python-Sphinx.changes +++ b/python-Sphinx.changes @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ee7b0e8eee17d29369cdb3dc8d23bd09e0a3e1fee2ce5c2ec0a3f8545016d209 -size 226326 +oid sha256:c74ced6b0024dc3429405c590cfc8a5c354606e7750882000297c0f926ee6e2f +size 226491 diff --git a/python-Sphinx.spec b/python-Sphinx.spec index 8be40bc..7ec7053 100644 --- a/python-Sphinx.spec +++ b/python-Sphinx.spec @@ -1,7 +1,7 @@ # # spec file for package python-Sphinx # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2025 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,6 +24,11 @@ %define psuffix %{nil} %bcond_with test %endif +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-Sphinx%{psuffix} Version: 8.2.3 @@ -68,13 +73,18 @@ Requires: python-sphinxcontrib-htmlhelp >= 2.0.0 Requires: python-sphinxcontrib-jsmath Requires: python-sphinxcontrib-qthelp >= 1.0.2 Requires: python-sphinxcontrib-serializinghtml >= 1.1.9 -Requires(post): update-alternatives -Requires(postun): update-alternatives Recommends: python-SQLAlchemy >= 0.9 Recommends: python-Sphinx-doc-man Recommends: python-Whoosh >= 2.0 Suggests: python-sphinx_rtd_theme BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif %if %{with test} BuildRequires: %{python_module Cython} BuildRequires: %{python_module Sphinx = %{version}} @@ -208,10 +218,10 @@ This package contains the documentation for Sphinx. Summary: Man files for python-Sphinx Group: Documentation/Man Requires: python3-Sphinx = %{version} -Requires(post): update-alternatives -Requires(postun): update-alternatives Supplements: python3-Sphinx Obsoletes: python-Sphinx-doc-man-common <= %{version} +BuildRequires: alts +Requires: alts %description -n python-Sphinx-doc-man Sphinx is a tool that facilitates creating documentation for Python @@ -266,6 +276,7 @@ $python -m sphinx -b html -j auto ./doc ./build.doc/html %python_clone -a %{buildroot}%{_bindir}/sphinx-autogen %python_clone -a %{buildroot}%{_bindir}/sphinx-build %python_clone -a %{buildroot}%{_bindir}/sphinx-quickstart +%python-group-libalternatives sphinx-apidoc sphinx-autogen sphinx-build sphinx-quickstart %python_expand mkdir -p %{buildroot}%{$python_sitelib}/sphinxcontrib %python_expand %fdupes %{buildroot}%{$python_sitelib} @@ -305,6 +316,9 @@ mv build.doc/man/sphinx-quickstart.1 %{buildroot}%{_mandir}/man1/sphinx-quicksta %postun %python_uninstall_alternative sphinx-apidoc + +%pre +%python_libalternatives_reset_alternative sphinx-apidoc %endif %check