# $Id: PKGBUILD 71315 2012-05-26 14:58:35Z seblu $
# Maintainer: Sébastien Luttringer <seblu@aur.archlinux.org>
# Contributor: Marti Raudsepp <marti@juffo.org>
# Contributor: Manuel Mazzuola <origin.of@gmail.com>

pkgname=ferm
pkgver=2.1
pkgrel=5
pkgdesc='Tool to maintain complex firewalls'
arch=('any')
url='http://ferm.foo-projects.org/'
license=('GPL2')
depends=('iptables')
optdepends=('ebtables' 'arptables' 'ipset')
backup=("etc/$pkgname.conf" "etc/conf.d/$pkgname")
source=(
  "http://ferm.foo-projects.org/download/${pkgver:0:3}/$pkgname-$pkgver.tar.gz"
  "$pkgname.conf"
  "$pkgname.rc"
  "$pkgname.service")
md5sums=('ac5d11554a50e514cbad8f354b14e564'
         'd6fd57e1ba4cb72cfa87a35f551653d7'
         'ce1b1cb54ec71f804b86f12f339d9631'
         '3397b94905df34a0428f1e9cb66ce39c')

package() {
  # software setup
  pushd $pkgname-$pkgver
  make PREFIX="${pkgdir}/usr" install
  popd
  # install initscripts
  install -Dm 755 $pkgname.rc "$pkgdir/etc/rc.d/$pkgname"
  install -Dm 644 $pkgname.conf "$pkgdir/etc/conf.d/$pkgname"
  # install systemd service
  install -Dm 644 $pkgname.service \
    "$pkgdir/usr/lib/systemd/system/$pkgname.service"
  # setup default config
  install -D -m 644 "$pkgdir/usr/share/doc/ferm/examples/workstation.ferm" \
    "$pkgdir/etc/$pkgname.conf"
}

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