2013-05-10 21:11:11 +02:00
|
|
|
# Created by: Shaun Amott <shaun@inerd.com>
|
2006-07-13 02:11:12 +02:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= netdisco
|
2014-07-02 00:29:52 +02:00
|
|
|
PORTVERSION= 1.3.3
|
2015-01-05 14:18:58 +01:00
|
|
|
PORTREVISION= 3
|
2006-07-13 02:11:12 +02:00
|
|
|
CATEGORIES= net-mgmt www
|
2009-08-22 02:32:25 +02:00
|
|
|
MASTER_SITES= SF
|
2006-07-13 02:11:12 +02:00
|
|
|
|
2012-02-17 18:22:21 +01:00
|
|
|
MAINTAINER= dgeo@centrale-marseille.fr
|
2006-07-13 02:11:12 +02:00
|
|
|
COMMENT= Web-based network management tool for moderate to large networks
|
|
|
|
|
2014-09-25 22:41:37 +02:00
|
|
|
LICENSE= BSD3CLAUSE
|
2012-02-17 18:22:21 +01:00
|
|
|
|
2013-11-09 15:05:30 +01:00
|
|
|
RUN_DEPENDS+= p5-Net-SNMP>=0:${PORTSDIR}/net-mgmt/p5-Net-SNMP \
|
2013-06-13 13:43:07 +02:00
|
|
|
p5-SNMP-Info>=3.01:${PORTSDIR}/net-mgmt/p5-SNMP-Info \
|
2012-07-01 16:14:22 +02:00
|
|
|
p5-HTML-Mason>=0:${PORTSDIR}/www/p5-HTML-Mason \
|
|
|
|
p5-DB_File-Lock>=0:${PORTSDIR}/devel/p5-DB_File-Lock \
|
|
|
|
p5-Apache-Session>=0:${PORTSDIR}/www/p5-Apache-Session \
|
|
|
|
p5-Net-NBName>=0:${PORTSDIR}/net/p5-Net-NBName \
|
|
|
|
p5-DBD-Pg>=0:${PORTSDIR}/databases/p5-DBD-Pg \
|
|
|
|
p5-HTML-Parser>=0:${PORTSDIR}/www/p5-HTML-Parser \
|
|
|
|
p5-Parallel-ForkManager>=0:${PORTSDIR}/devel/p5-Parallel-ForkManager
|
2006-07-13 02:11:12 +02:00
|
|
|
|
2014-09-25 22:41:37 +02:00
|
|
|
OPTIONS_DEFINE= DOCS GRAPHVIZ MIBS WEBUI
|
|
|
|
OPTIONS_DEFAULT=DOCS GRAPHVIZ MIBS WEBUI
|
|
|
|
OPTIONS_SUB= WEBUI
|
|
|
|
MIBS_DESC= Depend on net-mgmt/netdisco-mibs
|
|
|
|
GRAPHVIZ_DESC= Install GraphViz for network map support
|
|
|
|
WEBUI_DESC= With web interface (mod_perl2+apache22)
|
|
|
|
|
|
|
|
GRAPHVIZ_RUN_DEPENDS+= p5-Graph>=0:${PORTSDIR}/math/p5-Graph \
|
|
|
|
p5-GraphViz>=0:${PORTSDIR}/graphics/p5-GraphViz
|
|
|
|
WEBUI_RUN_DEPENDS+= ${APACHE_PKGNAMEPREFIX}mod_perl2>=0:${PORTSDIR}/www/mod_perl2 \
|
|
|
|
p5-Apache-DBI>=0:${PORTSDIR}/www/p5-Apache-DBI \
|
|
|
|
p5-libapreq2>=0:${PORTSDIR}/www/p5-libapreq2 \
|
|
|
|
p5-MasonX-Request-WithApacheSession>=0:${PORTSDIR}/www/p5-MasonX-Request-WithApacheSession
|
|
|
|
WEBUI_USE= APACHE_RUN=22+
|
|
|
|
|
|
|
|
USES= perl5 pgsql shebangfix
|
|
|
|
SHEBANG_FILES= bin/parse_kismet_ap netdisco
|
|
|
|
USE_PERL5= run build
|
2006-07-13 02:11:12 +02:00
|
|
|
|
2008-01-05 15:35:25 +01:00
|
|
|
USE_RC_SUBR= netdisco
|
2006-07-13 02:11:12 +02:00
|
|
|
|
|
|
|
NO_BUILD= yes
|
2014-09-25 22:41:37 +02:00
|
|
|
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
|
2006-07-13 02:11:12 +02:00
|
|
|
|
2014-07-02 00:29:52 +02:00
|
|
|
NETDISCO_USER= netdisco
|
|
|
|
NETDISCO_GROUP= netdisco
|
2012-02-17 18:22:21 +01:00
|
|
|
NETDISCO_RUNDIR=/var/run
|
|
|
|
NETDISCO_DBDIR= /var/db/netdisco
|
2006-07-13 02:11:12 +02:00
|
|
|
|
2014-09-25 22:41:37 +02:00
|
|
|
USERS= ${NETDISCO_USER}
|
|
|
|
GROUPS= ${NETDISCO_GROUP}
|
2006-07-13 02:11:12 +02:00
|
|
|
|
2014-09-25 22:41:37 +02:00
|
|
|
SUB_FILES= pkg-message
|
|
|
|
PLIST_SUB= WWWOWN=${WWWOWN} WWWGRP=${WWWGRP} \
|
|
|
|
NETDISCO_USER=${NETDISCO_USER} \
|
|
|
|
NETDISCO_GROUP=${NETDISCO_GROUP}
|
|
|
|
SUB_LIST= NETDISCO_USER=${NETDISCO_USER} \
|
|
|
|
NETDISCO_GROUP=${NETDISCO_GROUP} \
|
|
|
|
NETDISCO_DBDIR=${NETDISCO_DBDIR}
|
2006-07-13 02:11:12 +02:00
|
|
|
|
|
|
|
ALTER_FILES= netdisco netdisco.conf netdisco_apache.conf \
|
2010-11-07 20:47:04 +01:00
|
|
|
netdisco_apache_dir.conf netdisco.crontab sql/pg
|
2006-07-13 02:11:12 +02:00
|
|
|
CONFIG_FILES= netdisco.conf netdisco.crontab netdisco-topology.txt \
|
|
|
|
netdisco_apache.conf netdisco_apache_dir.conf
|
2013-06-24 13:19:03 +02:00
|
|
|
DOCFILES= ChangeLog doc/*.pod INSTALL README* UPGRADE
|
2012-02-17 18:22:21 +01:00
|
|
|
|
2013-11-03 05:53:54 +01:00
|
|
|
.include <bsd.port.options.mk>
|
2006-07-13 02:11:12 +02:00
|
|
|
|
2012-02-17 18:22:21 +01:00
|
|
|
MIBSDIR= ${PREFIX}/share/netdisco-mibs
|
2012-09-05 01:21:31 +02:00
|
|
|
.if ${PORT_OPTIONS:MMIBS}
|
2012-02-17 18:22:21 +01:00
|
|
|
RUN_DEPENDS+= ${MIBSDIR}/mib_index.txt:${PORTSDIR}/net-mgmt/netdisco-mibs
|
|
|
|
BUILD_DEPENDS+= ${MIBSDIR}/mib_index.txt:${PORTSDIR}/net-mgmt/netdisco-mibs
|
2013-11-09 15:05:30 +01:00
|
|
|
. include "${.CURDIR}/../netdisco-mibs/bsd.port.netdisco.mk"
|
2013-07-02 18:59:24 +02:00
|
|
|
MIBINCLUDES!=${ECHO} \"${MIBDIRS:S/^/${MIBSDIR}\//}\"
|
|
|
|
MIBINCLUDES:=${MIBINCLUDES:S/ /:/g:S/"//g}
|
2012-02-17 18:22:21 +01:00
|
|
|
.else
|
|
|
|
MIBINCLUDES="#please add here mibs dirs list (at least snmp and rfc ones)"
|
|
|
|
.endif
|
|
|
|
|
2014-09-25 22:41:37 +02:00
|
|
|
post-patch:
|
|
|
|
@(cd ${WRKSRC} && ${REINPLACE_CMD} \
|
|
|
|
-e 's#%%WWWDIR%%#${WWWDIR}#g' \
|
|
|
|
-e 's#%%PREFIX%%#${PREFIX}#g' \
|
|
|
|
-e 's#%%DATADIR%%#${DATADIR}#g' \
|
|
|
|
-e 's#%%DOCSDIR%%#${DOCSDIR}#g' \
|
|
|
|
-e 's#%%NETDISCO_RUNDIR%%#${NETDISCO_RUNDIR}#g' \
|
|
|
|
-e 's#%%NETDISCO_USER%%#${USERS}#g' \
|
|
|
|
-e 's#%%NETDISCO_GROUP%%#${GROUPS}#g' \
|
|
|
|
-e 's#%%NETDISCO_DBDIR%%#${NETDISCO_DBDIR}#g' \
|
|
|
|
-e 's#%%ETCDIR%%#${ETCDIR}#g' \
|
2014-12-23 03:22:19 +01:00
|
|
|
-e 's#%%SITE_PERL%%#${PREFIX}/${SITE_PERL_REL}#g' \
|
2014-09-25 22:41:37 +02:00
|
|
|
-e 's#%%APACHEMODDIR%%#${APACHEMODDIR}#g' \
|
|
|
|
-e 's#%%APACHEETCDIR%%#${APACHEETCDIR}#g' \
|
|
|
|
-e 's#%%MIBINCLUDES%%#${MIBINCLUDES}#g' \
|
|
|
|
${ALTER_FILES})
|
2006-07-13 02:11:12 +02:00
|
|
|
|
|
|
|
do-install:
|
2014-09-25 22:41:37 +02:00
|
|
|
@${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_PERL_REL} \
|
|
|
|
${STAGEDIR}${DATADIR}/sql \
|
|
|
|
${STAGEDIR}${DOCSDIR} \
|
|
|
|
${STAGEDIR}${ETCDIR}
|
|
|
|
(cd ${WRKSRC} && ${INSTALL_SCRIPT} netdisco bin/parse_mac \
|
|
|
|
bin/port_control bin/parse_kismet_ap ${STAGEDIR}${PREFIX}/bin)
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/netdisco.pm \
|
|
|
|
${STAGEDIR}${PREFIX}/${SITE_PERL_REL}
|
2013-11-09 15:05:30 +01:00
|
|
|
. if ${PORT_OPTIONS:MWEBUI}
|
2014-09-25 22:41:37 +02:00
|
|
|
@${MKDIR} ${STAGEDIR}${WWWDIR}/mason
|
|
|
|
(cd ${WRKSRC}/html && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR})
|
|
|
|
(cd ${STAGEDIR}${WWWDIR} && ${RM} -r doc/autohandler svg)
|
2013-11-09 15:05:30 +01:00
|
|
|
. endif
|
2014-07-02 00:29:52 +02:00
|
|
|
. for i in ${CONFIG_FILES}
|
2014-09-25 22:41:37 +02:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${ETCDIR}/${i}.sample
|
2014-07-02 00:29:52 +02:00
|
|
|
. endfor
|
2014-09-25 22:41:37 +02:00
|
|
|
(cd ${WRKSRC}/sql && \
|
|
|
|
${INSTALL_DATA} *.sql pg ${STAGEDIR}${DATADIR}/sql)
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/Makefile ${STAGEDIR}${DATADIR}
|
2014-07-02 00:29:52 +02:00
|
|
|
(cd ${WRKSRC} && ${INSTALL_MAN} ${DOCFILES} ${STAGEDIR}${DOCSDIR})
|
2014-09-25 22:41:37 +02:00
|
|
|
|
|
|
|
# This violates STAGEDIR, comment out the entire block
|
|
|
|
#. if !defined(PACKAGE_BUILDING)
|
|
|
|
# @(if [ -d ${PREFIX}/${APACHEETCDIR}/Includes ] ; then \
|
|
|
|
# ${ECHO_MSG} "===> Adding config in ${PREFIX}/${APACHEETCDIR}/Includes..."; \
|
|
|
|
# test -L ${PREFIX}/${APACHEETCDIR}/Includes/netdisco_apache.conf || \
|
|
|
|
# ${LN} -s ${ETCDIR}/netdisco_apache.conf ${PREFIX}/${APACHEETCDIR}/Includes/netdisco_apache.conf; \
|
|
|
|
# test -L ${PREFIX}/${APACHEETCDIR}/Includes/netdisco_apache_dir.conf || \
|
|
|
|
# ${LN} -s ${ETCDIR}/netdisco_apache_dir.conf ${PREFIX}/${APACHEETCDIR}/Includes/netdisco_apache_dir.conf; \
|
|
|
|
# fi)
|
|
|
|
#. endif
|
2006-07-13 02:11:12 +02:00
|
|
|
|
2013-11-03 05:53:54 +01:00
|
|
|
.include <bsd.port.mk>
|