#!/bin/sh

# Install Suricata dependencies
yum -y install gcc libpcap-devel pcre-devel libyaml-devel file-devel zlib-devel jansson-devel nss-devel libcap-ng-devel libnet-devel tar make libnetfilter_queue-devel lua-devel

# Download and extract Suricata
wget https://www.openinfosecfoundation.org/download/suricata-4.0.0-rc1.tar.gz
tar -xvzf suricata-4.0.0-rc1.tar.gz
cd suricata-4.0.0-rc1

# Build Suricata
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-nfqueue --enable-lua
make
make install
make install-conf
ldconfig

# Remove temporary files
cd ..

