summaryrefslogtreecommitdiff
path: root/pcr/fwsnort
diff options
context:
space:
mode:
Diffstat (limited to 'pcr/fwsnort')
-rw-r--r--pcr/fwsnort/PKGBUILD44
-rw-r--r--pcr/fwsnort/install_pl.patch27
2 files changed, 71 insertions, 0 deletions
diff --git a/pcr/fwsnort/PKGBUILD b/pcr/fwsnort/PKGBUILD
new file mode 100644
index 000000000..37a863822
--- /dev/null
+++ b/pcr/fwsnort/PKGBUILD
@@ -0,0 +1,44 @@
+# Contributor: Colin Shea <colin@evaryont.me>
+# Maintainer : Parabola GNU / Linux-libre Aurelien Desbrieres <aurelien@cwb.io>
+
+pkgname=fwsnort
+pkgver=1.6.2
+pkgrel=1
+pkgdesc="application layer IDS/IPS by translating snort rules into iptables"
+arch=('any')
+url="http://www.cipherdyne.org/fwsnort/"
+license=('GPL')
+depends=('perl' 'perl-net-ipv4addr' 'perl-iptables-parse' 'iptables' 'net-tools')
+makedepends=('wget')
+source=(http://www.cipherdyne.org/$pkgname/download/$pkgname-$pkgver.tar.bz2
+ 'install_pl.patch')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ mkdir -p $pkgdir/var/log/fwsnort \
+ $pkgdir/usr/lib/fwsnort \
+ $pkgdir/usr/share/man/man8 \
+ $pkgdir/usr/sbin \
+ $pkgdir/etc/fwsnort/snort_rules \
+ $pkgdir/etc/fwsnort/archive \
+ $pkgdir/etc/fwsnort/snort_rules_queue
+
+ patch -p0 -i $srcdir/install_pl.patch
+ sed -e "/mpath.*man8/s|/usr|$pkgdir&|" \
+ -e "/^my\\ \\\$sbin/s|/usr|$pkgdir&|" \
+ -i install.pl
+
+ cp fwsnort.conf fwsnort.conf.bak
+
+ sed -e "s|/var/log/fwsnort|$pkgdir&|" \
+ -e "s|/usr/lib/fwsnort|$pkgdir&|" \
+ -e "s|/etc/fwsnort|$pkgdir&|" \
+ ./fwsnort.conf -i
+ # -S skips installing the perl modules, which we did with packages
+ echo y | ./install.pl -S
+ mv -f fwsnort.conf.bak $pkgdir/etc/fwsnort/fwsnort.conf
+ chmod 755 $pkgdir/usr/sbin/fwsnort
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/pcr/fwsnort/install_pl.patch b/pcr/fwsnort/install_pl.patch
new file mode 100644
index 000000000..b9cfb4a33
--- /dev/null
+++ b/pcr/fwsnort/install_pl.patch
@@ -0,0 +1,27 @@
+--- install.pl 2011-02-05 05:02:38.845785881 -0700
++++ install2.pl 2011-02-05 05:03:21.350360881 -0700
+@@ -120,10 +120,6 @@
+ ### make sure the system binaries are where we think they are.
+ &check_commands();
+
+-### check to make sure we are running as root
+-$< == 0 && $> == 0 or die "You need to be root (or equivalent UID 0",
+- " account) to install/uninstall fwsnort!\n";
+-
+ if ($uninstall) {
+ &uninstall();
+ } else {
+--- install.pl 2011-01-02 18:38:51.000000000 -0700
++++ install2.pl 2011-02-05 04:59:01.653910881 -0700
+@@ -471,8 +471,11 @@
+ sub check_commands() {
+ my @path = qw(
+ /bin
++ /sbin
+ /usr/bin
++ /usr/sbin
+ /usr/local/bin
++ /usr/local/sbin
+ );
+ CMD: for my $cmd (keys %cmds) {
+ unless (-x $cmds{$cmd}) {