summaryrefslogtreecommitdiff
path: root/pcr/fwsnort/PKGBUILD
blob: 37a863822603e7d1cf13ccedf361993d9642f5d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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: