From 4280f502c5ae641efa2f517ad5a0b84a5282d0dd4f2963b323d203b65c644192 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 18 May 2020 20:33:50 +0000 Subject: [PATCH] - Don't use %python3_only command, but properly use alternatives. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-portpicker?expand=0&rev=9 --- python-portpicker.changes | 5 +++++ python-portpicker.spec | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/python-portpicker.changes b/python-portpicker.changes index 9dff1ff..06c6af1 100644 --- a/python-portpicker.changes +++ b/python-portpicker.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon May 18 20:33:40 UTC 2020 - Matej Cepl + +- Don't use %python3_only command, but properly use alternatives. + ------------------------------------------------------------------- Mon May 20 15:18:38 UTC 2019 - pgajdos@suse.com diff --git a/python-portpicker.spec b/python-portpicker.spec index 768ecfb..6dbd11d 100644 --- a/python-portpicker.spec +++ b/python-portpicker.spec @@ -1,7 +1,7 @@ # # spec file for package python-portpicker # -# 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 @@ -27,6 +27,8 @@ URL: https://github.com/google/python_portpicker Source0: https://files.pythonhosted.org/packages/source/p/portpicker/portpicker-%{version}.tar.gz BuildRequires: %{python_module setuptools} BuildRequires: fdupes +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module mock} @@ -46,16 +48,23 @@ harnesses that launch local servers. %install %python_install +%python_clone -a %{buildroot}%{_bindir}/portserver.py %python_expand %fdupes %{buildroot}%{$python_sitelib} %check %python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python src/tests/portpicker_test.py +%post +%python_install_alternative portserver.py + +%postun +%python_uninstall_alternative portserver.py + %files %{python_files} %license LICENSE %doc CONTRIBUTING.md README.md %{python_sitelib}/* # import asyncio -%python3_only %{_bindir}/portserver.py +%python_alternative %{_bindir}/portserver.py %changelog