[73174] trunk/dports/net/nedi

markd at macports.org markd at macports.org
Fri Nov 5 18:44:16 PDT 2010


Revision: 73174
          http://trac.macports.org/changeset/73174
Author:   markd at macports.org
Date:     2010-11-05 18:44:12 -0700 (Fri, 05 Nov 2010)
Log Message:
-----------
Closes #22088.  Update to 1.0.5 to fix missing tarball.  Path cleanup.

Modified Paths:
--------------
    trunk/dports/net/nedi/Portfile

Removed Paths:
-------------
    trunk/dports/net/nedi/files/patch-html-Reports-Modules.php-diff

Modified: trunk/dports/net/nedi/Portfile
===================================================================
--- trunk/dports/net/nedi/Portfile	2010-11-06 00:57:26 UTC (rev 73173)
+++ trunk/dports/net/nedi/Portfile	2010-11-06 01:44:12 UTC (rev 73174)
@@ -3,8 +3,7 @@
 PortSystem	1.0
 
 name			nedi
-version			1.0
-revision		3
+version			1.0.5
 categories		net
 maintainers		markd
 platforms		darwin
@@ -15,12 +14,11 @@
 			system for Cisco networks with a user friendly web interface.
 
 homepage		http://www.nedi.ch/
-master_sites	        http://nedi.web.psi.ch/
+master_sites	        http://www.nedi.ch/_media/files:
 
 extract.suffix		.tgz
 worksrcdir		${name}
-checksums		md5 adae0699ea6d010d6d92f807f04ca442
-patchfiles		patch-html-Reports-Modules.php-diff
+checksums		md5 6ed980228483addfdc5caf14430d7570
 
 depends_lib		path:bin/perl:perl5 \
 			path:bin/mysql_config5:mysql5 \
@@ -45,70 +43,69 @@
 
 
 # Set some useful variables
-set nedidir ${prefix}/share
+set nedidir ${prefix}/share/${name}
 set rrdbin ${prefix}/bin/rrdtool
-set rrdfiles ${nedidir}/${name}/rrd
+set rrdfiles ${nedidir}/rrd
 set fpingpath ${prefix}/sbin
 set cacticlidir ${prefix}/share/cacti/cli
 
 startupitem.create	yes
 startupitem.name	nedimonitor
-startupitem.executable	${nedidir}/${name}/moni.pl
+startupitem.executable	${nedidir}/moni.pl
 
 use_configure		no
 build {}
 
