From 531bac9301bca4c319c41c1cd4af367d50a9c3e1affa75a6dda013e4f6dee11c Mon Sep 17 00:00:00 2001 From: Greg Freemyer Date: Tue, 5 May 2020 23:25:00 +0000 Subject: [PATCH] Accepting request 800345 from home:dimstar:Factory - Allow distros to disable python2 build (bcond_without python2): Tumbleweed already declares this, as python2 is EOL. OBS-URL: https://build.opensuse.org/request/show/800345 OBS-URL: https://build.opensuse.org/package/show/security:forensics/libregf?expand=0&rev=20 --- libregf.changes | 6 ++++++ libregf.spec | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/libregf.changes b/libregf.changes index 73d1268..ed36670 100644 --- a/libregf.changes +++ b/libregf.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue May 5 11:21:40 UTC 2020 - Dominique Leuenberger + +- Allow distros to disable python2 build (bcond_without python2): + Tumbleweed already declares this, as python2 is EOL. + ------------------------------------------------------------------- Mon Apr 6 02:03:27 UTC 2020 - Greg Freemyer diff --git a/libregf.spec b/libregf.spec index 2f07ec7..1e0ea51 100644 --- a/libregf.spec +++ b/libregf.spec @@ -16,6 +16,7 @@ # +%bcond_without python2 Name: libregf %define lname libregf1 %define timestamp 20191221 @@ -28,7 +29,9 @@ URL: https://github.com/libyal/libregf/wiki Source: https://github.com/libyal/libregf/releases/download/%timestamp/%name-alpha-%timestamp.tar.gz Source2: Windows_NT_Registry_File_REGF_format.pdf BuildRequires: pkg-config +%if %{with python2} BuildRequires: python-devel +%endif BuildRequires: pkgconfig(fuse) >= 2.6 BuildRequires: pkgconfig(libbfio) >= 20131003 BuildRequires: pkgconfig(libcdata) >= 20130904 @@ -121,7 +124,13 @@ This subpackage contains the Python3 bindings for libregf. 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 @@ -151,11 +160,13 @@ find %{buildroot} -name '*.la' -delete %{_libdir}/pkgconfig/libregf.pc %{_mandir}/man3/libregf.3* +%if %{with python2} %files -n python2-%{name} %defattr(-,root,root) %doc AUTHORS README %license COPYING %{python2_sitearch}/pyregf.so +%endif %files -n python3-%{name} %defattr(-,root,root)