[arch-commits] Commit in dhcp/repos (20 files)

Eric Bélanger eric at archlinux.org
Sat Jul 28 22:37:01 UTC 2012


    Date: Saturday, July 28, 2012 @ 18:37:00
  Author: eric
Revision: 164255

archrelease: copy trunk to testing-i686, testing-x86_64

Added:
  dhcp/repos/testing-i686/
  dhcp/repos/testing-i686/PKGBUILD
    (from rev 164254, dhcp/trunk/PKGBUILD)
  dhcp/repos/testing-i686/dhclient-script-pathFixes.patch
    (from rev 164254, dhcp/trunk/dhclient-script-pathFixes.patch)
  dhcp/repos/testing-i686/dhcp
    (from rev 164254, dhcp/trunk/dhcp)
  dhcp/repos/testing-i686/dhcp-4.1.1-missing-ipv6-not-fatal.patch
    (from rev 164254, dhcp/trunk/dhcp-4.1.1-missing-ipv6-not-fatal.patch)
  dhcp/repos/testing-i686/dhcp.conf.d
    (from rev 164254, dhcp/trunk/dhcp.conf.d)
  dhcp/repos/testing-i686/dhcp.install
    (from rev 164254, dhcp/trunk/dhcp.install)
  dhcp/repos/testing-i686/dhcp4
    (from rev 164254, dhcp/trunk/dhcp4)
  dhcp/repos/testing-i686/dhcp6
    (from rev 164254, dhcp/trunk/dhcp6)
  dhcp/repos/testing-i686/dhcpd
    (from rev 164254, dhcp/trunk/dhcpd)
  dhcp/repos/testing-x86_64/
  dhcp/repos/testing-x86_64/PKGBUILD
    (from rev 164254, dhcp/trunk/PKGBUILD)
  dhcp/repos/testing-x86_64/dhclient-script-pathFixes.patch
    (from rev 164254, dhcp/trunk/dhclient-script-pathFixes.patch)
  dhcp/repos/testing-x86_64/dhcp
    (from rev 164254, dhcp/trunk/dhcp)
  dhcp/repos/testing-x86_64/dhcp-4.1.1-missing-ipv6-not-fatal.patch
    (from rev 164254, dhcp/trunk/dhcp-4.1.1-missing-ipv6-not-fatal.patch)
  dhcp/repos/testing-x86_64/dhcp.conf.d
    (from rev 164254, dhcp/trunk/dhcp.conf.d)
  dhcp/repos/testing-x86_64/dhcp.install
    (from rev 164254, dhcp/trunk/dhcp.install)
  dhcp/repos/testing-x86_64/dhcp4
    (from rev 164254, dhcp/trunk/dhcp4)
  dhcp/repos/testing-x86_64/dhcp6
    (from rev 164254, dhcp/trunk/dhcp6)
  dhcp/repos/testing-x86_64/dhcpd
    (from rev 164254, dhcp/trunk/dhcpd)

--------------------------------------------------------+
 testing-i686/PKGBUILD                                  |   86 +++++++++
 testing-i686/dhclient-script-pathFixes.patch           |  136 +++++++++++++++
 testing-i686/dhcp                                      |   10 +
 testing-i686/dhcp-4.1.1-missing-ipv6-not-fatal.patch   |   39 ++++
 testing-i686/dhcp.conf.d                               |    6 
 testing-i686/dhcp.install                              |   18 +
 testing-i686/dhcp4                                     |   57 ++++++
 testing-i686/dhcp6                                     |   57 ++++++
 testing-i686/dhcpd                                     |   40 ++++
 testing-x86_64/PKGBUILD                                |   86 +++++++++
 testing-x86_64/dhclient-script-pathFixes.patch         |  136 +++++++++++++++
 testing-x86_64/dhcp                                    |   10 +
 testing-x86_64/dhcp-4.1.1-missing-ipv6-not-fatal.patch |   39 ++++
 testing-x86_64/dhcp.conf.d                             |    6 
 testing-x86_64/dhcp.install                            |   18 +
 testing-x86_64/dhcp4                                   |   57 ++++++
 testing-x86_64/dhcp6                                   |   57 ++++++
 testing-x86_64/dhcpd                                   |   40 ++++
 18 files changed, 898 insertions(+)

Copied: dhcp/repos/testing-i686/PKGBUILD (from rev 164254, dhcp/trunk/PKGBUILD)
===================================================================
--- testing-i686/PKGBUILD	                        (rev 0)
+++ testing-i686/PKGBUILD	2012-07-28 22:37:00 UTC (rev 164255)
@@ -0,0 +1,86 @@
+# $Id$
+# Maintainer: Daniel Isenmann <daniel @archlinux.org>
+
+pkgbase=dhcp
+pkgname=('dhcp' 'dhclient')
+
+# separate patch levels with a period to maintain proper versioning.
+pkgver=4.2.4.1
+_pkgver=4.2.4-P1
+
+pkgrel=1
+arch=('i686' 'x86_64')
+license=('custom:isc-dhcp')
+url="https://www.isc.org/software/dhcp"
+makedepends=('bash' 'iproute2' 'net-tools')
+source=(ftp://ftp.isc.org/isc/${pkgbase}/${_pkgver}/${pkgbase}-${_pkgver}.tar.gz{,.asc}
+        dhcp4 dhcp6 dhcp
+        dhcp-4.1.1-missing-ipv6-not-fatal.patch
+        dhclient-script-pathFixes.patch)
+md5sums=('0ca7181024651f6323951d5498c8020b'
+         '0dfe000dd88555ea06b282ae5e574d5f'
+         'c49b1497837ba56c54e401a66e1bab9b'
+         '12c2f3ae47ed23eb698eb7f1bfd80f20'
+         '8f357e46e1efcbb746f38737a3f977a2'
+         'fd64aeb4f399dcc41ea43089a3811094'
+         '541b415a25a169eaf64b681405f79a80')
+
+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
+}
+
+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}"
+  install -d "${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="A standalone DHCP client from the dhcp package"
+  depends=('bash' 'iproute2' 'net-tools')
+
+  cd "${srcdir}/${pkgbase}-${_pkgver}"
+  make -C client DESTDIR="${pkgdir}" install
+
+  # move dhclient.conf to dhclient.conf.example
+  mv "${pkgdir}"/etc/dhclient.conf{,.example}
+  
+  install -d "${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"
+}

Copied: dhcp/repos/testing-i686/dhclient-script-pathFixes.patch (from rev 164254, dhcp/trunk/dhclient-script-pathFixes.patch)
===================================================================
--- testing-i686/dhclient-script-pathFixes.patch	                        (rev 0)
+++ testing-i686/dhclient-script-pathFixes.patch	2012-07-28 22:37:00 UTC (rev 164255)
@@ -0,0 +1,136 @@
+--- linux	2011-05-18 20:01:54.000000000 +0000
++++ linux_new	2011-12-21 18:45:41.487171012 +0000
+@@ -23,7 +23,7 @@
+ # of the $1 in its args.
+ 
+ # 'ip' just looks too weird.  /sbin/ip looks less weird.
+-ip=/sbin/ip
++ip=/usr/sbin/ip
+ 
+ make_resolv_conf() {
+   if [ x"$new_domain_name_servers" != x ]; then
+@@ -122,9 +122,9 @@
+ if [ x$reason = xPREINIT ]; then
+   if [ x$alias_ip_address != x ]; then
+     # Bring down alias interface. Its routes will disappear too.
+-    ifconfig $interface:0- inet 0
++    /sbin/ifconfig $interface:0- inet 0
+   fi
+-  ifconfig $interface 0 up
++  /sbin/ifconfig $interface 0 up
+ 
+   # We need to give the kernel some time to get the interface up.
+   sleep 1
+@@ -151,25 +151,25 @@
+   if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
+ 		[ x$alias_ip_address != x$old_ip_address ]; then
+     # Possible new alias. Remove old alias.
+-    ifconfig $interface:0- inet 0
++    /sbin/ifconfig $interface:0- inet 0
+   fi
+   if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
+     # IP address changed. Bringing down the interface will delete all routes,
+     # and clear the ARP cache.
+-    ifconfig $interface inet 0 down
++    /sbin/ifconfig $interface inet 0 down
+ 
+   fi
+   if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
+      [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
+ 
+-    ifconfig $interface inet $new_ip_address $new_subnet_arg \
++    /sbin/ifconfig $interface inet $new_ip_address $new_subnet_arg \
+ 					$new_broadcast_arg $mtu_arg
+     # Add a network route to the computed network address.
+     for router in $new_routers; do
+       if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+-	route add -host $router dev $interface
++	/sbin/route add -host $router dev $interface
+       fi
+-      route add default gw $router $metric_arg dev $interface
++      /sbin/route add default gw $router $metric_arg dev $interface
+     done
+   else
+     # we haven't changed the address, have we changed other options           
+@@ -177,21 +177,21 @@
+     if [ x$new_routers != x ] && [ x$new_routers != x$old_routers ] ; then
+       # if we've changed routers delete the old and add the new.
+       for router in $old_routers; do
+-        route del default gw $router
++        /sbin/route del default gw $router
+       done
+       for router in $new_routers; do
+         if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+-	  route add -host $router dev $interface
++	  /sbin/route add -host $router dev $interface
+ 	fi
+-	route add default gw $router $metric_arg dev $interface
++	/sbin/route add default gw $router $metric_arg dev $interface
+       done
+     fi
+   fi
+   if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
+    then
+-    ifconfig $interface:0- inet 0
+-    ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+-    route add -host $alias_ip_address $interface:0
++    /sbin/ifconfig $interface:0- inet 0
++    /sbin/ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
++    /sbin/route add -host $alias_ip_address $interface:0
+   fi
+   make_resolv_conf
+   exit_with_hooks 0
+@@ -201,42 +201,42 @@
+    || [ x$reason = xSTOP ]; then
+   if [ x$alias_ip_address != x ]; then
+     # Turn off alias interface.
+-    ifconfig $interface:0- inet 0
++    /sbin/ifconfig $interface:0- inet 0
+   fi
+   if [ x$old_ip_address != x ]; then
+     # Shut down interface, which will delete routes and clear arp cache.
+-    ifconfig $interface inet 0 down
++    /sbin/ifconfig $interface inet 0 down
+   fi
+   if [ x$alias_ip_address != x ]; then
+-    ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+-    route add -host $alias_ip_address $interface:0
++    /sbin/ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
++    /sbin/route add -host $alias_ip_address $interface:0
+   fi
+   exit_with_hooks 0
+ fi
+ 
+ if [ x$reason = xTIMEOUT ]; then
+   if [ x$alias_ip_address != x ]; then
+-    ifconfig $interface:0- inet 0
++    /sbin/ifconfig $interface:0- inet 0
+   fi
+-  ifconfig $interface inet $new_ip_address $new_subnet_arg \
++  /sbin/ifconfig $interface inet $new_ip_address $new_subnet_arg \
+ 					$new_broadcast_arg $mtu_arg
+   set $new_routers
+   if ping -q -c 1 $1; then
+     if [ x$new_ip_address != x$alias_ip_address ] && \
+ 			[ x$alias_ip_address != x ]; then
+-      ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+-      route add -host $alias_ip_address dev $interface:0
++      /sbin/ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
++      /sbin/route add -host $alias_ip_address dev $interface:0
+     fi
+     for router in $new_routers; do
+       if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+-	route add -host $router dev $interface
++	/sbin/route add -host $router dev $interface
+       fi
+-      route add default gw $router $metric_arg dev $interface
++      /sbin/route add default gw $router $metric_arg dev $interface
+     done
+     make_resolv_conf
+     exit_with_hooks 0
+   fi
+-  ifconfig $interface inet 0 down
++  /sbin/ifconfig $interface inet 0 down
+   exit_with_hooks 1
+ fi
+ 

Copied: dhcp/repos/testing-i686/dhcp (from rev 164254, dhcp/trunk/dhcp)
===================================================================
--- testing-i686/dhcp	                        (rev 0)
+++ testing-i686/dhcp	2012-07-28 22:37:00 UTC (rev 164255)
@@ -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"
+

Copied: dhcp/repos/testing-i686/dhcp-4.1.1-missing-ipv6-not-fatal.patch (from rev 164254, dhcp/trunk/dhcp-4.1.1-missing-ipv6-not-fatal.patch)
===================================================================
--- testing-i686/dhcp-4.1.1-missing-ipv6-not-fatal.patch	                        (rev 0)
+++ testing-i686/dhcp-4.1.1-missing-ipv6-not-fatal.patch	2012-07-28 22:37:00 UTC (rev 164255)
@@ -0,0 +1,39 @@
+--- common/discover.c	2009-09-29 21:44:49.000000000 +0200
++++ common/discover.c_new	2010-06-30 19:40:02.000000000 +0200
+@@ -443,7 +443,7 @@
+ 	}
+ 
+ #ifdef DHCPv6
+-	if (local_family == AF_INET6) {
++	if ((local_family == AF_INET6) && !access("/proc/net/if_inet6", R_OK)) {
+ 		ifaces->fp6 = fopen("/proc/net/if_inet6", "r");
+ 		if (ifaces->fp6 == NULL) {
+ 			log_error("Error opening '/proc/net/if_inet6' to "
+@@ -454,6 +454,8 @@
+ 			ifaces->fp = NULL;
+ 			return 0;
+ 		}
++	} else {
++		ifaces->fp6 = NULL;
+ 	}
+ #endif
+ 
+@@ -721,7 +723,7 @@
+ 		return 1;
+ 	}
+ #ifdef DHCPv6
+-	if (!(*err)) {
++	if (!(*err) && ifaces->fp6) {
+ 		if (local_family == AF_INET6)
+ 			return next_iface6(info, err, ifaces);
+ 	}
+@@ -740,7 +742,8 @@
+ 	ifaces->sock = -1;
+ #ifdef DHCPv6
+ 	if (local_family == AF_INET6) {
+-		fclose(ifaces->fp6);
++		if(ifaces->fp6)
++			fclose(ifaces->fp6);
+ 		ifaces->fp6 = NULL;
+ 	}
+ #endif

Copied: dhcp/repos/testing-i686/dhcp.conf.d (from rev 164254, dhcp/trunk/dhcp.conf.d)
===================================================================
--- testing-i686/dhcp.conf.d	                        (rev 0)
+++ testing-i686/dhcp.conf.d	2012-07-28 22:37:00 UTC (rev 164255)
@@ -0,0 +1,6 @@
+#
+# Arguments to be passed to the DHCP server daemon
+#
+
+DHCP_ARGS="-q"
+

Copied: dhcp/repos/testing-i686/dhcp.install (from rev 164254, dhcp/trunk/dhcp.install)
===================================================================
--- testing-i686/dhcp.install	                        (rev 0)
+++ testing-i686/dhcp.install	2012-07-28 22:37:00 UTC (rev 164255)
@@ -0,0 +1,18 @@
+# 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
+# arg 2:  the old package version
+post_upgrade() {
+  post_install $1
+}

Copied: dhcp/repos/testing-i686/dhcp4 (from rev 164254, dhcp/trunk/dhcp4)
===================================================================
--- testing-i686/dhcp4	                        (rev 0)
+++ testing-i686/dhcp4	2012-07-28 22:37:00 UTC (rev 164255)
@@ -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
+

Copied: dhcp/repos/testing-i686/dhcp6 (from rev 164254, dhcp/trunk/dhcp6)
===================================================================
--- testing-i686/dhcp6	                        (rev 0)
+++ testing-i686/dhcp6	2012-07-28 22:37:00 UTC (rev 164255)
@@ -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
+

Copied: dhcp/repos/testing-i686/dhcpd (from rev 164254, dhcp/trunk/dhcpd)
===================================================================
--- testing-i686/dhcpd	                        (rev 0)
+++ testing-i686/dhcpd	2012-07-28 22:37:00 UTC (rev 164255)
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/dhcp
+
+PIDFILE="/var/run/dhcpd.pid"
+PID=`cat $PIDFILE 2>/dev/null`
+case "$1" in
+  start)
+    stat_busy "Starting DHCP Server"
+    if [ "$PID" = "" ]; then 
+       /usr/sbin/dhcpd $DHCP_ARGS 
+    fi
+    if [ "$PID" != "" -o $? -gt 0 ]; then
+      stat_fail
+    else
+      add_daemon dhcpd
+      stat_done
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping DHCP Server"
+    [ ! -z "$PID" ]  && kill $PID &> /dev/null
+    rm -f $PIDFILE
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      rm_daemon dhcpd
+      stat_done
+    fi
+    ;;
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  *)
+    echo "usage: $0 {start|stop|restart}"  
+esac

Copied: dhcp/repos/testing-x86_64/PKGBUILD (from rev 164254, dhcp/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD	                        (rev 0)
+++ testing-x86_64/PKGBUILD	2012-07-28 22:37:00 UTC (rev 164255)
@@ -0,0 +1,86 @@
+# $Id$
+# Maintainer: Daniel Isenmann <daniel @archlinux.org>
+
+pkgbase=dhcp
+pkgname=('dhcp' 'dhclient')
+
+# separate patch levels with a period to maintain proper versioning.
+pkgver=4.2.4.1
+_pkgver=4.2.4-P1
+
+pkgrel=1
+arch=('i686' 'x86_64')
+license=('custom:isc-dhcp')
+url="https://www.isc.org/software/dhcp"
+makedepends=('bash' 'iproute2' 'net-tools')
+source=(ftp://ftp.isc.org/isc/${pkgbase}/${_pkgver}/${pkgbase}-${_pkgver}.tar.gz{,.asc}
+        dhcp4 dhcp6 dhcp
+        dhcp-4.1.1-missing-ipv6-not-fatal.patch
+        dhclient-script-pathFixes.patch)
+md5sums=('0ca7181024651f6323951d5498c8020b'
+         '0dfe000dd88555ea06b282ae5e574d5f'
+         'c49b1497837ba56c54e401a66e1bab9b'
+         '12c2f3ae47ed23eb698eb7f1bfd80f20'
+         '8f357e46e1efcbb746f38737a3f977a2'
+         'fd64aeb4f399dcc41ea43089a3811094'
+         '541b415a25a169eaf64b681405f79a80')
+
+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
+}
+
+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}"
+  install -d "${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="A standalone DHCP client from the dhcp package"
+  depends=('bash' 'iproute2' 'net-tools')
+
+  cd "${srcdir}/${pkgbase}-${_pkgver}"
+  make -C client DESTDIR="${pkgdir}" install
+
+  # move dhclient.conf to dhclient.conf.example
+  mv "${pkgdir}"/etc/dhclient.conf{,.example}
+  
+  install -d "${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"
+}

