app=vnstat
version=2.4
build=1sml
homepage="https://humdi.net/vnstat/"
download="https://humdi.net/vnstat/vnstat-2.4.tar.gz"
desc="Text-mode network traffic monitor and logger"
requires="bash sqlite libgd"

build() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions

  ./configure \
    --prefix="" \
    --sbindir=/bin \
    --sysconfdir=/etc 

  make all
  make install DESTDIR=$pkg

  cp COPYING $pkgdocs/

  ( cd $pkg/etc ; mv vnstat.conf vnstat.conf.new )

  preprunitservice vnstat down

  mkfinalpkg
}

sha512sums="
deb877b0eff18ccf33fea5c7389c7ba832d675376651c5d0f6cbfe3c5224afb6b8669aedb45c8e99b638e659cf44198f8714ec50c8a9e62272fb0c4e29c67488  vnstat-2.4.tar.lz
"
