From 2be378eccf33e11a4bd892d9ae0c52e84d6c833fdf6d6a2981dbd388b3fd4aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Thu, 21 Aug 2025 09:31:19 +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-Markdown?expand=0&rev=112 --- python-Markdown.changes | 5 +++++ python-Markdown.spec | 20 ++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/python-Markdown.changes b/python-Markdown.changes index 4be5cb2..a44a514 100644 --- a/python-Markdown.changes +++ b/python-Markdown.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 21 09:30:43 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems only + ------------------------------------------------------------------- Tue Aug 12 18:28:43 UTC 2025 - Matej Cepl diff --git a/python-Markdown.spec b/python-Markdown.spec index 1f94fb5..386a73a 100644 --- a/python-Markdown.spec +++ b/python-Markdown.spec @@ -1,6 +1,7 @@ # # spec file for package python-Markdown # +# Copyright (c) 2025 SUSE LLC # Copyright (c) 2025 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties @@ -25,7 +26,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-Markdown%{psuffix} Version: 3.8.2 @@ -44,12 +49,17 @@ BuildRequires: %{python_module importlib-metadata >= 4.4 if %python-base < 3.10 BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools >= 77.0} BuildRequires: %{python_module wheel} -BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: alts Requires: (python-importlib-metadata >= 4.4 if python-base < 3.10) 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 Markdown = %{version}} BuildRequires: %{python_module PyYAML} @@ -85,6 +95,12 @@ supported by the [Available Extensions][]. %endif %if %{without test} +%post +%python_install_alternative markdown_py + +%postun +%python_uninstall_alternative markdown_py + %pre %python_libalternatives_reset_alternative markdown_py