From 6a9cb88d98501b60e47b6da34cfb9233d6d3e24f Mon Sep 17 00:00:00 2001 From: geos_one Date: Wed, 8 Jul 2009 19:09:13 +0000 Subject: [PATCH] net-misc/dhcp: bump to 4.1 git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/mds@1351 6952d904-891a-0410-993b-d76249ca496b --- net-misc/dhcp/ChangeLog | 6 + net-misc/dhcp/Manifest | 7 +- net-misc/dhcp/dhcp-4.1.0.ebuild | 237 ++++++++++++++++++ .../dhcp/files/dhcp-4.1-dhclient-metric.patch | 211 ++++++++++++++++ .../dhcp/files/dhcp-4.1-no_isc_blurb.patch | 96 +++++++ 5 files changed, 556 insertions(+), 1 deletion(-) create mode 100644 net-misc/dhcp/dhcp-4.1.0.ebuild create mode 100644 net-misc/dhcp/files/dhcp-4.1-dhclient-metric.patch create mode 100644 net-misc/dhcp/files/dhcp-4.1-no_isc_blurb.patch diff --git a/net-misc/dhcp/ChangeLog b/net-misc/dhcp/ChangeLog index f043e45..1ad1aef 100644 --- a/net-misc/dhcp/ChangeLog +++ b/net-misc/dhcp/ChangeLog @@ -2,6 +2,12 @@ # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 # $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.154 2009/05/29 23:30:28 vapier Exp $ +*dhcp-4.1.0 (08 Jul 2009) + + 08 Jul 2009; Mario Fetka +dhcp-4.1.0.ebuild, + +files/dhcp-4.1-dhclient-metric.patch, +files/dhcp-4.1-no_isc_blurb.patch: + bump to 4.1 + 08 Jul 2009; Mario Fetka dhcp-3.1.2.ebuild, dhcp-4.0.1.ebuild: new upstream release diff --git a/net-misc/dhcp/Manifest b/net-misc/dhcp/Manifest index 4e0de6f..dfa52e2 100644 --- a/net-misc/dhcp/Manifest +++ b/net-misc/dhcp/Manifest @@ -23,15 +23,20 @@ AUX dhcp-4.0-no_isc_blurb.patch 2748 RMD160 f29d8705fab63320c18c6319dd5703a51acc AUX dhcp-4.0-paranoia.patch 4996 RMD160 2f8339e3d8af9164c91cc5a3bab7605ecd728295 SHA1 94db8a07b82b69d0a05645b08ef5d0ec0b99bd19 SHA256 14d328d400cdc1b4d7d6329d9c8e997b2c5e76e8f21330e267a75d6240799058 AUX dhcp-4.0.1-dhclient-stdin-conf.patch 2965 RMD160 2c3dd3994f0a7f15f3fe51972dd04a2e6055613a SHA1 f4a9d51126ea489f75fcf29053ab432b68e5055d SHA256 0b25bc74ae258656dd1f0e6f4ffd6b4ef8b4ad56956624c0b6070941a180e57c AUX dhcp-4.0.1.ebuild.patch 2594 RMD160 2a07162a5a9b9c3373d409a9bf0a05e9ae97d23f SHA1 edd8ab5fb8f0af1082395df492397485883a22e1 SHA256 95b4847217b05389ae245eb95d059431e7e4ba068f2911e1c6e531912c03a48b +AUX dhcp-4.1-dhclient-metric.patch 8332 RMD160 9ac1d0588d911700e4f86a10275010bb60f98b42 SHA1 a27db920020de86c42c54d073cf34ba0f8d17af8 SHA256 93b7072aa10868755db60cbcc631017a516cfa617345eaa1f2774791c9e4c3ab +AUX dhcp-4.1-no_isc_blurb.patch 2711 RMD160 72de8521fcb1c5876770d8fda8a5e88f6199d58d SHA1 a27b11f0e1bb1cbc41b4676a3ff2fa6c0a6c113c SHA256 d8e96e99c2ca68aab5f4194fac6b7d3dcb35adf1a697a4696b06ee950759bf2f AUX dhcpd.conf 1092 RMD160 936bb112c7cdf8e669b695599252d1f6626be2f3 SHA1 cbabbcea73a0cbc9692462683b983c96d6f18b0c SHA256 b86d27e0560689057b01a352474582fceb3a398eaf3b17f901378ec56284c4d5 AUX dhcpd.init 1989 RMD160 7f6b6858020100e47efa5d6a0809b2959e551249 SHA1 2c611adc6425fd095740aa56d09d8aafb4fea58a SHA256 916bfeb81dcb3423fd4239270ac2dce2e6dc105b28a06e03b352f6bf6b30ed1e AUX dhcrelay.conf 421 RMD160 456edbc9bcc8d3a44db5bb6dbf0c3003c3e7419c SHA1 78ecdb000382893fb49d0052ced063955b0ad9cf SHA256 409b895ed489e75c1a08f72961b45d641b93fd9357f528abc78b1fd036b7f730 AUX dhcrelay.init 736 RMD160 04566b87bd6dbb8bb754b26409ca30b878ef3ca3 SHA1 72742b308314b2e1476b27e94212fbf4d179adc4 SHA256 cfdaff3a723be3935d06c14e171d4008f2ad3329bd05ac2e49c19bc0e14bc59c DIST dhcp-3.1.2.tar.gz 799626 RMD160 026ac48b176ec273397fafa8a834a21fd6331681 SHA1 a60cccec2402a35025ddaafc8ac896595188560e SHA256 80daba1e4ac220a0945778aa3c1c9eb7860c4426645660bebb8ed35a3231a2fb DIST dhcp-4.0.1.tar.gz 1050570 RMD160 a9764a76d105778362fe4b58e77783331ee3448a SHA1 7d813740ab4a64e474f1c01b1395617987532ed1 SHA256 965d09a7759250eff7d6d06d37425ea085c14edb5b405f8357ef5ec72ded28ef +DIST dhcp-4.1.0.tar.gz 1086815 RMD160 bf96fa9d135a65b4d9b27f8caf4f3744f0636c80 SHA1 46e161892140a3b60cd56e62b442f48f51bc605f SHA256 688741e970410efdb177513550f8cd1ee52032eb109313ab316a852f40310914 DIST ldap-for-dhcp-3.1.2-2.tar.gz 39752 RMD160 96d2f469b1349485c0202012697222911b81abe8 SHA1 023d12eeb148ad493e252edbfd112d19c9d0cecd SHA256 afd30a30d72a17a4d8ae1a27c247711f03b30b5e270bdcf9f521695b55b28db7 DIST ldap-for-dhcp-4.0.1-3.tar.gz 39117 RMD160 977ec08ec0213e1a53d0dd5b3b08a234172dbd22 SHA1 8bc692bb2017c1b5ff35d73c10e5a2e4ed44e559 SHA256 161f5cd479ba0789d139ef59d101244fa7c880c3d1c13cbbbbae978004a30a18 +DIST ldap-for-dhcp-4.1.0-4.tar.gz 39175 RMD160 a9e31099bb971bdba0e78b80130f539ccc5eed0b SHA1 1c37ebf531b6a0bc358edc6f3e31b57bfe88dd8e SHA256 1088f0c0b2c7d8cc543eb0d34e655690a6efaec7eca85df3e28c06a2c456780b EBUILD dhcp-3.1.2.ebuild 8439 RMD160 af0143fd42720fc2ff28d72453023606a0be0964 SHA1 145459d45b160cb33b26165627e10e2ef1f73b7d SHA256 1ce562b1585743391b671e808d30a7572cd17ad0a8c6f20371fe07ed14b4bdb1 EBUILD dhcp-4.0.1.ebuild 7591 RMD160 e040ba3ab002c67f8a09be6b05eca762c602bad8 SHA1 848ca4332e76e68e253faff09cb8bbcde759369a SHA256 135a13f083d48eb6cb28ce859ce026a97141e6f0920767a0ef2dedf22c7e8391 -MISC ChangeLog 28246 RMD160 cb6ddf8ad15b0ed5cdfb0c7f64d765fc65e5bb04 SHA1 5f0980eb2b2c111ae1f6003455b4c43f0c4a7148 SHA256 cc6f791e1362d37c1ef6cf457441df20670d0f43c9181ccc9b03bc3fbcef0871 +EBUILD dhcp-4.1.0.ebuild 7519 RMD160 44fa11c14648e88fee7f72826d0c2ccadebf81ed SHA1 160928f21736c78a861d9c17e37e87d167f8e33e SHA256 6dbf3bdab27e1fc39def686b7f20de92393bf512e2ca7019ccca5c7fa18e3bea +MISC ChangeLog 28436 RMD160 fc01452f151469fdcde75faa1faf9ccbd964a92e SHA1 6b4d601c11c15ead0218602d3b2c4390e53fa958 SHA256 70f957b4d234bdd177696bd766ece96e851c8f0676a653aa8b01d1c7d1a25a25 MISC metadata.xml 358 RMD160 97ecd4b6ee0a24352a71a66d5ad4fd82481156b4 SHA1 d80da2cf7c6892cdad6b681fda29e46472d68871 SHA256 8665f24cdfcc09576b595f8bd257333ff5f9ea7ee0ca2925ba6fb74d90e12415 diff --git a/net-misc/dhcp/dhcp-4.1.0.ebuild b/net-misc/dhcp/dhcp-4.1.0.ebuild new file mode 100644 index 0000000..9dfcb48 --- /dev/null +++ b/net-misc/dhcp/dhcp-4.1.0.ebuild @@ -0,0 +1,237 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-4.0.1.ebuild,v 1.1 2009/03/30 13:13:28 chainsaw Exp $ + +inherit eutils flag-o-matic autotools + +LDAP_PV="4.1.0-4" + +MY_PV="${PV//_alpha/a}" +MY_PV="${MY_PV//_beta/b}" +MY_PV="${MY_PV//_rc/rc}" +MY_P="${PN}-${MY_PV}" +MY_LDAP_PV="${LDAP_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 + http://cloud.github.com/downloads/dcantrell/ldap-for-dhcp/ldap-for-dhcp-${LDAP_PV}.tar.gz + http://ftp.mars.arge.at/pub/ldap-for-dhcp-${LDAP_PV}.tar.gz" + +LICENSE="isc-dhcp" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" +IUSE="doc ipv6 selinux kernel_linux vim-syntax ldap ssl" + +DEPEND="selinux? ( sec-policy/selinux-dhcp ) + kernel_linux? ( sys-apps/net-tools ) + vim-syntax? ( app-vim/dhcpd-syntax ) + ldap? ( net-nds/openldap + ssl? ( dev-libs/openssl ) )" + +PROVIDE="virtual/dhcpc" + +S="${WORKDIR}/${MY_P}" + +src_unpack() { + unpack ${A} + cd "${S}" + + # Gentoo patches - these will probably never be accepted upstream + # Fix some permission issues + epatch "${FILESDIR}/${PN}"-3.0-fix-perms.patch + # Enable dhclient to equery NTP servers + epatch "${FILESDIR}/${PN}"-4.0-dhclient-ntp.patch + # resolvconf support in dhclient-script + epatch "${FILESDIR}/${PN}"-4.0-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}"-4.1-dhclient-metric.patch + # Stop downing the interface on Linux as that breaks link daemons + # such as wpa_supplicant and netplug + epatch "${FILESDIR}/${PN}"-3.0.3-dhclient-no-down.patch + # Quiet the isc blurb + epatch "${FILESDIR}/${PN}"-4.1-no_isc_blurb.patch + # Enable dhclient to get extra configuration from stdin + epatch "${FILESDIR}/${PN}"-4.0.1-dhclient-stdin-conf.patch + # Disable fallback interfaces when using BPF + # This allows more than one dhclient instance on the BSD's + epatch "${FILESDIR}/${PN}"-3.0.5-bpf-nofallback.patch + # This allows the software to actually compile on linux + epatch "${FILESDIR}/${PN}"-4.0-linux-ipv6-header.patch + # Consistent style for the if statements, also resolves + # unary operator expected warnings (new style is wrong). + epatch "${FILESDIR}/${PN}"-4.0-dhclient-script-correct-operators.patch + + # NetworkManager support patches + # If they fail to apply to future versions they will be dropped + # Add dbus support to dhclient + epatch "${FILESDIR}/${PN}"-3.0.3-dhclient-dbus.patch + + # Ldap patch for dhcp + epatch "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}/dhcp-${MY_LDAP_PV}"-ldap.patch + + # Brand the version with Gentoo + # include revision if >0 + local newver="Gentoo" + [[ ${PR} != "r0" ]] && newver="${newver}-${PR}" + + sed -i "/AC_INIT/s/\(\[[0-9]\+\.[0-9]\+\.[0-9]\+\)/\1-${newver}/" \ + configure.ac || 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 + + # No need for the linux script to force bash, #158540. + sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die + + # Quiet the freebsd logger a little + sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die + + # Remove these options from the sample config + sed -i -e "/\(script\|host-name\|domain-name\) / d" \ + client/dhclient.conf || die + + # 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 + + eautoreconf +} + +src_compile() { + myconf="" + if use ldap; then + myconf="${myconf} --with-ldap" + use ssl && myconf="${myconf} --with-ldapcrypto" + fi + econf \ + --enable-paranoia \ + --sysconfdir /etc/dhcp \ + --with-cli-pid-file=/var/run/dhcp/dhclient.pid \ + --with-cli-lease-file=/var/lib/dhcp/dhclient.leases \ + --with-srv-pid-file=/var/run/dhcp/dhcpd.pid \ + --with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \ + --with-relay-pid-file=/var/run/dhcp/dhcrelay.pid \ + $(use_enable ipv6 dhcpv6) \ + ${myconf} \ + || die + + emake || die "compile problem" +} + +src_install() { + for installdir in includes tests common minires dst omapip client dhcpctl relay server; do + cd "${S}/${installdir}" + if [ "${installdir}" == client ]; then + make install DESTDIR="${D}" exec_prefix="" || die + else + make install DESTDIR="${D}" exec_prefix="/usr" || die + fi + done + + cd "${S}" + + exeinto /sbin + if use kernel_linux; then + newexe "${S}"/client/scripts/linux dhclient-script + else + newexe "${S}"/client/scripts/freebsd dhclient-script + fi + + if use doc; then + dodoc README RELNOTES doc/* + use ldap && dodoc "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}"/*.ldap "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}"/draft-ietf-dhc-ldap-schema-01.txt + fi + insinto /etc/dhcp + newins client/dhclient.conf dhclient.conf.sample + keepdir /var/{lib,run}/dhcp + + # Install our server files + insinto /etc/dhcp + newins server/dhcpd.conf dhcpd.conf.sample + newinitd "${FILESDIR}"/dhcpd.init dhcpd + newinitd "${FILESDIR}"/dhcrelay.init dhcrelay + newconfd "${FILESDIR}"/dhcpd.conf dhcpd + newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay + + # install ldap files + if use ldap; then + insinto /etc/openldap/schema + doins "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}"/dhcp.* + dosbin "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}"/dhcpd-conf-to-ldap + fi + + + # We never want portage to own this file + rm -f "${D}"/var/lib/dhcp/dhcpd.leases +} + +pkg_preinst() { + enewgroup dhcp + enewuser dhcp -1 -1 /var/lib/dhcp dhcp +} + +pkg_postinst() { + 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() { + 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-4.1-dhclient-metric.patch b/net-misc/dhcp/files/dhcp-4.1-dhclient-metric.patch new file mode 100644 index 0000000..2f98af8 --- /dev/null +++ b/net-misc/dhcp/files/dhcp-4.1-dhclient-metric.patch @@ -0,0 +1,211 @@ +diff -uNr dhcp-4.1.0.orig/client/scripts/bsdos dhcp-4.1.0/client/scripts/bsdos +--- dhcp-4.1.0.orig/client/scripts/bsdos 2009-07-08 20:47:32.631747061 +0200 ++++ dhcp-4.1.0/client/scripts/bsdos 2009-07-08 20:48:21.198858540 +0200 +@@ -102,6 +102,9 @@ + if [ x$new_interface_mtu != x ]; then + mtu_arg="mtu $new_interface_mtu" + fi ++if [ x$IF_METRIC != x ]; then ++ metric_arg="metric $IF_METRIC" ++fi + + if [ x$reason = xMEDIUM ]; then + eval "ifconfig $interface $medium" +@@ -163,7 +166,7 @@ + if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \ + [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then + eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \ +- $new_broadcast_arg $mtu_arg $medium" ++ $new_broadcast_arg $mtu_arg $metric_arg $medium" + route add $new_ip_address 127.1 >/dev/null 2>&1 + for router in $new_routers; do + route add default $router >/dev/null 2>&1 +@@ -220,7 +223,7 @@ + route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1 + fi + eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \ +- $new_broadcast_arg $mtu_arg $medium" ++ $new_broadcast_arg $mtu_arg $metric_arg $medium" + sleep 1 + if [ "$new_routers" != "" ]; then + set $new_routers +diff -uNr dhcp-4.1.0.orig/client/scripts/freebsd dhcp-4.1.0/client/scripts/freebsd +--- dhcp-4.1.0.orig/client/scripts/freebsd 2009-07-08 20:47:32.631747061 +0200 ++++ dhcp-4.1.0/client/scripts/freebsd 2009-07-08 20:48:21.198858540 +0200 +@@ -112,6 +112,9 @@ + if [ x$new_interface_mtu != x ]; then + mtu_arg="mtu $new_interface_mtu" + fi ++if [ x$IF_METRIC != x ]; then ++ metric_arg="metric $IF_METRIC" ++fi + + if [ x$reason = xMEDIUM ]; then + eval "ifconfig $interface $medium" +@@ -173,7 +176,7 @@ + if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \ + [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then + eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \ +- $new_broadcast_arg $mtu_arg $medium" ++ $new_broadcast_arg $mtu_arg $metric_arg $medium" + $LOGGER "New IP Address ($interface): $new_ip_address" + $LOGGER "New Subnet Mask ($interface): $new_subnet_mask" + $LOGGER "New Broadcast Address ($interface): $new_broadcast_address" +@@ -243,7 +246,7 @@ + route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1 + fi + eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \ +- $new_broadcast_arg $mtu_arg $medium" ++ $new_broadcast_arg $mtu_arg $metric_arg $medium" + $LOGGER "New IP Address ($interface): $new_ip_address" + $LOGGER "New Subnet Mask ($interface): $new_subnet_mask" + $LOGGER "New Broadcast Address ($interface): $new_broadcast_address" +diff -uNr dhcp-4.1.0.orig/client/scripts/linux dhcp-4.1.0/client/scripts/linux +--- dhcp-4.1.0.orig/client/scripts/linux 2009-07-08 20:47:32.631747061 +0200 ++++ dhcp-4.1.0/client/scripts/linux 2009-07-08 20:48:53.235881547 +0200 +@@ -104,11 +104,6 @@ + fi + fi + +-release=`uname -r` +-release=`expr $release : '\(.*\)\..*'` +-relminor=`echo $release |sed -e 's/[0-9]*\.\([0-9][0-9]*\)\(\..*\)*$/\1/'` +-relmajor=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'` +- + ### + ### DHCPv4 Handlers + ### +@@ -131,6 +126,9 @@ + if [ x$new_interface_mtu != x ]; then + mtu_arg="mtu $new_interface_mtu" + fi ++if [ x$IF_METRIC != x ]; then ++ metric_arg="metric $IF_METRIC" ++fi + + if [ x$reason = xMEDIUM ]; then + # Linux doesn't do mediums (ok, ok, media). +@@ -142,15 +140,7 @@ + # Bring down alias interface. Its routes will disappear too. + ifconfig $interface:0- inet 0 + fi +- if [ $relmajor -lt 2 ] || ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ) +- then +- ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \ +- broadcast 255.255.255.255 up +- # Add route to make broadcast work. Do not omit netmask. +- route add default dev $interface netmask 0.0.0.0 +- else +- ifconfig $interface 0 up +- fi ++ ifconfig $interface 0 up + + # We need to give the kernel some time to get the interface up. + sleep 1 +@@ -192,15 +182,17 @@ + ifconfig $interface inet $new_ip_address $new_subnet_arg \ + $new_broadcast_arg $mtu_arg + # Add a network route to the computed network address. +- if [ $relmajor -lt 2 ] || \ +- ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then +- route add -net $new_network_number $new_subnet_arg dev $interface ++ if [ x$IF_METRIC != x ] && [ x$IF_METRIC != x0 ]; then ++ route del -net $new_network_number $new_subnet_arg \ ++ dev $interface ++ route add -net $new_network_number $new_subnet_arg $metric_arg \ ++ dev $interface + fi + for router in $new_routers; do + if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then + route add -host $router dev $interface + fi +- route add default gw $router ++ route add default gw $router $metric_arg dev $interface + done + fi + if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; +@@ -243,15 +235,18 @@ + ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg + route add -host $alias_ip_address dev $interface:0 + fi +- if [ $relmajor -lt 2 ] || \ +- ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then +- route add -net $new_network_number ++ # Add a network route to the computed network address. ++ if [ x$IF_METRIC != x ] && [ x$IF_METRIC != x0 ]; then ++ route del -net $new_network_number $new_subnet_arg \ ++ dev $interface ++ route add -net $new_network_number $new_subnet_arg $metric_arg \ ++ dev $interface + fi + for router in $new_routers; do + if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then + route add -host $router dev $interface + fi +- route add default gw $router ++ route add default gw $router $metric_arg dev $interface + done + make_resolv_conf + exit_with_hooks 0 +diff -uNr dhcp-4.1.0.orig/client/scripts/netbsd dhcp-4.1.0/client/scripts/netbsd +--- dhcp-4.1.0.orig/client/scripts/netbsd 2009-07-08 20:47:32.631747061 +0200 ++++ dhcp-4.1.0/client/scripts/netbsd 2009-07-08 20:48:21.201176019 +0200 +@@ -102,6 +102,9 @@ + if [ x$new_interface_mtu != x ]; then + mtu_arg="mtu $new_interface_mtu" + fi ++if [ x$IF_METRIC != x ]; then ++ metric_arg="metric $IF_METRIC" ++fi + + if [ x$reason = xMEDIUM ]; then + eval "ifconfig $interface $medium" +@@ -163,7 +166,7 @@ + if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \ + [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then + eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \ +- $new_broadcast_arg $mtu_arg $medium" ++ $new_broadcast_arg $mtu_arg $metric_arg $medium" + route add $new_ip_address 127.1 >/dev/null 2>&1 + for router in $new_routers; do + route add default $router >/dev/null 2>&1 +@@ -220,7 +223,7 @@ + route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1 + fi + eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \ +- $new_broadcast_arg $mtu_arg $medium" ++ $new_broadcast_arg $mtu_arg $metric_arg $medium" + sleep 1 + if [ "$new_routers" != "" ]; then + set $new_routers +diff -uNr dhcp-4.1.0.orig/client/scripts/solaris dhcp-4.1.0/client/scripts/solaris +--- dhcp-4.1.0.orig/client/scripts/solaris 2009-07-08 20:47:32.631747061 +0200 ++++ dhcp-4.1.0/client/scripts/solaris 2009-07-08 20:48:21.203487631 +0200 +@@ -97,6 +97,9 @@ + if [ x$new_interface_mtu != x ]; then + mtu_arg="mtu $new_interface_mtu" + fi ++if [ x$IF_METRIC != x ]; then ++ metric_arg="metric $IF_METRIC" ++fi + + ifconfig=/sbin/ifconfig + +@@ -159,7 +162,7 @@ + if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \ + [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then + eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \ +- $new_broadcast_arg $mtu_arg $medium" ++ $new_broadcast_arg $mtu_arg $metric_arg $medium" + route add $new_ip_address 127.1 1 >/dev/null 2>&1 + for router in $new_routers; do + route add default $router 1 >/dev/null 2>&1 +@@ -200,7 +203,7 @@ + route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1 + fi + eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \ +- $new_broadcast_arg $mtu_arg $medium" ++ $new_broadcast_arg $mtu_arg $metric_arg $medium" + sleep 1 + set $new_routers + if ping -s -n -I 1 $1 64 1; then diff --git a/net-misc/dhcp/files/dhcp-4.1-no_isc_blurb.patch b/net-misc/dhcp/files/dhcp-4.1-no_isc_blurb.patch new file mode 100644 index 0000000..a7aeba1 --- /dev/null +++ b/net-misc/dhcp/files/dhcp-4.1-no_isc_blurb.patch @@ -0,0 +1,96 @@ +diff -uNr dhcp-4.1.0.orig/client/dhclient.c dhcp-4.1.0/client/dhclient.c +--- dhcp-4.1.0.orig/client/dhclient.c 2009-07-08 20:53:54.570853169 +0200 ++++ dhcp-4.1.0/client/dhclient.c 2009-07-08 20:55:59.448693983 +0200 +@@ -87,6 +87,8 @@ + + static isc_result_t write_duid(struct data_string *duid); + ++extern int log_isc_blurb; ++ + int + main(int argc, char **argv) { + int fd; +@@ -385,6 +387,7 @@ + log_info("%s", ""); + } else { + log_perror = 0; ++ log_isc_blurb = 0; + quiet_interface_discovery = 1; + } + +diff -uNr dhcp-4.1.0.orig/omapip/errwarn.c dhcp-4.1.0/omapip/errwarn.c +--- dhcp-4.1.0.orig/omapip/errwarn.c 2009-07-08 20:53:54.573168693 +0200 ++++ dhcp-4.1.0/omapip/errwarn.c 2009-07-08 20:54:52.318516628 +0200 +@@ -43,6 +43,8 @@ + int log_perror = 1; + #endif + int log_priority; ++int log_isc_blurb=1; ++ + void (*log_cleanup) (void); + + #define CVT_BUF_MAX 1023 +@@ -74,7 +76,9 @@ + write (STDERR_FILENO, "\n", 1); + } + +-#if !defined (NOMINUM) ++#if !defined(NOMINUM) ++ if ( log_isc_blurb ) ++ { + log_error ("%s", ""); + log_error ("If you did not get this software from ftp.isc.org, please"); + log_error ("get the latest from ftp.isc.org and install that before"); +@@ -92,7 +96,12 @@ + log_error ("the README file."); + log_error ("%s", ""); + log_error ("exiting."); ++ }else ++ { ++ log_error ("exiting."); ++ } + #endif ++ + if (log_cleanup) + (*log_cleanup) (); + exit (1); +diff -uNr dhcp-4.1.0.orig/relay/dhcrelay.c dhcp-4.1.0/relay/dhcrelay.c +--- dhcp-4.1.0.orig/relay/dhcrelay.c 2009-07-08 20:53:54.543072262 +0200 ++++ dhcp-4.1.0/relay/dhcrelay.c 2009-07-08 20:56:46.552266455 +0200 +@@ -130,6 +130,7 @@ + static char arr[] = "All rights reserved."; + static char message[] = "Internet Systems Consortium DHCP Relay Agent"; + static char url[] = "For info, please visit http://www.isc.org/sw/dhcp/"; ++extern int log_isc_blurb; + + #ifdef DHCPv6 + #define DHCRELAY_USAGE \ +@@ -219,6 +220,7 @@ + } else if (!strcmp(argv[i], "-q")) { + quiet = 1; + quiet_interface_discovery = 1; ++ log_isc_blurb = 0; + } else if (!strcmp(argv[i], "-p")) { + if (++i == argc) + usage(); +diff -uNr dhcp-4.1.0.orig/server/dhcpd.c dhcp-4.1.0/server/dhcpd.c +--- dhcp-4.1.0.orig/server/dhcpd.c 2009-07-08 20:53:54.518186738 +0200 ++++ dhcp-4.1.0/server/dhcpd.c 2009-07-08 20:54:52.323721178 +0200 +@@ -62,6 +62,9 @@ + struct iaddr server_identifier; + int server_identifier_matched; + ++ ++extern int log_isc_blurb; ++ + #if defined (NSUPDATE) + + /* This stuff is always executed to figure the default values for certain +@@ -367,6 +370,7 @@ + lftest = 1; + log_perror = -1; + } else if (!strcmp (argv [i], "-q")) { ++ log_isc_blurb = 0; + quiet = 1; + quiet_interface_discovery = 1; + #ifdef DHCPv6