mds/net-misc/dhcp/files/dhcp-3.1.2.ebuild.patch
2009-07-08 17:32:17 +00:00

97 lines
3.0 KiB
Diff

--- /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-08 19:11:03.383208313 +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.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
+ ldap? ( 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,10 @@
#define _PATH_DHCLIENT_PID "/var/run/dhcp/dhclient.pid"
#define DHCPD_LOG_FACILITY LOG_LOCAL1
END
+ if use ldap ; then
+ echo "#define LDAP_CONFIGURATION" >> includes/site.h
+ use ssl && echo "#define USE_SSL" >> includes/site.h
+ fi
cat <<-END > site.conf
CC = $(tc-getCC)
@@ -138,6 +152,10 @@
USRMANEXT = .1
MANCAT = man
END
+ if use ldap ; then
+ echo "LDAPLIB = -lldap" >> site.conf
+ use ssl && echo "SSLLIB = -lcrypto -lssl" >> site.conf
+ fi
./configure --copts "-DPARANOIA -DEARLY_CHROOT ${CFLAGS}" \
|| die "configure failed"
@@ -152,7 +170,10 @@
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}"/*.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
@@ -167,6 +188,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.*
+ 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