From 9abd1d0df26eea549eccfbf9460afe370bb811218332d8f5fdee3d570ca7aaf3 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 18 May 2020 20:14:38 +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-ptr?expand=0&rev=6 --- python-ptr.changes | 5 +++++ python-ptr.spec | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/python-ptr.changes b/python-ptr.changes index 0a327a3..64ceab1 100644 --- a/python-ptr.changes +++ b/python-ptr.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon May 18 20:14:18 UTC 2020 - Matej Cepl + +- Don't use %python3_only command, but properly use alternatives. + ------------------------------------------------------------------- Wed Mar 18 09:25:42 UTC 2020 - Tomáš Chvátal diff --git a/python-ptr.spec b/python-ptr.spec index 4e21a0f..032fb06 100644 --- a/python-ptr.spec +++ b/python-ptr.spec @@ -29,6 +29,8 @@ BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires(post): update-alternatives +Requires(postun): update-alternatives # Conflicts on site-packages/ptr.py Conflicts: python-pytest-runner BuildArch: noarch @@ -47,12 +49,19 @@ sed -i '1{/^#!/d}' *.py %install %python_install +%python_clone -a %{buildroot}%{_bindir}/ptr %python_expand %fdupes %{buildroot}%{$python_sitelib} %check %python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python %{buildroot}%{_bindir}/ptr --help %python_exec setup.py test +%post +%python_install_alternative ptr + +%postun +%python_uninstall_alternative ptr + %files %{python_files} %doc CHANGES.md README.md %python3_only %{_bindir}/ptr