net-misc/dhcp: add ldap patch for 3.1.2

git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/mds@1332 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
geos_one
2009-07-07 20:17:02 +00:00
parent 1372cf2b83
commit 7e514c60c0
7 changed files with 474 additions and 9 deletions

View File

@@ -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
+ printf "$conf" | resolvconf -a "$interface"
+ else
+ printf "$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
+ printf "$conf" | resolvconf -a "$interface"
+ else
+ printf "$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
+ printf "$conf" | resolvconf -a "$interface"
+ else
+ printf "$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
+ printf "$conf" | resolvconf -a "$interface"
+ else
+ printf "$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
+ printf "$conf" | resolvconf -a "$interface"
+ else
+ printf "$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
+ printf "$conf" | resolvconf -a "$interface"
+ else
+ printf "$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

View File

@@ -0,0 +1,93 @@
--- /usr/portage/net-misc/dhcp/dhcp-3.1.1.ebuild 2009-04-05 12:37:41.000000000 +0200
+++ dhcp-3.1.2.ebuild 2009-07-07 22:01:04.968912251 +0200
@@ -1,24 +1,31 @@
-# Copyright 1999-2008 Gentoo Foundation
+# 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-3.1.1.ebuild,v 1.9 2008/11/05 00:41:46 vapier Exp $
inherit eutils flag-o-matic multilib toolchain-funcs
+LDAP_PV="3.1.2-1"
+
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"
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
+ http://dcantrel.fedorapeople.org/dhcp/ldap-patch/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 minimal static selinux kernel_linux"
+IUSE="doc minimal static selinux kernel_linux ldap ssl"
DEPEND="selinux? ( sec-policy/selinux-dhcp )
- kernel_linux? ( sys-apps/net-tools )"
+ kernel_linux? ( sys-apps/net-tools )
+ ldap? ( net-nds/openldap
+ ssl? ( dev-libs/openssl ) )"
PROVIDE="virtual/dhcpc"
@@ -65,6 +72,9 @@
# 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="${MY_PV}-Gentoo"
@@ -119,6 +129,8 @@
#define _PATH_DHCLIENT_PID "/var/run/dhcp/dhclient.pid"
#define DHCPD_LOG_FACILITY LOG_LOCAL1
END
+ use ldap && echo "#define LDAP_CONFIGURATION" >> includes/site.h
+ use ssl && echo "#define USE_SSL" >> includes/site.h
cat <<-END > site.conf
CC = $(tc-getCC)
@@ -138,6 +150,8 @@
USRMANEXT = .1
MANCAT = man
END
+ use ldap && echo "LDAPLIB = -lldap" >> site.conf
+ use ssl && echo "SSLLIB = -lcrypto -lssl" >> site.conf
./configure --copts "-DPARANOIA -DEARLY_CHROOT ${CFLAGS}" \
|| die "configure failed"
@@ -152,7 +166,11 @@
src_install() {
make install DESTDIR="${D}" || die
- use doc && dodoc README RELNOTES doc/*
+ if use doc; then
+ dodoc README RELNOTES doc/*
+ use ldap && dodoc "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}"/README.ldap "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}"/draft-ietf-dhc-ldap-schema-01.txt
+ use ldap && newdoc "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}"/LICENSE LICENSE.ldap
+ fi
insinto /etc/dhcp
newins client/dhclient.conf dhclient.conf.sample
@@ -167,6 +185,13 @@
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.schema
+ 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
fi

View File

@@ -0,0 +1,83 @@
--- /usr/portage/net-misc/dhcp/dhcp-4.0.1.ebuild 2009-03-30 15:13:28.000000000 +0200
+++ dhcp-4.0.1.ebuild 2009-07-07 21:58:00.179625641 +0200
@@ -4,22 +4,29 @@
inherit eutils flag-o-matic autotools
+LDAP_PV="4.0.1-1"
+
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"
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
+ http://dcantrel.fedorapeople.org/dhcp/ldap-patch/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"
+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 )"
+ vim-syntax? ( app-vim/dhcpd-syntax )
+ ldap? ( net-nds/openldap
+ ssl? ( dev-libs/openssl ) )"
PROVIDE="virtual/dhcpc"
@@ -65,6 +72,9 @@
# 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"
@@ -114,6 +124,8 @@
--with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \
--with-relay-pid-file=/var/run/dhcp/dhcrelay.pid \
$(use_enable ipv6 dhcpv6) \
+ $(use_with ldap) \
+ $(use_with ssl ldapcrypto) \
|| die
emake || die "compile problem"
@@ -138,8 +150,11 @@
newexe "${S}"/client/scripts/freebsd dhclient-script
fi
- use doc && dodoc README RELNOTES doc/*
-
+ if use doc; then
+ dodoc README RELNOTES doc/*
+ use ldap && dodoc "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}"/README.ldap "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}"/draft-ietf-dhc-ldap-schema-01.txt
+ use ldap && newdoc "${WORKDIR}/ldap-for-dhcp-${LDAP_PV}"/LICENSE LICENSE.ldap
+ fi
insinto /etc/dhcp
newins client/dhclient.conf dhclient.conf.sample
keepdir /var/{lib,run}/dhcp
@@ -152,6 +167,14 @@
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.schema
+ 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
}