# $Id: PKGBUILD 118122 2014-09-01 11:54:34Z spupykin $
# Maintainer:  Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer:  Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
# Contributor: Thorsten Töpper <atsutane-tu@freethoughts.de>

pkgname=vnstat
pkgver=1.12
pkgrel=1
pkgdesc="A console-based network traffic monitor"
arch=('i686' 'x86_64')
url="http://humdi.net/vnstat/"
license=('GPL')
depends=('bash')
makedepends=('gd')
optdepends=('gd: image output')
backup=(etc/vnstat.conf)
source=(http://humdi.net/vnstat/$pkgname-$pkgver.tar.gz)
md5sums=('a154b2196771e06a8accd1c24374009c')

build() {
  cd $srcdir/$pkgname-$pkgver
  make all SBIN=/usr/bin
}

package() {
  cd $srcdir/$pkgname-$pkgver
  make DESTDIR=$pkgdir install SBIN=$pkgdir/usr/bin
  install -Dm0755 examples/vnstat.cgi $pkgdir/usr/share/doc/vnstat/examples/vnstat.cgi
  install -Dm0644 examples/systemd/vnstat.service $pkgdir/usr/lib/systemd/system/vnstat.service
}
