summaryrefslogtreecommitdiff
path: root/net-mgmt/nagvis/Makefile
blob: ba0eac43dfd09fdd7bc21fbabf9791b4aaac4ebd (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
# Created by: Andrew 'derfi' Sidorov <derfi@vei.ru>
# $FreeBSD$

PORTNAME=	nagvis
PORTVERSION=	1.8.5
CATEGORIES=	net-mgmt
MASTER_SITES=	http://www.nagvis.org/share/

MAINTAINER=	derfi@vei.ru
COMMENT=	Visualization addon for Nagios

LICENSE=	GPLv2

OPTIONS_DEFINE=	GRAPHVIZ
OPTIONS_SINGLE=	BROKER
OPTIONS_SINGLE_BROKER=	MKLIVESTATUS NDO2DB
OPTIONS_DEFAULT=	MKLIVESTATUS
MKLIVESTATUS_DESC=	Depend on mk-livestatus broker (preferred)
NDO2DB_DESC=	Depend on ndo2db broker
GRAPHVIZ_DESC=	Graphviz is needed for automaps

USES=		gettext
NLS_USES=	gettext
NLS_CONFIGURE_OFF=	--disable-nls

NO_BUILD=	yes
USE_PHP=	gd gettext mbstring session json pdo pdo_sqlite
WANT_PHP_WEB=	yes

.include <bsd.port.options.mk>

WWW_OWNER?=	${WWWOWN}
WWW_GROUP?=	${WWWGRP}
DIRMODE?=	750
FILEMODE?=	640

SUB_LIST+=	WWW_OWNER=${WWW_OWNER} WWW_GROUP=${WWW_GROUP} \
		DIRMODE=${DIRMODE} FILEMODE=${FILEMODE}
SUB_FILES+=	pkg-install pkg-deinstall
PLIST_SUB+=	WWWDIR="${WWWDIR}"

.if ${PORT_OPTIONS:MNDO2DB}
USE_PHP+=	mysql
RUN_DEPENDS+=	ndo2db-3x:net-mgmt/ndoutils
.endif

.if ${PORT_OPTIONS:MMKLIVESTATUS}
RUN_DEPENDS+=	mk-livestatus>=0:net-mgmt/mk-livestatus
.endif

.if ${PORT_OPTIONS:MGRAPHVIZ}
RUN_DEPENDS+=	dot:graphics/graphviz
.endif

post-extract:
	@${RM} -f ${WRKSRC}/.gitignore ${WRKSRC}/install.sh ${WRKSRC}/INSTALL

post-patch:
	@${REINPLACE_CMD} -i '' -e 's|@NAGVIS_WEB@|/nagvis|g' \
		-e 's|@NAGVIS_PATH@|${WWWDIR}|g' \
		${WRKSRC}/etc/apache2-nagvis.conf-sample
	@${REINPLACE_CMD} -i '' -e 's|/usr/local/nagvis/|${WWWDIR}/|' \
		${WRKSRC}/etc/nagvis.ini.php-sample

do-install:
	cd ${WRKSRC} && ${COPYTREE_SHARE} \* ${STAGEDIR}${WWWDIR}/
	${MKDIR} ${STAGEDIR}${WWWDIR}/etc/automaps \
		${STAGEDIR}${WWWDIR}/share/var \
		${STAGEDIR}${WWWDIR}/var/tmpl/cache \
		${STAGEDIR}${WWWDIR}/var/tmpl/compile

.include <bsd.port.mk>