aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/nagiostat/Makefile
blob: b99f81fbdf66b28b5deea0d71901099c5d87b978 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# New ports collection makefile for:	nagiostat
# Date created:			20 July 2004
# Whom:				Janos.Mohacsi@bsd.hu
#
# $FreeBSD$
#

PORTNAME=	nagiostat
PORTVERSION=	1.0.0
PORTREVISION=	1
CATEGORIES=	net-mgmt
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR=	${PORTNAME}
EXTRACT_SUFX=	.tgz

MAINTAINER=	janos.mohacsi@bsd.hu
COMMENT=	Nagiostat parses performance-data from Nagios and generates graphs

RUN_DEPENDS=	rrdtool:${PORTSDIR}/net/rrdtool \
		nagios:${PORTSDIR}/net-mgmt/nagios

USE_PERL5=	yes
NO_BUILD=	yes
NO_WRKSUBDIR=	yes
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/|' \
		-e 's|%%NAGIOSTATDIR%%|${PREFIX}/libexec/${PORTNAME}/|' \
		-e 's|%%NAGIOSTATRRD%%|${NAGIOSDIR}/${PORTNAME}rrd/|' \
		-e 's|%%PREFIX%%|${PREFIX}|' \
		${WRKSRC}/nagiostat ${WRKSRC}/nagiostat.conf ${WRKSRC}/README
do-install:
	@${MKDIR} ${PREFIX}/libexec/${PORTNAME}
	@${MKDIR} ${NAGIOSDIR}/${PORTNAME}rrd
	@${INSTALL_SCRIPT} ${WRKSRC}/nagiostat ${PREFIX}/libexec/${PORTNAME}/
	@${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}/${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/

post-install:
.if !defined(NOPORTDOCS)
	@${MKDIR} ${DOCSDIR}
.for file in ${DOC_FILES}
	@${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}
.endfor
.endif

.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>