From c3e499ae32b4776f8c3da2e11207d54783502af1bfc73f5d12bf8cebe596f8ff Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 14 Apr 2020 16:04:07 +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-argparse-manpage?expand=0&rev=13 --- python-argparse-manpage.changes | 5 +++++ python-argparse-manpage.spec | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/python-argparse-manpage.changes b/python-argparse-manpage.changes index 63faf70..df06b31 100644 --- a/python-argparse-manpage.changes +++ b/python-argparse-manpage.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 14 14:52:26 UTC 2020 - Matej Cepl + +- Don't use %python3_only command, but properly use alternatives. + ------------------------------------------------------------------- Fri Jan 31 17:44:02 UTC 2020 - Dominique Leuenberger diff --git a/python-argparse-manpage.spec b/python-argparse-manpage.spec index 392ae70..1e9adda 100644 --- a/python-argparse-manpage.spec +++ b/python-argparse-manpage.spec @@ -32,6 +32,8 @@ BuildRequires: %{python_module six} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-setuptools +Requires(post): update-alternatives +Requires(postun): update-alternatives %python_subpackages %description @@ -51,16 +53,24 @@ support for (deprecated) optparse objects, too. %install %python_install +%python_clone -a %{buildroot}%{_bindir}/argparse-manpage +%python_clone -a %{buildroot}%{_mandir}/man1/argparse-manpage.1 %python_expand %fdupes %{buildroot}%{$python_sitelib} %check %pytest +%post +%{python_install_alternative argparse-manpage argparse-manpage.1} + +%postun +%{python_uninstall_alternative argparse-manpage argparse-manpage.1} + %files %{python_files} %doc README* %license LICENSE %{python_sitelib}/* -%python3_only %{_bindir}/argparse-manpage -%python3_only %{_mandir}/man1/argparse-manpage.1%{?ext_man} +%python_alternative %{_bindir}/argparse-manpage +%python_alternative %{_mandir}/man1/argparse-manpage.1%{?ext_man} %changelog