diff options
author | Wesley Shields <wxs@FreeBSD.org> | 2010-07-12 01:54:25 +0000 |
---|---|---|
committer | Wesley Shields <wxs@FreeBSD.org> | 2010-07-12 01:54:25 +0000 |
commit | 26a38793e9c7b5b614830a329e16abb10cb78fe6 (patch) | |
tree | 175978641d2ea0cb4052800818d0bca09804ebb7 /net/isc-dhcp41-server | |
parent | c30ea1e9df2a1f82814a835177038a9c629f98cf (diff) | |
download | ports-26a38793e9c7b5b614830a329e16abb10cb78fe6.tar.gz ports-26a38793e9c7b5b614830a329e16abb10cb78fe6.zip |
[1]: Don't remove /var/db/dhcpd on deinstall. This was breaking chroot setups
on upgrade.
[2]: Install more man pages.
[3]: Add LDAP configuration support. This was present in the other port.
PR: [1]: ports/147857
[2]: ports/147917
[3]: ports/147869
Submitted by: [1]: Henno Schooljan <henno@schooljan.nl>
[2]: Craig Leres <leres@ee.lbl.gov>
[3]: Alexander V. Ribchansky <triosoft@triosoft.com.ua>
Notes
Notes:
svn path=/head/; revision=257652
Diffstat (limited to 'net/isc-dhcp41-server')
-rw-r--r-- | net/isc-dhcp41-server/Makefile | 63 | ||||
-rw-r--r-- | net/isc-dhcp41-server/distinfo | 3 | ||||
-rw-r--r-- | net/isc-dhcp41-server/files/isc-dhcpd.in | 100 | ||||
-rw-r--r-- | net/isc-dhcp41-server/files/patch-server__Makefile.am | 15 | ||||
-rw-r--r-- | net/isc-dhcp41-server/pkg-deinstall | 22 | ||||
-rw-r--r-- | net/isc-dhcp41-server/pkg-plist | 3 |
6 files changed, 80 insertions, 126 deletions
diff --git a/net/isc-dhcp41-server/Makefile b/net/isc-dhcp41-server/Makefile index 9bf88aa03474..ba277c0243f0 100644 --- a/net/isc-dhcp41-server/Makefile +++ b/net/isc-dhcp41-server/Makefile @@ -6,7 +6,7 @@ # PORTNAME= dhcp -DISTVERSION= 4.1.1-P1 +DISTVERSION= 4.1.1-${PATCHLEVEL} PORTREVISION= ${DHCP_PORTREVISION} PORTEPOCH= 1 CATEGORIES= net @@ -19,7 +19,8 @@ DISTFILES= ${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX} MAINTAINER= wxs@FreeBSD.org COMMENT?= The ISC Dynamic Host Configuration Protocol server -PORTREVISION_SERVER= 0 +PATCHLEVEL= P1 +PORTREVISION_SERVER= 1 PORTREVISION_CLIENT= 0 PORTREVISION_RELAY= 0 @@ -28,7 +29,9 @@ SUBSYS?= server UNIQUENAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX} .if ${SUBSYS} == server -OPTIONS= DHCP_PARANOIA "Enable support for chroot" on +OPTIONS= DHCP_PARANOIA "Enable support for chroot" on \ + DHCP_LDAP "Experimental LDAP backend support" off \ + DHCP_LDAP_SSL "Support LDAP connection over SSL/TLS" on .endif # PORTREVISION and CONFLICTS handling @@ -61,7 +64,7 @@ MAN8= dhclient.8 dhclient-script.8 CONF_FILE= dhclient.conf .elif ${SUBSYS} == server CONFIGURE_ARGS+= --localstatedir=/var -MAN5= dhcpd.conf.5 dhcpd.leases.5 +MAN5= dhcpd.conf.5 dhcpd.leases.5 dhcp-eval.5 dhcp-options.5 MAN8= dhcpd.8 MAN1= omshell.1 MAN3= dhcpctl.3 omapi.3 @@ -91,6 +94,35 @@ REINPLACE_SUB= PREFIX="${PREFIX}" PKGMESSAGE_SUB= PREFIX="${PREFIX}" MAN1PREFIX="${MAN1PREFIX}" \ DOCSDIR="${DOCSDIR}" +.if defined(WITH_DHCP_LDAP) +MASTER_SITES+= http://cloud.github.com/downloads/dcantrell/ldap-for-dhcp/:ldap +LDAPPATCHRELEASE= 2 +LDAPPATCHDIST= ldap-for-dhcp-${PORTVERSION:S/.${PATCHLEVEL:L}$//}-${LDAPPATCHRELEASE} +LDAPPATCHFILE= dhcp-${PORTVERSION:S/.${PATCHLEVEL:L}$//}-ldap.patch +DISTFILES+= ${LDAPPATCHDIST}.tar.gz:ldap +PLIST_SUB+= SCHEMA_DIR="${SCHEMA_DIR:S,^${PREFIX}/,,}" LDAP="" +PORTDOCS+= README.ldap LICENSE.ldap +LDAP_SCRIPT= ${WRKDIR}/${LDAPPATCHDIST}/dhcpd-conf-to-ldap +LDAP_SCHEMA= ${WRKDIR}/${LDAPPATCHDIST}/dhcp.schema +USE_PERL5_RUN= yes +USE_OPENLDAP= yes +USE_AUTOTOOLS= aclocal:110 libtoolize:226 autoconf:262 autoheader:262 automake:110 +LIBTOOLIZE_ARG= --copy --force +AUTOMAKE_ARGS= --foreign --add-missing --copy +CFLAGS+= -I${PREFIX}/include -L${PREFIX}/lib +CONFIGURE_ARGS+= --with-ldap +.else +PLIST_SUB+= LDAP="@comment " +.endif + +# WITH_DHCP_LDAP_SSL without WITH_DHCP_LDAP is silly. +.if defined(WITH_DHCP_LDAP_SSL) && defined (WITH_DHCP_LDAP) +USE_OPENSSL= yes +CONFIGURE_ARGS+= --with-ldapcrypto +# hack to get bsd.openssl.mk included at this late state +.include "${PORTSDIR}/Mk/bsd.openssl.mk" +.endif + .if defined(WITH_DHCP_PARANOIA) CONFIGURE_ARGS+= --enable-paranoia --enable-early-chroot SUB_LIST+= PARANOIA=yes @@ -101,6 +133,11 @@ SUB_LIST+= PARANOIA=no post-extract: @${CP} ${FILESDIR}/client::scripts::freebsd ${WRKSRC}/client/scripts/freebsd +pre-patch: +.if ${SUBSYS} == server && defined(WITH_DHCP_LDAP) + @cd ${WRKSRC} && ${PATCH} -p1 < ${WRKDIR}/${LDAPPATCHDIST}/${LDAPPATCHFILE} +.endif + post-patch: @${SED} ${PKGMESSAGE_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ ${MSG_FILE} > ${PKGMESSAGE} @@ -115,8 +152,19 @@ do-install: ${MAKE} -C ${WRKSRC}/dst install ${MAKE} -C ${WRKSRC}/omapip install ${MAKE} -C ${WRKSRC}/includes install + ${MAKE} -C ${WRKSRC}/common install ${INSTALL_DATA} ${WRKSRC}/dhcpctl/dhcpctl.h ${PREFIX}/include .endif +.if defined(WITH_DHCP_LDAP) + @${MKDIR} ${SCHEMA_DIR} + ${INSTALL_DATA} ${LDAP_SCHEMA} ${SCHEMA_DIR} + ${INSTALL_SCRIPT} ${LDAP_SCRIPT} ${PREFIX}/bin +.endif +.if defined(WITH_DHCP_LDAP) && !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + ${INSTALL_MAN} ${WRKDIR}/${LDAPPATCHDIST}/README.ldap ${DOCSDIR} + ${INSTALL_MAN} ${WRKDIR}/${LDAPPATCHDIST}/LICENSE.ldap ${DOCSDIR} +.endif post-install: .if defined(CONF_FILE) @@ -127,6 +175,13 @@ post-install: .if ${SUBSYS} == client ${INSTALL_SCRIPT} ${WRKSRC}/client/scripts/freebsd ${PREFIX}/sbin/dhclient-script .endif + @${SED} ${PKGMESSAGE_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${MSG_FILE} > ${PKGMESSAGE} +.if defined(WITH_DHCP_LDAP) + @${REINPLACE_CMD} -e 's|^%%LDAP%%||g' ${PKGMESSAGE} +.else + @${REINPLACE_CMD} -e '/^%%LDAP%%/d' ${PKGMESSAGE} +.endif @${ECHO_MSG} @${CAT} ${PKGMESSAGE} @${ECHO_MSG} diff --git a/net/isc-dhcp41-server/distinfo b/net/isc-dhcp41-server/distinfo index c9fbd3943e64..71d20166b201 100644 --- a/net/isc-dhcp41-server/distinfo +++ b/net/isc-dhcp41-server/distinfo @@ -1,3 +1,6 @@ MD5 (dhcp-4.1.1-P1.tar.gz) = ee390a35687dd75dbfc32c856c0938d1 SHA256 (dhcp-4.1.1-P1.tar.gz) = 2f640350cbb1966ec3090198c3f128d649a3655f747f96ce910a477fe63263da SIZE (dhcp-4.1.1-P1.tar.gz) = 1085414 +MD5 (ldap-for-dhcp-4.1.1-2.tar.gz) = 9fa2f64826c969a55fd28263e4b6cad6 +SHA256 (ldap-for-dhcp-4.1.1-2.tar.gz) = 566b7be2ebefdc583d0bf0095c804ba69807b67e5cc29a2b64b1b39202b37d0d +SIZE (ldap-for-dhcp-4.1.1-2.tar.gz) = 39004 diff --git a/net/isc-dhcp41-server/files/isc-dhcpd.in b/net/isc-dhcp41-server/files/isc-dhcpd.in index c17f60c502b9..a0011bd5c1e4 100644 --- a/net/isc-dhcp41-server/files/isc-dhcpd.in +++ b/net/isc-dhcp41-server/files/isc-dhcpd.in @@ -444,48 +444,6 @@ dhcpd_stop () fi } -remove_pid () -{ - if [ -e ${_dhcpd_pidfile} ]; then - warn "${_dhcpd_pidfile} still exists! -- removing anyway" - fi - safe_remove ${_dhcpd_pidfile} -} - -remove_leases () -{ - if [ -s ${_dhcpd_leasesfile} ]; then - warn "${_dhcpd_leasesfile} not empty -- not removed --" \ - "futher warning messages expected, don't care." - else - safe_remove ${_dhcpd_leasesfile} ${_dhcpd_leasesfile}~ - fi -} - -remove_chuser () -{ - if checkyesno paranoia && { - checkyesno dhcpd_chuser_enable || checkyesno dhcpd_chroot_enable - }; then - safe_rmdir ${_dhcpd_piddir} ${_dhcpd_leasesdir} - fi -} - -remove_chroot () -{ - if checkyesno paranoia && checkyesno dhcpd_chroot_enable; then - safe_remove ${_dhcpd_conffile} ${_dhcpd_includedir} \ - ${_dhcpd_etcdir} - if checkyesno dhcpd_devfs_enable; then - safe_umount ${_dhcpd_devdir} - safe_rmdir ${_dhcpd_devdir}/_ # XXX /_ hack! - else - safe_remove ${_dhcpd_devdir} - fi - safe_rmdir ${_dhcpd_confdir} ${_dhcpd_rootdir} # XXX /_ hack! - fi -} - dhcpd_check () { check_chuser @@ -514,64 +472,6 @@ dhcpd_postcmd () cleanup_chroot } -_dhcpd_uninstall () # user group root -{ - local _user _group _root - - _user=$1 _group=$2 _root=$3 - - if [ -n "${_user}" -o -n "${_group}" ]; then - dhcpd_chuser_enable=YES - dhcpd_withuser=${_user} - dhcpd_withgroup=${_group} - else - dhcpd_chuser_enable=NO - fi - if [ -n "${_root}" ]; then - dhcpd_chroot_enable=YES - dhcpd_rootdir=${_root} - else - dhcpd_chroot_enable=NO - fi - dhcpd_check - dhcpd_rcvar - dhcpd_uninstall -} - -dhcpd_uninstall () -{ - if checkyesno __dhcpd_uninstall; then - dhcpd_stop - remove_pid - remove_leases - remove_chuser - remove_chroot - else - local _user _group _root - - __dhcpd_uninstall=YES - - _user=${dhcpd_withuser} - _group=${dhcpd_withgroup} - _root=${dhcpd_rootdir} - - _dhcpd_uninstall "" "" "" - - if checkyesno paranoia; then - if [ -n "${_user}" -o -n "${_group}" ]; then - _dhcpd_uninstall "${_user}" "${_group}" "" - fi - if [ -n "${_root}" ]; then - _dhcpd_uninstall "" "" "${_root}" - fi - if [ -n "${_user}" -o -n "${_group}" ] && - [ -n "${_root}" ]; then - _dhcpd_uninstall "${_user}" "${_group}" "${_root}" - fi - fi - fi -} - dhcpd_checkconfig () { local rc_flags_mod diff --git a/net/isc-dhcp41-server/files/patch-server__Makefile.am b/net/isc-dhcp41-server/files/patch-server__Makefile.am new file mode 100644 index 000000000000..d8d24c7376f0 --- /dev/null +++ b/net/isc-dhcp41-server/files/patch-server__Makefile.am @@ -0,0 +1,15 @@ +--- server/Makefile.am.orig 2010-07-11 21:36:46.615753042 -0400 ++++ server/Makefile.am 2010-07-11 21:37:48.559861502 -0400 +@@ -14,3 +14,12 @@ + man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5 + EXTRA_DIST = $(man_MANS) + ++install-dist_sysconfDATA: $(dist_sysconf_DATA) ++ @$(NORMAL_INSTALL) ++ test -z "$(sysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" ++ @list='$(dist_sysconf_DATA)'; for p in $$list; do \ ++ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ ++ f=$(am__strip_dir) \ ++ echo " $(dist_sysconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sysconfdir)/$$f.sample'"; \ ++ $(dist_sysconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sysconfdir)/$$f.sample"; \ ++ done diff --git a/net/isc-dhcp41-server/pkg-deinstall b/net/isc-dhcp41-server/pkg-deinstall deleted file mode 100644 index cc91547668ef..000000000000 --- a/net/isc-dhcp41-server/pkg-deinstall +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -[ $# != 2 ] && exit 1 -[ -z "${PKG_PREFIX}" ] && exit 1 -[ -n "${BATCH}" ] && exit 0 - -case $2 in -DEINSTALL) - if [ -x ${PKG_PREFIX}/etc/rc.d/isc-dhcpd ]; then - ${PKG_PREFIX}/etc/rc.d/isc-dhcpd forceuninstall - fi - ;; -POST-DEINSTALL) - ;; -*) - echo "usage: $0 <PKG_NAME> {DEINSTALL|POST-DEINSTALL}" >&2 - exit 1 - ;; -esac diff --git a/net/isc-dhcp41-server/pkg-plist b/net/isc-dhcp41-server/pkg-plist index 03eb7103e62e..c4f0a0a1a04f 100644 --- a/net/isc-dhcp41-server/pkg-plist +++ b/net/isc-dhcp41-server/pkg-plist @@ -5,6 +5,7 @@ etc/dhcpd.conf.sample @exec if [ ! -f %D/etc/dhcpd.conf ] ; then cp -p %D/%F %B/dhcpd.conf; fi sbin/dhcpd bin/omshell +%%LDAP%%bin/dhcpd-conf-to-ldap include/dhcpctl.h include/isc-dhcp/boolean.h include/isc-dhcp/dst.h @@ -28,5 +29,7 @@ include/omapip/convert.h lib/libdhcpctl.a lib/libomapi.a lib/libdst.a +%%LDAP%%%%SCHEMA_DIR%%/dhcp.schema +%%LDAP%%@dirrm %%SCHEMA_DIR%% @dirrm include/omapip @dirrm include/isc-dhcp |