# Maintainer: PktSurf <smlinux@pktsurf.in>
app=unbound
version=1.17.1
build=1sml
homepage="https://www.nlnetlabs.nl/projects/unbound/about/"
download="https://www.nlnetlabs.nl/downloads/unbound/unbound-$version.tar.gz"
desc="Validating, recursive, and caching DNSSEC resolver written in C"
requires="expat openssl"

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

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

build() {
  ./configure \
    --prefix="" \
    --sysconfdir=/etc \
    --sbindir=/bin \
    --with-username=nobody \
    --disable-static

  make
  make install DESTDIR=$pkg

  mv $pkg/etc/unbound/unbound.conf $pkg/etc/unbound/unbound.conf.new

  cp LICENSE $pkgdocs/

  preprunitservice -s unbound -d

  mkfinalpkg
}

sha512sums="
a31fea727101180db11fe4ce84c35ca558ba3f45822e8c5b745741c9a9ce2d7bd75e3e2e752866d2ac006b80886098ee591d9f8ed576d0c8baab1c8889862132  unbound-1.17.1.tar.lz
"
