Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 May 2004 14:56:05 +0000 (GMT)
From:      Olafur Osvaldsson <oli@isnic.is>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/67297: dns/nsd: Adding rc script and options to Makefile
Message-ID:  <20040528145605.42AD9942CB@aker.isnic.is>
Resent-Message-ID: <200405281500.i4SF0gk7070076@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         67297
>Category:       ports
>Synopsis:       dns/nsd: Adding rc script and options to Makefile
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 28 08:00:42 PDT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Olafur Osvaldsson
>Release:        FreeBSD 5.2.1-RELEASE-p4 i386
>Organization:
ISNIC
>Environment:
System: FreeBSD aker.isnic.is 5.2.1-RELEASE-p4 FreeBSD 5.2.1-RELEASE-p4 #6: Wed Mar 31 09:08:35 GMT 2004 oli@aker.isnic.is:/usr/obj/usr/src/sys/HP360 i386


	
>Description:
	
I added a download host for redundancy.

Made it possible for users to customise the install like a normal
nsd compile/install would allow them.

Added a rc script.
>How-To-Repeat:
	
>Fix:

	

--- nsd.diff begins here ---
diff -ruN nsd.orig/Makefile nsd/Makefile
--- nsd.orig/Makefile	Thu May 27 11:48:46 2004
+++ nsd/Makefile	Fri May 28 14:51:19 2004
@@ -2,30 +2,98 @@
 # Date created:				08 August 2002
 # Whom:					alexis
 #
-# $FreeBSD: ports/dns/nsd/Makefile,v 1.12 2004/05/27 07:51:57 vs Exp $
+# $FreeBSD: ports/dns/nsd/Makefile,v 1.11 2004/05/15 14:21:47 vs Exp $
 #
 
 PORTNAME=	nsd
 PORTVERSION=	2.1.0
 CATEGORIES=	dns ipv6
-MASTER_SITES=	http://www.nlnetlabs.nl/downloads/nsd/
+MASTER_SITES=	http://www.nlnetlabs.nl/downloads/nsd/	\
+		ftp://ftp.rhnet.is/pub/nsd/
 
 MAINTAINER=	oli@isnic.is
 COMMENT=	An authoritative only non-recursive high performance name server
 
+USE_RC_SUBR=	yes
+
+NSDUSER?=	bind
+NSDDIR?=	${PREFIX}/etc/nsd
+NSDDBFILE?=	/var/db/nsd.database
+NSDXFER?=	/usr/libexec/named-xfer
+
 GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--with-user=bind \
-		--enable-ipv6 \
-		--with-configdir=${PREFIX}/etc/nsd \
+CONFIGURE_ARGS=	--with-user=${NSDUSER} \
+		--with-configdir=${NSDDIR} \
 		--with-pidfile=/var/run/nsd.pid \
-		--with-dbfile=/var/db/nsd.database \
-		--with-namedxfer=/usr/libexec/named-xfer \
+		--with-dbfile=${NSDDBFILE} \
+		--with-namedxfer=${NSDXFER} \
 		--with-libwrap
 
+.if defined(DISABLE_IPV6)
+CONFIGURE_ARGS+=	--disable-ipv6
+.endif
+
+.if defined(DISABLE_AXFR)
+CONFIGURE_ARGS+=	--disable-axfr
+.endif
+
+.if defined(ENABLE_PLUGINS)
+CONFIGURE_ARGS+=	--enable-plugins
+.endif
+
+.if defined(ENABLE_BIND8_STATS)
+CONFIGURE_ARGS+=	--enable-bind8-stats
+.endif
+
+.if defined(ENABLE_DNSSEC)
+CONFIGURE_ARGS+=	--enable-dnssec
+.endif
+
+.if defined(ENABLE_ROOT_SERVER)
+CONFIGURE_ARGS+=	--enable-root-server
+.endif
+
+.if defined(ENABLE_MMAP)
+CONFIGURE_ARGS+=	--enable-mmap
+.endif
+
+SED_SCRIPT=	-e 's,%%NSDUSER%%,${NSDUSER},g' \
+		-e 's,%%NSDDIR%%,${NSDDIR},g' \
+		-e 's,%%PREFIX%%,${PREFIX},g' \
+		-e 's,%%RC_SUBR%%,${RC_SUBR},g'
+
 MAN8=	nsd.8 zonec.8 nsdc.8 nsd-notify.8
 
