updated on Wed Jan 25 20:08:56 UTC 2012
[aur-mirror.git] / psad / PKGBUILD
blobaa4c76866ca96798960260f691455b968f12883c
1 # Contributor: Muhammad Qadri <maqadri at comcast dot net>
2 pkgname=psad
3 pkgver=2.1.7
4 pkgrel=1
5 pkgdesc="A collection of three lightweight system daemons (two main daemons and one helper daemon) that run on Linux machines and analyze iptables log messages to detect port scans and other suspicious traffic"
6 arch=('i686')
7 url="http://cipherdyne.org/psad/"
8 license=('GPL')
9 groups=()
10 depends=('perl-bit-vector' 'perl-date-calc' 'perl-iptables-chainmgr' 'perl-iptables-parse' 'perl-net-ipv4addr' 'perl-storable' 'perl-unix-syslog')
11 makedepends=()
12 optdepends=()
13 provides=()
14 conflicts=()
15 replaces=()
16 backup=()
17 options=()
18 install=
19 source=("http://cipherdyne.org/psad/download/$pkgname-$pkgver.tar.gz" "responses" "psad-init.archlinux" "psad.patch1")
20 noextract=()
21 md5sums=('c5e4a8d1bba6b5026ebada0084970e47'
22          '2425986f9eaa44d983128ebea6c8baf4'
23          'c0a978cd7a70525a2c901f4730be5547'
24          '9d72e2e5af8a06b7c85973b927fc12ae')
26 build() {
27   cd "$srcdir/$pkgname-$pkgver"
28   cp $startdir/psad-init.archlinux init-scripts/
29   if [ ! -e responses ]; then 
30     ln $startdir/responses responses -s; 
31   fi
32   patch -p1 -i $srcdir/psad.patch1
34   #Create the dirs it will need to make the program
35   mkdir -p $pkgdir/etc/psad \
36            $pkgdir/etc/rc.d \
37            $pkgdir/usr/bin \
38            $pkgdir/usr/sbin \
39            $pkgdir/usr/share/man/man8 \
40            $pkgdir/var/lib/psad \
41            $pkgdir/var/log/psad \
42            $pkgdir/var/run/psad \
43            $pkgdir/usr/lib/psad 
45   #Set the config dirs
46   sed -e "s|'/usr/sbin'|'$pkgdir/usr/sbin'|" \
47       -e "s|'/usr/bin'|'$pkgdir/usr/bin'|" \
48       -e "s|my \$mpath = \"/usr/share/man/man\$section\";|my \$mpath = \"$pkgdir/usr/share/man/man\$section\";|" \
49           ./install.pl -i
50   sed -e "s|/var/log/psad|$pkgdir&|" \
51       -e "s|/var/run/psad|$pkgdir&|" \
52       -e "s|/var/lib/psad|$pkgdir&|" \
53       -e "s|/usr/lib/psad|$pkgdir&|" \
54       -e "s|/etc/psad|$pkgdir&|" \
55       -e "s|/usr/bin/whois_psad|$pkgdir&|" \
56       -e "s|/usr/sbin/fwcheck_psad|$pkgdir&|" \
57       -e "s|/usr/sbin/psadwatchd|$pkgdir&|" \
58       -e "s|/usr/sbin/kmsgsd|$pkgdir&|" \
59       -e "s|/usr/sbin/psad|$pkgdir&|" \
60       -e 's|root@localhost|new&|' \
61         ./psad.conf -i
63   #hope that things work
64   ./install.pl --init-dir "$pkgdir/etc/rc.d/" < responses
67 # vim:set ts=2 sw=2 et: