From 5e81c60ebf5ef804516fdada1235bbdad5faaf3de39b04a89ff645e6df67ede2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 25 Aug 2025 09:52:40 +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-antlr4-python3-runtime?expand=0&rev=18 --- python-antlr4-python3-runtime.changes | 5 +++++ python-antlr4-python3-runtime.spec | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/python-antlr4-python3-runtime.changes b/python-antlr4-python3-runtime.changes index be538d2..543d518 100644 --- a/python-antlr4-python3-runtime.changes +++ b/python-antlr4-python3-runtime.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 25 09:52:12 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems + ------------------------------------------------------------------- Tue Oct 8 12:57:07 UTC 2024 - John Paul Adrian Glaubitz diff --git a/python-antlr4-python3-runtime.spec b/python-antlr4-python3-runtime.spec index ad83b83..a02669a 100644 --- a/python-antlr4-python3-runtime.spec +++ b/python-antlr4-python3-runtime.spec @@ -1,7 +1,7 @@ # # spec file for package python-antlr4-python3-runtime # -# Copyright (c) 2024 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 @@ -16,6 +16,11 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-antlr4-python3-runtime Version: 4.13.2 @@ -30,9 +35,14 @@ BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros +BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else Requires(post): update-alternatives Requires(postun): update-alternatives -BuildArch: noarch +%endif %python_subpackages %description @@ -62,6 +72,9 @@ sed -i 's,self.assertEquals,self.assertEqual,' tests/Test* %postun %python_uninstall_alternative pygrun +%pre +%python_libalternatives_reset_alternative pygrun + %check cd %{_builddir}/antlr4-%{version}/runtime/Python3 %{python_expand #