From 50b25ac9aeb81e5f74c8aef27d080a9507d8813ca66479eb76a9d2d51ce37010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Wed, 16 Jul 2025 10:07:31 +0000 Subject: [PATCH] - Convert to libalternatives OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-netaddr?expand=0&rev=39 --- python-netaddr.changes | 5 +++++ python-netaddr.spec | 24 +++++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/python-netaddr.changes b/python-netaddr.changes index 3be497f..a4d187f 100644 --- a/python-netaddr.changes +++ b/python-netaddr.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jul 16 10:07:02 UTC 2025 - Markéta Machová + +- Convert to libalternatives + ------------------------------------------------------------------- Thu Dec 5 09:53:32 UTC 2024 - Matej Cepl diff --git a/python-netaddr.spec b/python-netaddr.spec index 5c487c1..162a7f5 100644 --- a/python-netaddr.spec +++ b/python-netaddr.spec @@ -1,7 +1,7 @@ # # spec file for package python-netaddr # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,7 @@ # +%bcond_without libalternatives %{?sle15_python_module_pythons} Name: python-netaddr Version: 1.3.0 @@ -28,17 +29,17 @@ Source: https://files.pythonhosted.org/packages/source/n/netaddr/netaddr BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} +BuildRequires: alts +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: alts +BuildArch: noarch # SECTION test -BuildRequires: %{python_module pytest} BuildRequires: %{python_module iniconfig} BuildRequires: %{python_module packaging} BuildRequires: %{python_module pluggy} +BuildRequires: %{python_module pytest} # /SECTION -BuildRequires: fdupes -BuildRequires: python-rpm-macros -Requires(post): update-alternatives -Requires(postun): update-alternatives -BuildArch: noarch %python_subpackages %description @@ -60,7 +61,7 @@ Included are routines for: %prep %autosetup -p1 -n netaddr-%{version} -sed -i "1{\@/usr/bin/env python@d}" netaddr/{cli,ip/iana,eui/ieee}.py # Fix non-executable scripts +sed -i "1{\@%{_bindir}/env python@d}" netaddr/{cli,ip/iana,eui/ieee}.py # Fix non-executable scripts %build %pyproject_wheel @@ -73,11 +74,8 @@ sed -i "1{\@/usr/bin/env python@d}" netaddr/{cli,ip/iana,eui/ieee}.py # Fix non- %check %pytest -%post -%python_install_alternative netaddr - -%postun -%python_uninstall_alternative netaddr +%pre +%python_libalternatives_reset_alternative netaddr %files %{python_files} %license LICENSE.rst