void-packages/srcpkgs/suricata/template

51 lines
1.8 KiB
Bash

# Template file for 'suricata'
pkgname=suricata
version=4.1.4
revision=1
build_style=gnu-configure
build_helper="$(vopt_if rust_support rust)"
configure_args="--disable-gccmarch-native $(vopt_enable rust)
$(vopt_enable lua) $(vopt_enable hiredis) --disable-suricata-update
--disable-static --enable-non-bundled-htp"
hostmakedepends="pkg-config $(vopt_if rust cargo)"
makedepends="libnet-devel libpcap-devel pcre-devel libyaml-devel libcap-ng-devel
liblz4-devel liblzma-devel file-devel jansson-devel nss-devel libhtp-devel
$(vopt_if rust rust-std) $(vopt_if lua lua-devel)
$(vopt_if hiredis hiredis-devel)"
short_desc="Suricata is a network IDS, IPS and NSM engine"
maintainer="Andrea Brancaleoni <abc@pompel.me>"
license="GPL-2.0-only"
homepage="https://suricata-ids.org/"
distfiles="https://www.openinfosecfoundation.org/download/${pkgname}-${version}.tar.gz"
checksum=2da50d91f92adf8b1af930f388361f76424420b88f553f610e2780e4240f2009
build_options="lua rust hiredis"
build_options_default="hiredis"
desc_option_hiredis="Enable hiredis support"
desc_option_lua="Enable lua support"
desc_option_rust="Enable rust protocol parsers"
if [ -z "$CROSS_BUILD" ]; then
build_options_default+=" rust lua"
fi
system_accounts="$pkgname"
conf_files="/etc/${pkgname}/*.* /etc/${pkgname}/rules/*"
post_build() {
sed -i 's|#run-as:|run-as:|g' $pkgname.yaml
sed -i "s|# user: suri| user: $pkgname|g" $pkgname.yaml
sed -i "s|# group: suri| group: $pkgname|g" $pkgname.yaml
sed -i "s|#daemon-directory: \"/\"|daemon-directory: \"/var/lib/suricata\"|g" $pkgname.yaml
}
post_install() {
vsv $pkgname
vinstall $pkgname.yaml 644 etc/$pkgname
vinstall classification.config 644 etc/$pkgname
vinstall reference.config 644 etc/$pkgname
vinstall threshold.config 644 etc/$pkgname
vmkdir etc/$pkgname/rules
vcopy rules/*.rules etc/$pkgname/rules
}