From b535a6d3088723099d3bb52ba78e6d4df583f7d061c1ea6d0d37e30b8bbad65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Thu, 21 Aug 2025 09:30:02 +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-it-py?expand=0&rev=13 --- python-markdown-it-py.changes | 5 +++++ python-markdown-it-py.spec | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/python-markdown-it-py.changes b/python-markdown-it-py.changes index be3525b..4d52291 100644 --- a/python-markdown-it-py.changes +++ b/python-markdown-it-py.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 21 09:29:32 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems only + ------------------------------------------------------------------- Fri Jul 11 10:44:45 UTC 2025 - Markéta Machová diff --git a/python-markdown-it-py.spec b/python-markdown-it-py.spec index fc242e2..dff5dc6 100644 --- a/python-markdown-it-py.spec +++ b/python-markdown-it-py.spec @@ -16,7 +16,11 @@ # +%if 0%{?suse_version} > 1500 %bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-markdown-it-py Version: 3.0.0 @@ -29,13 +33,18 @@ BuildRequires: %{python_module flit-core} BuildRequires: %{python_module mdurl} BuildRequires: %{python_module pip} BuildRequires: %{python_module wheel} -BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: alts Requires: python-mdurl Suggests: python-mdit-py-plugins BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif # SECTION tests BuildRequires: %{python_module linkify-it-py} BuildRequires: %{python_module pytest-regressions} @@ -63,6 +72,12 @@ sed -i '1{/\/usr\/bin\/env python*/d;}' markdown_it/cli/parse.py %check %pytest tests +%post +%python_install_alternative markdown-it + +%postun +%python_uninstall_alternative markdown-it + %pre %python_libalternatives_reset_alternative markdown-it