From 9269c81e56a881ce536cf74a6073c176ba331eef970d3c3ddb48901968e59d7c Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 27 Jan 2021 04:22:50 +0000 Subject: [PATCH] - Switch from python3_only to python_alternative for the snimpy script and its manual page. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-snimpy?expand=0&rev=5 --- python-snimpy.changes | 6 ++++++ python-snimpy.spec | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/python-snimpy.changes b/python-snimpy.changes index 614feab..a837279 100644 --- a/python-snimpy.changes +++ b/python-snimpy.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jan 27 04:21:34 UTC 2021 - Steve Kowalik + +- Switch from python3_only to python_alternative for the snimpy script + and its manual page. + ------------------------------------------------------------------- Wed Jul 29 10:43:00 UTC 2020 - Marketa Calabkova diff --git a/python-snimpy.spec b/python-snimpy.spec index 94fbe5d..09a493c 100644 --- a/python-snimpy.spec +++ b/python-snimpy.spec @@ -1,7 +1,7 @@ # # spec file for package python-snimpy # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # Copyright (c) 2016-2020, Martin Hauke # # All modifications and additions to the file contributed by third parties @@ -45,6 +45,8 @@ Requires: python-cffi >= 1.0.0 Requires: python-pycryptodomex Requires: python-pysnmp >= 4 Requires: python-setuptools +Requires(post): update-alternatives +Requires(postun): update-alternatives %python_subpackages %description @@ -80,15 +82,23 @@ export CFLAGS="%{optflags}" %install %python_install %python_expand %fdupes %{buildroot}%{$python_sitearch} +%python_clone -a %{buildroot}%{_bindir}/snimpy +%python_clone -a %{buildroot}%{_mandir}/man1/snimpy.1 %check %python_exec -m unittest discover tests -v +%post +%python_install_alternative snimpy snimpy.1 + +%postun +%python_uninstall_alternative snimpy snimpy.1 + %files %{python_files} %license docs/license.rst %doc AUTHORS.rst README.rst -%python3_only %{_bindir}/snimpy -%python3_only %{_mandir}/man1/snimpy.1%{ext_man} +%python_alternative %{_bindir}/snimpy +%python_alternative %{_mandir}/man1/snimpy.1%{ext_man} %{python_sitearch}/snimpy* %changelog