File suricata4.spec of Package suricata4

# spec file for package [spectemplate]
# Copyright (c) 2010 SUSE LINUX Products 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
# norootforbuild

Name:           suricata4
Version:        4.0.5
Release:        1
Summary:        Open Source Next Generation Intrusion Detection and Prevention Engine
Group:          Productivity/Networking/Security
License:        GPL-3.0
Source2:        %{name}.keyring
BuildRoot:      /var/tmp/%{name}-%{version}-buildroot

BuildRequires:  pkg-config
BuildRequires:  libpcap1-devel
BuildRequires:  pcre-devel
%if %{defined suse_version}
BuildRequires:  libnet-devel, libnetfilter_queue1-devel, libnfnetlink0-devel
BuildRequires:  libcap-ng-devel, zlib-devel, libyaml-devel, file-devel
BuildRequires:  python
BuildRequires:  lua-devel
BuildRequires:  libjansson-devel
BuildRequires:  mozilla-nspr-devel
BuildRequires:  mozilla-nss-devel
BuildRequires:  libGeoIP-devel
BuildRequires:  coccinelle
BuildRequires:  hiredis-devel

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. 

%setup -q -n suricata-%{version}

%configure --enable-nfqueue \
           --enable-gccprotect \
           --enable-old-barnyard2 \
           --enable-geoip \
           --enable-lua \
           --enable-hiredis \

make %{?_smp_mflags}

make install DESTDIR=%{buildroot}
mkdir -p %{buildroot}/var/log/suricata
mkdir -p %{buildroot}/etc/suricata
cp *.config %{buildroot}/etc/suricata/
cp suricata.yaml %{buildroot}/etc/suricata/
cp -R rules %{buildroot}/etc/suricata/
rm -rf %{buildroot}/%{_datadir}/doc/suricata
rm -rf %{buildroot}/%{_includedir}/htp
rm -rf %{buildroot}/%{_libdir}/libhtp*
rm -rf %{buildroot}/%{_libdir}/pkgconfig/htp.pc
rm -f %{buildroot}/%{python_sitelib}/suricatasc/suricatasc.pyc
rm -f %{buildroot}/%{python_sitelib}/suricatasc/__init__.pyc
chmod 755 %{buildroot}/%{python_sitelib}/suricatasc/

rm -rf %{buildroot}

mkdir -p /var/log/suricata

%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
%ghost /var/log/suricata