svn commit: r347339 - head/net-mgmt/nagiosgraph

Matthew Seaman matthew at FreeBSD.org
Fri Mar 7 06:26:32 UTC 2014


Author: matthew
Date: Fri Mar  7 06:26:31 2014
New Revision: 347339
URL: http://svnweb.freebsd.org/changeset/ports/347339
QAT: https://qat.redports.org/buildarchive/r347339/

Log:
  Various updates to the nagiosgraph port:
  
    * Stagify
    * Unconditionally install docs and examples to staging
    * Fix English grammar in the comment
    * Add an option to depend on net-mgmt/nagios4 instead of net-mgmt/nagios
  
  Approved by:	hizel at vyborg.ru (maintainer)

Modified:
  head/net-mgmt/nagiosgraph/Makefile
  head/net-mgmt/nagiosgraph/pkg-plist

Modified: head/net-mgmt/nagiosgraph/Makefile
==============================================================================
--- head/net-mgmt/nagiosgraph/Makefile	Fri Mar  7 06:25:16 2014	(r347338)
+++ head/net-mgmt/nagiosgraph/Makefile	Fri Mar  7 06:26:31 2014	(r347339)
@@ -3,84 +3,99 @@
 
 PORTNAME=	nagiosgraph
 PORTVERSION=	1.4.4
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net-mgmt
 MASTER_SITES=	SF
 
 MAINTAINER=	hizel at vyborg.ru
-COMMENT=	Generate rrdtool\'s graphs by performance data from nagios plugins
+COMMENT=	Generate rrdtool graphs using performance data from nagios plugins
 
-RUN_DEPENDS=	${LOCALBASE}/bin/nagios:${PORTSDIR}/net-mgmt/nagios \
-		rrdtool>=0:${PORTSDIR}/databases/rrdtool
+RUN_DEPENDS=	rrdtool>=0:${PORTSDIR}/databases/rrdtool
 
-USES=		perl5
+OPTIONS_SINGLE=		NAGIOS
+OPTIONS_SINGLE_NAGIOS=	NAGIOS35 NAGIOS4
+OPTIONS_DEFAULT=	NAGIOS35
+
+NAGIOS35_DESC=		Install for nagios-3.5.x (net-mgmt/nagios)
+NAGIOS35_RUN_DEPENDS=	${LOCALBASE}/bin/nagios:${PORTSDIR}/net-mgmt/nagios
+
+NAGIOS4_DESC=		Install for nagios-4.0.x (net-mgmt/nagios4)
+NAGIOS4_RUN_DEPENDS=	${LOCALBASE}/bin/nagios:${PORTSDIR}/net-mgmt/nagios4
+
+USES=		perl5 shebangfix
 USE_PERL5=	run
 NO_BUILD=	yes
 
-PORTDOCS=	AUTHORS CHANGELOG INSTALL README TODO
+DOCS=		AUTHORS CHANGELOG INSTALL README TODO
 NAGIOSWWWDIR?=	www/nagios
-CGIFILES=	show.cgi showconfig.cgi showgraph.cgi showgroup.cgi showhost.cgi \
-		showservice.cgi testcolor.cgi
+CGIFILES=	show.cgi showconfig.cgi showgraph.cgi showgroup.cgi \
+		showhost.cgi showservice.cgi testcolor.cgi
 LIBFILES=	insert.pl
