# $Id: PKGBUILD 134290 2015-05-28 21:32:19Z seblu $
# Maintainer: Sébastien Luttringer
# Contributor: Marti Raudsepp <marti@juffo.org>
# Contributor: Manuel Mazzuola <origin.of@gmail.com>

pkgname=ferm
pkgver=2.2
pkgrel=3
pkgdesc='Tool to maintain complex firewalls'
arch=('any')
url='http://ferm.foo-projects.org/'
license=('GPL2')
depends=('iptables' 'perl')
optdepends=('ebtables' 'arptables' 'ipset')
backup=("etc/$pkgname.conf")
source=(
  "http://ferm.foo-projects.org/download/${pkgver:0:3}/$pkgname-$pkgver.tar.gz"
  "$pkgname.service")
md5sums=('f2d6e6950d90c768ef9e1f055a01fba2'
         '9c5ece2628fd86a73b70f9c39df63e9f')

package() {
  # software setup
  cd $pkgname-$pkgver
  make PREFIX="$pkgdir/usr" install
  cd "$pkgdir"
  # setup default config
  install -D -m 644 usr/share/doc/ferm/examples/workstation.ferm etc/$pkgname.conf
  # remove fancy docs
  rm usr/share/doc/ferm/ferm.{html,txt}
  # /usr merge
  mv usr/sbin usr/bin
  # systemd
  install -Dm 644 "$srcdir/$pkgname.service" usr/lib/systemd/system/$pkgname.service
}

# vim:set ts=2 sw=2 et:
