summaryrefslogtreecommitdiffstats
path: root/net/jffnms/Makefile
blob: d8c491f6045d1d434ba38626da861baea867d398 (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
# Ports collection makefile for:  jffnms
# Date created:			  Aug 21 2003
# Whom:				  Sergey Akifyev <asa@gascom.ru>
#
# $FreeBSD$
#

PORTNAME=	jffnms
PORTVERSION=	0.7.9
CATEGORIES=	net
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR=${PORTNAME}

MAINTAINER=	asa@gascom.ru
COMMENT=	Very advanced network monitoring and control system

RUN_DEPENDS=	neato:${PORTSDIR}/graphics/graphviz \
		rrdtool:${PORTSDIR}/net/rrdtool \
		nmap:${PORTSDIR}/security/nmap \
		${LOCALBASE}/sbin/tmpwatch:${PORTSDIR}/sysutils/tmpwatch

USE_PHP=	gd snmp sockets
USE_MYSQL=	yes
USE_REINPLACE=	yes

JFFNMSDIR?=	share/jffnms
CRONTAB?=	/usr/bin/crontab

PLIST_SUB=	JFFNMSDIR=${JFFNMSDIR}

do-build:
	@${REINPLACE_CMD} -e 's|/opt/jffnms|${PREFIX}/${JFFNMSDIR}|g' \
		-e 's|/usr/bin/php|${LOCALBASE}/bin/php|g' \
		-e 's|/usr/bin/rrdtool|${LOCALBASE}/bin/rrdtool|g' \
		-e 's|/usr/bin/nmap|${LOCALBASE}/bin/nmap|g' \
		-e 's|/usr/bin/neato|${LOCALBASE}/bin/neato|g' \
		-e 's| /jffnms| /htdocs|g' \
		${WRKSRC}/conf/config.ini

do-install:
	@-${RM} ${WRKSRC}/engine/tmpwatch.sh.orig > /dev/null 2>&1
	@${MKDIR} ${PREFIX}/${JFFNMSDIR}
	@${CP} -R ${WRKSRC}/* ${PREFIX}/${JFFNMSDIR}
	@${CHOWN} -R www:www ${PREFIX}/${JFFNMSDIR}
	@${SED} -e 's|%LOCALBASE%|${PREFIX}|g' \
		-e 's|%JFFNMSDIR%|${PREFIX}/${JFFNMSDIR}|g' ${FILESDIR}/jffnms.cron \
		> ${PREFIX}/${JFFNMSDIR}/jffnms.cron
	@${SED} -e 's|%JFFNMSDIR%|${PREFIX}/${JFFNMSDIR}|g' \
		-e 's|%JFFNMS%|${DISTNAME}|g' ${FILESDIR}/jffnms_db.sh \
		> ${PREFIX}/${JFFNMSDIR}/jffnms_db.sh
	@${CRONTAB} -u www ${PREFIX}/${JFFNMSDIR}/jffnms.cron
	@${SED} -e 's|%JFFNMSDIR%|${PREFIX}/${JFFNMSDIR}|g' ${PKGMESSAGE}

#
#	!!! Maintainer only !!!
#
packinglist: pkg-plist.new
pkg-plist.new:
	@${ECHO_MSG} '---> Making ${@}'
	@${FIND} '${PREFIX}/${JFFNMSDIR}' -type f | \
		${SED} -e 's|^${PREFIX}/${JFFNMSDIR}|%%JFFNMSDIR%%|' | \
		${SORT} -t / > ${@}
	@${FIND} '${PREFIX}/${JFFNMSDIR}' -type d | \
		${SORT} -rt / | \
		${SED} -e 's|^${PREFIX}/${JFFNMSDIR}|@dirrm %%JFFNMSDIR%%|' >> ${@}
	@${ECHO} "@exec crontab -u www %%JFFNMSDIR%%/jffnms.cron" >> ${@}
	@${ECHO} "@unexec crontab -u www -l | sed 's|.*JFFNMS.*||' | crontab -u www -" >> ${@}

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