15
0
forked from pool/python-evtx

Accepting request 923240 from home:schubi2

- Use libalternatives instead of update-alternatives.

OBS-URL: https://build.opensuse.org/request/show/923240
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-evtx?expand=0&rev=23
This commit is contained in:
Cédric Bosdonnat
2021-11-05 09:57:19 +00:00
committed by Git OBS Bridge
parent b84eaab3fb
commit cc7b71dbe0
2 changed files with 24 additions and 2 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Oct 5 12:35:19 UTC 2021 - Stefan Schubert <schubi@suse.de>
- Use libalternatives instead of update-alternatives.
-------------------------------------------------------------------
Mon Oct 4 08:29:55 UTC 2021 - Ben Greiner <code@bnavigator.de>

View File

@@ -16,6 +16,12 @@
#
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define commands dump dump_chunk_slack eid_record_numbers extract_record filter_records info record_structure structure templates
%bcond_without python2
@@ -35,14 +41,19 @@ BuildRequires: python2-xml
%endif
BuildRequires: dos2unix
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python-rpm-macros >= 20210929
Requires: python-hexdump
Requires: python-lxml
%ifpython2
Requires: python-xml
%endif
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun):update-alternatives
Requires(postun): update-alternatives
%endif
BuildArch: noarch
%python_subpackages
@@ -74,6 +85,12 @@ done
%check
%pytest
%pre
# If libalternatives is used: Removing old update-alternatives entries.
%{lua:for c in rpm.expand("%{commands}"):gmatch("%S+") do
print(rpm.expand("%python_libalternatives_reset_alternative evtx_" .. c .. ".py"))
end}
%post
%{lua:for c in rpm.expand("%{commands}"):gmatch("%S+") do
print(rpm.expand("%python_install_alternative evtx_" .. c .. ".py"))