summaryrefslogtreecommitdiff
path: root/net/mrtg/Makefile
blob: c4f66babd577635885c8ab2bbd0c7d02bef8a8b0 (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
# $NetBSD: Makefile,v 1.86 2008/02/13 12:05:26 martti Exp $

DISTNAME=	mrtg-2.16.0
#PKGREVISION=	1
CATEGORIES=	net
MASTER_SITES=	http://oss.oetiker.ch/mrtg/pub/ \
		http://oss.oetiker.ch/mrtg/pub/old/

MAINTAINER=	martti@NetBSD.org
HOMEPAGE=	http://oss.oetiker.ch/mrtg/
COMMENT=	The Multi-Router Traffic Grapher
#LICENSE=	gnu-gpl-v2

USE_TOOLS+=	perl:run
GNU_CONFIGURE=	YES

LDFLAGS+=	-lgd -lintl -ljpeg

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

.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

.include "options.mk"

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 ${PKGMANDIR}/man1 ${EGDIR}
INSTALLATION_DIRS+=	share/mrtg share/doc/mrtg

.include "../../devel/gettext-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:
	for FILE in ${WRKSRC}/doc/*.??*; do \
	  ${INSTALL_DATA} $$FILE ${PREFIX}/share/doc/mrtg; \
	done
	${INSTALL_DATA} ${WRKSRC}/doc/mrtg*.1 ${PREFIX}/${PKGMANDIR}/man1/
	for FILE in cfgmaker.1 indexmaker.1; do \
	  ${INSTALL_DATA} ${WRKSRC}/doc/$$FILE ${PREFIX}/${PKGMANDIR}/man1/mrtg$$FILE; \
	done
	for FILE in 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_INSTALLVENDORLIB}
	${INSTALL_DATA} ${WRKSRC}/lib/mrtg2/BER.pm \
	  ${WRKSRC}/lib/mrtg2/SNMP_Session.pm \
	  ${WRKSRC}/lib/mrtg2/SNMP_util.pm \
	  ${WRKSRC}/lib/mrtg2/Net_SNMP_util.pm \
	  ${WRKSRC}/lib/mrtg2/MRTG_lib.pm \
	  ${WRKSRC}/lib/mrtg2/locales_mrtg.pm \
	  ${PERL5_INSTALLVENDORLIB}
	${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"