1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-28 01:06:17 +00:00

- Add option to install Munun plugin

PR:		199798
Submitted by:	tgyurci@gmail.com
Approved by:	maintainer timeout
This commit is contained in:
Dmitry Marakasov 2015-05-18 17:44:32 +00:00
parent 20837fc7c3
commit 4ae2b42965
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=386695
3 changed files with 24 additions and 3 deletions

View File

@ -11,6 +11,7 @@ MAINTAINER= jaap@NLnetLabs.nl
COMMENT= Authoritative only non-recursive name server
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
CONFLICTS= nsd-[0-3]* nsd3-[0-9]*
@ -29,7 +30,7 @@ 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
@ -50,8 +51,9 @@ PORTDOCS= CREDITS ChangeLog LICENSE NSD-DATABASE NSD-DIFFFILE \
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
@ -63,6 +65,7 @@ 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
@ -78,6 +81,18 @@ MAXIPS_CONFIGURE_ON= --with-max-ips=${NSDMAX_IPS}
RRL_CONFIGURE_ENABLE= ratelimit
ZONE_STATS_CONFIGURE_ENABLE= zone-stats
.include <bsd.port.options.mk>
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
@ -87,5 +102,10 @@ post-install:
${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 <bsd.port.mk>

View File

@ -21,7 +21,7 @@ rcvar=nsd_enable
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}"

View File

@ -9,6 +9,7 @@ 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%%