diff options
Diffstat (limited to 'extra/dhcp/PKGBUILD')
-rw-r--r-- | extra/dhcp/PKGBUILD | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/extra/dhcp/PKGBUILD b/extra/dhcp/PKGBUILD new file mode 100644 index 000000000..b7b23fc58 --- /dev/null +++ b/extra/dhcp/PKGBUILD @@ -0,0 +1,84 @@ +# $Id: PKGBUILD 119729 2011-04-14 10:22:18Z daniel $ +# Maintainer: Daniel Isenmann <daniel @archlinux.org> + +pkgbase=dhcp +pkgname=('dhcp' 'dhclient') + +# separate patch levels with a period to maintain proper versioning. +pkgver=4.2.1.1 +_pkgver=4.2.1-P1 + +pkgrel=1 +arch=('i686' 'x86_64' 'mips64el') +license=('custom:isc-dhcp') +url="https://www.isc.org/software/dhcp" +source=(ftp://ftp.isc.org/isc/${pkgbase}/${pkgbase}-${_pkgver}.tar.gz + dhcp4 dhcp6 dhcp + dhcp-4.1.1-missing-ipv6-not-fatal.patch + dhclient-script-pathFixes.patch) +md5sums=('22e6f1eff6d5cfe2621a06cc62ba5b70' + 'c49b1497837ba56c54e401a66e1bab9b' + '12c2f3ae47ed23eb698eb7f1bfd80f20' + '8f357e46e1efcbb746f38737a3f977a2' + 'fd64aeb4f399dcc41ea43089a3811094' + 'ddcc5cd576ec631ade6c4da21952b50b') + +build() { + cd ${srcdir}/${pkgbase}-${_pkgver} + + # Define _GNU_SOURCE to fix IPV6. + sed '/^CFLAGS="$CFLAGS/ s/INGS"/INGS -D_GNU_SOURCE"/' -i configure + + # Make not having ipv6 non-fatal. + patch -Np0 -i ${srcdir}/dhcp-4.1.1-missing-ipv6-not-fatal.patch + + ./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 + + patch -i ${srcdir}/dhclient-script-pathFixes.patch client/scripts/linux || return 1 +} + +package_dhcp(){ + pkgdesc="A DHCP server, client, and relay agent" + depends=('openssl>=0.9.8a') + backup=('etc/dhcpd.conf' 'etc/conf.d/dhcp') + install=dhcp.install + + cd ${srcdir}/${pkgbase}-${_pkgver} + make DESTDIR=${pkgdir} install + + install -D -m755 ${srcdir}/dhcp4 ${pkgdir}/etc/rc.d/dhcp4 + install -D -m755 ${srcdir}/dhcp6 ${pkgdir}/etc/rc.d/dhcp6 + install -D -m644 ${srcdir}/dhcp ${pkgdir}/etc/conf.d/${pkgbase} + mkdir -p ${pkgdir}/var/state/dhcp + + # Remove dhclient + make -C client DESTDIR=${pkgdir} uninstall + + # install license + install -m644 -D LICENSE ${pkgdir}/usr/share/licenses/dhcp/LICENSE +} + +package_dhclient(){ + pkgdesc="dhclient is standalone client from the dhcp package" + depends=('bash' 'iproute2') + + cd ${srcdir}/${pkgbase}-${_pkgver} + make -C client DESTDIR=${pkgdir} install + + # move dhclient.conf to dhclient.conf.example + mv ${pkgdir}/etc/dhclient.conf{,.example} + + mkdir -p ${pkgdir}/var/state/dhclient + + # install dhclient linux script + install -m755 -D client/scripts/linux ${pkgdir}/sbin/dhclient-script + + # install license + install -m644 -D LICENSE ${pkgdir}/usr/share/licenses/dhclient/LICENSE +} |