diff --git a/python-exrex.changes b/python-exrex.changes index 012bde3..52c4edc 100644 --- a/python-exrex.changes +++ b/python-exrex.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 26 06:34:10 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + ------------------------------------------------------------------- Mon Jun 3 10:59:25 UTC 2019 - pgajdos@suse.com diff --git a/python-exrex.spec b/python-exrex.spec index 3b833ea..42414ed 100644 --- a/python-exrex.spec +++ b/python-exrex.spec @@ -1,7 +1,7 @@ # # spec file for package python-exrex # -# 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 @@ -31,6 +31,8 @@ BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-setuptools +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch %python_subpackages @@ -47,15 +49,22 @@ sed -i '1s/^#!.*//' exrex.py %install %python_install +%python_clone -a %{buildroot}%{_bindir}/exrex rm %{buildroot}%{_bindir}/exrex.py %python_expand %fdupes %{buildroot}%{$python_sitelib} %check # no upstream tests +%post +%python_install_alternative exrex + +%postun +%python_uninstall_alternative exrex + %files %{python_files} %{python_sitelib}/* %license COPYING -%python3_only %{_bindir}/exrex +%python_alternative %{_bindir}/exrex %changelog