void-packages/srcpkgs/suricata/template
2020-07-01 00:04:40 +02:00

50 lines
1.8 KiB
Bash

# Template file for 'suricata'
pkgname=suricata
version=4.1.5
revision=1
build_style=gnu-configure
build_helper="$(vopt_if rust 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 lua53-devel)
$(vopt_if hiredis hiredis-devel)"
short_desc="Suricata is a network IDS, IPS and NSM engine"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-only"
homepage="https://suricata-ids.org/"
distfiles="https://www.openinfosecfoundation.org/download/${pkgname}-${version}.tar.gz"
checksum=cee5f6535cd7fe63fddceab62eb3bc66a63fc464466c88ec7a41b7a1331ac74b
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
}