From c874622976311f2c6e23f7f4f12ab80099d5c41473f9e61779bfea1240bcd507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 26 Aug 2025 12:05:06 +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-avro?expand=0&rev=38 --- python-avro.changes | 5 +++++ python-avro.spec | 21 ++++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/python-avro.changes b/python-avro.changes index 7d3a7a5..2f2f6e9 100644 --- a/python-avro.changes +++ b/python-avro.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Aug 26 12:02:47 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems only + ------------------------------------------------------------------- Mon Jun 16 14:40:54 UTC 2025 - Markéta Machová diff --git a/python-avro.spec b/python-avro.spec index 696d2db..391b217 100644 --- a/python-avro.spec +++ b/python-avro.spec @@ -1,7 +1,7 @@ # # spec file for package python-avro # -# 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 @@ -16,7 +16,11 @@ # +%if 0%{?suse_version} > 1500 %bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-avro Version: 1.12.0 @@ -29,11 +33,16 @@ BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} -BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: alts BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif %python_subpackages %description @@ -57,6 +66,12 @@ sed -i '1{\@^#!/usr/bin/env python@d}' avro/*.py avro/tether/*.py avro/test/*.py rm avro/test/test_ipc.py %pyunittest discover -v +%post +%python_install_alternative avro + +%postun +%python_uninstall_alternative avro + %pre %python_libalternatives_reset_alternative avro