File liblightgrep.spec of Package liblightgrep

#
# spec file for package liblightgrep
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define soname 0

Name:           liblightgrep
%define lname %{name}%soname
Version:        1.4
Release:        0
Summary:        Not the worst forensics regexp engine
License:        GPL-3.0-or-later
Group:          Productivity/File utilities
Url:            https://github.com/jonstewart/liblightgrep
# The original archive contains tests : 155MB. As we don't run them, save space by removing them :
# /pytest, /re_gen and /test
#Source:         https://github.com/LightboxTech/liblightgrep/archive/v%{version}.tar.gz
Source:         %{name}-%{version}.tar.xz
Patch0:         aarch64_and_ppc64le.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  bison
%if 0%{?suse_version} > 1325
BuildRequires:  libboost_program_options-devel
BuildRequires:  libboost_system-devel
BuildRequires:  libboost_thread-devel
%else
BuildRequires:  boost-devel
%endif
BuildRequires:  gcc-c++
BuildRequires:  libicu-devel
BuildRequires:  libtool
BuildRequires:  pkg-config
# With v1.2.1, to run the %check section, you may need extra modules:
# - Boost::asio
# - Boost::chrono
# - Boost::program_options
# - Boost::system
# - Boost::thread
# - Scope (a git submodule)

%description
liblightgrep is a new regular expression engine, designed specifically for digital forensics. Why another regexp engine?

Lightgrep:

    searches for many patterns simultaneously
    searches binary data as a stream, not as discrete lines of text
    searches for patterns in many different encodings; give it dirty data, lightgrep don't care
    never, ever, ever, never, never looks at a byte twice or backs up in your input

Lightgrep is still pretty new and doesn't have all the regexp features you might be used to. But it has enough features to be more than a toy, and what is supported is well-tested.

%package -n %{lname}
Summary:        Not the worst forensics regexp engine
License:        LGPL-3.0-or-later
Group:          System/Libraries

%description -n %lname

liblightgrep is a new regular expression engine, designed specifically for digital forensics. Why another regexp engine?

Lightgrep:

    searches for many patterns simultaneously
    searches binary data as a stream, not as discrete lines of text
    searches for patterns in many different encodings; give it dirty data, lightgrep don't care
    never, ever, ever, never, never looks at a byte twice or backs up in your input

Lightgrep is still pretty new and doesn't have all the regexp features you might be used to. But it has enough features to be more than a toy, and what is supported is well-tested.

%package devel
Summary:        Development files for liblightgrep
License:        LGPL-3.0-or-later
Group:          Development/Libraries/C and C++
Requires:       %{name}%{soname} = %{version}

%description devel
Development files for liblightgrep, a new regex engine designed specifically for digital forensics.

This subpackage contains libraries and header files for developing
applications that want to make use of %{name}.

%prep
%setup -q
%patch0 -p1
#The test file test_kilopattern.CPP breaks ARM builds
find . -name 'test_kilopattern.CPP' -delete

%build
autoreconf -i
%configure --disable-static
make %{?_smp_mflags}

%install
%make_install
find %{buildroot} -name '*.la' -delete

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

%check
#these take many minutes, so don't run them all the time
#   THIS IS FAILING TO BUILD WITH v1.2.1, so comment out
#make check

%files -n %lname
%defattr(-,root,root)
%doc README.md COPYING
%{_libdir}/liblightgrep.so.*

%files devel
%defattr(-,root,root)
%doc README.md COPYING
%{_includedir}/lightgrep/
%{_libdir}/liblightgrep.so
%{_libdir}/pkgconfig/lightgrep.pc

%changelog
openSUSE Build Service is sponsored by