summaryrefslogtreecommitdiff
path: root/pcr/psad/PKGBUILD
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@lavabit.com>2012-11-23 16:00:21 -0200
committerAndré Fabian Silva Delgado <emulatorman@lavabit.com>2012-11-23 16:00:21 -0200
commit13e7da299d6c1d313b32309f5737d887212b7d4c (patch)
treed4f484d0a730e8f66f3412d1535ff561adf7dea9 /pcr/psad/PKGBUILD
parente0755bc7fa7cd05b992a9988a9d38587e169f42d (diff)
parente61f24169547faea84a6b813212bac030feaacd1 (diff)
downloadabslibre-13e7da299d6c1d313b32309f5737d887212b7d4c.tar.gz
abslibre-13e7da299d6c1d313b32309f5737d887212b7d4c.tar.bz2
abslibre-13e7da299d6c1d313b32309f5737d887212b7d4c.zip
Merge branch 'master' of ssh://parabolagnulinux.org:1863/srv/git/abslibre
Diffstat (limited to 'pcr/psad/PKGBUILD')
-rw-r--r--pcr/psad/PKGBUILD66
1 files changed, 66 insertions, 0 deletions
diff --git a/pcr/psad/PKGBUILD b/pcr/psad/PKGBUILD
new file mode 100644
index 000000000..145625e89
--- /dev/null
+++ b/pcr/psad/PKGBUILD
@@ -0,0 +1,66 @@
+# Maintainer: Artur Wojcik <xartii at gmail dot com>
+# Maintainer : Parabola GNU / Linux-libre Aurelien Desbrieres <aurelien@cwb.IO>
+
+pkgname=psad
+pkgver=2.2
+pkgrel=2
+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"
+arch=('i686 x86_64')
+url="http://cipherdyne.org/psad/"
+license=('GPL')
+depends=('perl-bit-vector' 'perl-date-calc' 'perl-iptables-chainmgr' 'perl-iptables-parse' 'perl-net-ipv4addr' 'perl-storable' 'perl-unix-syslog' 'net-tools')
+source=("http://cipherdyne.org/psad/download/$pkgname-$pkgver.tar.gz" "responses" "psad-sysvinit.archlinux" "psad-systemdinit.archlinux" "psad.patch1")
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+ cp $srcdir/psad-sysvinit.archlinux init-scripts/psad-init.archlinux
+ if [ ! -e responses ]; then
+ ln $srcdir/responses responses -s;
+ fi
+ patch -p1 -i $srcdir/psad.patch1
+
+ #Create the dirs it will need to make the program
+ mkdir -p $pkgdir/etc/psad \
+ $pkgdir/etc/rc.d \
+ $pkgdir/usr/bin \
+ $pkgdir/usr/sbin \
+ $pkgdir/usr/share/man/man8 \
+ $pkgdir/var/lib/psad \
+ $pkgdir/var/log/psad \
+ $pkgdir/var/run/psad \
+ $pkgdir/usr/lib/psad \
+ $pkgdir/usr/lib/systemd/system
+ #Set the config dirs
+ sed -e "s|'/usr/sbin'|'$pkgdir/usr/sbin'|" \
+ -e "s|'/usr/bin'|'$pkgdir/usr/bin'|" \
+ -e "s|my \$mpath = \"/usr/share/man/man\$section\";|my \$mpath = \"$pkgdir/usr/share/man/man\$section\";|" \
+ ./install.pl -i
+ sed -e "s|/var/log/psad|$pkgdir&|" \
+ -e "s|/var/run/psad|$pkgdir&|" \
+ -e "s|/var/lib/psad|$pkgdir&|" \
+ -e "s|/usr/lib/psad|$pkgdir&|" \
+ -e "s|/etc/psad|$pkgdir&|" \
+ -e "s|/usr/bin/whois_psad|$pkgdir&|" \
+ -e "s|/usr/sbin/fwcheck_psad|$pkgdir&|" \
+ -e "s|/usr/sbin/psadwatchd|$pkgdir&|" \
+ -e "s|/usr/sbin/kmsgsd|$pkgdir&|" \
+ -e "s|/usr/sbin/psad|$pkgdir&|" \
+ ./psad.conf -i
+
+ #hope that things work
+ ./install.pl --init-dir "$pkgdir/etc/rc.d/" < responses
+
+ #add the systemd service file
+ cp $srcdir/psad-systemdinit.archlinux $pkgdir/usr/lib/systemd/system/psad.service
+
+ # Fix the config
+ sed -e "s|$pkgdir||" $pkgdir/etc/psad/psad.conf -i
+ sed -e "s|$pkgdir||" $pkgdir/var/log/psad/install.log -i
+
+ #Set correct permissions
+ chmod 0700 $pkgdir/var/lib/psad
+
+
+}
+
+# vim:set ts=2 sw=2 et: