# Contributor: Michael Mason # Contributor: Leonardo Arena # Maintainer: Natanael Copa setvar pkgname = 'snort' setvar pkgver = '2.9.9.0' setvar pkgrel = '0' setvar pkgdesc = ""An open source network intrusion prevention and detection system"" setvar url = ""http://www.snort.org/"" setvar arch = ""all"" setvar license = ""GPL"" setvar depends = '' setvar makedepends = ""pcre-dev libpcap-dev libnet-dev libdnet-dev daq-dev bison flex zlib-dev libtirpc-dev"" setvar install = ""$pkgname.pre-install"" setvar subpackages = ""$pkgname-doc $pkgname-dev"" setvar source = ""https://www.snort.org/downloads/snort/snort-$pkgver.tar.gz snort.initd snort.confd "" setvar pkgusers = ""snort"" setvar pkggroups = ""snort"" setvar _builddir = ""$srcdir/$pkgname-$pkgver"" proc prepare { cd $_builddir for i in $source { case (i) { *.patch { msg $i; patch -p1 -i "$srcdir"/$i || return 1} } } # 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 } proc build { cd $_builddir export CFLAGS="$CFLAGS $(pkgconf --cflags libtirpc)" export LDFLAGS="$LDFLAGS $(pkgconf --libs libtirpc)" ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --enable-ipv6 \ --enable-gre \ --enable-non-ether-decoders \ || return 1 make || return 1 } proc package { cd $_builddir make -j1 DESTDIR="$pkgdir" install 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 { ln -s /var/lib/snort/etc/$file "$pkgdir"/etc/snort/$file } touch "$pkgdir"/var/lib/snort/rules/white_list.rules touch "$pkgdir"/var/lib/snort/rules/black_list.rules } setvar md5sums = ""fd3012bf36710481d66b40ad046b231d snort-2.9.9.0.tar.gz f163599315be80d682a51f8d22849ab5 snort.initd 446f8d2b3435b8a6be738da978670605 snort.confd"" setvar sha256sums = ""71b147125e96390a12f3d55796ed5073df77206bd3563d84d3e5a1f19e7d7a56 snort-2.9.9.0.tar.gz d447f1481a49543878030d361c8c31a6538c41b2c57e1c0cffd858cc5f83f70b snort.initd d504cb31ffcce9acc8fc7b68123a31a53b491444c52730339ea9a4e986521f71 snort.confd"" setvar sha512sums = ""2c17539c80484c90198a2e5d5efd1e70f26afb79ce7c28e745ded356b6f1a1f97763ff21fde986652af1768fa3bcdafbbcc3c82ee8ad6d2ef0471f360cfcab83 snort-2.9.9.0.tar.gz c71d11f4cde4aba432641d3915faec8070e9fea5b33c71f6b2872b2208871180b3c7dbbadd2ddaebe5f3280adf7c5c9daf1585afd331fe552486a675ff676e52 snort.initd abc0846ea6e08029c772f24e213f211a39219701e6e2c8b3aa112632318479db7b21014c5f2c4987cb2981cafce0ea744549c3ce754e9145cba9ec5604ae66f3 snort.confd""