app=unbound
version=1.9.2
build=1sml
homepage="https://www.nlnetlabs.nl/projects/unbound/about/"
download="https://www.nlnetlabs.nl/downloads/unbound/unbound-1.9.2.tar.gz"
desc="Validating, recursive, and caching DNSSEC resolver written in C"
requires="expat openssl"

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

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

  ./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 unbound down

  mkfinalpkg
}

sha512sums="
391e170ff64741955cb2366bef5699fbf36b9ad865e10b6ea523e8a1f4e116be69ff572ec745f6a0cb753381106592d29a3f5647a5ecd2d665b73422ebd6a3c2  unbound-1.9.2.tar.lz
"
