diff --git a/python-getmac.changes b/python-getmac.changes index 5d890a9..f21b64f 100644 --- a/python-getmac.changes +++ b/python-getmac.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 26 06:34:22 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + ------------------------------------------------------------------- Thu Apr 16 13:23:39 UTC 2020 - Tomáš Chvátal diff --git a/python-getmac.spec b/python-getmac.spec index b1193b1..8dc328e 100644 --- a/python-getmac.spec +++ b/python-getmac.spec @@ -32,6 +32,8 @@ BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch %python_subpackages @@ -49,6 +51,8 @@ find . -type f -exec chmod -x {} \; %install %python_install +%python_clone -a %{buildroot}%{_mandir}/man1/getmac.1 +%python_clone -a %{buildroot}%{_bindir}/getmac %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -57,11 +61,17 @@ export LANG=C.UTF-8 # test_cli_multiple_debug_levels same as above %pytest tests -k 'not test_get_default_iface_freebsd and not test_cli_main and not test_cli_multiple_debug_levels' +%post +%python_install_alternative getmac getmac.1 + +%postun +%python_uninstall_alternative getmac + %files %{python_files} %doc CHANGELOG.md README.md %license LICENSE -%python3_only %{_bindir}/getmac -%python3_only %{_mandir}/man1/getmac.1* +%python_alternative %{_bindir}/getmac +%python_alternative %{_mandir}/man1/getmac.1%{?ext_man} %{python_sitelib}/getmac* %changelog