# Contributor: Michael Mason # Contributor: Leonardo Arena # Maintainer: Natanael Copa pkgname=snort pkgver=2.9.3.1 pkgrel=0 pkgdesc="An open source network intrusion prevention and detection system" url="http://www.snort.org/" arch="all" license="GPL" depends= makedepends="pcre-dev libpcap-dev libnet-dev libdnet-dev daq-dev autoconf automake libtool bison flex zlib-dev" install="$pkgname.pre-install" subpackages="$pkgname-doc $pkgname-dev" source="http://www.snort.org/dl/snort-current/snort-$pkgver.tar.gz snort.initd snort.confd " pkgusers="snort" pkggroups="snort" _builddir="$srcdir/$pkgname-$pkgver" build() { cd "$_builddir" # fix parallel builds sed -i -e 's/^all-local:.*/all-local: $(LTLIBRARIES)/' \ src/dynamic-preprocessors/*/Makefile.am || return 1 # correct paths in default config file sed -i -e 's|/usr/local|/usr|' etc/snort.conf || return 1 sed -i -e 's|\.\./|/var/lib/snort/|' etc/snort.conf || return 1 aclocal -I m4 && autoconf && automake --add-missing && libtoolize || return 1 ./configure --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --enable-ipv6 \ --enable-gre make || return 1 } package() { cd "$_builddir" make -j1 DESTDIR="$pkgdir" install rm "$pkgdir"/usr/lib/*/*.la \ "$pkgdir"/usr/lib/snort/*/*.la || return 1 install -D -m 755 ../snort.initd "$pkgdir"/etc/init.d/snort install -D -m 644 ../snort.confd "$pkgdir"/etc/conf.d/snort install -D -m 644 etc/snort.conf "$pkgdir"/etc/snort/snort.conf install -D -m 644 rpm/snort.logrotate "$pkgdir"/etc/logrotate.d/snort mkdir -p "$pkgdir"/usr/lib/snort_dynamicrules mkdir -p "$pkgdir"/var/lib/snort/rules mkdir -m 770 -p "$pkgdir"/var/log/snort && chown snort.snort "$pkgdir"/var/log/snort for file in classification.config reference.config threshold.conf \ unicode.map do ln -s /var/lib/snort/etc/$file "$pkgdir"/etc/snort/$file done touch "$pkgdir"/var/lib/snort/rules/white_list.rules touch "$pkgdir"/var/lib/snort/rules/black_list.rules } md5sums="b2102605a7ca023ad6a2429821061c29 snort-2.9.3.1.tar.gz b65d10cce3e79f38aa6fb5e0aa494144 snort.initd 446f8d2b3435b8a6be738da978670605 snort.confd"