Index: head/dns/nsd/Makefile =================================================================== --- head/dns/nsd/Makefile (revision 386694) +++ head/dns/nsd/Makefile (revision 386695) @@ -1,91 +1,111 @@ # Created by: alexis # $FreeBSD$ PORTNAME= nsd PORTVERSION= 4.1.2 CATEGORIES= dns ipv6 MASTER_SITES= http://www.nlnetlabs.nl/downloads/nsd/ \ ftp://ftp.rhnet.is/pub/nsd/ MAINTAINER= jaap@NLnetLabs.nl COMMENT= Authoritative only non-recursive name server LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE CONFLICTS= nsd-[0-3]* nsd3-[0-9]* USES= cpe CPE_VENDOR= nlnetlabs USE_RC_SUBR= nsd NSDUSER?= nsd NSDGROUP?= nsd NSDLSDIR= /var NSDDBDIR= /var/db/nsd NSDRUNDIR= /var/run/nsd NSDMAX_IPS?= 512 GNU_CONFIGURE= yes CONFIGURE_ARGS= --with-libevent=${LOCALBASE} \ --with-user=${NSDUSER} \ - --with-configdir=${PREFIX}/etc/nsd \ + --with-configdir=${ETCDIR} \ --localstatedir=${NSDLSDIR} \ --with-dbfile=${NSDDBDIR}/nsd.db \ --with-pidfile=${NSDRUNDIR}/nsd.pid PLIST_SUB= NSDUSER=${NSDUSER} \ NSDGROUP=${NSDGROUP} \ NSDDBDIR=${NSDDBDIR} \ NSDRUNDIR=${NSDRUNDIR} USERS= ${NSDUSER} GROUPS= ${NSDGROUP} USE_OPENSSL= yes PORTDOCS= CREDITS ChangeLog LICENSE NSD-DATABASE NSD-DIFFFILE \ NSD-4-features NSD-FOR-BIND-USERS README README.icc RELNOTES \ REQUIREMENTS TESTPLAN TODO UPGRADING coding-style \ differences.tex OPTIONS_DEFINE= ROOT_SERVER LARGEFILE IPV6 BIND8_STATS CHECKING \ - MINRESPSIZE NSEC3 MMAP MAXIPS DOCS RRL ZONE_STATS + MINRESPSIZE NSEC3 MMAP MAXIPS DOCS RRL ZONE_STATS MUNIN_PLUGIN OPTIONS_DEFAULT= LARGEFILE IPV6 NSEC3 MINRESPSIZE RRL +OPTIONS_SUB= yes ROOT_SERVER_DESC= Configure as a root server LARGEFILE_DESC= Largefile support BIND8_STATS_DESC= BIND8-like NSTATS & XSTATS CHECKING_DESC= Internal run-time checks NSEC3_DESC= NSEC3 support MINRESPSIZE_DESC= Minimial response sizing MMAP_DESC= Use mmap instead of malloc (experimental) MAXIPS_DESC= Raise max-ips from 8 to ${NSDMAX_IPS} RRL_DESC= Response Rate Limiting ZONE_STATS_DESC= Separate statistics for each zone +MUNIN_PLUGIN_DESC= Install Munin plugin (requires BIND8_STATS) LIB_DEPENDS+= libevent.so:${PORTSDIR}/devel/libevent2 ROOT_SERVER_CONFIGURE_ENABLE= root-server LARGEFILE_CONFIGURE_ENABLE= largefile IPV6_CONFIGURE_ENABLE= ipv6 BIND8_STATS_CONFIGURE_ENABLE= bind8-stats CHECKING_CONFIGURE_ENABLE= checking NSEC3_CONFIGURE_ENABLE= nsec3 MINRESPSIZE_CONFIGURE_ENABLE= minimal-responses MMAP_CONFIGURE_ENABLE= mmap MAXIPS_CONFIGURE_ON= --with-max-ips=${NSDMAX_IPS} RRL_CONFIGURE_ENABLE= ratelimit ZONE_STATS_CONFIGURE_ENABLE= zone-stats +.include + +post-build: +.if ${PORT_OPTIONS:MMUNIN_PLUGIN} + ${REINPLACE_CMD} \ + -e 's|/usr/local|${LOCALBASE}|g' \ + -e 's|/usr/local/etc/nsd.conf|${ETCDIR}/nsd.conf|g' \ + -e 's|/usr/local/var/munin/plugin-state|/var/munin/plugin-state/root|g' \ + -e '90s|/var/munin/plugin-state/root|$${MUNIN_PLUGSTATE}|' \ + ${WRKSRC}/contrib/nsd_munin_ +.endif + post-install: ${INSTALL_DATA} ${WRKSRC}/nsd.conf.sample \ ${STAGEDIR}${PREFIX}/etc/nsd/nsd.conf.sample @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/doc/|} ${STAGEDIR}${DOCSDIR} ${STRIP_CMD} ${STAGEDIR}${PREFIX}/sbin/nsd \ ${STAGEDIR}${PREFIX}/sbin/nsd-checkconf \ ${STAGEDIR}${PREFIX}/sbin/nsd-checkzone \ ${STAGEDIR}${PREFIX}/sbin/nsd-control +.if ${PORT_OPTIONS:MMUNIN_PLUGIN} + @${MKDIR} ${STAGEDIR}${PREFIX}/share/munin/plugins + ${INSTALL_SCRIPT} ${WRKSRC}/contrib/nsd_munin_ \ + ${STAGEDIR}${PREFIX}/share/munin/plugins +.endif .include Index: head/dns/nsd/files/nsd.in =================================================================== --- head/dns/nsd/files/nsd.in (revision 386694) +++ head/dns/nsd/files/nsd.in (revision 386695) @@ -1,34 +1,34 @@ #!/bin/sh # # $FreeBSD$ # # PROVIDE: nsd # REQUIRE: DAEMON # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following line to /etc/rc.conf to enable nsd: # # nsd_enable="YES" # . /etc/rc.subr name=nsd rcvar=nsd_enable # read settings, set default values load_rc_config "${name}" : ${nsd_enable="NO"} -config=${nsd_config:=%%PREFIX%%/etc/nsd/nsd.conf} +config=${nsd_config:=%%ETCDIR%%/nsd.conf} required_files=${config} pidfile=`%%PREFIX%%/sbin/nsd-checkconf -f -o pidfile ${config}` command="%%PREFIX%%/sbin/${name}" command_args="-c ${required_files}" extra_commands="reload" load_rc_config $name run_rc_command "$1" Index: head/dns/nsd/pkg-plist =================================================================== --- head/dns/nsd/pkg-plist (revision 386694) +++ head/dns/nsd/pkg-plist (revision 386695) @@ -1,15 +1,16 @@ %%ETCDIR%%/nsd.conf.sample man/man5/nsd.conf.5.gz man/man8/nsd-checkconf.8.gz man/man8/nsd-checkzone.8.gz man/man8/nsd-control.8.gz man/man8/nsd.8.gz sbin/nsd sbin/nsd-checkconf sbin/nsd-checkzone sbin/nsd-control sbin/nsd-control-setup +%%MUNIN_PLUGIN%%share/munin/plugins/nsd_munin_ @dir(%%NSDUSER%%,%%NSDGROUP%%,0755) %%NSDRUNDIR%% @dir(%%NSDUSER%%,%%NSDGROUP%%,0755) %%NSDDBDIR%% @exec chown -R %%NSDUSER%%:%%NSDGROUP%% %%NSDRUNDIR%% @exec chown -R %%NSDUSER%%:%%NSDGROUP%% %%NSDDBDIR%%