[arch-commits] Commit in dhcp/trunk (PKGBUILD dhcp dhcp.install dhcp4 dhcp6)
Daniel Isenmann
daniel at archlinux.org
Thu Apr 14 10:22:19 UTC 2011
Date: Thursday, April 14, 2011 @ 06:22:18
Author: daniel
Revision: 119729
upgpkg: dhcp 4.2.1.1-1
Fixed FS#23609, FS#23308, FS#22819
Added:
dhcp/trunk/dhcp
dhcp/trunk/dhcp4
dhcp/trunk/dhcp6
Modified:
dhcp/trunk/PKGBUILD
dhcp/trunk/dhcp.install
--------------+
PKGBUILD | 31 +++++++++++++++++--------------
dhcp | 10 ++++++++++
dhcp.install | 7 +++++++
dhcp4 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
dhcp6 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 148 insertions(+), 14 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2011-04-14 07:54:55 UTC (rev 119728)
+++ PKGBUILD 2011-04-14 10:22:18 UTC (rev 119729)
@@ -5,20 +5,21 @@
pkgname=('dhcp' 'dhclient')
# separate patch levels with a period to maintain proper versioning.
-pkgver=4.2.0.2
-_pkgver=4.2.0-P2
+pkgver=4.2.1.1
+_pkgver=4.2.1-P1
pkgrel=1
arch=('i686' 'x86_64')
license=('custom:isc-dhcp')
url="https://www.isc.org/software/dhcp"
source=(http://ftp.isc.org/isc/${pkgbase}/${pkgbase}-${_pkgver}.tar.gz
- dhcpd dhcp.conf.d
+ dhcp4 dhcp6 dhcp
dhcp-4.1.1-missing-ipv6-not-fatal.patch
dhclient-script-pathFixes.patch)
-md5sums=('a98f4ce3ca651e7e28a5a1ae6398689e'
- 'df22cffa7d7415ece7bb025b7bf774dd'
- '49da3192e5c885e3c7d02f447c2dea5e'
+md5sums=('22e6f1eff6d5cfe2621a06cc62ba5b70'
+ 'c49b1497837ba56c54e401a66e1bab9b'
+ '12c2f3ae47ed23eb698eb7f1bfd80f20'
+ '8f357e46e1efcbb746f38737a3f977a2'
'fd64aeb4f399dcc41ea43089a3811094'
'ddcc5cd576ec631ade6c4da21952b50b')
@@ -33,11 +34,13 @@
./configure --prefix=/usr --sysconfdir=/etc \
--with-srv-lease-file=/var/state/dhcp/dhcpd.leases \
- --with-srv6-lease-file=/var/state/dhcp/dhcpd6.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
+ patch -i ${srcdir}/dhclient-script-pathFixes.patch client/scripts/linux || return 1
}
package_dhcp(){
@@ -49,8 +52,9 @@
cd ${srcdir}/${pkgbase}-${_pkgver}
make DESTDIR=${pkgdir} install
- install -D -m755 ${srcdir}/dhcpd ${pkgdir}/etc/rc.d/dhcpd
- install -D -m644 ${srcdir}/dhcp.conf.d ${pkgdir}/etc/conf.d/${pkgbase}
+ 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
@@ -62,17 +66,16 @@
package_dhclient(){
pkgdesc="dhclient is standalone client from the dhcp package"
- depends=('bash')
+ 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
- # directory needed for leasefiles
- mkdir -p ${pkgdir}/var/lib/dhclient
-
# install dhclient linux script
install -m755 -D client/scripts/linux ${pkgdir}/sbin/dhclient-script
Added: dhcp
===================================================================
--- dhcp (rev 0)
+++ dhcp 2011-04-14 10:22:18 UTC (rev 119729)
@@ -0,0 +1,10 @@
+#
+# Arguments to be passed to the DHCP server daemon
+#
+
+# ipv4 runtime parameters
+DHCP4_ARGS="-q"
+
+# ipv6 runtime parameters
+DHCP6_ARGS="-q"
+
Modified: dhcp.install
===================================================================
--- dhcp.install 2011-04-14 07:54:55 UTC (rev 119728)
+++ dhcp.install 2011-04-14 10:22:18 UTC (rev 119729)
@@ -1,7 +1,14 @@
# arg 1: the new package version
post_install() {
[ -f var/state/dhcp/dhcpd.leases ] || : >var/state/dhcp/dhcpd.leases
+ [ -f var/state/dhcp/dhcpd6.leases ] || : >var/state/dhcp/dhcpd6.leases
#echo "If dhcpd doesn't start, ensure the ipv6 kernel module is loaded."
+
+ echo
+ echo "==> The dhcp server has now two rc.d scripts."
+ echo "==> Use '/etc/rc.d/dhcp6' to use IPv6 dhcp server or"
+ echo "==> '/etc/rc.d/dhcp4' to use IPv4 dhcp server."
+ echo "==> Make sure that you change your DAEMONS array in '/etc/rc.conf'!"
}
# arg 1: the new package version
Added: dhcp4
===================================================================
--- dhcp4 (rev 0)
+++ dhcp4 2011-04-14 10:22:18 UTC (rev 119729)
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/dhcp
+
+PIDFILE="/var/run/dhcpd.pid"
+
+if [[ -f $PIDFILE ]]; then
+ read -r PID < "$PIDFILE"
+
+ # prevent stale pidfiles from hanging around
+ if [[ ! -d /proc/$PID ]]; then
+ echo 'pid not found. deleteing stale pidfile'
+ unset PID
+ rm -f "$PIDFILE"
+ fi
+fi
+
+case "$1" in
+ start)
+ stat_busy "Starting DHCPv4 Server"
+ if [[ $PID ]]; then
+ stat_fail
+ exit 1
+ fi
+ if /usr/sbin/dhcpd -4 -pf "$PIDFILE" $DHCP4_ARGS; then
+ add_daemon dhcp4
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping DHCPv4 Server"
+ if [[ ! $PID ]]; then
+ stat_fail
+ exit 1
+ fi
+ if { kill $PID && rm -f "$PIDFILE"; } &>/dev/null; then
+ rm_daemon dhcp4
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+
Added: dhcp6
===================================================================
--- dhcp6 (rev 0)
+++ dhcp6 2011-04-14 10:22:18 UTC (rev 119729)
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/dhcp
+
+PIDFILE="/var/run/dhcp6.pid"
+
+if [[ -f $PIDFILE ]]; then
+ read -r PID < "$PIDFILE"
+
+ # prevent stale pidfiles from hanging around
+ if [[ ! -d /proc/$PID ]]; then
+ echo 'pid not found. deleteing stale pidfile'
+ unset PID
+ rm -f "$PIDFILE"
+ fi
+fi
+
+case "$1" in
+ start)
+ stat_busy "Starting DHCPv6 Server"
+ if [[ $PID ]]; then
+ stat_fail
+ exit 1
+ fi
+ if /usr/sbin/dhcpd -6 -pf "$PIDFILE" $DHCP6_ARGS; then
+ add_daemon dhcp6
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping DHCPv6 Server"
+ if [[ ! $PID ]]; then
+ stat_fail
+ exit 1
+ fi
+ if { kill $PID && rm -f "$PIDFILE"; } &>/dev/null; then
+ rm_daemon dhcp6
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+
More information about the arch-commits
mailing list