void-packages/srcpkgs/suricata/template
Jürgen Buchmüller 69ed65372c suricata: download emerging.rules.tar.gz w/o csum
The file emerging.rules.tar.gz is not versioned and changes every
now and then thus download it in post_fetch() and extract it into
the builddir for the rules to be added to the package.
2018-03-10 11:15:27 +01:00

42 lines
1.5 KiB
Bash

# Template file for 'suricata'
pkgname=suricata
version=4.0.4
revision=1
build_style=gnu-configure
configure_args="--disable-gccmarch-native"
hostmakedepends="pkg-config"
makedepends="libnet-devel libpcap-devel pcre-devel libyaml-devel libcap-ng-devel file-devel"
short_desc="Next Generation Intrusion Detection and Prevention Engine"
maintainer="Andrea Brancaleoni <abc@pompel.me>"
license="GPL-2"
homepage="https://suricata-ids.org/"
distfiles="https://www.openinfosecfoundation.org/download/$pkgname-$version.tar.gz"
checksum="617e83b6e20b03aa7d5e05a980d3cb6d2810ec18a6f15a36bf66c81c9c0a2abb"
system_accounts="$pkgname"
conf_files="/etc/$pkgname/*.* /etc/$pkgname/rules/*"
post_extract() {
$XBPS_FETCH_CMD https://rules.emergingthreats.net/open/suricata/emerging.rules.tar.gz
mkdir -p erules
tar xf emerging.rules.tar.gz -C erules
}
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
vcopy erules/rules/*.rules etc/$pkgname/rules
vlicense erules/rules/LICENSE emerging-rules.LICENSE
}