From t@nakao.org  Tue Feb  7 07:14:15 2006
Return-Path: <t@nakao.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1253E16A422
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  7 Feb 2006 07:14:15 +0000 (GMT)
	(envelope-from t@nakao.org)
Received: from jodo.ipboot.net (jodo.ipboot.net [202.178.100.5])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A032243D46
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  7 Feb 2006 07:14:14 +0000 (GMT)
	(envelope-from t@nakao.org)
Received: from localhost (localhost [127.0.0.1])
	by jodo.ipboot.net (Postfix) with ESMTP id B86D239986
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  7 Feb 2006 16:14:12 +0900 (JST)
Received: from jodo.ipboot.net ([127.0.0.1])
 by localhost (jodo.ipboot.net [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 07660-06 for <FreeBSD-gnats-submit@freebsd.org>;
 Tue,  7 Feb 2006 16:14:10 +0900 (JST)
Received: from localhost (localhost [IPv6:::1])
	by jodo.ipboot.net (Postfix) with ESMTP id 2F1D539971
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  7 Feb 2006 16:14:10 +0900 (JST)
Message-Id: <20060207.161410.00366242.nakao@nict.go.jp>
Date: Tue, 07 Feb 2006 16:14:10 +0900 (JST)
From: Takayuki Nakao <t@nakao.org>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Update ports: net-mgmt/nagiostat

>Number:         92944
>Category:       ports
>Synopsis:       Update ports: net-mgmt/nagiostat
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 07 07:20:05 GMT 2006
>Closed-Date:    Sat Apr 01 22:41:01 GMT 2006
>Last-Modified:  Sat Apr 01 22:41:01 GMT 2006
>Originator:     Takayuki Nakao <t@nakao.org>
>Release:        
>Organization:
>Environment:
>Description:
As of Jan 28th 2006, this port was marked as BROKEN.
I requested a fix to original maintainer <janos.mohacsi@bsd.hu> with
the attached patch, but I did not receive any reply from him/her for a
week. Thus I submit this PR by myself!

Following bug fixes are included in this patch;
- Destination directory where nagiostat.cgi and graph.gif are
  installed was not consistent with the default installation directory
  of a port net-mgmt/nagios.
  Now, the destination directory is configurable by NAGIOSWWWDIR variable.
- Unnecessary dependency to a port www/p5-CGI is deleted.


>How-To-Repeat:
>Fix:
The recursive diff is attached below;

diff -ruN nagiostat.orig/Makefile nagiostat/Makefile
--- nagiostat.orig/Makefile	Tue Feb  7 15:52:29 2006
+++ nagiostat/Makefile	Tue Feb  7 15:52:41 2006
@@ -16,10 +16,7 @@
 COMMENT=	Nagiostat parses performance-data from Nagios and generates graphs
 
 RUN_DEPENDS=	rrdtool:${PORTSDIR}/net/rrdtool \
-		nagios:${PORTSDIR}/net-mgmt/nagios \
-		${SITE_PERL}/CGI.pm:${PORTSDIR}/www/p5-CGI.pm
-
-BROKEN=		Does not install
+		nagios:${PORTSDIR}/net-mgmt/nagios
 
 USE_PERL5=	yes
 NO_BUILD=	yes
@@ -28,6 +25,9 @@
 NAGIOSDIR?=	/var/spool/nagios
 DOC_FILES=	README GPL.txt
 
+NAGIOSWWWDIR?=	www/nagios
+PLIST_SUB+=	NAGIOSWWWDIR=${NAGIOSWWWDIR}
+
 post-patch:
 	@${REINPLACE_CMD} \
 		-e 's|%%NAGIOSTATCONFDIR%%|${PREFIX}/etc/|' \
@@ -39,9 +39,9 @@
 	@${MKDIR} ${PREFIX}/libexec/${PORTNAME}
 	@${MKDIR} ${NAGIOSDIR}/${PORTNAME}rrd
 	@${INSTALL_SCRIPT} ${WRKSRC}/nagiostat ${PREFIX}/libexec/${PORTNAME}/
-	@${LN} -fs ${PREFIX}/libexec/${PORTNAME}/nagiostat ${PREFIX}/share/nagios/cgi-bin/nagiostat.cgi
+	@${LN} -fs ${PREFIX}/libexec/${PORTNAME}/nagiostat ${PREFIX}/${NAGIOSWWWDIR}/cgi-bin/nagiostat.cgi
 	@${INSTALL_DATA} ${WRKSRC}/nagiostat.conf ${PREFIX}/etc/nagiostat.conf-sample
-	@${INSTALL_DATA} ${WRKSRC}/graph.gif ${PREFIX}/share/nagios/images/logos
+	@${INSTALL_DATA} ${WRKSRC}/graph.gif ${PREFIX}/${NAGIOSWWWDIR}/images/logos
 	@${MKDIR} ${PREFIX}/libexec/${PORTNAME}/html-templates/
 	@${INSTALL_DATA} ${WRKSRC}/html-templates/default.html ${PREFIX}/libexec/${PORTNAME}/html-templates/
 	@${INSTALL_DATA} ${WRKSRC}/html-templates/graphindex.html ${PREFIX}/libexec/${PORTNAME}/html-templates/
@@ -54,4 +54,10 @@
 .endfor
 .endif
 
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+.if ${PERL_LEVEL} < 500800
+RUN_DEPENDS+=	${SITE_PERL}/CGI.pm:${PORTSDIR}/www/p5-CGI.pm
+.endif
+
+.include <bsd.port.post.mk>
diff -ruN nagiostat.orig/pkg-plist nagiostat/pkg-plist
--- nagiostat.orig/pkg-plist	Tue Feb  7 15:52:29 2006
+++ nagiostat/pkg-plist	Tue Feb  7 15:52:41 2006
@@ -3,11 +3,11 @@
 @exec chown nagios:nagios /var/spool/nagios/nagiostatrrd
 @unexec rmdir /var/spool/nagios/nagiostatrrd 2>/dev/null || true
 etc/nagiostat.conf-sample
-share/nagios/cgi-bin/nagiostat.cgi
+%%NAGIOSWWWDIR%%/cgi-bin/nagiostat.cgi
 libexec/nagiostat/nagiostat
 libexec/nagiostat/html-templates/default.html
 libexec/nagiostat/html-templates/graphindex.html
-share/nagios/images/logos/graph.gif
+%%NAGIOSWWWDIR%%/images/logos/graph.gif
 %%PORTDOCS%%%%DOCSDIR%%/README
 %%PORTDOCS%%%%DOCSDIR%%/GPL.txt
 @dirrm libexec/nagiostat/html-templates
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Tue Feb 7 07:24:11 UTC 2006 
State-Changed-Why:  
Awaiting maintainers feedback 

http://www.freebsd.org/cgi/query-pr.cgi?pr=92944 

From: Janos Mohacsi <mohacsi@niif.hu>
To: bug-followup@FreeBSD.org, t@nakao.org
Cc:  
Subject: Re: ports/92944: Update ports: net-mgmt/nagiostat
Date: Wed, 22 Feb 2006 11:41:19 +0100

 I approve the patch. Thank you for submitting it
 Janos Mohacsi
State-Changed-From-To: feedback->closed 
State-Changed-By: pav 
State-Changed-When: Sat Apr 1 22:40:53 UTC 2006 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=92944 
>Unformatted:
