diff --git a/net-misc/dhcp/ChangeLog b/net-misc/dhcp/ChangeLog index 9eb5b51..4f3468a 100644 --- a/net-misc/dhcp/ChangeLog +++ b/net-misc/dhcp/ChangeLog @@ -2,6 +2,10 @@ # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 14 Mar 2009; Mario Fetka + +files/dhcp-4.0.1-dhclient-stdin-conf.patch, +dhcp-4.0.1-r1.ebuild: + Upstream Bump and bump patch dhclient-stdin-conf + 14 Mar 2009; Mario Fetka +dhcp-3.1.2-r1.ebuild: Upstream Bump diff --git a/net-misc/dhcp/Manifest b/net-misc/dhcp/Manifest index 071b98b..6680da1 100644 --- a/net-misc/dhcp/Manifest +++ b/net-misc/dhcp/Manifest @@ -27,6 +27,7 @@ AUX dhcp-4.0-linux-ipv6-header.patch 817 RMD160 cd395ba33c6e729862af7a3c869d412e AUX dhcp-4.0-no_isc_blurb.patch 2748 RMD160 f29d8705fab63320c18c6319dd5703a51acc1687 SHA1 d8af8f4567e4bdbfac5d8e5455dede87a188ad40 SHA256 603e9a6f28264e35513f40f987d10e4fdce6d5e4f8d48aa46f83b8687d57dff0 AUX dhcp-4.0-paranoia.patch 4996 RMD160 2f8339e3d8af9164c91cc5a3bab7605ecd728295 SHA1 94db8a07b82b69d0a05645b08ef5d0ec0b99bd19 SHA256 14d328d400cdc1b4d7d6329d9c8e997b2c5e76e8f21330e267a75d6240799058 AUX dhcp-4.0.0-ldap-1.patch 173862 RMD160 73a7d17638eeb47a93386281fc1d25c7b15f2d6f SHA1 da02fb9b0865b17fb94b6840dbddb2267d4617d7 SHA256 445379243ea745a7389fbb5a37dd77d2ca6b644baace2d843453a26d42038af8 +AUX dhcp-4.0.1-dhclient-stdin-conf.patch 2965 RMD160 d418d62ce059cb57200356bf4c83565b6dbc18b2 SHA1 01d4367a7713f083f7b0d5d484e846aa5b188d6a SHA256 07da738eecfab459702829d78008fe673f9a408398862c33e6bee3c41ca79268 AUX dhcp-ebuild.patch 1058 RMD160 41ee0def17846786c19cf88695dbe0d2886ddbcf SHA1 cc32b5a520649b68a35179bf71dd464d70a470df SHA256 00b4963336a23d860c4d095178acf8086fa2ea930611992a0a9ad87a5e58189c AUX dhcpd.conf 1092 RMD160 936bb112c7cdf8e669b695599252d1f6626be2f3 SHA1 cbabbcea73a0cbc9692462683b983c96d6f18b0c SHA256 b86d27e0560689057b01a352474582fceb3a398eaf3b17f901378ec56284c4d5 AUX dhcpd.init 1989 RMD160 7f6b6858020100e47efa5d6a0809b2959e551249 SHA1 2c611adc6425fd095740aa56d09d8aafb4fea58a SHA256 916bfeb81dcb3423fd4239270ac2dce2e6dc105b28a06e03b352f6bf6b30ed1e @@ -36,9 +37,11 @@ DIST dhcp-3.1.0.tar.gz 797100 RMD160 59ef8b695b66d3cb61437e25a179d9f17639017d SH DIST dhcp-3.1.1.tar.gz 798228 RMD160 08ed15d26ca64928e1d3b07c631cbbfa9a3dc8cb SHA1 3f7e013cb62aed0f3af45bdd97424d8b63e9c280 SHA256 129024c7545e3e8d37e75cd5d534b50c53955592c4935189a57916e216355f6d DIST dhcp-3.1.2.tar.gz 799626 RMD160 026ac48b176ec273397fafa8a834a21fd6331681 SHA1 a60cccec2402a35025ddaafc8ac896595188560e SHA256 80daba1e4ac220a0945778aa3c1c9eb7860c4426645660bebb8ed35a3231a2fb DIST dhcp-4.0.0.tar.gz 1043725 RMD160 86963598124617bc7d1059262c75176db431f26d SHA1 acb4ab7634ba002893b15baba1443ef4d6c92201 SHA256 8efee52b567e934d0e80fb33f17dc0cc9f43892dc2e177a242eddebd64e23c68 +DIST dhcp-4.0.1.tar.gz 1050570 RMD160 a9764a76d105778362fe4b58e77783331ee3448a SHA1 7d813740ab4a64e474f1c01b1395617987532ed1 SHA256 965d09a7759250eff7d6d06d37425ea085c14edb5b405f8357ef5ec72ded28ef EBUILD dhcp-3.1.0-r1.ebuild 7622 RMD160 831ed83951cf678c02ea5b2a7b6c0c873009270f SHA1 a1be08f55e97189d6cde851491b410294db6c6c0 SHA256 a7ca880b7af8422ed152f09eb9c5917b6c3186d51f2a87ab043eae560b94d127 EBUILD dhcp-3.1.1-r1.ebuild 7627 RMD160 be9c724df2ed0914b35aaf5fd3e84668abc8876e SHA1 d25967f3fc46afbd60b8eb38573e175efdfe2a69 SHA256 bb9c72fa54c65b5bccb0fb4b155fd84a71ae198deb3ea6abe2c617364d18601a EBUILD dhcp-3.1.2-r1.ebuild 7627 RMD160 0cf3930678dd424a3ff6c2c153e1a5dbe8cda735 SHA1 90bc8917affa48f76c7d53af3ca2440c0350a7e2 SHA256 a84de839390f6a8a1c3e40ce76151f9b1bab801ffe4db16a8d16230e6c1ad720 EBUILD dhcp-4.0.0-r1.ebuild 6928 RMD160 b64f080ddd84c08e1101dd31c60a2924e6cbb997 SHA1 49253dae217afb93d7988b79986c9b4369b17884 SHA256 ac73f2c317f58de897bf2f3ddab6b067c0901501d477f5ae1d57f6b1a37efd93 -MISC ChangeLog 962 RMD160 2d01ff5af71fc7f4e3d20616e565364d649e1aba SHA1 6360d58b1f01eefd944638e28698f9d1d2f4f805 SHA256 51e034540acafa41a8c8ecbc964bc17648bb30e997d1a7a5303b8ea30a882cb3 +EBUILD dhcp-4.0.1-r1.ebuild 6930 RMD160 af6ed20b8c2130e12d4f9abed6d30dddadc9977f SHA1 c147b5a32eaf6ba0351ea294d11a548eddeaac79 SHA256 9f1ac6615ed95b954e4ce29d9c3b00aa0be84f0a4aff074718a3b1816866b3fe +MISC ChangeLog 1135 RMD160 3a06c94e10d32936e20d3404a86dbd4eca5179bd SHA1 8025c300da408776dabf1bada795805490b3bd13 SHA256 ebaa5bba8fe5070aa0617164df4cf650494b4c2a16e7185ea7970b1077c4721b MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42 diff --git a/net-misc/dhcp/dhcp-4.0.1-r1.ebuild b/net-misc/dhcp/dhcp-4.0.1-r1.ebuild new file mode 100644 index 0000000..a78a4c7 --- /dev/null +++ b/net-misc/dhcp/dhcp-4.0.1-r1.ebuild @@ -0,0 +1,218 @@ +# 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.0.ebuild,v 1.2 2008/10/26 03:45:20 vapier Exp $ + +inherit eutils flag-o-matic autotools + +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 ~sparc-fbsd ~x86 ~x86-fbsd" +IUSE="doc ipv6 selinux kernel_linux vim-syntax ldap" + +DEPEND="selinux? ( sec-policy/selinux-dhcp ) + kernel_linux? ( sys-apps/net-tools ) + vim-syntax? ( app-vim/dhcpd-syntax ) + ldap? ( net-nds/openldap )" + +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}"-4.0-paranoia.patch + # 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.0-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.0-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 support patch + # Add ldap support to dhcpd + use ldap && epatch "${FILESDIR}/${PN}"-4.0.0-ldap-1.patch + + # Brand the version with Gentoo + # include revision if >0 + local newver="Gentoo" + use ldap && local newver="Gentoo-LDAP" + [[ ${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() { + 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) \ + || 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 + + 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 + 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 + + # 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.0.1-dhclient-stdin-conf.patch b/net-misc/dhcp/files/dhcp-4.0.1-dhclient-stdin-conf.patch new file mode 100644 index 0000000..9bef470 --- /dev/null +++ b/net-misc/dhcp/files/dhcp-4.0.1-dhclient-stdin-conf.patch @@ -0,0 +1,114 @@ +diff -uNr dhcp-4.0.1.orig/client/clparse.c dhcp-4.0.1/client/clparse.c +--- dhcp-4.0.1.orig/client/clparse.c 2009-03-14 09:18:41.222564184 +0100 ++++ dhcp-4.0.1/client/clparse.c 2009-03-14 09:23:19.032649576 +0100 +@@ -174,6 +174,10 @@ + #endif + } + ++ /* Read any extra configuration from stdin */ ++ read_client_conf_stdin ((struct interface_info *)0, ++ &top_level_config); ++ + /* Set up state and config structures for clients that don't + have per-interface configuration statements. */ + config = (struct client_config *)0; +@@ -203,23 +207,13 @@ + return status; + } + +-int read_client_conf_file (const char *name, struct interface_info *ip, ++int read_client_conf_actual (struct parse *cfile, struct interface_info *ip, + struct client_config *client) + { +- int file; +- struct parse *cfile; + const char *val; + int token; + isc_result_t status; + +- if ((file = open (name, O_RDONLY)) < 0) +- return uerr2isc (errno); +- +- cfile = NULL; +- status = new_parse(&cfile, file, NULL, 0, path_dhclient_conf, 0); +- if (status != ISC_R_SUCCESS || cfile == NULL) +- return status; +- + do { + token = peek_token (&val, (unsigned *)0, cfile); + if (token == END_OF_FILE) +@@ -230,10 +224,74 @@ + status = (cfile -> warnings_occurred + ? ISC_R_BADPARSE + : ISC_R_SUCCESS); ++ return status; ++} ++ ++int read_client_conf_file (const char *name, struct interface_info *ip, ++ struct client_config *client) ++{ ++ int file; ++ struct parse *cfile; ++ isc_result_t status; ++ ++ if ((file = open (name, O_RDONLY)) < 0) ++ return uerr2isc (errno); ++ ++ cfile = (struct parse *)0; ++ new_parse (&cfile, file, (char *)0, 0, path_dhclient_conf, 0); ++ status = read_client_conf_actual(cfile, ip, client); + end_parse (&cfile); + return status; + } + ++int read_client_conf_stdin (struct interface_info *ip, ++ struct client_config *client) ++{ ++ int file; ++ char *buffer = NULL, *p; ++ unsigned buflen, len = 0; ++ struct parse *cfile; ++ size_t bytes; ++ isc_result_t status; ++ ++ file = fileno(stdin); ++ if (isatty (file)) ++ return ISC_R_NOTFOUND; ++ if (fcntl (file, F_SETFL, O_NONBLOCK) < 0) ++ log_fatal ("could not set stdin to non blocking!"); ++ ++ buflen = BUFSIZ; ++ buffer = malloc (BUFSIZ + 1); ++ p = buffer; ++ do { ++ bytes = read (file, p, BUFSIZ); ++ if (bytes == 0) ++ break; ++ if (bytes == -1) ++ log_fatal ("failed to read stdin!"); ++ if (bytes >= BUFSIZ) { ++ buflen += BUFSIZ; ++ len += BUFSIZ; ++ buffer = realloc (buffer, buflen + 1); ++ if (!buffer) ++ log_fatal ("not enough buffer to read stdin!"); ++ p = buffer + len; ++ } else { ++ len += bytes; ++ break; ++ } ++ } while(1); ++ buffer[len] = '\0'; ++ ++ cfile = (struct parse *)0; ++ status = new_parse (&cfile, -1, buffer, len, "stdin", 0); ++ if (status == ISC_R_SUCCESS) { ++ status = read_client_conf_actual (cfile, ip, client); ++ end_parse (&cfile); ++ } ++ free(buffer); ++ return status; ++} + + /* lease-file :== client-lease-statements END_OF_FILE + client-lease-statements :==