+PORTDOCS=	README RELNOTES CREDITS DIFFERENCES REQUIREMENTS
+
+pre-everything::
+	@${ECHO_MSG} ""
+	@${ECHO_MSG} "nsd has the following tunables:"
+	@${ECHO_MSG} ""
+	@${ECHO_MSG} "  DISABLE_IPV6		Disables IPv6 support"
+	@${ECHO_MSG} "  DISABLE_AXFR		Disables AXFR"
+	@${ECHO_MSG} ""
+	@${ECHO_MSG} "  ENABLE_PLUGINS	Enable plugin support"
+	@${ECHO_MSG} "  ENABLE_BIND8_STATS	Enables BIND8 like NSTATS & XSTATS"
+	@${ECHO_MSG} "  ENABLE_DNSSEC		Enable experimental DNSSEC support"
+	@${ECHO_MSG} "			according to the latest drafts"
+	@${ECHO_MSG} "  ENABLE_ROOT_SERVER	Configure NSD as a root server"
+	@${ECHO_MSG} "  ENABLE_MMAP		Configure NSD to load the database using mmap(2)"
+	@${ECHO_MSG} ""
+
+pre-build:
+
 post-install:
+	${SED} ${SED_SCRIPT} < ${FILESDIR}/nsd.sh.tmpl >${WRKDIR}/nsd.sh
+.if !defined(NOPORTDOCS)
+	@${MKDIR} ${DOCSDIR}
+.for f in ${PORTDOCS}
+	${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
+.endfor
+.endif
 	${INSTALL_DATA} ${WRKSRC}/nsd.zones.sample \
 		${PREFIX}/etc/nsd/nsd.zones.sample
+	${INSTALL_SCRIPT} ${WRKDIR}/nsd.sh ${PREFIX}/etc/rc.d/
+	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.mk>
diff -ruN nsd.orig/files/nsd.sh.tmpl nsd/files/nsd.sh.tmpl
--- nsd.orig/files/nsd.sh.tmpl	Thu Jan  1 00:00:00 1970
+++ nsd/files/nsd.sh.tmpl	Thu May 27 13:03:43 2004
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: nsd
+# REQUIRE: DAEMON
+# KEYWORD: FreeBSD
+#
+# Add the following line to /etc/rc.conf to enable nsd:
+#
+# nsd_enable="YES"
+#
+
+. %%RC_SUBR%%
+
+name=nsd
+rcvar=`set_rcvar`
+
+prefix=%%PREFIX%%
+
+required_files=%%NSDDIR%%/nsd.zones
+
+command=/usr/local/sbin/${name}
+pidfile=/var/run/${name}.pid
+
+# set defaults
+
+nsd_enable=${nsd_enable:-"NO"}
+nsd_flags=${nsd_flags:-""}
+
+load_rc_config ${name}
+run_rc_command "$1"
+
diff -ruN nsd.orig/pkg-message nsd/pkg-message
--- nsd.orig/pkg-message	Thu Jan  1 00:00:00 1970
+++ nsd/pkg-message	Fri May 28 14:47:46 2004
@@ -0,0 +1,5 @@
+**************************************************************************
+*                                                                        *
+*   To run nsd from startup, add nsd_enable="YES" to your /etc/rc.conf   *
+*                                                                        *
+**************************************************************************
diff -ruN nsd.orig/pkg-plist nsd/pkg-plist
--- nsd.orig/pkg-plist	Sun Aug  3 00:51:14 2003
+++ nsd/pkg-plist	Fri May 28 14:44:58 2004
@@ -1,8 +1,9 @@
 @comment $FreeBSD: ports/dns/nsd/pkg-plist,v 1.2 2003/08/03 00:51:14 naddy Exp $
+etc/rc.d/nsd.sh
+etc/nsd/nsd.zones.sample
+etc/nsd/nsdc.conf.sample
 sbin/nsd
+sbin/nsd-notify
 sbin/nsdc
 sbin/zonec
-sbin/nsd-notify
-etc/nsd/nsd.zones.sample
-etc/nsd/nsdc.conf.sample
 @dirrm etc/nsd
--- nsd.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040528145605.42AD9942CB>