summaryrefslogtreecommitdiffstats
path: root/net-mgmt/ifgraph/Makefile
blob: 144420a3c483f983a5564724cb1d6673100956bb (plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# New ports collection makefile for:	ifgraph
# Date created:				Sep 18 2003
# Whom:                                 Lars Thegler <lars@thegler.dk>
#
# $FreeBSD$
#

PORTNAME=	ifgraph
PORTVERSION=	0.4.9
CATEGORIES=	net-mgmt www
MASTER_SITES=	http://ifgraph.sourceforge.net/stable/

MAINTAINER=	lars@thegler.dk
COMMENT=	Simple grapher of SNMP data with RRD

RUN_DEPENDS=	rrdtool:${PORTSDIR}/net/rrdtool

USE_PERL5=	yes
NO_BUILD=	yes

PKGMESSAGE=	${WRKDIR}/pkg-message
PKGINSTALL=	${WRKDIR}/pkg-install
PKGDEINSTALL=	${WRKDIR}/pkg-deinstall

IFGRAPH_USER=	ifgraph
IFGRAPH_GROUP=	ifgraph

PLFILES=	find-if.pl ifgraph.pl makegraph.pl
DOCFILES=	CHANGELOG INSTALACAO INSTALL TODO LICENSE.TXT MUDANCAS

FILES_SUB=	USER=${IFGRAPH_USER} GROUP=${IFGRAPH_GROUP} \
		PREFIX=${PREFIX} DOCSDIR=${DOCSDIR}

pre-install:
	@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
		${PKGDIR}/pkg-install > ${PKGINSTALL}
	@ ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL

do-install:
	@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
		${PKGDIR}/pkg-deinstall > ${PKGDEINSTALL}
	@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
		${PKGDIR}/pkg-message > ${PKGMESSAGE}
.for plfile in ${PLFILES}
	@ ${INSTALL_SCRIPT} ${WRKSRC}/${plfile} ${PREFIX}/bin
.endfor
	@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
		${WRKSRC}/ifgraph.conf > ${WRKSRC}/ifgraph.conf.sample
	@ ${INSTALL_DATA} ${WRKSRC}/ifgraph.conf.sample ${PREFIX}/etc
	@ ${MKDIR} ${PREFIX}/ifgraph
	@ ${MKDIR} ${PREFIX}/ifgraph/htdocs
	@ ${CP} -Rp ${WRKSRC}/templates ${PREFIX}/ifgraph
	@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
		${FILESDIR}/crontab.in > ${PREFIX}/ifgraph/crontab.in
	@ ${CHOWN} -R ifgraph:ifgraph ${PREFIX}/ifgraph
	@ ${MKDIR} ${PREFIX}/var/ifgraph
	@ ${CHOWN} ifgraph:ifgraph ${PREFIX}/var/ifgraph
.if !defined(NOPORTDOCS)
	@ ${MKDIR} ${DOCSDIR}
.for docfile in ${DOCFILES}
	@ ${INSTALL_DATA} ${WRKSRC}/${docfile} ${DOCSDIR}
.endfor
.endif

post-install:
	@ ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.if !defined(BATCH)
	@ ${CAT} ${PKGMESSAGE}
.endif

.include <bsd.port.pre.mk>

.if ${PERL_LEVEL} < 500600
RUN_DEPENDS+=	${SITE_PERL}/Net/SNMP.pm:${PORTSDIR}/net-mgmt/p5-Net-SNMP3
.else
RUN_DEPENDS+=	${SITE_PERL}/Net/SNMP.pm:${PORTSDIR}/net-mgmt/p5-Net-SNMP
.endif

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud