New alpha version. Has FQDN support, wooooo.
authorRoy Marples <uberlord@gentoo.org>
Thu, 7 Sep 2006 19:53:36 +0000 (19:53 +0000)
committerRoy Marples <uberlord@gentoo.org>
Thu, 7 Sep 2006 19:53:36 +0000 (19:53 +0000)
Package-Manager: portage-2.1.1_rc1-r6

net-misc/dhcp/ChangeLog
net-misc/dhcp/Manifest
net-misc/dhcp/dhcp-3.1.0_alpha1.ebuild [new file with mode: 0644]
net-misc/dhcp/files/dhcp-3.1.0a1-dhclient-resolvconf.patch [new file with mode: 0644]
net-misc/dhcp/files/dhcp-3.1.0a1-x-option.patch [new file with mode: 0644]
net-misc/dhcp/files/digest-dhcp-3.1.0_alpha1 [new file with mode: 0644]

index 9871de5a786ba464989fe6b2a3cb65a02f610200..18b522ff8b09ec95fa38aa681c38ca2e06010407 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for net-misc/dhcp
 # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.115 2006/09/06 07:35:03 uberlord Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.116 2006/09/07 19:53:36 uberlord Exp $
+
+*dhcp-3.1.0_alpha1 (07 Sep 2006)
+
+  07 Sep 2006; Roy Marples <uberlord@gentoo.org>
+  +files/dhcp-3.1.0a1-dhclient-resolvconf.patch,
+  +files/dhcp-3.1.0a1-x-option.patch, +dhcp-3.1.0_alpha1.ebuild:
+  New alpha version. Has FQDN support, wooooo.
 
   06 Sep 2006; Roy Marples <uberlord@gentoo.org> dhcp-3.0.5_rc2.ebuild:
   Just warn about Packet Socket instead of requiring linux sources
index 570411a22a193dc3ae5856a3e029b6c6b3cd5378..233309d4e7c09b658447cf50925a892d43a48241 100644 (file)
@@ -66,6 +66,14 @@ AUX dhcp-3.0.4-dhclient-stdin-conf.patch 2176 RMD160 fae08899f6b57da3ec7ab0068e2
 MD5 f47ef574359340021a78f5c2f67e4954 files/dhcp-3.0.4-dhclient-stdin-conf.patch 2176
 RMD160 fae08899f6b57da3ec7ab0068e288bbdf2fbf2ae files/dhcp-3.0.4-dhclient-stdin-conf.patch 2176
 SHA256 80141fe71e52774f1c7b1a02f2cbd49bc646f19753ceefc1c3605104df0cae5f files/dhcp-3.0.4-dhclient-stdin-conf.patch 2176
+AUX dhcp-3.1.0a1-dhclient-resolvconf.patch 10328 RMD160 672eb37b32486655a027b37b4c37d103c6e87c15 SHA1 a882cdc741637f921d15238d6761ff8e45ddb8f4 SHA256 f662f98eefe57a5c21cbbcefc6d092c7b60a239b59f10942fe13560ed684889c
+MD5 207562d42d2fc7ec3cb5e5b86f5ca41d files/dhcp-3.1.0a1-dhclient-resolvconf.patch 10328
+RMD160 672eb37b32486655a027b37b4c37d103c6e87c15 files/dhcp-3.1.0a1-dhclient-resolvconf.patch 10328
+SHA256 f662f98eefe57a5c21cbbcefc6d092c7b60a239b59f10942fe13560ed684889c files/dhcp-3.1.0a1-dhclient-resolvconf.patch 10328
+AUX dhcp-3.1.0a1-x-option.patch 6674 RMD160 47a57c8a6992347ed50a9ee1507491a1c8aed5bf SHA1 760804be8ee5966f7f428ee16a7a50226a01fa37 SHA256 bf3183ac79da9fcb5bc71b0c5ab5a9aba96a42e9eea45dc9f5f354d429418d30
+MD5 6dc9b849e108cca18ae978e719f3d6a3 files/dhcp-3.1.0a1-x-option.patch 6674
+RMD160 47a57c8a6992347ed50a9ee1507491a1c8aed5bf files/dhcp-3.1.0a1-x-option.patch 6674
+SHA256 bf3183ac79da9fcb5bc71b0c5ab5a9aba96a42e9eea45dc9f5f354d429418d30 files/dhcp-3.1.0a1-x-option.patch 6674
 AUX dhcpd.conf 1092 RMD160 936bb112c7cdf8e669b695599252d1f6626be2f3 SHA1 cbabbcea73a0cbc9692462683b983c96d6f18b0c SHA256 b86d27e0560689057b01a352474582fceb3a398eaf3b17f901378ec56284c4d5
 MD5 3f165a207e98ea92deb7ebfbbf4c2cf7 files/dhcpd.conf 1092
 RMD160 936bb112c7cdf8e669b695599252d1f6626be2f3 files/dhcpd.conf 1092
@@ -85,6 +93,7 @@ SHA256 0d16910b1197946165da7812acffecef8ee3b31cdf8f9a596ca6ecb19756fcee files/dh
 DIST dhcp-3.0.3.tar.gz 870240 RMD160 bcbd1f8b49f17809a3473103a7b5e096c45855d7 SHA1 1e2e6c3ecdb8046a39aaabe1a36171e1d45d21e4 SHA256 c96bcd884dde06c22a709cfb9e84f7e32f6577dcd52aa7f12186aa22b5e63afe
 DIST dhcp-3.0.4.tar.gz 883245 RMD160 f5636d87e1e2138bd239157f54d8f73c73af73ac SHA1 2efe316d69563bf2440cbb4efc2bc06ef9445db3 SHA256 89171155b7a9225f5eb81c83ff63f071168b87eacab05fb859b8397d36809bf7
 DIST dhcp-3.0.5rc2.tar.gz 876507 RMD160 6f0f776c550d00528ab77f8585a3bc93408a2372 SHA1 c0b014c0458dc60c11fc073de054cf36030ef780 SHA256 01f66158315489084e349d92fbb390e0754eb9a094926d4a500b2d5804b1fad4
+DIST dhcp-3.1.0a1.tar.gz 773828 RMD160 4ededc197e668219d404a054816cd48e71ac8a39 SHA1 d9f0e71d049f79fbfd99ca4de6e6d12e9ff86548 SHA256 80f610a6bdfe2ac2d2dd50886d903217141c2983c1a22af23fb223998769651b
 EBUILD dhcp-3.0.3-r9.ebuild 7090 RMD160 39faccca29004357a6982530b476a58ef0724eac SHA1 627289ef0d63eb7acaf5c7855b39c2ecac5286ff SHA256 a98505b8c62a03cb7e712b2f5fc1b7190f64314eb4a9bacdf5b45f373dc53aca
 MD5 91749ab205c46ac726bcc8b75279e6de dhcp-3.0.3-r9.ebuild 7090
 RMD160 39faccca29004357a6982530b476a58ef0724eac dhcp-3.0.3-r9.ebuild 7090
@@ -97,10 +106,14 @@ EBUILD dhcp-3.0.5_rc2.ebuild 7154 RMD160 3fee62fe1154fbd7148446c53d9d3e83961b514
 MD5 8900b639a5cf8f4b85b545e22fe7efd1 dhcp-3.0.5_rc2.ebuild 7154
 RMD160 3fee62fe1154fbd7148446c53d9d3e83961b5140 dhcp-3.0.5_rc2.ebuild 7154
 SHA256 d462bcdfbcb273775cc58ef62bea4095caa38e018ea8ccc550842369f0a6ac99 dhcp-3.0.5_rc2.ebuild 7154
-MISC ChangeLog 19757 RMD160 97fb6920c06e1e6e9f5915349ee56699b754d38b SHA1 2fca2b40a23979d6a3edd833f65e823f1177d902 SHA256 ecca518a8422abbf22e1c1b720244d4c59fd32324ab65d06b1cb905d21cc32c4
-MD5 d18b4a755bc2b7e985e25a06d371b404 ChangeLog 19757
-RMD160 97fb6920c06e1e6e9f5915349ee56699b754d38b ChangeLog 19757
-SHA256 ecca518a8422abbf22e1c1b720244d4c59fd32324ab65d06b1cb905d21cc32c4 ChangeLog 19757
+EBUILD dhcp-3.1.0_alpha1.ebuild 7188 RMD160 e6d1bb2a1bc159bcab20180161a40bf65f2ee6d3 SHA1 85e11153022a689f60439ea3426ee8e117868dcf SHA256 bd0345390ac5d36760f4b739172da11e868f2bcf21fb9d85f6fff1958bb6472d
+MD5 49dc0d26e22c10fe43112bef491991bf dhcp-3.1.0_alpha1.ebuild 7188
+RMD160 e6d1bb2a1bc159bcab20180161a40bf65f2ee6d3 dhcp-3.1.0_alpha1.ebuild 7188
+SHA256 bd0345390ac5d36760f4b739172da11e868f2bcf21fb9d85f6fff1958bb6472d dhcp-3.1.0_alpha1.ebuild 7188
+MISC ChangeLog 20002 RMD160 199c89f1510d2f7ee38918d48c375171be91e791 SHA1 a9d889004f03a4cc394154b463301d842a5979bc SHA256 0dd0e4393d9cb5c57423e314facacc44ef1c9459a2546934943cd34f75fbc7f4
+MD5 0886949f69ee1eb0747ca0e2c7b94d2c ChangeLog 20002
+RMD160 199c89f1510d2f7ee38918d48c375171be91e791 ChangeLog 20002
+SHA256 0dd0e4393d9cb5c57423e314facacc44ef1c9459a2546934943cd34f75fbc7f4 ChangeLog 20002
 MISC metadata.xml 441 RMD160 489c700355a49fda7d249a7b3f72066add57e779 SHA1 f2013226d45685a4bd06c3f7723df78e134486d4 SHA256 16dccfd59e8db49b0c9b9bb34f99188f9773a2ef00757d4fb429fea4293ac44e
 MD5 3ccab43e194be4b8df2632546cbd028e metadata.xml 441
 RMD160 489c700355a49fda7d249a7b3f72066add57e779 metadata.xml 441
@@ -114,3 +127,6 @@ SHA256 fbea6a9170dda5da61af6c7c6f629d33b642ca3fbfa7f64537bd783e283be420 files/di
 MD5 9bcfd0200ea79ae1610d34029cf2e864 files/digest-dhcp-3.0.5_rc2 241
 RMD160 921c145bf03455eb145900a3e8177fcaaadf43d8 files/digest-dhcp-3.0.5_rc2 241
 SHA256 9394bc332009daadfd256fe921d30a1d4021d421d3840a02fb93f46e8c0b2cae files/digest-dhcp-3.0.5_rc2 241
+MD5 9eadfd8d6702b780408ee4e8013097d4 files/digest-dhcp-3.1.0_alpha1 238
+RMD160 872cf1cb4babcb908f4753d69dd7705ffd488c5c files/digest-dhcp-3.1.0_alpha1 238
+SHA256 69241c8b8610ce8aa684cc62eb072b3db23c43fc5bca173c77e57cfa64d25005 files/digest-dhcp-3.1.0_alpha1 238
diff --git a/net-misc/dhcp/dhcp-3.1.0_alpha1.ebuild b/net-misc/dhcp/dhcp-3.1.0_alpha1.ebuild
new file mode 100644 (file)
index 0000000..c41b82a
--- /dev/null
@@ -0,0 +1,235 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-3.1.0_alpha1.ebuild,v 1.1 2006/09/07 19:53:36 uberlord Exp $
+
+inherit eutils flag-o-matic multilib toolchain-funcs
+
+MY_PV="${PV//_alpha/a}"
+MY_PV="${MY_PV//_beta/b}"
+MY_PV="${MY_PV//_rc/rc}"
+MY_P="${PN}-${MY_PV}"
+DESCRIPTION="ISC Dynamic Host Configuration Protocol"
+HOMEPAGE="http://www.isc.org/products/DHCP"
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz"
+
+LICENSE="isc-dhcp"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="doc minimal static selinux"
+
+DEPEND="selinux? ( sec-policy/selinux-dhcp )
+       kernel_linux? ( sys-apps/net-tools )"
+
+PROVIDE="virtual/dhcpc"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+
+       # Gentoo patches - these will probably never be accepted upstream
+       # Enable chroot support
+       epatch "${FILESDIR}/${PN}"-3.0-paranoia.patch
+       # Fix some permission issues
+       epatch "${FILESDIR}/${PN}"-3.0-fix-perms.patch
+       # Enable dhclient to equery NTP servers
+       epatch "${FILESDIR}/${PN}"-3.0.3-dhclient-ntp.patch
+       # resolvconf support in dhclient-script
+       epatch "${FILESDIR}/${PN}"-3.1.0a1-dhclient-resolvconf.patch
+       # Fix setting hostnames on Linux
+       epatch "${FILESDIR}/${PN}"-3.0.3-dhclient-hostname.patch
+       # Allow mtu settings
+       epatch "${FILESDIR}/${PN}"-3.0.3-dhclient-mtu.patch
+       # Allow dhclient to use IF_METRIC to set route metrics
+       epatch "${FILESDIR}/${PN}"-3.0.3-dhclient-metric.patch
+       # Stop downing the interface on Linux as that breaks link dameons
+       # such as wpa_supplicant and netplug
+       epatch "${FILESDIR}/${PN}"-3.0.3-dhclient-no-down.patch
+       # Quiet the isc blurb
+       epatch "${FILESDIR}/${PN}"-3.0.3-no_isc_blurb.patch
+       # Enable dhclient to get extra configuration from stdin
+       epatch "${FILESDIR}/${PN}"-3.0.4-dhclient-stdin-conf.patch
+
+       # General fixes which will probably be accepted upstream eventually
+       # Install libdst, #75544
+       epatch "${FILESDIR}/${PN}"-3.0.3-libdst.patch
+       # Fix building on Gentoo/FreeBSD
+       epatch "${FILESDIR}/${PN}"-3.0.2-gmake.patch
+
+       # NetworkManager support patches
+       # If they fail to apply to future versions they will be dropped
+       # Enable eXtended options
+       epatch "${FILESDIR}/${PN}"-3.1.0a1-x-option.patch
+       # Add dbus support to dhclient
+       epatch "${FILESDIR}/${PN}"-3.0.3-dhclient-dbus.patch
+
+       # Brand the version with Gentoo
+       # include revision if >0
+       local newver="${MY_PV}-Gentoo"
+       [[ ${PR} != "r0" ]] && newver="${newver}-${PR}"
+       sed -i '/^#define DHCP_VERSION[ \t]\+/ s/'"${MY_PV}/${newver}/g" \
+               includes/version.h || die
+
+       # Change the hook script locations of the scripts
+       sed -i -e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
+               -e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
+               client/scripts/* || die
+
+       # Remove these options from the sample config
+       sed -i -e "/\(script\|host-name\|domain-name\) / d" \
+               client/dhclient.conf || die
+
+       # Build sed man pages as we don't ever support BSD 4.4 and older, #130251.
+       local x=
+       for x in Makefile.dist $(ls */Makefile.dist) ; do
+               sed -i -e 's/$(CATMANPAGES)/$(SEDMANPAGES)/g' "${x}" || die
+       done
+
+       # Only install different man pages if we don't have en
+       if [[ " ${LINGUAS} " != *" en "* ]]; then
+               # Install Japanese man pages
+               if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
+                       einfo "Installing Japanese documention"
+                       cp doc/ja_JP.eucJP/dhclient* client
+                       cp doc/ja_JP.eucJP/dhcp* common
+               fi
+       fi
+
+       # Now remove the non-english docs so there are no errors later
+       [[ -d doc/ja_JP.eucJP ]] && rm -rf doc/ja_JP.eucJP
+}
+
+src_compile() {
+       use static && append-ldflags -static
+
+       cat <<-END >> includes/site.h
+       #define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf"
+       #define _PATH_DHCPD_PID "/var/run/dhcp/dhcpd.pid"
+       #define _PATH_DHCPD_DB "/var/lib/dhcp/dhcpd.leases"
+       #define _PATH_DHCLIENT_CONF "/etc/dhcp/dhclient.conf"
+       #define _PATH_DHCLIENT_DB "/var/lib/dhcp/dhclient.leases"
+       #define _PATH_DHCLIENT_PID "/var/run/dhcp/dhclient.pid"
+       #define DHCPD_LOG_FACILITY LOG_LOCAL1
+       END
+
+       cat <<-END > site.conf
+       CC = $(tc-getCC)
+       LFLAGS = ${LDFLAGS}
+       LIBDIR = /usr/$(get_libdir)
+       INCDIR = /usr/include
+       ETC = /etc/dhcp
+       VARDB = /var/lib/dhcp
+       VARRUN = /var/run/dhcp
+       ADMMANDIR = /usr/share/man/man8
+       ADMMANEXT = .8
+       FFMANDIR = /usr/share/man/man5
+       FFMANEXT = .5
+       LIBMANDIR = /usr/share/man/man3
+       LIBMANEXT = .3
+       USRMANDIR = /usr/share/man/man1
+       USRMANEXT = .1
+       MANCAT = man
+       END
+
+       ./configure --copts "-DPARANOIA -DEARLY_CHROOT -DEXTENDED_NEW_OPTION_INFO \
+               ${CFLAGS}" || die "configure failed"
+
+       # Remove server support from the Makefile
+       # We still install some extra crud though
+       if use minimal ; then
+               sed -i -e 's/\(server\|relay\|dhcpctl\)/ /g' work.*/Makefile || die
+       fi
+       emake || die "compile problem"
+}
+
+src_install() {
+       make install DESTDIR="${D}" || die
+       use doc && dodoc README RELNOTES doc/*
+
+       insinto /etc/dhcp
+       newins client/dhclient.conf dhclient.conf.sample
+       keepdir /var/{lib,run}/dhcp
+
+       # Install our server files
+       if ! use minimal ; then
+               insinto /etc/dhcp
+               newins server/dhcpd.conf dhcpd.conf.sample
+               newinitd "${FILESDIR}"/dhcpd.init dhcpd
+               newinitd "${FILESDIR}"/dhcrelay.init dhcrelay
+               insinto /etc/conf.d
+               newins "${FILESDIR}"/dhcpd.conf dhcpd
+               newins "${FILESDIR}"/dhcrelay.conf dhcrelay
+       fi
+}
+
+pkg_preinst() {
+       if ! use minimal ; then
+               enewgroup dhcp
+               enewuser dhcp -1 -1 /var/lib/dhcp dhcp
+       fi
+}
+
+pkg_postinst() {
+       if use kernel_linux ; then
+               ewarn
+               ewarn "${PN} requires kernel support for Packet Socket (CONFIG_PACKET)."
+               ewarn
+       fi
+
+       use minimal && return
+
+       chown dhcp:dhcp "${ROOT}"/var/{lib,run}/dhcp
+
+       if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then
+               ewarn
+               ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
+               ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
+               ewarn "and dhcp should be removed from the default runlevel"
+               ewarn
+       fi
+
+       einfo "You can edit /etc/conf.d/dhcpd to customize dhcp settings."
+       einfo
+       einfo "If you would like to run dhcpd in a chroot, simply configure the"
+       einfo "DHCPD_CHROOT directory in /etc/conf.d/dhcpd and then run:"
+       einfo "  emerge --config =${PF}"
+}
+
+pkg_config() {
+       if use minimal ; then
+               eerror "${PN} has not been compiled for server support"
+               eerror "emerge ${PN} without the minimal USE flag to use dhcp sever"
+               return 1
+       fi
+
+       local CHROOT="$(
+               sed -n -e 's/^[[:blank:]]\?DHCPD_CHROOT="*\([^#"]\+\)"*/\1/p' \
+               "${ROOT}"/etc/conf.d/dhcpd
+       )"
+
+       if [[ -z ${CHROOT} ]]; then
+               eerror "CHROOT not defined in /etc/conf.d/dhcpd"
+               return 1
+       fi
+
+       CHROOT="${ROOT}/${CHROOT}"
+
+       if [[ -d ${CHROOT} ]] ; then
+               ewarn "${CHROOT} already exists - aborting"
+               return 0
+       fi
+
+       ebegin "Setting up the chroot directory"
+       mkdir -m 0755 -p "${CHROOT}/"{dev,etc,var/lib,var/run/dhcp}
+       cp /etc/{localtime,resolv.conf} "${CHROOT}"/etc
+       cp -R /etc/dhcp "${CHROOT}"/etc
+       cp -R /var/lib/dhcp "${CHROOT}"/var/lib
+       ln -s ../../var/lib/dhcp "${CHROOT}"/etc/dhcp/lib
+       chown -R dhcp:dhcp "${CHROOT}"/var/{lib,run}/dhcp
+       eend 0
+
+       local logger="$(best_version virtual/logger)"
+       einfo "To enable logging from the dhcpd server, configure your"
+       einfo "logger (${logger}) to listen on ${CHROOT}/dev/log"
+}
diff --git a/net-misc/dhcp/files/dhcp-3.1.0a1-dhclient-resolvconf.patch b/net-misc/dhcp/files/dhcp-3.1.0a1-dhclient-resolvconf.patch
new file mode 100644 (file)
index 0000000..2baaa78
--- /dev/null
@@ -0,0 +1,254 @@
+diff -ur client.orig/scripts/bsdos client/scripts/bsdos
+--- client.orig/scripts/bsdos  2006-09-07 18:53:10.476329752 +0100
++++ client/scripts/bsdos       2006-09-07 19:19:53.000000000 +0100
+@@ -1,21 +1,22 @@
+ #!/bin/sh
+ make_resolv_conf() {
+-  if [ x"$new_domain_name_servers" != x ]; then
+-    cat /dev/null > /etc/resolv.conf.dhclient
+-    if [ "x$new_domain_search" != x ]; then
+-      echo search $new_domain_search >> /etc/resolv.conf.dhclient
+-    elif [ "x$new_domain_name" != x ]; then
+-      # Note that the DHCP 'Domain Name Option' is really just a domain
+-      # name, and that this practice of using the domain name option as
+-      # a search path is both nonstandard and deprecated.
+-      echo search $new_domain_name >> /etc/resolv.conf.dhclient
++  if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then
++    if [ "x$new_domain_name" != x ] || [ "x$new_domain_name_servers" != x ]; then
++      conf="# Generated by dhclient for interface $interface\n"
++      if [ "x$new_domain_name" != x ]; then
++        conf="${conf}search $new_domain_name\n"
++      fi
++      for nameserver in $new_domain_name_servers; do
++        conf="${conf}nameserver $nameserver\n"
++      done
++      if [ -x /sbin/resolvconf ]; then
++        echo -e "$conf" | resolvconf -a "$interface"
++      else
++        echo -e "$conf" > /etc/resolv.conf
++        chmod 644 /etc/resolv.conf
++      fi
+     fi
+-    for nameserver in $new_domain_name_servers; do
+-      echo nameserver $nameserver >> /etc/resolv.conf.dhclient
+-    done
+-
+-    mv /etc/resolv.conf.dhclient /etc/resolv.conf
+   fi
+   # If we're making confs, may as well make an ntp.conf too
+   make_ntp_conf
+diff -ur client.orig/scripts/freebsd client/scripts/freebsd
+--- client.orig/scripts/freebsd        2006-09-07 18:53:10.476329752 +0100
++++ client/scripts/freebsd     2006-09-07 19:19:32.000000000 +0100
+@@ -11,38 +11,20 @@
+ fi
+ make_resolv_conf() {
+-  if [ x"$new_domain_name_servers" != x ]; then
+-    ( cat /dev/null > /etc/resolv.conf.dhclient )
+-    exit_status=$?
+-    if [ $exit_status -ne 0 ]; then
+-      $LOGGER "Unable to create /etc/resolv.conf.dhclient: Error $exit_status"
+-    else
+-      if [ "x$new_domain_search" != x ]; then
+-      ( echo search $new_domain_search >> /etc/resolv.conf.dhclient )
+-      exit_status=$?
+-      elif [ "x$new_domain_name" != x ]; then
+-      # Note that the DHCP 'Domain Name Option' is really just a domain
+-      # name, and that this practice of using the domain name option as
+-      # a search path is both nonstandard and deprecated.
+-      ( echo search $new_domain_name >> /etc/resolv.conf.dhclient )
+-      exit_status=$?
++  if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then
++    if [ "x$new_domain_name" != x ] || [ "x$new_domain_name_servers" != x ]; then
++      conf="# Generated by dhclient for interface $interface\n"
++      if [ "x$new_domain_name" != x ]; then
++        conf="${conf}search $new_domain_name\n"
+       fi
+       for nameserver in $new_domain_name_servers; do
+-      if [ $exit_status -ne 0 ]; then
+-        break
+-      fi
+-      ( echo nameserver $nameserver >>/etc/resolv.conf.dhclient )
+-      exit_status=$?
++        conf="${conf}nameserver $nameserver\n"
+       done
+-
+-      # If there were no errors, attempt to mv the new file into place.
+-      if [ $exit_status -eq 0 ]; then
+-      ( mv /etc/resolv.conf.dhclient /etc/resolv.conf )
+-      exit_status = $?
+-      fi
+-
+-      if [ $exit_status -ne 0 ]; then
+-      $LOGGER "Error while writing new /etc/resolv.conf."
++      if [ -x /sbin/resolvconf ]; then
++        echo -e "$conf" | resolvconf -a "$interface"
++      else
++        echo -e "$conf" > /etc/resolv.conf
++        chmod 644 /etc/resolv.conf
+       fi
+     fi
+   fi
+diff -ur client.orig/scripts/linux client/scripts/linux
+--- client.orig/scripts/linux  2006-09-07 18:53:10.476329752 +0100
++++ client/scripts/linux       2006-09-07 19:18:57.000000000 +0100
+@@ -23,22 +23,22 @@
+ # of the $1 in its args.
+ make_resolv_conf() {
+-  if [ x"$new_domain_name_servers" != x ]; then
+-    cat /dev/null > /etc/resolv.conf.dhclient
+-    chmod 644 /etc/resolv.conf.dhclient
+-    if [ x"$new_domain_search" != x ]; then
+-      echo search $new_domain_search >> /etc/resolv.conf.dhclient
+-    elif [ x"$new_domain_name" != x ]; then
+-      # Note that the DHCP 'Domain Name Option' is really just a domain
+-      # name, and that this practice of using the domain name option as
+-      # a search path is both nonstandard and deprecated.
+-      echo search $new_domain_name >> /etc/resolv.conf.dhclient
++  if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then
++    if [ "x$new_domain_name" != x ] || [ "x$new_domain_name_servers" != x ]; then
++      conf="# Generated by dhclient for interface $interface\n"
++      if [ "x$new_domain_name" != x ]; then
++        conf="${conf}search $new_domain_name\n"
++      fi
++      for nameserver in $new_domain_name_servers; do
++        conf="${conf}nameserver $nameserver\n"
++      done
++      if [ -x /sbin/resolvconf ]; then
++        echo -e "$conf" | resolvconf -a "$interface"
++      else
++        echo -e "$conf" > /etc/resolv.conf
++        chmod 644 /etc/resolv.conf
++      fi
+     fi
+-    for nameserver in $new_domain_name_servers; do
+-      echo nameserver $nameserver >>/etc/resolv.conf.dhclient
+-    done
+-
+-    mv /etc/resolv.conf.dhclient /etc/resolv.conf
+   fi
+   # If we're making confs, may as well make an ntp.conf too
+   make_ntp_conf
+diff -ur client.orig/scripts/netbsd client/scripts/netbsd
+--- client.orig/scripts/netbsd 2006-09-07 18:53:10.476329752 +0100
++++ client/scripts/netbsd      2006-09-07 19:20:10.000000000 +0100
+@@ -1,21 +1,22 @@
+ #!/bin/sh
+ make_resolv_conf() {
+-  if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
+-    cat /dev/null > /etc/resolv.conf.dhclient
+-    if [ "x$new_domain_search != x ]; then
+-      echo search $new_domain_search >> /etc/resolv.conf.dhclient
+-    elif [ "x$new_domain_name != x ]; then
+-      # Note that the DHCP 'Domain Name Option' is really just a domain
+-      # name, and that this practice of using the domain name option as
+-      # a search path is both nonstandard and deprecated.
+-      echo search $new_domain_name >> /etc/resolv.conf.dhclient
++  if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then
++    if [ "x$new_domain_name" != x ] || [ "x$new_domain_name_servers" != x ]; then
++      conf="# Generated by dhclient for interface $interface\n"
++      if [ "x$new_domain_name" != x ]; then
++        conf="${conf}search $new_domain_name\n"
++      fi
++      for nameserver in $new_domain_name_servers; do
++        conf="${conf}nameserver $nameserver\n"
++      done
++      if [ -x /sbin/resolvconf ]; then
++        echo -e "$conf" | resolvconf -a "$interface"
++      else
++        echo -e "$conf" > /etc/resolv.conf
++        chmod 644 /etc/resolv.conf
++      fi
+     fi
+-    for nameserver in $new_domain_name_servers; do
+-      echo nameserver $nameserver >>/etc/resolv.conf.dhclient
+-    done
+-
+-    mv /etc/resolv.conf.dhclient /etc/resolv.conf
+   fi
+   # If we're making confs, may as well make an ntp.conf too
+   make_ntp_conf
+diff -ur client.orig/scripts/openbsd client/scripts/openbsd
+--- client.orig/scripts/openbsd        2006-09-07 18:53:10.476329752 +0100
++++ client/scripts/openbsd     2006-09-07 19:20:38.000000000 +0100
+@@ -1,21 +1,22 @@
+ #!/bin/sh
+ make_resolv_conf() {
+-  if x"$new_domain_name_servers" != x ]; then
+-    cat /dev/null > /etc/resolv.conf.dhclient
+-    if [ x"$new_domain_search" != x ]; then
+-      echo search $new_domain_search >> /etc/resolv.conf.dhclient
+-    elif [ x"$new_domain_name" != x ]; then
+-      # Note that the DHCP 'Domain Name Option' is really just a domain
+-      # name, and that this practice of using the domain name option as
+-      # a search path is both nonstandard and deprecated.
+-      echo search $new_domain_name >> /etc/resolv.conf.dhclient
++  if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then
++    if [ "x$new_domain_name" != x ] || [ "x$new_domain_name_servers" != x ]; then
++      conf="# Generated by dhclient for interface $interface\n"
++      if [ "x$new_domain_name" != x ]; then
++        conf="${conf}search $new_domain_name\n"
++      fi
++      for nameserver in $new_domain_name_servers; do
++        conf="${conf}nameserver $nameserver\n"
++      done
++      if [ -x /sbin/resolvconf ]; then
++        echo -e "$conf" | resolvconf -a "$interface"
++      else
++        echo -e "$conf" > /etc/resolv.conf
++        chmod 644 /etc/resolv.conf
++      fi
+     fi
+-    for nameserver in $new_domain_name_servers; do
+-      echo nameserver $nameserver >>/etc/resolv.conf.dhclient
+-    done
+-
+-    mv /etc/ersolv.conf.dhclient /etc/resolv.conf
+   fi
+   # If we're making confs, may as well make an ntp.conf too
+   make_ntp_conf
+diff -ur client.orig/scripts/solaris client/scripts/solaris
+--- client.orig/scripts/solaris        2006-09-07 18:53:10.476329752 +0100
++++ client/scripts/solaris     2006-09-07 19:21:12.000000000 +0100
+@@ -1,21 +1,22 @@
+ #!/bin/sh  
+ make_resolv_conf() {
+-  if [ x"$new_domain_name_servers" != x ]; then
+-    cat /dev/null > /etc/resolv.conf.dhclient
+-    if [ x"$new_domain_search" != x ]; then
+-      echo search $new_domain_search >> /etc/resolv.conf.dhclient
+-    elif [ x"$new_domain_name" != x ]; then
+-      # Note that the DHCP 'Domain Name Option' is really just a domain
+-      # name, and that this practice of using the domain name option as
+-      # a search path is both nonstandard and deprecated.
+-      echo search $new_domain_name >> /etc/resolv.conf.dhclient
++  if [ x$PEER_DNS = x ] || [ x$PEER_DNS = xyes ]; then
++    if [ "x$new_domain_name" != x ] || [ "x$new_domain_name_servers" != x ]; then
++      conf="# Generated by dhclient for interface $interface\n"
++      if [ "x$new_domain_name" != x ]; then
++        conf="${conf}search $new_domain_name\n"
++      fi
++      for nameserver in $new_domain_name_servers; do
++        conf="${conf}nameserver $nameserver\n"
++      done
++      if [ -x /sbin/resolvconf ]; then
++        echo -e "$conf" | resolvconf -a "$interface"
++      else
++        echo -e "$conf" > /etc/resolv.conf
++        chmod 644 /etc/resolv.conf
++      fi
+     fi
+-    for nameserver in $new_domain_name_servers; do
+-      echo nameserver $nameserver >>/etc/resolv.conf.dhclient
+-    done
+-
+-    mv /etc/resolv.conf.dhclient /etc/resolv.conf
+   fi
+   # If we're making confs, may as well make an ntp.conf too
+   make_ntp_conf
diff --git a/net-misc/dhcp/files/dhcp-3.1.0a1-x-option.patch b/net-misc/dhcp/files/dhcp-3.1.0a1-x-option.patch
new file mode 100644 (file)
index 0000000..8728e0c
--- /dev/null
@@ -0,0 +1,223 @@
+diff -ur client.orig/dhclient.8 client/dhclient.8
+--- client.orig/dhclient.8     2006-09-07 19:24:17.756460024 +0100
++++ client/dhclient.8  2006-09-07 19:24:52.000000000 +0100
+@@ -85,6 +85,9 @@
+ .B -w
+ ]
+ [
++.B -x
++]
++[
+ .I if0
+ [
+ .I ...ifN
+@@ -268,6 +271,10 @@
+ supplying the
+ .B -nw
+ flag.
++.PP
++The -x argument enables eXtended option information to be created in the
++-s dhclient-script environment, which would allow applications running 
++in that environment to handle options they do not know about in advance.
+ .SH CONFIGURATION
+ The syntax of the dhclient.conf(5) file is discussed separately.
+ .SH OMAPI
+diff -ur client.orig/dhclient.c client/dhclient.c
+--- client.orig/dhclient.c     2006-09-07 19:24:17.756460024 +0100
++++ client/dhclient.c  2006-09-07 19:24:52.000000000 +0100
+@@ -74,7 +74,9 @@
+ int onetry=0;
+ int quiet=0;
+ int nowait=0;
+-
++#ifdef EXTENDED_NEW_OPTION_INFO
++int extended_option_environment = 0;
++#endif
+ static void usage PROTO ((void));
+ void do_release(struct client_state *);
+@@ -211,6 +213,11 @@
+               } else if (!strcmp (argv [i], "--version")) {
+                       log_info ("isc-dhclient-%s", DHCP_VERSION);
+                       exit (0);
++#ifdef EXTENDED_NEW_OPTION_INFO
++              } else if (!strcmp (argv [i], "-x")) {
++                  extended_option_environment = 1;
++                  new_option_info_tree = GENERATE_NEW_OPTION_INFO;
++#endif
+               } else if (argv [i][0] == '-') {
+                   usage ();
+               } else {
+@@ -483,7 +490,11 @@
+       log_info (arr);
+       log_info (url);
++#ifdef EXTENDED_NEW_OPTION_INFO
++      log_error ("Usage: dhclient [-1dqr] [-nwx] [-p <port>] %s",
++#else
+       log_error ("Usage: dhclient [-1dqr] [-nw] [-p <port>] %s",
++#endif
+                  "[-s server]");
+       log_error ("                [-cf config-file] [-lf lease-file]%s",
+                  "[-pf pid-file] [-e VAR=val]");
+@@ -2479,8 +2490,28 @@
+ struct envadd_state {
+       struct client_state *client;
+       const char *prefix;
++        struct universe *universe;
+ };
++#ifdef EXTENDED_NEW_OPTION_INFO                       
++static 
++void build_universe_info_envvar
++(      struct option_cache *oc,
++       struct packet *p, struct lease *l,
++       struct client_state *client,
++       struct option_state *in_o,
++       struct option_state *cf_o,
++       struct binding_scope **scope,
++       struct universe *u, void *es             
++)
++{
++    char info_name[512], info_data[512];
++    snprintf(info_name, 512, "%s._universe_.", oc->option->universe->name);
++    snprintf(info_data, 512, "%u:%s", oc->option->code,oc->option->format);
++    client_envadd( client, info_name, oc->option->name, info_data );
++}
++#endif
++
+ void client_option_envadd (struct option_cache *oc,
+                          struct packet *packet, struct lease *lease,
+                          struct client_state *client_state,
+@@ -2497,6 +2528,31 @@
+                                  in_options, cfg_options, scope, oc, MDL)) {
+               if (data.len) {
+                       char name [256];
++#ifdef EXTENDED_NEW_OPTION_INFO                       
++                      if (  extended_option_environment )
++                      {
++                              if(  ( oc->option->universe != &dhcp_universe )
++                                 &&( oc->option->universe->index > fqdn_universe.index )
++                                 &&( es->universe !=  oc->option->universe )
++                                )
++                              {
++                                      es->universe = oc->option->universe;
++                                      (*(es->universe->foreach))
++                                           (  (struct packet *)0, (struct lease *)0, 
++                                              client_state, 
++                                              in_options, cfg_options, 
++                                              scope, es->universe, es, 
++                                              build_universe_info_envvar
++                                           );
++                              }else
++                              if ( lookup_new_option_info(oc->option) != 0L )                    
++                                      build_universe_info_envvar
++                                            ( oc, packet, lease, client_state, 
++                                              in_options, cfg_options, scope,
++                                              oc->option->universe, es 
++                                            );
++                      }
++#endif
+                       if (dhcp_option_ev_name (name, sizeof name,
+                                                oc -> option)) {
+                               client_envadd (es -> client, es -> prefix,
+@@ -2525,6 +2581,7 @@
+       es.client = client;
+       es.prefix = prefix;
++      es.universe = 0L;
+       client_envadd (client,
+                      prefix, "ip_address", "%s", piaddr (lease -> address));
+@@ -2736,7 +2793,14 @@
+                       s = option -> name;
+                       if (j + 1 == buflen)
+                               return 0;
++#ifdef EXTENDED_NEW_OPTION_INFO
++                      if ( ! extended_option_environment )
++                          buf [j++] = '_';
++                      else
++                          buf [j++] = '.';
++#else
+                       buf [j++] = '_';
++#endif
+               }
+               ++i;
+       } while (i != 2);
+diff -ur /tmp/dhcp-3.1.0a1/common/parse.c ./common/parse.c
+--- /tmp/dhcp-3.1.0a1/common/parse.c   2006-09-07 19:24:17.753460480 +0100
++++ ./common/parse.c   2006-09-07 19:27:18.000000000 +0100
+@@ -1566,6 +1566,10 @@
+                            option, MDL);
+       option_name_hash_add(option->universe->name_hash, option->name, 0,
+                            option, MDL);
++#ifdef EXTENDED_NEW_OPTION_INFO
++      if (new_option_info_tree != 0L)
++              add_new_option_info(option);
++#endif
+       return 1;
+ }
+Only in ./common: parse.c.orig
+diff -ur /tmp/dhcp-3.1.0a1/common/tables.c ./common/tables.c
+--- /tmp/dhcp-3.1.0a1/common/tables.c  2006-09-07 19:24:17.754460328 +0100
++++ ./common/tables.c  2006-09-07 19:24:52.000000000 +0100
+@@ -887,3 +887,40 @@
+       universe_hash_add(universe_hash, isc_universe.name, 0,
+                         &isc_universe, MDL);
+ }
++
++#ifdef EXTENDED_NEW_OPTION_INFO
++#include <search.h>
++
++void *new_option_info_tree = 0L;
++
++static int  new_option_info_comparator( const void* p1, const void *p2 )
++{
++      uint32_t ocode1 =  (((const struct option*)p1)->universe->index << 8)
++                        |(((const struct option*)p1)->code),
++               ocode2 =  (((const struct option*)p2)->universe->index << 8)
++                        |(((const struct option*)p2)->code);
++      return( (ocode1 == ocode2) 
++              ? 0 
++              :( ( ocode1 > ocode2 )
++                 ?  1
++                 : -1
++               )
++            );
++}
++
++void *add_new_option_info( struct option *option )
++{
++      if ( option->universe->index >= fqdn_universe.index )
++              return 0L;
++      if ( new_option_info_tree == GENERATE_NEW_OPTION_INFO )
++              new_option_info_tree = (void*)0L;
++      return tsearch( option, &(new_option_info_tree), new_option_info_comparator );
++}
++
++void *lookup_new_option_info( struct option *option )
++{
++      if ( new_option_info_tree == GENERATE_NEW_OPTION_INFO )
++              return 0L;
++      return tfind( option, &(new_option_info_tree), new_option_info_comparator );
++}
++#endif
+Only in ./common: tables.c.orig
+diff -ur /tmp/dhcp-3.1.0a1/includes/dhcpd.h ./includes/dhcpd.h
+--- /tmp/dhcp-3.1.0a1/includes/dhcpd.h 2006-09-07 19:24:17.831448624 +0100
++++ ./includes/dhcpd.h 2006-09-07 19:24:52.000000000 +0100
+@@ -1938,6 +1938,13 @@
+ void initialize_common_option_spaces PROTO ((void));
+ struct universe *config_universe;
++#ifdef EXTENDED_NEW_OPTION_INFO
++#define GENERATE_NEW_OPTION_INFO ((void*)1)
++extern void   *new_option_info_tree;
++extern void   *add_new_option_info( struct option*);
++extern void   *lookup_new_option_info( struct option *);
++#endif
++
+ /* stables.c */
+ #if defined (FAILOVER_PROTOCOL)
+ extern failover_option_t null_failover_option;
diff --git a/net-misc/dhcp/files/digest-dhcp-3.1.0_alpha1 b/net-misc/dhcp/files/digest-dhcp-3.1.0_alpha1
new file mode 100644 (file)
index 0000000..3b3d805
--- /dev/null
@@ -0,0 +1,3 @@
+MD5 a326c6f135b9fa3ad24988312c784be5 dhcp-3.1.0a1.tar.gz 773828
+RMD160 4ededc197e668219d404a054816cd48e71ac8a39 dhcp-3.1.0a1.tar.gz 773828
+SHA256 80f610a6bdfe2ac2d2dd50886d903217141c2983c1a22af23fb223998769651b dhcp-3.1.0a1.tar.gz 773828