From 9c551a7c1eb17a75497a07c70693c4c3325df1f186657c4848c680265380bb76 Mon Sep 17 00:00:00 2001 From: Greg Freemyer Date: Tue, 5 May 2020 23:21:11 +0000 Subject: [PATCH] Accepting request 800336 from home:dimstar:Factory - Allow distros to disable py2 support (bcond_without). Tumbleweed declares this, as py2 is EOL. OBS-URL: https://build.opensuse.org/request/show/800336 OBS-URL: https://build.opensuse.org/package/show/security:forensics/libevt?expand=0&rev=13 --- libevt.changes | 6 ++++++ libevt.spec | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/libevt.changes b/libevt.changes index 5cc82fc..bfb18af 100644 --- a/libevt.changes +++ b/libevt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue May 5 11:07:37 UTC 2020 - Dominique Leuenberger + +- Allow distros to disable py2 support (bcond_without). Tumbleweed + declares this, as py2 is EOL. + ------------------------------------------------------------------- Mon Apr 6 02:36:35 UTC 2020 - Greg Freemyer diff --git a/libevt.spec b/libevt.spec index c07d051..af9c29f 100644 --- a/libevt.spec +++ b/libevt.spec @@ -16,6 +16,7 @@ # +%bcond_without python2 Name: libevt %define lname libevt1 %define timestamp 20191221 @@ -28,7 +29,9 @@ URL: https://github.com/libyal/libevt/wiki Source: https://github.com/libyal/libevt/releases/download/%timestamp/%name-alpha-%timestamp.tar.gz Source2: Windows_Event_Log_EVT.pdf BuildRequires: pkg-config +%if %{with python2} BuildRequires: python-devel +%endif BuildRequires: pkgconfig(libbfio) >= 20120426 BuildRequires: pkgconfig(libcdata) >= 20120425 BuildRequires: pkgconfig(libcdirectory) >= 20120423 @@ -122,7 +125,13 @@ Python bindings for libevt, which can read Windows event files. cp "%SOURCE2" . %build -%configure --disable-static --enable-wide-character-type --enable-python2 --enable-python3 +%configure \ + --disable-static \ + --enable-wide-character-type \ +%if %{with python2} + --enable-python2 \ +%endif + --enable-python3 make %{?_smp_mflags} %install @@ -153,11 +162,13 @@ find %buildroot -name '*.la' -delete %_libdir/pkgconfig/libevt.pc %_mandir/man3/libevt.3* +%if %{with python2} %files -n python2-%name %defattr(-,root,root) %doc AUTHORS ChangeLog README %license COPYING %python2_sitearch/pyevt.so +%endif %files -n python3-%name %defattr(-,root,root)