From ab487329ec84fd7041749fe869ff57f6883378c0e795d635f1003c0347e63e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 21 May 2020 18:33:18 +0000 Subject: [PATCH] Accepting request 807983 from home:pgajdos:python submit OBS-URL: https://build.opensuse.org/request/show/807983 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-netaddr?expand=0&rev=23 --- python-netaddr.changes | 5 +++++ python-netaddr.spec | 19 ++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/python-netaddr.changes b/python-netaddr.changes index caf7d3f..b144039 100644 --- a/python-netaddr.changes +++ b/python-netaddr.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 21 10:56:34 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + ------------------------------------------------------------------- Tue Dec 4 12:50:45 UTC 2018 - Matej Cepl diff --git a/python-netaddr.spec b/python-netaddr.spec index d7efcab..001268a 100644 --- a/python-netaddr.spec +++ b/python-netaddr.spec @@ -1,7 +1,7 @@ # # spec file for package python-netaddr # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,11 +24,13 @@ Release: 0 Summary: Pythonic manipulation of IPv4, IPv6, CIDR, EUI and MAC network addresses License: BSD-3-Clause Group: Development/Languages/Python -Url: http://github.com/drkjam/netaddr +URL: https://github.com/drkjam/netaddr Source: https://files.pythonhosted.org/packages/source/n/netaddr/netaddr-%{version}.tar.gz BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch %python_subpackages @@ -58,7 +60,7 @@ sed -i "1d" netaddr/{ip/iana,eui/ieee,tests/__init__}.py # Fix non-executable sc %install %python_install -%python_clone %{buildroot}%{_bindir}/netaddr +%python_clone -a %{buildroot}%{_bindir}/netaddr %fdupes %{buildroot} %if %{with test} @@ -66,10 +68,17 @@ sed -i "1d" netaddr/{ip/iana,eui/ieee,tests/__init__}.py # Fix non-executable sc %python_exec setup.py test %endif +%post +%python_install_alternative netaddr + +%postun +%python_uninstall_alternative netaddr + %files %{python_files} %{python_sitelib}/* %{_bindir}/netaddr-%{python_bin_suffix} -%python3_only %{_bindir}/netaddr -%doc AUTHORS CHANGELOG COPYRIGHT README.md LICENSE +%python_alternative %{_bindir}/netaddr +%license LICENSE +%doc AUTHORS CHANGELOG COPYRIGHT README.md %changelog