# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
description Network Discovery Suite
long_description A low noise network discovery, management, and inventory \
system for Cisco networks with a user friendly web interface.
homepage http://www.nedi.ch/
master_sites http://www.nedi.ch/pub
checksums rmd160 776b178b4fd3fe139796dbc367ae0e626f6ccaa1 \
sha256 cf004dafb781f1ac638b2291ea565d3c3972eb5dd049f9119b46dbc66f722f13
depends_lib port:perl${perl5.major} \
path:bin/mysql_config5:mysql5 \
port:p${perl5.major}-net-snmp \
port:p${perl5.major}-net-ssh-perl \
port:p${perl5.major}-net-telnet \
port:p${perl5.major}-net-telnet-cisco \
port:p${perl5.major}-libwww-perl \
port:p${perl5.major}-algorithm-diff \
port:p${perl5.major}-dbi \
port:p${perl5.major}-dbd-mysql \
# Set some useful variables
set nedidir ${prefix}/share/${name}
set rrdbin ${prefix}/bin/rrdtool
set rrdfiles ${nedidir}/rrd
set fpingpath ${prefix}/sbin
set cacticlidir ${prefix}/share/cacti/cli
startupitem.name nedimonitor
startupitem.executable ${nedidir}/moni.pl
file mkdir ${destroot}/Library/LaunchDaemons
file mkdir ${destroot}${nedidir}
# copy content to destroot
copy {*}[glob ${worksrcpath}/*] ${destroot}${nedidir}
reinplace "s|^#!.*|#!${perl5.bin}|" \
{*}[glob ${destroot}${nedidir}/*.pl] \
{*}[glob ${destroot}${nedidir}/contrib/*.pl] \
{*}[glob ${destroot}${nedidir}/inc/*.pl]
reinplace "s|netstat|/usr/sbin/netstat|g" \
${destroot}${nedidir}/inc/libmisc.pm
reinplace "s|/etc/nedi.conf|${nedidir}/nedi.conf|g" \
${destroot}${nedidir}/html/inc/libmisc.php
# Fix rrdcmd location in nedi.conf
reinplace "s|rrdtool|${rrdbin}|g" \
${destroot}${nedidir}/nedi.conf
reinplace "s|/usr/local/sbin|${fpingpath}|g" \
${destroot}${nedidir}/html/Nodes-Toolbox.php
# Fix Cacti paths in nedi.conf
reinplace "s|/usr/bin/php /var/www/html/cacti/cli|${prefix}/bin/php ${cacticlidir}|g" \
${destroot}${nedidir}/nedi.conf