# Maintainer: PktSurf <smlinux@pktsurf.in>
app=dnsmasq
version=2.85
build=1sml
homepage="https://thekelleys.org.uk/dnsmasq/doc.html"
download="https://thekelleys.org.uk/dnsmasq/dnsmasq-$version.tar.xz"
desc="Lightweight DNS and DHCP server suitable for a small network"
requires="musl"

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

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

build() {
  SM_BUILDOPTS="-DHAVE_DNSSEC -DHAVE_DBUS -DHAVE_LIBIDN2 -DHAVE_CONNTRACK"
  make COPTS="$SM_BUILDOPTS" 
  make COPTS="$SM_BUILDOPTS" PREFIX="/" BINDIR="/bin" DESTDIR="$pkg" install

  install -Dm 600 dnsmasq.conf.example $pkg/etc/dnsmasq.conf.new
  cp COPYING* $pkgdocs/

  preprunitservice -s dnsmasq -d

  mkfinalpkg
}

sha512sums="
6df1aeee42dbccbe2c6727ca761bbf6efe6eb0af63361984e194ef4c5bde3cd66078aab9e48eac253cd4f1468369b4301df976d87a17cece82317738d95b9ed6  dnsmasq-2.85.tar.lz
"
