Blob Blame History Raw
%global s_name forensic1394
%global with_python3 1

Name:           libforensic1394
Version:        0.2
Release:        3%{?dist}
Summary:        A library for performing live memory forensics over firewire

Group:          System Environment/Libraries
License:        LGPLv3+
URL:            https://freddie.witherden.org/tools/libforensic1394/
Source0:        https://freddie.witherden.org/tools/%{name}/releases/%{name}-%{version}.tar.gz
Patch0:         libforensic1394-0.2-cmake.patch

BuildRequires:  cmake
BuildRequires:  doxygen

%description
An library for performing live memory forensics over the IEEE 1394 (FireWire)
interface. libforensic1394 improves upon existing libraries by providing a
simple and clean interface to the the direct memory access functionality
available over FireWire.

%package devel
Summary:        Headers for developing programs that will use %{name}
Group:          Development/Libraries
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description devel
This package contains the header files needed for developing
%{name} applications.

%package -n python2-%{s_name}
Summary:        Python bindings for %{name}
Group:          Development/Libraries
Requires:       %{name}%{?_isa} = %{version}-%{release}
BuildRequires:  python2-devel 

%description -n python2-%{s_name}
This package contains the python bindings for %{name}.

%if 0%{?with_python3}
%package -n python3-%{s_name}
Summary:        Python bindings for %{name}
Group:          Development/Libraries
Requires:       %{name}%{?_isa} = %{version}-%{release}
BuildRequires:  python3-devel

%description -n python3-%{s_name}
This package contains the python 3 bindings for %{name}.
%endif # if with_python3

%prep
%setup -q
%patch0 -p1 -b .path

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a python %{py3dir}
%endif # if with_python3

%build
mkdir -p build
pushd build
%cmake -G"Unix Makefiles" \
    -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \
    -DFORENSIC1394_BUILD_STATIC:BOOL=OFF ..
make %{?_smp_mflags}
popd

# Python 2 bindings
pushd python
%{__python2} setup.py build
popd

%if 0%{?with_python3}
# Python 3 bindings
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif # if with_python3

# Docs
doxygen docs/Doxyfile

%install
pushd build
make install DESTDIR=%{buildroot} INSTALL="install -p"
find %{buildroot} -name '*.la' -exec rm -f {} ';'
popd

# Python 2 bindings
pushd python
%{__python2} setup.py install --root %{buildroot}
popd

%if 0%{?with_python3}
# Python 3 bindings
pushd %{py3dir}
%{__python3} setup.py install --root %{buildroot}
popd
%endif # if with_python3

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%doc AUTHORS COPYING COPYING.LESSER README
%{_libdir}/%{name}.so.*

%files devel
%doc COPYING COPYING.LESSER docs/html
%{_includedir}/%{s_name}.h
%{_libdir}/%{name}.so

%files -n python2-%{s_name}
%{python2_sitelib}/%{s_name}/
%{python2_sitelib}/*.egg-info

%if 0%{?with_python3}
%files -n python3-%{s_name}
%{python3_sitelib}/%{s_name}/
%{python3_sitelib}/*.egg-info
%endif # with_python3

%changelog
* Sat Jan 05 2013 Fabian Affolter <mail@fabian-affolter.ch> - 0.2-3
- Integrated patch from Eduardo Echeverria

* Mon Dec 10 2012 Fabian Affolter <mail@fabian-affolter.ch> - 0.2-2
- python2 package added
- -devel subpackage requires: fixed
- License files from the subpackages removed
- python 3 subpackage renamed
- Docs generation changed

* Mon Apr 16 2012 Fabian Affolter <mail@fabian-affolter.ch> - 0.2-1
- Initial package for Fedora