-post-patch {
-	eval reinplace "s|__PREFIX__|${prefix}|g" \
-		[glob ${filespath}/*]
-}
+#post-patch {
+#	eval reinplace "s|__PREFIX__|${prefix}|g" \
+#		[glob ${filespath}/*]
+#}
 
 destroot {
-	xinstall -m 755 -d ${destroot}${nedidir}
-	system "cp -R ${worksrcpath} ${destroot}${nedidir}"
+	file mkdir ${destroot}${nedidir}
+	system "cp -R ${worksrcpath}/* ${destroot}${nedidir}"
 }
 
 post-destroot {
 # Fix general paths
-       eval reinplace "s|/usr/bin/perl|${prefix}/bin/perl|g" \
-                [glob ${destroot}${nedidir}/${name}/*.pl] \
-		[glob ${destroot}${nedidir}/${name}/inc/*.pl] \
-                [glob ${destroot}${nedidir}/${name}/html/inc/*.pl]
+       eval reinplace "s|/usr/|${prefix}/|g" \
+                [glob ${destroot}${nedidir}/*.pl] \
+		[glob ${destroot}${nedidir}/inc/*.pl] \
+                [glob ${destroot}${nedidir}/html/inc/*.pl] \
+		[glob ${destroot}${nedidir}/contrib/*.pl]
 
 	reinplace "s|netstat|/usr/sbin/netstat|g" \
-                ${destroot}${nedidir}/${name}/inc/libmisc.pl
+                ${destroot}${nedidir}/inc/libmisc.pl
 
-        reinplace "s|/etc/nedi.conf|${nedidir}/nedi/nedi.conf|g" \
-                ${destroot}${nedidir}/${name}/html/inc/libmisc.php
+        reinplace "s|/etc/nedi.conf|${nedidir}/nedi.conf|g" \
+                ${destroot}${nedidir}/html/inc/libmisc.php
 
-# Fix rrdcmd and rrdpath variables in nedi.conf
+# Fix rrdcmd location in nedi.conf
 	reinplace "s|rrdtool|${rrdbin}|g" \
-                ${destroot}${nedidir}/${name}/nedi.conf
-	reinplace "s|/var/nedi/rrd|${rrdfiles}|g" \
-		${destroot}${nedidir}/${name}/nedi.conf
+                ${destroot}${nedidir}/nedi.conf
 
 # Fix fping path
 	reinplace "s|/usr/local/sbin|${fpingpath}|g" \
- 		${destroot}${nedidir}/${name}/html/Nodes-Toolbox.php
+ 		${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}/${name}/nedi.conf
+		${destroot}${nedidir}/nedi.conf
 
 # Create directory for rrd files
         xinstall -m 755 -d ${destroot}${rrdfiles}
 
 # Keep these empty directories
         destroot.keepdirs \
-                ${destroot}${nedidir}/${name}/db/cfg \
-		${destroot}${nedidir}/${name}/html/log \
+                ${destroot}${nedidir}/db/cfg \
+		${destroot}${nedidir}/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}${nedidir}/${name}/nedi.conf \
-		${destroot}${nedidir}/${name}/nedi.conf.sample
-		system "chmod 600 ${destroot}${nedidir}/${name}/nedi.conf.sample"
+	file rename ${destroot}${nedidir}/nedi.conf \
+		${destroot}${nedidir}/nedi.conf.sample
+		system "chmod 600 ${destroot}${nedidir}/nedi.conf.sample"
 }
 
 pre-install {
@@ -172,9 +169,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}
+-Apache symlink: ln -s ${nedidir}/html/  ${prefix}/apache2/htdocs/nedi
+-Edit nedi.conf Backend/Authen/Device Access sections: sudo pico ${nedidir}/nedi.conf
 	Leave nedi.conf permissions at 600 to protect your network passwords!
 backend		MSQ
 dbpass		<nedidb-password>
@@ -184,7 +181,7 @@
 <usr> <pass> <enablepass> (user/pass of your Cisco devices)
 
 -Initialize the NeDi database:
-	cd ${nedidir}/${name}
+	cd ${nedidir}
 	sudo ./nedi.pl -i
 	When prompted for \"MySQL admin user:\" and enter 'root' and then MySQL root password.
 
@@ -204,7 +201,7 @@
 
 5) Discover Your Network with NeDi
 -----------------------------------------------
--Edit nedi.conf Device Acc. variables: sudo pico ${nedidir}/${name}/nedi.conf
+-Edit nedi.conf Device Acc. variables: sudo pico ${nedidir}/nedi.conf
 
 comm <my-community-string>
 <usr>  <pass>  <enablepass>
@@ -213,7 +210,7 @@
 
 -Make any other desired changes in nedi.conf
 -Start NeDi data collection:
-	cd ${nedidir}/${name}
+	cd ${nedidir}
 	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
@@ -221,7 +218,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} ; ./nedi.pl -c >> /dev/null 2>&1
 
 
 6) Set NeDi to receive device alerts, syslogs, and SNMP traps.  (optional)
@@ -237,7 +234,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}/trap.pl
 
  Then load the startup script to run the Unix snmptrapd daemon:
 

Deleted: trunk/dports/net/nedi/files/patch-html-Reports-Modules.php-diff
===================================================================
--- trunk/dports/net/nedi/files/patch-html-Reports-Modules.php-diff	2010-11-06 00:57:26 UTC (rev 73173)
+++ trunk/dports/net/nedi/files/patch-html-Reports-Modules.php-diff	2010-11-06 01:44:12 UTC (rev 73174)
@@ -1,82 +0,0 @@
---- html/Reports-Modules.php.orig	2008-06-06 20:49:43.000000000 -0700
-+++ html/Reports-Modules.php	2008-06-25 22:36:11.000000000 -0700
-@@ -10,6 +10,7 @@
- # 03/07/07	minor changes & new inventory
- # 04/09/07	implemented CSS scheme
- # 20/09/07	implemented language support
-+# 24/06/08	fixed ccc support (provided by Andreas Wassatsch)
- */
- 
- error_reporting(E_ALL ^ E_NOTICE);
-@@ -190,20 +191,25 @@
- 			echo "<tr class=\"imgb\" class=\"blu\"><th>\n";
- 			echo "<a href=\"Devices-Status.php?dev=$ud\"><b>$d[0]</b></a></th>\n";
- 
--	//$query_ccc = "SELECT status,contract FROM cisco_contracts WHERE serial=\"$d[2]\"";
--	$query_ccc = GenQuery('cisco_contracts','s','status,contract','','',array('serial'),array('='),array($d[2]));
-+	//$query_ccc = GenQuery('cisco_contracts','s','service_level,contract_number,end_date,DATEDIFF(STR_TO_DATE(end_date, '%d-%b-%Y'),CURDATE())','','',array('serial'),array('='),array($d[2]));
-+	$query_ccc = "SELECT service_level,contract_number,end_date,DATEDIFF(STR_TO_DATE(end_date, '%d-%b-%Y'),CURDATE()) FROM cisco_contracts WHERE serial_number=\"$d[2]\"";
- 	$res_ccc = @DbQuery($query_ccc,$link_ccc);
- 	$ccc = @DbFetchRow($res_ccc);
--	if ($ccc[0] == 0) {
-+	if ($ccc[3] > 30) {
- 		$color = "green";
--	} elseif ($ccc[0] == 1) {
-+		$ccc_message = "$ccc[0]<br>Contract #$ccc[1] valid till $ccc[2]";
-+	} elseif ($ccc[3] > 1) {
- 		$color = "darkyellow";
--	} elseif ($ccc[0] == 2) {
--		$color = "red";
-+		$ccc_message = "$ccc[0]<br>Contract #$ccc[1] valid till $ccc[2]";
- 	} else {
--		$color = "orange";
-+		$color = "red";
-+		$ccc_message = "$ccc[0]<br>Contract #$ccc[1] expired since $ccc[2] !";
-+	}
-+	if ($ccc[1] == "") {
-+		$color = "blue";
-+		$ccc_message = "Unknown";
- 	}
--			echo "<td align=right>-</td><td><b>$d[1]</b></td><td>$d[2]</td><td><font color=$color>$ccc[1]</font></td></tr>\n";
-+			echo "<td align=right>-</td><td><b>$d[1]</b></td><td>$d[2]</td><td><font color=$color>$ccc_message</font></td></tr>\n";
- 
- 			$mquery	= GenQuery('modules','s','*','slot','',array('device'),array('='),array($d[0]));
- 			$mres	= @DbQuery($mquery,$link);
-@@ -212,19 +218,24 @@
- 					if ($row % 2){$bg = "txta";}else{$bg = "txtb";}
- 					$row++;
- 					echo "<tr class=\"$bg\"><th>\n";
--	$query_ccc = "SELECT status,contract FROM cisco_contracts WHERE serial=\"$m[4]\"";
--	$res_ccc = @DbQuery($query_ccc,$link_ccc);
--	$ccc = @DbFetchRow($res_ccc);
--	if ($ccc[0] == 0) {
--		$color = "green";
--	} elseif ($ccc[0] == 1) {
--		$color = "darkyellow";
--	} elseif ($ccc[0] == 2) {
--		$color = "red";
--	} else {
--		$color = "orange";
--	}
--					echo "<td align=right>$m[1]</td><td><b>$m[2]</b> $m[3]</td><td>$m[4]</td><td><font color=$color>$ccc[1]</font></td></tr>\n";
-+					$query_ccc = "SELECT service_level,contract_number,end_date,DATEDIFF(STR_TO_DATE(end_date, '%d-%b-%Y'),CURDATE()) FROM cisco_contracts WHERE serial_number=\"$m[2]\"";
-+					$res_ccc = @DbQuery($query_ccc,$link_ccc);
-+					$ccc = @DbFetchRow($res_ccc);
-+					if ($ccc[3] > 30) {
-+						$color = "green";
-+						$ccc_message = "$ccc[0]<br>Contract #$ccc[1] valid till $ccc[2]";
-+					} elseif ($ccc[3] > 1) {
-+						$color = "darkyellow";
-+						$ccc_message = "$ccc[0]<br>Contract #$ccc[1] valid till $ccc[2]";
-+					} else {
-+						$color = "red";
-+						$ccc_message = "$ccc[0]<br>Contract #$ccc[1] expired since $ccc[2]";
-+					}
-+					if ($ccc[1] == "") {
-+						$color = "blue";
-+						$ccc_message = "Unknown";
-+					}
-+					echo "<td align=right>$m[1]</td><td><b>$m[2]</b> $m[3]</td><td>$m[4]</td><td><font color=$color>$ccc_message</font></td></tr>\n";
- 				}
- 				@DbFreeResult($mres);
- 			}else{
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20101105/c88eecd1/attachment-0001.html>


More information about the macports-changes mailing list