From a6349c06e993577a104b65ddd21fbd5b2efca001 Mon Sep 17 00:00:00 2001 From: rpmbuild Date: Mon, 1 Apr 2019 23:40:06 +0000 Subject: [PATCH] split python2/3 subpackages, fix python dependencies for EPEL --- afflib.spec | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 96 insertions(+), 2 deletions(-) diff --git a/afflib.spec b/afflib.spec index 05b1aed..8c0a7a1 100644 --- a/afflib.spec +++ b/afflib.spec @@ -1,8 +1,14 @@ Name: afflib Version: 3.7.18 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Library to support the Advanced Forensic Format +# Build also the python2 package +%global with_python2 1 +# Build also the python3 package +%global with_python3 1 + + License: BSD with advertising URL: https://github.com/sshock/AFFLIBv3 Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz @@ -23,10 +29,26 @@ BuildRequires: python2-devel #BuildRequires: libedit-devel - good replacement for readline - not supported for now BuildRequires: zlib-devel +%if 0%{?with_python2} +BuildRequires: python2 +BuildRequires: python2-devel +BuildRequires: python2-setuptools +%endif # if with_python2 + + +%if 0%{?with_python3} +BuildRequires: python%{python3_pkgversion} +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools +%endif # if with_python3 + + + # Afflib format uses lzma-SDK 443 Provides: bundled(lzma) = 443 + %description AFF® is an open and extensible file format designed to store disk images and associated metadata. @@ -50,6 +72,37 @@ Requires: pkgconfig The %{name}-devel package contains libraries and header files for developing applications that use %{name}. +#==================================================================== +%if 0%{?with_python2} +%package -n python2-pyaff +Summary: Python2 binding for the AFFLIB +Group: Development/Libraries +%{?python_provide:%python_provide python2-pyaff} + +%description -n python2-pyaff +Python2 bindings for AFFLIB. +These bindings currently support a read-only file-like interface to AFFLIB and +basic metadata accessor functions. The binding is not currently complete. +%endif # with_python2 + + + +%if 0%{?with_python3} +%package -n python%{python3_pkgversion}-pyaff +Summary: Python3 binding for the AFFLIB +Group: Development/Libraries +%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} + + + +%description -n python%{python3_pkgversion}-pyaff +Python3 bindings for AFFLIB. +These bindings currently support a read-only file-like interface to AFFLIB and +basic metadata accessor functions. The binding is not currently complete. +%endif # with_python3 + + + %prep %autosetup -p1 -n AFFLIBv3-%{version} @@ -65,7 +118,7 @@ chmod 0644 lib/base64.{h,cpp} %build %configure --enable-shared \ --disable-static \ - --enable-python=yes \ + --enable-python=no \ --enable-s3=yes # Remove rpath from libtool @@ -76,12 +129,30 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool %make_build +cd pyaff +%global py_setup_args build_ext --include-dirs %{_builddir}/AFFLIBv3-%{version}/include --library-dirs %{_builddir}/AFFLIBv3-%{version}/lib/.libs +%if 0%{?with_python2} +%py2_build +%endif # with_python2 + +%if 0%{?with_python3} +%py3_build +%endif # with_python3 %install %make_install find %{buildroot} -name '*.la' -exec rm -f {} ';' +cd pyaff +%if 0%{?with_python2} +%py2_install +%endif # with_python2 + +%if 0%{?with_python3} +%py3_install +%endif # with_python3 + %ldconfig_scriptlets @@ -103,8 +174,30 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';' %{_libdir}/*.so %{_libdir}/pkgconfig/afflib.pc +%if 0%{?with_python2} +%files -n python2-pyaff +%license COPYING +%doc pyaff/README +%{python2_sitearch}/PyAFF* +%{python2_sitearch}/pyaff* +%endif # with_python2 + + +%if 0%{?with_python3} +%files -n python%{python3_pkgversion}-pyaff +%license COPYING +%doc pyaff/README +%{python3_sitearch}/PyAFF* +%{python3_sitearch}/pyaff* +%endif # with_python3 + + %changelog +* Mon Apr 01 2019 Michal Ambroz - 3.7.18-2 +- separate python2-pyaff / python3-pyaff packages +- fix python dependencies for EPEL build + * Mon Mar 11 2019 Michal Ambroz - 3.7.18-1 - bump to 3.7.18 which contains: - Remove upstream patch Sanity-check-size-passed-to-malloc.patch @@ -118,6 +211,7 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';' - Sanity check size passed to malloc... (6 months ago) - Fix incrementing in vnode_split_raw.cpp for comment consistnecy (12 months ago) - Update Win32 readmes to fix issue #26. (1 year, 2 months ago) +- build python3 package * Thu Jan 31 2019 Fedora Release Engineering - 3.7.16-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild