updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / snort-sam / PKGBUILD
blobaacf8f3619b7d64b336164166b79cdb9108f62cb
1 # Contributor: Tyler Gates <TGates81@gmail.com>
3 pkgname=snort-sam
4 _pkgname=snort
5 pkgver=2.4.5
6 pkgrel=1
7 pkgdesc="A lightweight network intrusion detection system"
8 url="http://www.snort.org"
9 depends=('libpcap' 'pcre')
10 backup=('etc/conf.d/snort' 'etc/snort/snort.conf')
11 provides=('snort')
12 conflicts=('snort')
13 source=(http://www.snort.org/dl/current/$_pkgname-$pkgver.tar.gz snort snort.conf.d \
14         http://www.snort.org/pub-bin/downloads.cgi/Download/vrt_pr/snortrules-pr-2.4.tar.gz \
15         http://www.snortsam.net/files/snort-plugin/snortsam-patch.tar.gz)
16 md5sums=('108b3c20dcbaf3cdb17ea9203342eaaa' '53284a7996ee41c4c58d13c65d46d776'\
17          'a117b68ec3d188e40e117f3197e1db25' '35d9a2486f8c0280bb493aa03c011927'\
18          'e37653bb57087b4bc344fd99898064de')
20 build() {
21   cd $startdir/src/$_pkgname-$pkgver
22   msg "decompressing snortsam-patch.tar.gz to snort source directory..."
23   tar xzvf ../snortsam-patch.tar.gz  || return 1
24   msg "patching snort with snortsam support..."
25   sh patchsnort.sh $startdir/src/$_pkgname-$pkgver/ || return 1
26   msg "running aclocal -I m4..."
27   aclocal -I m4 || return 1
28   msg "running autoconf..."
29   autoconf || return 1
30   msg "running autoheader..."
31   autoheader || return 1
32   msg "running automake --add-missing --copy --foreign..."
33   automake --add-missing --copy --foreign || return 1
34   msg "starting build..."
35   ./configure --prefix=/usr --sysconfdir=/etc/snort --with-libpcap-includes=/usr/include/pcap \
36     --without-mysql --without-postgresql --without-oracle --without-odbc
37   make || return 1
38   make DESTDIR=$startdir/pkg install
39   mkdir -p $startdir/pkg/{etc/rc.d,etc/snort/rules,var/log/snort}
40   install -D -m644 etc/{*.conf*,*.map,generators} $startdir/pkg/etc/snort
41   install -D -m644 ../../snort.conf.d $startdir/pkg/etc/conf.d/snort
42   install -D -m644 $startdir/src/rules/*.rules $startdir/pkg/etc/snort/rules
43   install -D -m755 $startdir/snort $startdir/pkg/etc/rc.d/snort
44   sed 's|RULE_PATH ../rules|RULE_PATH /etc/snort/rules|' -i $startdir/pkg/etc/snort/snort.conf