aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/netdot/Makefile
blob: e3bdac514e39bcc8f92112e54ee3df048889553b (plain) (blame)
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
PORTNAME=	netdot
PORTVERSION=	1.0.7
DISTVERSIONPREFIX=	${PORTNAME}-
PORTREVISION=	4
CATEGORIES=	net-mgmt

MAINTAINER=	nick@foobar.org
COMMENT=	Open source tool to organize and maintain network information
WWW=		https://github.com/cvicente/Netdot/

LICENSE=	GPLv2

RUN_DEPENDS=	p5-libapreq2>=0:www/p5-libapreq2 \
		mp2bug:www/mod_perl2 \
		p5-Apache-Session>=1.6:www/p5-Apache-Session \
		p5-Apache-AuthCookie>=0:www/p5-Apache-AuthCookie \
		p5-Apache2-SiteControl>=1.0:www/p5-Apache2-SiteControl \
		p5-URI>=0:net/p5-URI \
		p5-DBD-mysql>=0:databases/p5-DBD-mysql \
		p5-SQL-Translator>=0.07:databases/p5-SQL-Translator \
		p5-Class-DBI>=3.0.17:databases/p5-Class-DBI \
		p5-Class-DBI-AbstractSearch>=0:databases/p5-Class-DBI-AbstractSearch \
		p5-SNMP-Info>=2.06:net-mgmt/p5-SNMP-Info \
		p5-HTML-Mason>=1.31:www/p5-HTML-Mason \
		p5-Log-Dispatch>=0:devel/p5-Log-Dispatch \
		p5-Log-Log4perl>=0:devel/p5-Log-Log4perl \
		p5-Parallel-ForkManager>=0:devel/p5-Parallel-ForkManager \
		p5-Net-IRR>=0:net/p5-Net-IRR \
		p5-NetAddr-IP>=4.042:net-mgmt/p5-NetAddr-IP \
		p5-Net-Patricia>=1.20:net/p5-Net-Patricia \
		p5-Net-Appliance-Session>=3.113610:net/p5-Net-Appliance-Session \
		p5-Net-DNS>=0:dns/p5-Net-DNS \
		p5-Net-DNS-ZoneFile-Fast>=1.12:dns/p5-Net-DNS-ZoneFile-Fast \
		p5-BIND-Config-Parser>=0:dns/p5-BIND-Config-Parser \
		p5-Carp-Assert>=0:devel/p5-Carp-Assert \
		p5-XML-Simple>=0:textproc/p5-XML-Simple \
		p5-Socket6>=0:net/p5-Socket6 \
		p5-GraphViz>=2.02:graphics/p5-GraphViz \
		rrdtool:databases/rrdtool \
		netdisco-mibs>=0:net-mgmt/netdisco-mibs

USES=		gmake mysql perl5 shebangfix

USE_GITHUB=	yes
GH_ACCOUNT=	cvicente
GH_PROJECT=	Netdot

NO_BUILD=	yes

SUB_FILES=	pkg-message pkg-install
SUB_LIST=	WWWDIR="${WWWDIR}"	\
		WWWOWN="${WWWOWN}"	\
		WWWGRP="${WWWGRP}"	\
		CHOWN="${CHOWN}"	\
		CHMOD="${CHMOD}"

SHEBANG_FILES=	bin/*.pl bin/initdb upgrade/upgrade-tasks
SHEBANG_LANG=	perl perl2
perl2_OLD_CMD=	<<Make:PERL>>
perl2_CMD=	${LOCALBASE}/bin/perl

.include <bsd.port.pre.mk>

INSTALL_TARGET=	install		\
	PREFIX=${WWWDIR}	\
	PERL=${PERL}		\
	STAGEDIR=${STAGEDIR}${WWWDIR}	\
	APACHEUSER=${WWWOWN}	\
	APACHEGROUP=${WWWGRP}

post-patch:
	@${REINPLACE_CMD} "s#/usr/local/netdot#${WWWDIR}#g" ${WRKSRC}/netdot.cron ${WRKSRC}/Makefile ${WRKSRC}/import/import_ip_bulk.pl
	@${REINPLACE_CMD} "s#%%LOCALPREFIX%%#${PREFIX}#g" ${WRKSRC}/etc/Default.conf

post-install:
.for f in export/bind export/dhcpd export/ethers export/rancid export/smokeping export/sysmon htdocs/img/graphs lib/Netdot/Manual tmp/sessions/locks htdocs/masondata/cache
	@${TOUCH} ${STAGEDIR}${WWWDIR}/${f}/.keep-me
.endfor
.for f in initdb
	${INSTALL_SCRIPT} ${WRKSRC}/bin/${f} ${STAGEDIR}${WWWDIR}/bin/${f}
.endfor
	${MKDIR} ${STAGEDIR}${WWWDIR}/upgrade
.for f in Makefile updatedb upgrade-tasks
	${INSTALL_SCRIPT} ${WRKSRC}/upgrade/${f} ${STAGEDIR}${WWWDIR}/upgrade/${f}
.endfor
	${INSTALL_DATA} ${WRKSRC}/netdot.cron ${STAGEDIR}${WWWDIR}/etc/netdot.cron
	${INSTALL_DATA} ${WRKSRC}/etc/default_data ${STAGEDIR}${WWWDIR}/etc/default_data

.include <bsd.port.post.mk>