app=dhcpcd
version=9.1.4
build=1sml
homepage="https://roy.marples.name/projects/dhcpcd"
download="https://github.com/NetworkConfiguration/dhcpcd/archive/refs/tags/dhcpcd-9.1.4.tar.gz"
desc="RFC2131 and 1541-compliant DHCP client"
requires="musl"

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

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

  ./configure \
    --prefix="" \
    --sbindir=/bin \
    --libexecdir=/lib/dhcpcd \
    --datadir=/share \
    --mandir=/share/man \
    --dbdir=/var/lib/dhcpcd \
    --privsepuser=dhcpcd

  make
  make install DESTDIR=$pkg 

  cp LICENSE $pkgdocs/

  # Rename the config file as .new
  mv $pkg/etc/dhcpcd.conf $pkg/etc/dhcpcd.conf.new

  mkfinalpkg
}

sha512sums="
ef043dbd45cb6e5cfb407d9835e5fcd4580c4341e37170f2ff26869badf6ae030c477acca15163753e708ae8cadd62fa7d277c8542984b9119b851ed25a3149a  dhcpcd-9.1.4.tar.xz
"
