pkgbase=dhcp pkgname=('dhcp' 'dhclient') pkgver=4.4.3.P1 _pkgver=4.4.3-P1 pkgrel=2 arch=('x86_64') license=('MPL 2.0.') url="https://www.isc.org/dhcp/" makedepends=('bash' 'iproute2') source=("https://ftp.isc.org/isc/dhcp/${_pkgver}/${pkgbase}-${_pkgver}.tar.gz" 'dhcpd4.service' 'dhcpd6.service' "https://gitlab.isc.org/isc-projects/dhcp/-/commit/6c7e61578b1b449272dbb40dd8b98d03dad8a57a.diff") md5sums=('36c6ca77212373b0cff478ae9e5d32af' '7045e63a5d294c761ce306084eec2c67' 'a2ebf4460c049cbee3e49cb26a475f68' 'eef25d700f3f054cf05ad3d786dc0f28') build() { cd ${pkgname}-${_pkgver} # Define _GNU_SOURCE to fix IPV6. sed '/^CFLAGS="$CFLAGS/ s/INGS"/INGS -D_GNU_SOURCE"/' -i configure # use patches from LFS http://www.linuxfromscratch.org/blfs/view/cvs/basicnet/dhcp.html #patch -p1 -i ${srcdir}/6c7e61578b1b449272dbb40dd8b98d03dad8a57a.diff ./configure --prefix=/usr \ --sysconfdir=/etc \ --with-srv-lease-file=/var/state/dhcp/dhcpd.leases \ --with-srv6-lease-file=/var/state/dhcp/dhcpd6.leases \ --with-cli-lease-file=/var/state/dhclient/dhclient.leases \ --with-cli6-lease-file=/var/state/dhclient/dhclient6.leases make -j1 } package_dhcp() { pkgdesc="A DHCP server, client, and relay agent" backup=('etc/dhcpd.conf') install=dhcp.install cd ${pkgname}-${_pkgver} make DESTDIR=${pkgdir} install mkdir -p ${pkgdir}/var/state/dhcp # Install systemd service files install -D -m0644 ${srcdir}/dhcpd4.service ${pkgdir}/usr/lib/systemd/system/dhcpd4.service install -D -m0644 ${srcdir}/dhcpd6.service ${pkgdir}/usr/lib/systemd/system/dhcpd6.service ln -s dhcpd4.service ${pkgdir}/usr/lib/systemd/system/dhcp4.service ln -s dhcpd6.service ${pkgdir}/usr/lib/systemd/system/dhcp6.service # move back to config. This file is in backup array, so pacman will not overwrite a changed config. mv ${pkgdir}/etc/dhcpd.conf.example ${pkgdir}/etc/dhcpd.conf # Remove dhclient make -C client DESTDIR=${pkgdir} uninstall install -Dm0644 LICENSE ${pkgdir}/usr/share/licenses/dhcp/LICENSE } package_dhclient() { _pkgname=dhcp pkgdesc="dhclient is standalone client from the dhcp package" depends=('bash' 'iproute2') cd ${_pkgname}-${_pkgver} make -C client DESTDIR=${pkgdir} install install -m755 -d ${pkgdir}/usr/share/dhclient mv ${pkgdir}/etc/dhclient.conf.example ${pkgdir}/usr/share/dhclient/ install -d ${pkgdir}/var/state/dhclient install -Dm0755 client/scripts/linux ${pkgdir}/sbin/dhclient-script install -Dm0644 LICENSE ${pkgdir}/usr/share/licenses/dhclient/LICENSE }