From 4869db0d5d1b3d75ebf10a2d7b24d1fb00df4b1ee970a2e15e1b12e9240bf588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 27 May 2020 11:47:37 +0000 Subject: [PATCH 1/2] Accepting request 809499 from home:pgajdos:python - %python3_only -> %python_alternative OBS-URL: https://build.opensuse.org/request/show/809499 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ethtool?expand=0&rev=12 --- python-ethtool.changes | 5 +++++ python-ethtool.spec | 26 +++++++++++++++++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/python-ethtool.changes b/python-ethtool.changes index a673630..3d449d9 100644 --- a/python-ethtool.changes +++ b/python-ethtool.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 26 06:34:08 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + ------------------------------------------------------------------- Fri Mar 1 10:55:25 UTC 2019 - Tomáš Chvátal diff --git a/python-ethtool.spec b/python-ethtool.spec index 8714ef6..d218e6d 100644 --- a/python-ethtool.spec +++ b/python-ethtool.spec @@ -1,7 +1,7 @@ # -# spec file for package python +# spec file for package python-ethtool # -# Copyright (c) 2019 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 @@ -34,6 +34,8 @@ BuildRequires: libnl3-devel BuildRequires: net-tools-deprecated BuildRequires: pkgconfig BuildRequires: python-rpm-macros +Requires(post): update-alternatives +Requires(postun): update-alternatives %python_subpackages %description @@ -51,19 +53,33 @@ export CFLAGS="%{optflags}" %install %python_install %python_expand %fdupes %{buildroot}%{$python_sitearch} - mkdir -p %{buildroot}%{_sbindir} mv %{buildroot}{%{_bindir},%{_sbindir}}/pifconfig mv %{buildroot}{%{_bindir},%{_sbindir}}/pethtool +%python_clone -a %{buildroot}%{_sbindir}/pifconfig +%python_clone -a %{buildroot}%{_sbindir}/pethtool %check %python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -m unittest discover -v +%post +# %python_install_alternative for %{_sbindir} binaries +%{python_expand \ + %{_sbindir}/update-alternatives --quiet --install %{_sbindir}/pifconfig pifconfig \ + %{_sbindir}/pifconfig-%{$python_version} %{$python_version_nodots} + %{_sbindir}/update-alternatives --quiet --install %{_sbindir}/pethtool pethtool \ + %{_sbindir}/pethtool-%{$python_version} %{$python_version_nodots} +} + +%postun +%python_uninstall_alternative pifconfig +%python_uninstall_alternative pethtool + %files %{python_files} %license COPYING %doc README.rst CHANGES.rst %{python_sitearch}/ -%python3_only %{_sbindir}/pethtool -%python3_only %{_sbindir}/pifconfig +%python_alternative %{_sbindir}/pethtool +%python_alternative %{_sbindir}/pifconfig %changelog From 2b69124ba7b79cf33eab3b60219ae99a4f2aa663df5a43b7b541f065ed9b21bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 27 May 2020 12:01:09 +0000 Subject: [PATCH 2/2] Accepting request 809509 from home:pgajdos:python OBS-URL: https://build.opensuse.org/request/show/809509 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ethtool?expand=0&rev=13 --- python-ethtool.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-ethtool.spec b/python-ethtool.spec index d218e6d..5bc15e1 100644 --- a/python-ethtool.spec +++ b/python-ethtool.spec @@ -63,7 +63,7 @@ mv %{buildroot}{%{_bindir},%{_sbindir}}/pethtool %python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -m unittest discover -v %post -# %python_install_alternative for %{_sbindir} binaries +# %%python_install_alternative for %{_sbindir} binaries %{python_expand \ %{_sbindir}/update-alternatives --quiet --install %{_sbindir}/pifconfig pifconfig \ %{_sbindir}/pifconfig-%{$python_version} %{$python_version_nodots}