app=openntpd
version=6.2p3
build=1sml
homepage="https://www.openntpd.org/"
download="https://cdn.openbsd.org/pub/OpenBSD/OpenNTPD/openntpd-6.2p3.tar.gz"
desc="Secure NTPD implementation from OpenBSD developers"
requires="openssl"

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

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

  ./configure \
    --prefix="" \
    --bindir=/bin \
    --sbindir=/bin \
    --sysconfdir=/etc \
    --with-privsep-user=nobody \
    --with-adjtimex

  make
  make install DESTDIR=$pkg

  cp COPYING $pkgdocs/

  preprunitservice openntpd down

  mkfinalpkg
}

sha512sums="
727689597c031d1a0872b63ca0e83edc7c8e65aa7fa90a5546dd029445f9e40c268d71f9e054c40799a8a591fa0c618be8683dd42d9c872a2ab6413309ac4669  openntpd-6.2p3.tar.lz
"
