summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2003-10-02 18:28:03 +0000
committerMike Frysinger <vapier@gentoo.org>2003-10-02 18:28:03 +0000
commitd98623daccb6b767f123be7a202a4f86f4178cc0 (patch)
treed07e821d8ac76f7877d7adc675814622f02824db /net-misc/dhcp
parentold (diff)
downloadgentoo-2-d98623daccb6b767f123be7a202a4f86f4178cc0.tar.gz
gentoo-2-d98623daccb6b767f123be7a202a4f86f4178cc0.tar.bz2
gentoo-2-d98623daccb6b767f123be7a202a4f86f4178cc0.zip
option fix #30049 and static support #30026
Diffstat (limited to 'net-misc/dhcp')
-rw-r--r--net-misc/dhcp/ChangeLog8
-rw-r--r--net-misc/dhcp/dhcp-3.0_p2-r2.ebuild122
-rw-r--r--net-misc/dhcp/files/dhcp-3.0pl2-user-option-fix.patch54
-rw-r--r--net-misc/dhcp/files/digest-dhcp-3.0_p2-r22
4 files changed, 185 insertions, 1 deletions
diff --git a/net-misc/dhcp/ChangeLog b/net-misc/dhcp/ChangeLog
index 20057914b6a8..3b422f0d1f55 100644
--- a/net-misc/dhcp/ChangeLog
+++ b/net-misc/dhcp/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-misc/dhcp
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.20 2003/09/17 01:53:17 max Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.21 2003/10/02 18:28:03 vapier Exp $
+
+*dhcp-3.0_p2-r2 (02 Oct 2003)
+
+ 02 Oct 2003; Mike Frysinger <vapier@gentoo.org> :
+ Add patch to fix user options to dhclient #30049 and add USE=static
+ support #30026.
16 Sep 2003; Max Kalika <max@gentoo.org> dhcp-3.0_p2-r1.ebuild:
Set proper ownership on /var/lib/dhcp.
diff --git a/net-misc/dhcp/dhcp-3.0_p2-r2.ebuild b/net-misc/dhcp/dhcp-3.0_p2-r2.ebuild
new file mode 100644
index 000000000000..e8472aae7b05
--- /dev/null
+++ b/net-misc/dhcp/dhcp-3.0_p2-r2.ebuild
@@ -0,0 +1,122 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-3.0_p2-r2.ebuild,v 1.1 2003/10/02 18:28:03 vapier Exp $
+
+inherit flag-o-matic
+
+DESCRIPTION="ISC Dynamic Host Configuration Protocol."
+HOMEPAGE="http://www.isc.org/products/DHCP"
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${P/_p/pl}.tar.gz
+ http://www.episec.com/people/edelkind/patches/dhcp/dhcp-3.0+paranoia.patch"
+
+LICENSE="isc-dhcp"
+SLOT="0"
+KEYWORDS="~x86 ~ppc ~sparc ~mips"
+IUSE="static"
+
+DEPEND="virtual/glibc
+ >=sys-apps/sed-4"
+
+S=${WORKDIR}/${P/_p/pl}
+
+src_unpack() {
+ unpack ${A} && cd ${S}
+ epatch ${FILESDIR}/dhclient.c-3.0-dw-cli-fix.patch
+ epatch ${DISTDIR}/dhcp-3.0+paranoia.patch
+ epatch ${FILESDIR}/dhcp-3.0pl2-user-option-fix.patch
+}
+
+src_compile() {
+ # 01/Mar/2003: Fix for bug #11960 by Jason Wever <weeve@gentoo.org>
+ if [ "${ARCH}" = "sparc" ] ; then
+ filter-flags "-O3"
+ filter-flags "-O2"
+ filter-flags "-O"
+ fi
+
+ cat <<-END >> includes/site.h
+ #define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf"
+ #define _PATH_DHCLIENT_DB "/var/lib/dhcp/dhclient.leases"
+ #define _PATH_DHCPD_DB "/var/lib/dhcp/dhcpd.leases"
+ #define DHCPD_LOG_FACILITY LOG_LOCAL1
+ END
+
+ use static && append-flags -static
+ cat <<-END > site.conf
+ CC = gcc ${CFLAGS}
+ LIBDIR = /usr/lib
+ INCDIR = /usr/include
+ ETC = /etc/dhcp
+ VARDB = /var/lib/dhcp
+ ADMMANDIR = /usr/share/man/man8
+ FFMANDIR = /usr/share/man/man5
+ LIBMANDIR = /usr/share/man/man3
+ USRMANDIR = /usr/share/man/man1
+ END
+
+ ./configure --with-nsupdate \
+ --copts "-DPARANOIA -DEARLY_CHROOT" || die "configure failed"
+
+ emake || die "compile problem"
+}
+
+src_install() {
+ enewgroup dhcp
+ enewuser dhcp -1 /bin/false /var/lib/dhcp dhcp
+
+ einstall DESTDIR="${D}"
+
+ insinto /etc/dhcp
+ newins server/dhcpd.conf dhcpd.conf.sample
+ newins client/dhclient.conf dhclient.conf.sample
+ dosed "s:/etc/dhclient-script:/etc/dhcp/dhclient-script:" \
+ /etc/dhcp/dhclient.conf.sample
+ mv "${D}/sbin/dhclient-script" "${D}/etc/dhcp/dhclient-script.sample"
+
+ dodoc ANONCVS CHANGES COPYRIGHT README RELNOTES doc/*
+ newdoc client/dhclient.conf dhclient.conf.sample
+ newdoc client/scripts/linux dhclient-script.sample
+ newdoc server/dhcpd.conf dhcpd.conf.sample
+
+ insinto /etc/conf.d
+ newins "${FILESDIR}/dhcp.conf" dhcp
+
+ exeinto /etc/init.d
+ newexe "${FILESDIR}/dhcp.rc6" dhcp
+
+ keepdir /var/lib/dhcp
+ fowners dhcp:dhcp /var/lib/dhcp
+}
+
+pkg_postinst() {
+ einfo "You can edit /etc/conf.d/dhcp to customize dhcp settings"
+ einfo
+ einfo "The DHCP ebuild now includes chroot support."
+ einfo "If you like to run dhcpd in chroot AND this is a new install OR"
+ einfo "your dhcpd doesn't already run in chroot, simply run:"
+ einfo " ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config"
+ einfo "Before running the above command you might want to change the chroot"
+ einfo "dir in /etc/conf.d/dhcp, otherwise /chroot/dhcp will be used."
+ echo
+}
+
+pkg_config() {
+ CHROOT=`sed -n 's/^[[:blank:]]\?CHROOT="\([^"]\+\)"/\1/p' /etc/conf.d/dhcp 2>/dev/null`
+
+ if [ ! -d "${CHROOT:=/chroot/dhcp}" ] ; then
+ ebegin "Setting up the chroot directory"
+ mkdir -m 0755 -p "${CHROOT}/etc" "${CHROOT}/var/lib"
+ cp -R /etc/dhcp "${CHROOT}/etc/"
+ cp -R /var/lib/dhcp "${CHROOT}/var/lib"
+ chown -R dhcp:dhcp "${CHROOT}/var/lib"
+ eend
+
+ if [ "`grep '^#[[:blank:]]\?CHROOT' /etc/conf.d/dhcp`" ] ; then
+ sed -e '/^#[[:blank:]]\?CHROOT/s/^#[[:blank:]]\?//' -i /etc/conf.d/dhcp
+ fi
+ else
+ eerror
+ eerror "${CHROOT} already exists. Quitting."
+ eerror
+ fi
+}
diff --git a/net-misc/dhcp/files/dhcp-3.0pl2-user-option-fix.patch b/net-misc/dhcp/files/dhcp-3.0pl2-user-option-fix.patch
new file mode 100644
index 000000000000..ea385c1a1de3
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-3.0pl2-user-option-fix.patch
@@ -0,0 +1,54 @@
+diff -ur dhcp-current/client/clparse.c dhcp-rentec/client/clparse.c
+--- dhcp-current/client/clparse.c Tue Jun 26 20:29:27 2001
++++ dhcp-rentec/client/clparse.c Thu Oct 17 16:37:31 2002
+@@ -599,34 +599,41 @@
+ struct parse *cfile;
+ u_int32_t **list;
+ {
+- int ix, i;
++ int ix;
+ int token;
+ const char *val;
+ pair p = (pair)0, q, r;
++ struct option *option;
+
+ ix = 0;
+ do {
+- token = next_token (&val, (unsigned *)0, cfile);
+- if (token == SEMI)
++ token = peek_token (&val, (unsigned *)0, cfile);
++ if (token == SEMI) {
++ token = next_token (&val, (unsigned *)0, cfile);
+ break;
++ }
+ if (!is_identifier (token)) {
+ parse_warn (cfile, "%s: expected option name.", val);
++ token = next_token (&val, (unsigned *)0, cfile);
+ skip_to_semi (cfile);
+ return;
+ }
+- for (i = 0; i < 256; i++) {
+- if (!strcasecmp (dhcp_options [i].name, val))
+- break;
++ option = parse_option_name (cfile, 0, NULL);
++ if (!option) {
++ parse_warn (cfile, "expected option name.");
++ return;
+ }
+- if (i == 256) {
+- parse_warn (cfile, "%s: expected option name.", val);
++ if (option -> universe != &dhcp_universe) {
++ parse_warn (cfile, "%s.%s: Only global options allowed.",
++ option -> universe -> name,
++ option -> name);
+ skip_to_semi (cfile);
+ return;
+ }
+ r = new_pair (MDL);
+ if (!r)
+ log_fatal ("can't allocate pair for option code.");
+- r -> car = (caddr_t)(long)i;
++ r -> car = (caddr_t)(long)option -> code;
+ r -> cdr = (pair)0;
+ if (p)
+ q -> cdr = r;
diff --git a/net-misc/dhcp/files/digest-dhcp-3.0_p2-r2 b/net-misc/dhcp/files/digest-dhcp-3.0_p2-r2
new file mode 100644
index 000000000000..5c34b82115a3
--- /dev/null
+++ b/net-misc/dhcp/files/digest-dhcp-3.0_p2-r2
@@ -0,0 +1,2 @@
+MD5 2cb5db7a0c23deaef4724b5fc3f9a869 dhcp-3.0pl2.tar.gz 865196
+MD5 66becf9870e0293bbd35d1fba770751a dhcp-3.0+paranoia.patch 5366