[33893] trunk/dports/net/nedi/Portfile
markd at macports.org
markd at macports.org
Wed Feb 6 17:43:47 PST 2008
Revision: 33893
http://trac.macosforge.org/projects/macports/changeset/33893
Author: markd at macports.org
Date: 2008-02-06 17:43:45 -0800 (Wed, 06 Feb 2008)
Log Message:
-----------
Update to RC6; tweak portfile variables.
Modified Paths:
--------------
trunk/dports/net/nedi/Portfile
Modified: trunk/dports/net/nedi/Portfile
===================================================================
--- trunk/dports/net/nedi/Portfile 2008-02-07 00:01:05 UTC (rev 33892)
+++ trunk/dports/net/nedi/Portfile 2008-02-07 01:43:45 UTC (rev 33893)
@@ -3,7 +3,7 @@
PortSystem 1.0
name nedi
-version 1.0-rc5
+version 1.0-rc6
categories net
maintainers markd
platforms darwin
@@ -19,7 +19,7 @@
distname ${name}-${version}
extract.suffix .tgz
worksrcdir ${name}
-checksums md5 fd72f04d355159ba9c9d629b32ea577c
+checksums md5 1aa34876601a57d061f041e9ab8ea9f0
default_variants +server
depends_lib port:perl5.8 \
@@ -41,11 +41,14 @@
}
# Set some useful variables
-set nedidir ${prefix}/share/
+set nedidir ${prefix}/share
+set rrdbin ${prefix}/bin/rrdtool
+set rrdfiles ${nedidir}/${name}/rrd
+set cacticlidir ${prefix}/share/cacti/cli
startupitem.create yes
startupitem.name nedimonitor
-startupitem.executable ${prefix}/share/${name}/moni.pl
+startupitem.executable ${nedidir}/${name}/moni.pl
use_configure no
patch {}
@@ -64,37 +67,41 @@
post-destroot {
# Fix general paths
eval reinplace "s|/usr/bin/perl|${prefix}/bin/perl|g" \
- [glob ${destroot}${prefix}/share/${name}/*.pl] \
- [glob ${destroot}${prefix}/share/${name}/inc/*.pl] \
- [glob ${destroot}${prefix}/share/${name}/html/inc/*.pl]
+ [glob ${destroot}${nedidir}/${name}/*.pl] \
+ [glob ${destroot}${nedidir}/${name}/inc/*.pl] \
+ [glob ${destroot}${nedidir}/${name}/html/inc/*.pl]
reinplace "s|netstat|/usr/sbin/netstat|g" \
- ${destroot}${prefix}/share/${name}/inc/libmisc.pl
+ ${destroot}${nedidir}/${name}/inc/libmisc.pl
- reinplace "s|/etc/nedi.conf|${prefix}/share/nedi/nedi.conf|g" \
- ${destroot}${prefix}/share/${name}/html/inc/libmisc.php
+ reinplace "s|/etc/nedi.conf|${nedidir}/nedi/nedi.conf|g" \
+ ${destroot}${nedidir}/${name}/html/inc/libmisc.php
# Fix RRDtool paths
- reinplace "s|\"rrdtool\"|\"${prefix}/bin/rrdtool\"|g" \
- ${destroot}${prefix}/share/${name}/inc/libmisc.pl
- reinplace "s|/var/nedi/rrd|${prefix}/share/${name}/rrd|g" \
- ${destroot}${prefix}/share/${name}/html/inc/libgraph.php
- reinplace "s|\"rrdtool\"|\"${prefix}/bin/rrdtool\"|g" \
- ${destroot}${prefix}/share/${name}/html/inc/libgraph.php
+ reinplace "s|\"rrdtool\"|\"${rrdbin}\"|g" \
+ ${destroot}${nedidir}/${name}/inc/libmisc.pl
+ reinplace "s|/var/nedi/rrd|${rrdfiles}|g" \
+ ${destroot}${nedidir}/${name}/html/inc/libgraph.php
+ reinplace "s|\"rrdtool\"|\"${rrdbin}\"|g" \
+ ${destroot}${nedidir}/${name}/html/inc/libgraph.php
+# Fix Cacti paths
+ reinplace "s|/usr/local/bin/php /var/www/htdocs/cacti/cli|${prefix}/bin/php ${cacticlidir}|g" \
+ ${destroot}${nedidir}/${name}/html/inc/libmisc.php
+
# Create directory for rrd files
- xinstall -m 755 -d ${destroot}${prefix}/share/${name}/rrd
+ xinstall -m 755 -d ${destroot}${rrdfiles}
# Keep these empty directories
destroot.keepdirs \
- ${destroot}${prefix}/share/${name}/db/cfg \
- ${destroot}${prefix}/share/${name}/html/log \
- ${destroot}${prefix}/share/${name}/rrd
+ ${destroot}${nedidir}/${name}/db/cfg \
+ ${destroot}${nedidir}/${name}/html/log \
+ ${destroot}${rrdfiles}
# Rename nedi.conf to nedi.conf.sample so port upgrades don't overwrite an installed nedi.conf
# Also set permissions on nedi.conf because it has passwords.
- file rename ${destroot}${prefix}/share/${name}/nedi.conf \
- ${destroot}${prefix}/share/${name}/nedi.conf.sample
- system "chmod 600 ${destroot}${prefix}/share/${name}/nedi.conf.sample"
+ file rename ${destroot}${nedidir}/${name}/nedi.conf \
+ ${destroot}${nedidir}/${name}/nedi.conf.sample
+ system "chmod 600 ${destroot}${nedidir}/${name}/nedi.conf.sample"
}
pre-install {
@@ -154,9 +161,9 @@
4) Configure NeDi, initialize database, and Login to NeDi
-----------------------------------------------
--Set NeDi owner: sudo chown -R <nedi-user>:<nedi-group> ${nedidir}${name}/
--Apache symlink: ln -s ${nedidir}${name}/html/ ${prefix}/apache2/htdocs/nedi
--Edit nedi.conf Backend/Authen/Device Access sections: sudo pico ${nedidir}${name}/nedi.conf
+-Set NeDi owner: sudo chown -R <nedi-user>:<nedi-group> ${nedidir}/${name}/
+-Apache symlink: ln -s ${nedidir}/${name}/html/ ${prefix}/apache2/htdocs/nedi
+-Edit nedi.conf Backend/Authen/Device Access sections: sudo pico ${nedidir}/${name}/nedi.conf
Leave nedi.conf permissions at 600 to protect your network passwords!
backend MSQ
dbpass <nedidb-password>
@@ -166,7 +173,7 @@
<usr> <pass> <enablepass> (user/pass of your Cisco devices)
-Initialize the NeDi database:
- cd ${prefix}/share/${name}
+ cd ${nedidir}/${name}
sudo ./nedi.pl -i
When prompted for \"MySQL admin user:\" and enter 'root' and then MySQL root password.
@@ -186,14 +193,14 @@
5) Discover Your Network with NeDi
-----------------------------------------------
--Edit nedi.conf Device Acc. variables: sudo pico ${prefix}/share/${name}/nedi.conf
+-Edit nedi.conf Device Acc. variables: sudo pico ${nedidir}/${name}/nedi.conf
comm <my-community-string>
<usr> <pass> <enablepass>
-Make any other desired changes in nedi.conf
-Start NeDi data collection:
- cd ${nedidir}${name}
+ cd ${nedidir}/${name}
sudo -u <nedi-user> nedi.pl -c -d (debug)
-Put a command in the crontab to discover your network at regular intervals.
A typical interval is 1 hour; to get accurate NeDi rrdtool graphs at
@@ -201,7 +208,7 @@
Otherwise, you must adjust NeDi's default rrdtool settings. To run
NeDi every hour, the cron entry is:
-0 * * * * cd ${nedidir}${name} ; ./nedi.pl -c >> /dev/null 2>&1
+0 * * * * cd ${nedidir}/${name} ; ./nedi.pl -c >> /dev/null 2>&1
6) Set NeDi to receive device alerts, syslogs, and SNMP traps. (optional)
@@ -217,7 +224,7 @@
-To enable the NeDi SNMP trap receiver, first use the snmpconf Unix utility to create an
snmptrapd.conf file with the entry:
- traphandle default ${nedidir}${name}/trap.pl
+ traphandle default ${nedidir}/${name}/trap.pl
Then load the startup script to run the Unix snmptrapd daemon:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080206/26bbfca9/attachment-0001.html
More information about the macports-changes
mailing list