summaryrefslogtreecommitdiff
path: root/net/mrtg/Makefile
blob: 84cf2ffb391fe3e7bc98fb54da2a7fd05ce956fc (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# $NetBSD: Makefile,v 1.61 2005/06/17 03:50:26 jlam Exp $

DISTNAME=	mrtg-2.11.1
PKGREVISION=	1
CATEGORIES=	net
MASTER_SITES=	http://people.ee.ethz.ch/~oetiker/webtools/mrtg/pub/ \
		ftp://ftp.sunet.se/pub/network/monitoring/mrtg/ \
		ftp://ftp.chg.ru/pub/networking/management/mrtg/ \
		ftp://ftp.mirrors.wiretapped.net/pub/mrtg/ \
		ftp://ftp.planetmirror.com/pub/oetiker/webtools/mrtg/ \
		ftp://mrtg.pop-mg.com.br/pub/mrtg/pub/ \
		ftp://ftp.130th.net/pub/mirror/mrtg/ \
		ftp://ftp.exobit.org/pub/monitoring/mrtg/ \
		ftp://ftp.azc.uam.mx/mirrors/mrtg/ \
		ftp://ftp2.cscnet.cz/pub/mirror/mrtg/ \
		ftp://ftp.unipi.it/pub/mirror/mrtg/ \
		ftp://venom.ath.cx/mirror/mrtg/ \
		ftp://ftp.heanet.ie/pub/oetiker/mrtg/ \
		ftp://ftp.nctu.edu.tw/network/mrtg/ \
		ftp://ftp.ayamura.org/pub/mrtg/ \
		ftp://mirror.nucba.ac.jp/mirror/mrtg/ \
		ftp://sunsite.icm.edu.pl/pub/unix/net/mrtg/ \
		ftp://net2b.co.pt/pub/mrtg/

MAINTAINER=	bouyer@NetBSD.org
HOMEPAGE=	http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html
COMMENT=	The Multi-Router Traffic Grapher

USE_PERL5=	YES
PERL5_REQD+=	5.6.1
GNU_CONFIGURE=	YES
USE_PKGINSTALL=	YES

BUILD_DEFS+=	USE_INET6
LDFLAGS+=	-lgd -lttf -lintl -ljpeg

.include "../../mk/bsd.prefs.mk"

.if defined(USE_INET6) && ${USE_INET6} == "YES"
.include "../../net/p5-INET6/buildlink3.mk"
.endif

.if ${OPSYS} == "SunOS"
CONFIGURE_ARGS+=	--with-z-lib=${LOCALBASE}/lib
CONFIGURE_ARGS+=	--with-z-inc=${LOCALBASE}/include
CONFIGURE_ARGS+=	--with-png-lib=${LOCALBASE}/lib
CONFIGURE_ARGS+=	--with-png-inc=${LOCALBASE}/include
.endif

REPLACE_PERL=	bin/cfgmaker bin/indexmaker bin/mrtg
EGDIR=		${PREFIX}/share/examples/${PKGBASE}

CONF_FILES=	${EGDIR}/mrtg.conf ${PKG_SYSCONFDIR}/mrtg.conf

SUBST_CLASSES+=		files
SUBST_STAGE.files=	post-patch
SUBST_FILES.files=	../mrtg.conf.example ../netstat2mrtg		\
			../sys2mrtg ../envstat2mrtg	
SUBST_SED.files=	-e "s|@PREFIX@|${PREFIX}|g"
SUBST_MESSAGE.files=	"Fixing default configuration files."

INSTALLATION_DIRS=	bin libexec man/man1

.include "../../graphics/freetype-lib/buildlink3.mk"
.include "../../graphics/gd/buildlink3.mk"

post-extract:
	@${CP} ${FILESDIR}/mrtg.conf.example ${WRKDIR}
	@${CP} ${FILESDIR}/netstat2mrtg ${WRKDIR}
	@${CP} ${FILESDIR}/sys2mrtg ${WRKDIR}
	@${CP} ${FILESDIR}/envstat2mrtg ${WRKDIR}

do-install:
	${INSTALL_DATA_DIR} ${EGDIR}
	${INSTALL_DATA_DIR} ${PREFIX}/share/mrtg
	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/mrtg
	for FILE in ${WRKSRC}/doc/*.??*; do \
	  ${INSTALL_DATA} $$FILE ${PREFIX}/share/doc/mrtg; \
	done
	${INSTALL_DATA} ${WRKSRC}/doc/mrtg*.1 ${PREFIX}/man/man1/
	for FILE in cfgmaker.1 indexmaker.1; do \
	  ${INSTALL_DATA} ${WRKSRC}/doc/$$FILE ${PREFIX}/man/man1/mrtg$$FILE; \
	done
	for FILE in ANNOUNCE CHANGES COPYING COPYRIGHT README; do \
	  ${INSTALL_DATA} ${WRKSRC}/$$FILE ${PREFIX}/share/doc/mrtg; \
	done
	for FILE in ${WRKSRC}/images/*.png; do \
	  ${INSTALL_DATA} $$FILE ${PREFIX}/share/mrtg; \
	done
	${INSTALL_DATA} ${WRKDIR}/mrtg.conf.example ${EGDIR}/mrtg.conf
	for FILE in netstat2mrtg sys2mrtg envstat2mrtg; do \
	  ${INSTALL_SCRIPT} ${WRKDIR}/$$FILE ${PREFIX}/libexec; \
	done
	${INSTALL_DATA_DIR} ${PERL5_SITELIB}
	${INSTALL_SCRIPT} ${WRKSRC}/lib/mrtg2/BER.pm \
	  ${WRKSRC}/lib/mrtg2/SNMP_Session.pm \
	  ${WRKSRC}/lib/mrtg2/SNMP_util.pm \
	  ${WRKSRC}/lib/mrtg2/MRTG_lib.pm \
	  ${WRKSRC}/lib/mrtg2/locales_mrtg.pm \
	  ${PERL5_SITELIB}
	${INSTALL_PROGRAM} ${WRKSRC}/bin/rateup ${PREFIX}/libexec/
	${INSTALL_SCRIPT} ${WRKSRC}/bin/mrtg ${PREFIX}/bin/
	for FILE in cfgmaker indexmaker; do \
	  ${INSTALL_SCRIPT} ${WRKSRC}/bin/$$FILE ${PREFIX}/bin/mrtg$$FILE; \
	done

.include "../../mk/bsd.pkg.mk"