# $Id: PKGBUILD 72157 2012-06-09 08:21:09Z bpiotrowski $
# Maintainer:  Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
# Contributor: Geoffroy Carrier <geoffroy.carrier@koon.fr>
# Contributor: michalzxc
# Contributor: nbags <neilbags@gmail.com>

pkgname=fail2ban
pkgver=0.8.6
pkgrel=2
pkgdesc="Bans IPs after too many failed authentification attempts against common daemons"
url="http://www.fail2ban.org/"
license=("GPL")
arch=('any')
depends=('python2' 'iptables')
backup=('etc/fail2ban/fail2ban.conf' 'etc/fail2ban/jail.conf')
source=(https://github.com/downloads/$pkgname/$pkgname/${pkgname}_${pkgver}.orig.tar.gz
        $pkgname.rc)
md5sums=('a5f08a67fe6bfb0580043d90c6f81cfd'
         '70caa58e130a13a505d63a35b9aecfb6')

package() {
  cd "$srcdir/$pkgname-$pkgname-a20d1f8"
  python2 setup.py install --root "$pkgdir"
  install -D -m755 "$srcdir/$pkgname.rc" "$pkgdir/etc/rc.d/$pkgname"

  # avoid conflict with filesystem>=2012.06
  rm -r "$pkgdir/var/run"
}