Copied: dhcp/repos/testing-x86_64/dhclient-script-pathFixes.patch (from rev 164254, dhcp/trunk/dhclient-script-pathFixes.patch)
===================================================================
--- testing-x86_64/dhclient-script-pathFixes.patch	                        (rev 0)
+++ testing-x86_64/dhclient-script-pathFixes.patch	2012-07-28 22:37:00 UTC (rev 164255)
@@ -0,0 +1,136 @@
+--- linux	2011-05-18 20:01:54.000000000 +0000
++++ linux_new	2011-12-21 18:45:41.487171012 +0000
+@@ -23,7 +23,7 @@
+ # of the $1 in its args.
+ 
+ # 'ip' just looks too weird.  /sbin/ip looks less weird.
+-ip=/sbin/ip
++ip=/usr/sbin/ip
+ 
+ make_resolv_conf() {
+   if [ x"$new_domain_name_servers" != x ]; then
+@@ -122,9 +122,9 @@
+ if [ x$reason = xPREINIT ]; then
+   if [ x$alias_ip_address != x ]; then
+     # Bring down alias interface. Its routes will disappear too.
+-    ifconfig $interface:0- inet 0
++    /sbin/ifconfig $interface:0- inet 0
+   fi
+-  ifconfig $interface 0 up
++  /sbin/ifconfig $interface 0 up
+ 
+   # We need to give the kernel some time to get the interface up.
+   sleep 1
+@@ -151,25 +151,25 @@
+   if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
+ 		[ x$alias_ip_address != x$old_ip_address ]; then
+     # Possible new alias. Remove old alias.
+-    ifconfig $interface:0- inet 0
++    /sbin/ifconfig $interface:0- inet 0
+   fi
+   if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
+     # IP address changed. Bringing down the interface will delete all routes,
+     # and clear the ARP cache.
+-    ifconfig $interface inet 0 down
++    /sbin/ifconfig $interface inet 0 down
+ 
+   fi
+   if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
+      [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
+ 
+-    ifconfig $interface inet $new_ip_address $new_subnet_arg \
++    /sbin/ifconfig $interface inet $new_ip_address $new_subnet_arg \
+ 					$new_broadcast_arg $mtu_arg
+     # Add a network route to the computed network address.
+     for router in $new_routers; do
+       if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+-	route add -host $router dev $interface
++	/sbin/route add -host $router dev $interface
+       fi
+-      route add default gw $router $metric_arg dev $interface
++      /sbin/route add default gw $router $metric_arg dev $interface
+     done
+   else
+     # we haven't changed the address, have we changed other options           
+@@ -177,21 +177,21 @@
+     if [ x$new_routers != x ] && [ x$new_routers != x$old_routers ] ; then
+       # if we've changed routers delete the old and add the new.
+       for router in $old_routers; do
+-        route del default gw $router
++        /sbin/route del default gw $router
+       done
+       for router in $new_routers; do
+         if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+-	  route add -host $router dev $interface
++	  /sbin/route add -host $router dev $interface
+ 	fi
+-	route add default gw $router $metric_arg dev $interface
++	/sbin/route add default gw $router $metric_arg dev $interface
+       done
+     fi
+   fi
+   if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
+    then
+-    ifconfig $interface:0- inet 0
+-    ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+-    route add -host $alias_ip_address $interface:0
++    /sbin/ifconfig $interface:0- inet 0
++    /sbin/ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
++    /sbin/route add -host $alias_ip_address $interface:0
+   fi
+   make_resolv_conf
+   exit_with_hooks 0
+@@ -201,42 +201,42 @@
+    || [ x$reason = xSTOP ]; then
+   if [ x$alias_ip_address != x ]; then
+     # Turn off alias interface.
+-    ifconfig $interface:0- inet 0
++    /sbin/ifconfig $interface:0- inet 0
+   fi
+   if [ x$old_ip_address != x ]; then
+     # Shut down interface, which will delete routes and clear arp cache.
+-    ifconfig $interface inet 0 down
++    /sbin/ifconfig $interface inet 0 down
+   fi
+   if [ x$alias_ip_address != x ]; then
+-    ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+-    route add -host $alias_ip_address $interface:0
++    /sbin/ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
++    /sbin/route add -host $alias_ip_address $interface:0
+   fi
+   exit_with_hooks 0
+ fi
+ 
+ if [ x$reason = xTIMEOUT ]; then
+   if [ x$alias_ip_address != x ]; then
+-    ifconfig $interface:0- inet 0
++    /sbin/ifconfig $interface:0- inet 0
+   fi
+-  ifconfig $interface inet $new_ip_address $new_subnet_arg \
++  /sbin/ifconfig $interface inet $new_ip_address $new_subnet_arg \
+ 					$new_broadcast_arg $mtu_arg
+   set $new_routers
+   if ping -q -c 1 $1; then
+     if [ x$new_ip_address != x$alias_ip_address ] && \
+ 			[ x$alias_ip_address != x ]; then
+-      ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+-      route add -host $alias_ip_address dev $interface:0
++      /sbin/ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
++      /sbin/route add -host $alias_ip_address dev $interface:0
+     fi
+     for router in $new_routers; do
+       if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+-	route add -host $router dev $interface
++	/sbin/route add -host $router dev $interface
+       fi
+-      route add default gw $router $metric_arg dev $interface
++      /sbin/route add default gw $router $metric_arg dev $interface
+     done
+     make_resolv_conf
+     exit_with_hooks 0
+   fi
+-  ifconfig $interface inet 0 down
++  /sbin/ifconfig $interface inet 0 down
+   exit_with_hooks 1
+ fi
+ 

Copied: dhcp/repos/testing-x86_64/dhcp (from rev 164254, dhcp/trunk/dhcp)
===================================================================
--- testing-x86_64/dhcp	                        (rev 0)
+++ testing-x86_64/dhcp	2012-07-28 22:37:00 UTC (rev 164255)
@@ -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"
+

Copied: dhcp/repos/testing-x86_64/dhcp-4.1.1-missing-ipv6-not-fatal.patch (from rev 164254, dhcp/trunk/dhcp-4.1.1-missing-ipv6-not-fatal.patch)
===================================================================
--- testing-x86_64/dhcp-4.1.1-missing-ipv6-not-fatal.patch	                        (rev 0)
+++ testing-x86_64/dhcp-4.1.1-missing-ipv6-not-fatal.patch	2012-07-28 22:37:00 UTC (rev 164255)
@@ -0,0 +1,39 @@
+--- common/discover.c	2009-09-29 21:44:49.000000000 +0200
++++ common/discover.c_new	2010-06-30 19:40:02.000000000 +0200
+@@ -443,7 +443,7 @@
+ 	}
+ 
+ #ifdef DHCPv6
+-	if (local_family == AF_INET6) {
++	if ((local_family == AF_INET6) && !access("/proc/net/if_inet6", R_OK)) {
+ 		ifaces->fp6 = fopen("/proc/net/if_inet6", "r");
+ 		if (ifaces->fp6 == NULL) {
+ 			log_error("Error opening '/proc/net/if_inet6' to "
+@@ -454,6 +454,8 @@
+ 			ifaces->fp = NULL;
+ 			return 0;
+ 		}
++	} else {
++		ifaces->fp6 = NULL;
+ 	}
+ #endif
+ 
+@@ -721,7 +723,7 @@
+ 		return 1;
+ 	}
+ #ifdef DHCPv6
+-	if (!(*err)) {
++	if (!(*err) && ifaces->fp6) {
+ 		if (local_family == AF_INET6)
+ 			return next_iface6(info, err, ifaces);
+ 	}
+@@ -740,7 +742,8 @@
+ 	ifaces->sock = -1;
+ #ifdef DHCPv6
+ 	if (local_family == AF_INET6) {
+-		fclose(ifaces->fp6);
++		if(ifaces->fp6)
++			fclose(ifaces->fp6);
+ 		ifaces->fp6 = NULL;
+ 	}
+ #endif

Copied: dhcp/repos/testing-x86_64/dhcp.conf.d (from rev 164254, dhcp/trunk/dhcp.conf.d)
===================================================================
--- testing-x86_64/dhcp.conf.d	                        (rev 0)
+++ testing-x86_64/dhcp.conf.d	2012-07-28 22:37:00 UTC (rev 164255)
@@ -0,0 +1,6 @@
+#
+# Arguments to be passed to the DHCP server daemon
+#
+
+DHCP_ARGS="-q"
+

Copied: dhcp/repos/testing-x86_64/dhcp.install (from rev 164254, dhcp/trunk/dhcp.install)
===================================================================
--- testing-x86_64/dhcp.install	                        (rev 0)
+++ testing-x86_64/dhcp.install	2012-07-28 22:37:00 UTC (rev 164255)
@@ -0,0 +1,18 @@
+# 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
+# arg 2:  the old package version
+post_upgrade() {
+  post_install $1
+}

Copied: dhcp/repos/testing-x86_64/dhcp4 (from rev 164254, dhcp/trunk/dhcp4)
===================================================================
--- testing-x86_64/dhcp4	                        (rev 0)
+++ testing-x86_64/dhcp4	2012-07-28 22:37:00 UTC (rev 164255)
@@ -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
+

Copied: dhcp/repos/testing-x86_64/dhcp6 (from rev 164254, dhcp/trunk/dhcp6)
===================================================================
--- testing-x86_64/dhcp6	                        (rev 0)
+++ testing-x86_64/dhcp6	2012-07-28 22:37:00 UTC (rev 164255)
@@ -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
+

Copied: dhcp/repos/testing-x86_64/dhcpd (from rev 164254, dhcp/trunk/dhcpd)
===================================================================
--- testing-x86_64/dhcpd	                        (rev 0)
+++ testing-x86_64/dhcpd	2012-07-28 22:37:00 UTC (rev 164255)
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/dhcp
+
+PIDFILE="/var/run/dhcpd.pid"
+PID=`cat $PIDFILE 2>/dev/null`
+case "$1" in
+  start)
+    stat_busy "Starting DHCP Server"
+    if [ "$PID" = "" ]; then 
+       /usr/sbin/dhcpd $DHCP_ARGS 
+    fi
+    if [ "$PID" != "" -o $? -gt 0 ]; then
+      stat_fail
+    else
+      add_daemon dhcpd
+      stat_done
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping DHCP Server"
+    [ ! -z "$PID" ]  && kill $PID &> /dev/null
+    rm -f $PIDFILE
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      rm_daemon dhcpd
+      stat_done
+    fi
+    ;;
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  *)
+    echo "usage: $0 {start|stop|restart}"  
+esac




More information about the arch-commits mailing list