File suricata.spec of Package suricata

#
# spec file for package suricata
#
# Copyright (c) 2016 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/
#


Name:           suricata
Version:        3.1.2
Release:        0
Summary:        Open Source Next Generation Intrusion Detection and Prevention Engine
License:        GPL-2.0
Group:          Productivity/Networking/Security
Url:            http://www.openinfosecfoundation.org/
Source0:        http://www.openinfosecfoundation.org/download/suricata-%{version}.tar.gz
Source1:        http://www.openinfosecfoundation.org/download/suricata-%{version}.tar.gz.sig
BuildRequires:  coccinelle
BuildRequires:  file-devel
BuildRequires:  gpg-offline
BuildRequires:  pkgconfig(hiredis)
BuildRequires:  libGeoIP-devel
BuildRequires:  pkgconfig(libcap-ng)
BuildRequires:  libjansson-devel
BuildRequires:  libpcap-devel
BuildRequires:  libyaml-devel
BuildRequires:  pkgconfig(lua)
BuildRequires:  mozilla-nspr-devel
BuildRequires:  mozilla-nss-devel
BuildRequires:  pcre-devel
BuildRequires:  pkgconfig
BuildRequires:  python
BuildRequires:  pkgconfig(zlib)
BuildRequires:  libhtp-devel
BuildRequires:  pkgconfig(libprelude)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %{defined suse_version}
BuildRequires:  libnet-devel
BuildRequires:  pkgconfig(libnetfilter_queue)
BuildRequires:  pkgconfig(libnfnetlink)
%endif

%description
The Suricata Engine is an Open Source Next Generation Intrusion Detection and Prevention Engine. This engine is not intended to just replace or emulate the existing tools in the industry, but will bring new ideas and technologies to the field.

OISF is part of and funded by the Department of Homeland Security's Directorate for Science and Technology HOST program (Homeland Open Security Technology), by the the Navy's Space and Naval Warfare Systems Command (SPAWAR), as well as through the very generous support of the members of the OISF Consortium. More information about the Consortium is available, as well as a list of our current Consortium Members.

%prep
%setup -q -n suricata-%{version}
%gpg_verify %{SOURCE1}


%build
# Per upstream, once 3.2 is released the 3 --with lines below can be removed
%configure --enable-nfqueue \
           --with-libnetfilter_queue-includes=`pkg-config libnetfilter_queue --variable=includedir` \
           --with-libnetfilter_log-includes=`pkg-config libnetfilter_log --variable=includedir` \
           --with-libnfnetlink-includes=`pkg-config libnfnetlink --variable=includedir` \
           --enable-prelude \
           --enable-gccprotect \
           --enable-old-barnyard2 \
           --enable-non-bundled-htp \
           --enable-geoip \
           --enable-lua \
           --enable-hiredis

make %{?_smp_mflags}


%install
make %{?_smp_mflags} DESTDIR=%{buildroot} install
mkdir -p %{buildroot}%{_localstatedir}/log/suricata
mkdir -p %{buildroot}%{_sysconfdir}/suricata
cp *.config %{buildroot}%{_sysconfdir}/suricata/
cp suricata.yaml %{buildroot}%{_sysconfdir}/suricata/
cp -R rules %{buildroot}%{_sysconfdir}/suricata/
rm -rf %{buildroot}/%{_datadir}/doc/suricata
rm -f %{buildroot}/%{python_sitelib}/suricatasc/suricatasc.pyc
rm -f %{buildroot}/%{python_sitelib}/suricatasc/__init__.pyc
chmod 755 %{buildroot}/%{python_sitelib}/suricatasc/suricatasc.py

%post
mkdir -p %{_localstatedir}/log/suricata

%files
%defattr(-,root,root,-)
%doc doc/AUTHORS doc/Basic_Setup.txt doc/GITGUIDE doc/HTP_library_installation.txt doc/Installation_* doc/Setting_up_IPSinline_for_Linux.txt doc/Third_Party_Installation_Guides.txt doc/TODO
%config(noreplace)%{_sysconfdir}/suricata
%{_bindir}/suricata
%{_bindir}/suricatasc
%{python_sitelib}/suricatasc*
%ghost %{_localstatedir}/log/suricata

%changelog
openSUSE Build Service is sponsored by