# Maintainer: PktSurf <smlinux@pktsurf.in>
app=vnstat
version=2.10
build=1sml
homepage="https://humdi.net/vnstat/"
download="https://humdi.net/vnstat/vnstat-$version.tar.gz"
desc="Text-mode network traffic monitor and logger"
requires="bash sqlite libgd"

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

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

build() {
  ./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 -s vnstat -d

  mkfinalpkg
}

sha512sums="
73bcd991c8a5dbaf4ac2ae0758230ee14981dea18551cf3632fddd43d59245cf1f82245967ea095f1da803f7022665d96436488fe14a00823fc911ec0380a7a8  vnstat-2.10.tar.lz
"
