diff --git a/python-kismetdb.changes b/python-kismetdb.changes index 5fe25e6..01ebf9a 100644 --- a/python-kismetdb.changes +++ b/python-kismetdb.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon May 25 06:50:31 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + ------------------------------------------------------------------- Fri Dec 27 10:25:11 UTC 2019 - Martin Hauke diff --git a/python-kismetdb.spec b/python-kismetdb.spec index 828d4bc..26c8914 100644 --- a/python-kismetdb.spec +++ b/python-kismetdb.spec @@ -1,6 +1,7 @@ # # spec file for package python-kismetdb # +# Copyright (c) 2020 SUSE LLC # Copyright (c) 2019, Martin Hauke # # All modifications and additions to the file contributed by third parties @@ -12,10 +13,12 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define binaries kismet_log_devices_to_filebeat_json kismet_log_to_pcap kismet_log_to_csv kismet_log_devices_to_json kismet_log_to_kml Name: python-kismetdb Version: 2019.05.05 Release: 0 @@ -28,6 +31,8 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-python-dateutil Requires: python-simplekml +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch %python_subpackages @@ -42,20 +47,33 @@ Kismet database wrapper. %install %python_install +for b in %{binaries}; do + %python_clone -a %{buildroot}%{_bindir}/$b +done %python_expand %fdupes %{buildroot}%{$python_sitelib} %check # tests are disabled for now since those need a docker environment for testing #%%pytest +%post +for b in %{binaries}; do + %python_install_alternative $b +done + +%postun +for b in %{binaries}; do + %python_uninstall_alternative $b +done + %files %{python_files} %license LICENSE %doc CHANGELOG.rst README.rst -%python3_only %{_bindir}/kismet_log_to_kml -%python3_only %{_bindir}/kismet_log_devices_to_json -%python3_only %{_bindir}/kismet_log_to_csv -%python3_only %{_bindir}/kismet_log_to_pcap -%python3_only %{_bindir}/kismet_log_devices_to_filebeat_json +%python_alternative %{_bindir}/kismet_log_to_kml +%python_alternative %{_bindir}/kismet_log_devices_to_json +%python_alternative %{_bindir}/kismet_log_to_csv +%python_alternative %{_bindir}/kismet_log_to_pcap +%python_alternative %{_bindir}/kismet_log_devices_to_filebeat_json %{python_sitelib}/* %changelog