mds/net-misc/dhcp/files/dhcp-4.0.1.ebuild.patch

84 lines
2.5 KiB
Diff
Raw Normal View History

--- /usr/portage/net-misc/dhcp/dhcp-4.0.1.ebuild 2009-03-30 15:13:28.000000000 +0200
+++ dhcp-4.2.0.ebuild 2009-07-08 19:11:15.121631116 +0200
@@ -4,22 +4,30 @@
inherit eutils flag-o-matic autotools
+LDAP_PV="4.0.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
+ ldap? ( http://dcantrel.fedorapeople.org/dhcp/ldap-patch/ldap-for-dhcp-${LDAP_PV}.tar.gz
+ http://ftp.disconnected-by-peer.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"
+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 +73,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 +125,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 +151,10 @@
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}"/*.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
@@ -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.*
+ 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
}