-CFGFILES=	nagiosgraph.conf nagiosgraph_de.conf nagiosgraph_es.conf nagiosgraph_fr.conf \
-		servdb.conf groupdb.conf hostdb.conf datasetdb.conf map access.conf labels.conf \
-		rrdopts.conf
+CFGFILES=	nagiosgraph.conf nagiosgraph_de.conf nagiosgraph_es.conf \
+		nagiosgraph_fr.conf servdb.conf groupdb.conf hostdb.conf \
+		datasetdb.conf map access.conf labels.conf rrdopts.conf
+
+SHEBANG_FILES=	 utils/*.pl
 
 PLIST_SUB=	NAGIOSWWWDIR=${NAGIOSWWWDIR} PORTNAME=${PORTNAME}
 
-NO_STAGE=	yes
 post-patch:
-	@${REINPLACE_CMD} -e 's!%%PREFIX%%!${PREFIX}!' ${WRKSRC}/etc/nagiosgraph.conf
+	@${REINPLACE_CMD} -e 's!%%PREFIX%%!${PREFIX}!' \
+		${WRKSRC}/etc/nagiosgraph.conf
 .for i in ${CGIFILES}
-	@${REINPLACE_CMD} -e 's!/usr/bin/perl!${PERL}!g' -e 's!/usr/local!${PREFIX}!g' \
-		-e 's!/opt/nagiosgraph/etc!${PREFIX}/etc/nagios/nagiosgraph!g' \
-			${WRKSRC}/cgi/$i
+	@${REINPLACE_CMD} -e 's!/usr/bin/perl!${PERL}!g' \
+	    -e 's!/usr/local!${PREFIX}!g' \
+	    -e 's!/opt/nagiosgraph/etc!${PREFIX}/etc/nagios/nagiosgraph!g' \
+		${WRKSRC}/cgi/$i
 .endfor
 
 .for i in ${LIBFILES}
-	@${REINPLACE_CMD} -e 's!/usr/bin/perl!${PERL}!g' -e 's!/usr/local!${PREFIX}!g' \
-		-e 's!/opt/nagiosgraph/etc!${PREFIX}/etc/nagios/nagiosgraph!g' \
-			${WRKSRC}/lib/$i
+	@${REINPLACE_CMD} -e 's!/usr/bin/perl!${PERL}!g' \
+	    -e 's!/usr/local!${PREFIX}!g' \
+	    -e 's!/opt/nagiosgraph/etc!${PREFIX}/etc/nagios/nagiosgraph!g' \
+		${WRKSRC}/lib/$i
 .endfor
 
 do-install:
-	${MKDIR} ${PREFIX}/etc/nagios/${PORTNAME}
-	${INSTALL_DATA} ${WRKSRC}/etc/ngshared.pm ${PREFIX}/etc/nagios/${PORTNAME}/ngshared.pm
+	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/nagios/${PORTNAME}
+	${INSTALL_DATA} ${WRKSRC}/etc/ngshared.pm \
+		${STAGEDIR}${PREFIX}/etc/nagios/${PORTNAME}/ngshared.pm
 
 .for i in ${CFGFILES}
-	${INSTALL_DATA} ${WRKSRC}/etc/$i ${PREFIX}/etc/nagios/${PORTNAME}/${i}.sample
-	[ -f ${PREFIX}/etc/nagios/${PORTNAME}/${i} ] || ${CP} -p ${PREFIX}/etc/nagios/${PORTNAME}/${i}.sample \
-		${PREFIX}/etc/nagios/${PORTNAME}/${i}
+	${INSTALL_DATA} ${WRKSRC}/etc/$i \
+		${STAGEDIR}${PREFIX}/etc/nagios/${PORTNAME}/${i}.sample
 .endfor
 
-	${MKDIR} ${PREFIX}/libexec/${PORTNAME}
+	@${MKDIR} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}
 .for i in ${LIBFILES}
-	${INSTALL_SCRIPT} ${WRKSRC}/lib/${i} ${PREFIX}/libexec/${PORTNAME}
+	${INSTALL_SCRIPT} ${WRKSRC}/lib/${i} \
+		${STAGEDIR}${PREFIX}/libexec/${PORTNAME}
 .endfor
 
-	${MKDIR} ${PREFIX}/${NAGIOSWWWDIR}/cgi-bin/${PORTNAME}
+	@${MKDIR} ${STAGEDIR}${PREFIX}/${NAGIOSWWWDIR}/cgi-bin/${PORTNAME}
 .for i in ${CGIFILES}
-	${INSTALL_SCRIPT} ${WRKSRC}/cgi/$i ${PREFIX}/${NAGIOSWWWDIR}/cgi-bin/${PORTNAME}/
+	${INSTALL_SCRIPT} ${WRKSRC}/cgi/$i \
+		${STAGEDIR}${PREFIX}/${NAGIOSWWWDIR}/cgi-bin/${PORTNAME}/
 .endfor
 
+	@${MKDIR} ${STAGEDIR}${PREFIX}/${NAGIOSWWWDIR}/stylesheets
 .for i in share/nagiosgraph.css share/nagiosgraph.js share/nagiosgraph.ssi
-	${INSTALL_DATA} ${WRKSRC}/$i ${PREFIX}/${NAGIOSWWWDIR}/stylesheets
+	${INSTALL_DATA} ${WRKSRC}/$i \
+		${STAGEDIR}${PREFIX}/${NAGIOSWWWDIR}/stylesheets/
 .endfor
 
-	${INSTALL_DATA} ${WRKSRC}/share/graph.gif ${PREFIX}/${NAGIOSWWWDIR}/images/action-nagiosgraph.gif
+	@${MKDIR} ${STAGEDIR}${PREFIX}/${NAGIOSWWWDIR}/images
+	${INSTALL_DATA} ${WRKSRC}/share/graph.gif \
+		${STAGEDIR}${PREFIX}/${NAGIOSWWWDIR}/images/action-nagiosgraph.gif
 
-.if !defined(NOPORTEXAMPLES)
-	${MKDIR} ${EXAMPLESDIR}
+	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
 .for i in utils/testentry.pl utils/upgrade.pl
-	${INSTALL_SCRIPT} ${WRKSRC}/$i ${EXAMPLESDIR}/
+	${INSTALL_SCRIPT} ${WRKSRC}/$i ${STAGEDIR}${EXAMPLESDIR}/
 .endfor
-.endif
 
-.if !defined(NOPORTDOCS)
-	${MKDIR} ${DOCSDIR}
-.  for i in ${PORTDOCS}
-	${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}/
-.  endfor
-.endif
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+.for i in ${DOCS}
+	${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR}/
+.endfor
 
 .include <bsd.port.mk>

Modified: head/net-mgmt/nagiosgraph/pkg-plist
==============================================================================
--- head/net-mgmt/nagiosgraph/pkg-plist	Fri Mar  7 06:25:16 2014	(r347338)
+++ head/net-mgmt/nagiosgraph/pkg-plist	Fri Mar  7 06:26:31 2014	(r347339)
@@ -1,41 +1,48 @@
- at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/groupdb.conf.sample %D/etc/nagios/%%PORTNAME%%/groupdb.conf; then rm -f %D/etc/nagios/%%PORTNAME%%/groupdb.conf; fi
+ at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/access.conf.sample %D/etc/nagios/%%PORTNAME%%/access.conf ; then rm -f %D/etc/nagios/%%PORTNAME%%/access.conf ; fi
+etc/nagios/%%PORTNAME%%/access.conf.sample
+ at exec [ ! -f %B/access.conf ] && cp -p %D/%F %B/access.conf || true
+ at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/datasetdb.conf.sample %D/etc/nagios/%%PORTNAME%%/datasetdb.conf ; then rm -f %D/etc/nagios/%%PORTNAME%%/datasetdb.conf ; fi
+etc/nagios/%%PORTNAME%%/datasetdb.conf.sample
+ at exec [ ! -f %B/datasetdb.conf ] && cp -p %D/%F %B/datasetdb.conf || true
+ at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/groupdb.conf.sample %D/etc/nagios/%%PORTNAME%%/groupdb.conf ; then rm -f %D/etc/nagios/%%PORTNAME%%/groupdb.conf ; fi
 etc/nagios/%%PORTNAME%%/groupdb.conf.sample
- at exec if [ ! -f %D/etc/nagios/%%PORTNAME%%/groupdb.conf ] ; then cp -p %D/%F %B/groupdb.conf; fi
- at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/hostdb.conf.sample %D/etc/nagios/%%PORTNAME%%/hostdb.conf; then rm -f %D/etc/nagios/%%PORTNAME%%/hostdb.conf; fi
+ at exec [ ! -f %B/groupdb.conf ] && cp -p %D/%F %B/groupdb.conf || true
+ at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/hostdb.conf.sample %D/etc/nagios/%%PORTNAME%%/hostdb.conf ; then rm -f %D/etc/nagios/%%PORTNAME%%/hostdb.conf ; fi
 etc/nagios/%%PORTNAME%%/hostdb.conf.sample
- at exec if [ ! -f %D/etc/nagios/%%PORTNAME%%/hostdb.conf ] ; then cp -p %D/%F %B/hostdb.conf; fi
- at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/map.sample %D/etc/nagios/%%PORTNAME%%/map; then rm -f %D/etc/nagios/%%PORTNAME%%/map; fi
+ at exec [ ! -f %B/hostdb.conf ] && cp -p %D/%F %B/hostdb.conf || true
+ at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/labels.conf.sample %D/etc/nagios/%%PORTNAME%%/labels.conf ; then rm -f %D/etc/nagios/%%PORTNAME%%/labels.conf ; fi
+etc/nagios/%%PORTNAME%%/labels.conf.sample
+ at exec [ ! -f %B/labels.conf ] && cp -p %D/%F %B/labels.conf || true
+ at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/map.sample %D/etc/nagios/%%PORTNAME%%/map ; then rm -f %D/etc/nagios/%%PORTNAME%%/map ; fi
 etc/nagios/%%PORTNAME%%/map.sample
- at exec if [ ! -f %D/etc/nagios/%%PORTNAME%%/map ] ; then cp -p %D/%F %B/map; fi
- at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/nagiosgraph.conf.sample %D/etc/nagios/%%PORTNAME%%/nagiosgraph.conf; then rm -f %D/etc/nagios/%%PORTNAME%%/nagiosgraph.conf; fi
-etc/nagios/%%PORTNAME%%/nagiosgraph.conf.sample
- at exec if [ ! -f %D/etc/nagios/%%PORTNAME%%/nagiosgraph.conf ] ; then cp -p %D/%F %B/nagiosgraph.conf; fi
- at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/nagiosgraph_de.conf.sample %D/etc/nagios/%%PORTNAME%%/nagiosgraph_de.conf; then rm -f %D/etc/nagios/%%PORTNAME%%/nagiosgraph_de.conf; fi
-etc/nagios/%%PORTNAME%%/nagiosgraph_de.conf.sample
- at exec if [ ! -f %D/etc/nagios/%%PORTNAME%%/nagiosgraph_de.conf ] ; then cp -p %D/%F %B/nagiosgraph_de.conf; fi
- at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/nagiosgraph_es.conf.sample %D/etc/nagios/%%PORTNAME%%/nagiosgraph_es.conf; then rm -f %D/etc/nagios/%%PORTNAME%%/nagiosgraph_es.conf; fi
-etc/nagios/%%PORTNAME%%/nagiosgraph_es.conf.sample
- at exec if [ ! -f %D/etc/nagios/%%PORTNAME%%/nagiosgraph_es.conf ] ; then cp -p %D/%F %B/nagiosgraph_es.conf; fi
- at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/nagiosgraph_fr.conf.sample %D/etc/nagios/%%PORTNAME%%/nagiosgraph_fr.conf; then rm -f %D/etc/nagios/%%PORTNAME%%/nagiosgraph_fr.conf; fi
-etc/nagios/%%PORTNAME%%/nagiosgraph_fr.conf.sample
- at exec if [ ! -f %D/etc/nagios/%%PORTNAME%%/nagiosgraph_fr.conf ] ; then cp -p %D/%F %B/nagiosgraph_fr.conf; fi
+ at exec [ ! -f %B/map ] && cp -p %D/%F %B/map || true
+ at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/%%PORTNAME%%.conf.sample %D/etc/nagios/%%PORTNAME%%/%%PORTNAME%%.conf ; then rm -f %D/etc/nagios/%%PORTNAME%%/%%PORTNAME%%.conf ; fi
+etc/nagios/%%PORTNAME%%/%%PORTNAME%%.conf.sample
+ at exec [ ! -f %B/%%PORTNAME%%.conf ] && cp -p %D/%F %B/%%PORTNAME%%.conf || true
+ at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/%%PORTNAME%%_de.conf.sample %D/etc/nagios/%%PORTNAME%%/%%PORTNAME%%_de.conf ; then rm -f %D/etc/nagios/%%PORTNAME%%/%%PORTNAME%%_de.conf ; fi
+etc/nagios/%%PORTNAME%%/%%PORTNAME%%_de.conf.sample
+ at exec [ ! -f %B/%%PORTNAME%%_de.conf ] && cp -p %D/%F %B/%%PORTNAME%%_de.conf || true
+ at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/%%PORTNAME%%_es.conf.sample %D/etc/nagios/%%PORTNAME%%/%%PORTNAME%%_es.conf ; then rm -f %D/etc/nagios/%%PORTNAME%%/%%PORTNAME%%_es.conf ; fi
+etc/nagios/%%PORTNAME%%/%%PORTNAME%%_es.conf.sample
+ at exec [ ! -f %B/%%PORTNAME%%_es.conf ] && cp -p %D/%F %B/%%PORTNAME%%_es.conf || true
+ at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/%%PORTNAME%%_fr.conf.sample %D/etc/nagios/%%PORTNAME%%/%%PORTNAME%%_fr.conf ; then rm -f %D/etc/nagios/%%PORTNAME%%/%%PORTNAME%%_fr.conf ; fi
+etc/nagios/%%PORTNAME%%/%%PORTNAME%%_fr.conf.sample
+ at exec [ ! -f %B/%%PORTNAME%%_fr.conf ] && cp -p %D/%F %B/%%PORTNAME%%_fr.conf || true
 etc/nagios/%%PORTNAME%%/ngshared.pm
- at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/servdb.conf.sample %D/etc/nagios/%%PORTNAME%%/servdb.conf; then rm -f %D/etc/nagios/%%PORTNAME%%/servdb.conf; fi
-etc/nagios/%%PORTNAME%%/servdb.conf.sample
- at exec if [ ! -f %D/etc/nagios/%%PORTNAME%%/servdb.conf ] ; then cp -p %D/%F %B/servdb.conf; fi
- at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/datasetdb.conf.sample %D/etc/nagios/%%PORTNAME%%/datasetdb.conf; then rm -f %D/etc/nagios/%%PORTNAME%%/datasetdb.conf; fi
-etc/nagios/%%PORTNAME%%/datasetdb.conf.sample
- at exec if [ ! -f %D/etc/nagios/%%PORTNAME%%/datasetdb.conf ] ; then cp -p %D/%F %B/datasetdb.conf; fi
- at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/access.conf.sample %D/etc/nagios/%%PORTNAME%%/access.conf; then rm -f %D/etc/nagios/%%PORTNAME%%/access.conf; fi
-etc/nagios/%%PORTNAME%%/access.conf.sample
- at exec if [ ! -f %D/etc/nagios/%%PORTNAME%%/access.conf ] ; then cp -p %D/%F %B/access.conf; fi
- at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/labels.conf.sample %D/etc/nagios/%%PORTNAME%%/labels.conf; then rm -f %D/etc/nagios/%%PORTNAME%%/labels.conf; fi
-etc/nagios/%%PORTNAME%%/labels.conf.sample
- at exec if [ ! -f %D/etc/nagios/%%PORTNAME%%/labels.conf ] ; then cp -p %D/%F %B/labels.conf; fi
- at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/rrdopts.conf.sample %D/etc/nagios/%%PORTNAME%%/rrdopts.conf; then rm -f %D/etc/nagios/%%PORTNAME%%/rrdopts.conf; fi
+ at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/rrdopts.conf.sample %D/etc/nagios/%%PORTNAME%%/rrdopts.conf ; then rm -f %D/etc/nagios/%%PORTNAME%%/rrdopts.conf ; fi
 etc/nagios/%%PORTNAME%%/rrdopts.conf.sample
- at exec if [ ! -f %D/etc/nagios/%%PORTNAME%%/rrdopts.conf ] ; then cp -p %D/%F %B/rrdopts.conf; fi
+ at exec [ ! -f %B/rrdopts.conf ] && cp -p %D/%F %B/rrdopts.conf || true
+ at unexec if cmp -s %D/etc/nagios/%%PORTNAME%%/servdb.conf.sample %D/etc/nagios/%%PORTNAME%%/servdb.conf ; then rm -f %D/etc/nagios/%%PORTNAME%%/servdb.conf ; fi
+etc/nagios/%%PORTNAME%%/servdb.conf.sample
+ at exec [ ! -f %B/servdb.conf ] && cp -p %D/%F %B/servdb.conf || true
 libexec/%%PORTNAME%%/insert.pl
+%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
+%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
+%%PORTDOCS%%%%DOCSDIR%%/INSTALL
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%%%DOCSDIR%%/TODO
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/testentry.pl
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/upgrade.pl
 %%NAGIOSWWWDIR%%/cgi-bin/%%PORTNAME%%/show.cgi
 %%NAGIOSWWWDIR%%/cgi-bin/%%PORTNAME%%/showconfig.cgi
 %%NAGIOSWWWDIR%%/cgi-bin/%%PORTNAME%%/showgraph.cgi
@@ -43,13 +50,12 @@ libexec/%%PORTNAME%%/insert.pl
 %%NAGIOSWWWDIR%%/cgi-bin/%%PORTNAME%%/showhost.cgi
 %%NAGIOSWWWDIR%%/cgi-bin/%%PORTNAME%%/showservice.cgi
 %%NAGIOSWWWDIR%%/cgi-bin/%%PORTNAME%%/testcolor.cgi
-%%NAGIOSWWWDIR%%/images/action-nagiosgraph.gif
+%%NAGIOSWWWDIR%%/images/action-%%PORTNAME%%.gif
 %%NAGIOSWWWDIR%%/stylesheets/%%PORTNAME%%.css
 %%NAGIOSWWWDIR%%/stylesheets/%%PORTNAME%%.js
 %%NAGIOSWWWDIR%%/stylesheets/%%PORTNAME%%.ssi
-%%PORTEXAMPLES%%%%EXAMPLESDIR%%/testentry.pl
-%%PORTEXAMPLES%%%%EXAMPLESDIR%%/upgrade.pl
- at dirrm libexec/%%PORTNAME%%
 @dirrmtry %%NAGIOSWWWDIR%%/cgi-bin/%%PORTNAME%%
+%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%%
+%%PORTDOCS%%@dirrmtry %%DOCSDIR%%
+ at dirrmtry libexec/%%PORTNAME%%
 @dirrmtry etc/nagios/%%PORTNAME%%
-%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%


More information about the svn-ports-head mailing list