ports/98369: ifgraph port doesn't work out-of-box

vax at satx.rr.com vax at satx.rr.com
Fri Jun 2 12:10:37 UTC 2006


>Number:         98369
>Category:       ports
>Synopsis:       ifgraph port doesn't work out-of-box
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 02 12:10:18 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     nobody in particular
>Release:        FreeBSD 6.0-RELEASE i386
>Organization:
>Environment:
System: FreeBSD xxx.yyy.zzz 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu Nov 3 09:36:13 UTC 2005 root at x64.samsco.home:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:
	

Try to build /usr/ports/net-mgmt/ifgraph, watch it fail.

>How-To-Repeat:
	
>Fix:

	

diff -ur /usr/ports/net-mgmt/ifgraph.orig/Makefile /usr/ports/net-mgmt/ifgraph/Makefile
--- /usr/ports/net-mgmt/ifgraph.orig/Makefile	Sat Apr  1 11:50:10 2006
+++ /usr/ports/net-mgmt/ifgraph/Makefile	Thu Jun  1 18:53:19 2006
@@ -50,6 +50,8 @@
 	@ ${INSTALL_DATA} ${WRKSRC}/ifgraph.conf.sample ${PREFIX}/etc
 	@ ${MKDIR} ${PREFIX}/ifgraph
 	@ ${MKDIR} ${PREFIX}/ifgraph/htdocs
+	@ ${MKDIR} ${PREFIX}/ifgraph/lib
+	@ ${CP} ${WRKSRC}/lib/rgb.txt ${PREFIX}/ifgraph/lib
 	@ ${CP} -Rp ${WRKSRC}/templates ${PREFIX}/ifgraph
 	@ ${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
 		${FILESDIR}/crontab.in > ${PREFIX}/ifgraph/crontab.in
diff -ur /usr/ports/net-mgmt/ifgraph.orig/files/patch-makegraph.pl /usr/ports/net-mgmt/ifgraph/files/patch-makegraph.pl
--- /usr/ports/net-mgmt/ifgraph.orig/files/patch-makegraph.pl	Sat Apr  1 11:50:10 2006
+++ /usr/ports/net-mgmt/ifgraph/files/patch-makegraph.pl	Thu Jun  1 18:58:28 2006
@@ -1,5 +1,5 @@
---- makegraph.pl.orig	Sat Jan  3 16:44:21 2004
-+++ makegraph.pl	Tue Feb  7 12:48:07 2006
+--- makegraph.pl.orig	Thu Jun  1 18:39:09 2006
++++ makegraph.pl	Thu Jun  1 18:55:09 2006
 @@ -19,8 +19,6 @@
  #Sugestoes e criticas (sem flames!!) mailto:sartori at ifgraph.lrv.ufsc.br
  #Visite: http://ifgraph.lrv.ufsc.br
@@ -25,3 +25,30 @@
  
  # HELP
  if (defined($opt_h)) {
+@@ -48,7 +39,7 @@
+ 
+ # Creating a color converter object
+ &debug("main(): Creating a RGB converter object from Color::Rgb\n");
+-$rgb_converter = new Color::Rgb(rgb_txt=>"$FindBin::Bin/lib/rgb.txt");
++$rgb_converter = new Color::Rgb(rgb_txt=>"/usr/local/ifgraph/lib/rgb.txt");
+ if ($rgb_converter) { &debug("main(): Ok RGB converter object created\n"); }
+ 
+ # Defining the $configile variable
+@@ -737,7 +728,7 @@
+   &debug("criaGraficoBits(): Colors are $color_back, $color_canvas, $color_shadea, $color_shadeb, $color_grid, $color_mgrid, $color_font, $color_frame, $color_arrow, $color_in, $color_out\ncriaGraficoBits(): Options are $$targets[$targetindex][6]->[0] $$targets[$targetindex][6]->[1] $$targets[$targetindex][6]->[2] $$targets[$targetindex][6]->[3] $$targets[$targetindex][6]->[4] $$targets[$targetindex][6]->[5]\ncriaGraficoBits(): Dimensions are $$targets[$targetindex][7]->[0] x $$targets[$targetindex][7]->[1]\n");
+   my($start);
+   while ($start=shift(@period)) {
+-	  print(RRDTOOL "graph $global->[3]/$targets->[$targetindex][0]$start.$opt_imgformat -a $$global[5] -b 1000 $opt_rigid -s $start -e -$targets->[$targetindex][19] $opt_legend $opt_nominor -w $dim_width -h $dim_height -c BACK$color_back -c CANVAS$color_canvas -c SHADEA$color_shadea -c SHADEB$color_shadeb -c GRID$color_grid -c MGRID$color_mgrid -c FONT$color_font -c FRAME$color_frame -c ARROW$color_arrow -v \"$$targets[$targetindex][9]\" -t \"$$targets[$targetindex][10]\" $opt_inout_def  CDEF:deltain=totalin,errin,-,0,LT,0,totalin,errin,-,IF CDEF:in=deltain,0,LT,0,deltain,IF,$bytes_bwidth_in,GT,$bytes_bwidth_in,deltain,IF CDEF:deltaout=totalout,errout,-,0,LT,0,totalout,errout,-,IF CDEF:out=deltaout,0,LT,0,deltaout,IF,$bytes_bwidth_out,GT,$bytes_bwidth_out,deltaout,IF CDEF:bitsin=in,8,* CDEF:bitsout=out,8,* CDEF:kbitsin=bitsin,1000,\/ CDEF:kbitsout=bitsout,1000,\/ CDEF:percbin=bitsin,100,*,$bwidth_in,\/ CDEF:percbout=bitsout,100,*,$bwidth_out,\/ CDEF:berrin=errin,8,\/ CDEF:ber
 rout=errout,8,\/ AREA:bitsin$color_in:\"$$targets[$targetindex][11]->[0]\" LINE2:bitsout$color_out:\"$$targets[$targetindex][11]->[1]\\l\" GPRINT:kbitsin:LAST:\'$$targets[$targetindex][11]->[0] - Now\\: %.$targets->[$targetindex][20]lf $$targets[$targetindex][13]\\g\' GPRINT:percbin:LAST:\' (%.1lf%%)\' GPRINT:kbitsin:AVERAGE:\'Avg\\: %.$targets->[$targetindex][20]lf $$targets[$targetindex][13]\\g\' GPRINT:percbin:AVERAGE:\' (%.1lf%%)\' GPRINT:kbitsin:MAX:\'Max\\: %.$targets->[$targetindex][20]lf $$targets[$targetindex][13]\\g\' GPRINT:percbin:MAX:\' (%.1lf%%)\\l\' GPRINT:kbitsout:LAST:\'$$targets[$targetindex][11]->[1] - Now\\: %.$targets->[$targetindex][20]lf $$targets[$targetindex][13]\\g\' GPRINT:percbout:LAST:\' (%.1lf%%)\' GPRINT:kbitsout:AVERAGE:\'Avg\\: %.$targets->[$targetindex][20]lf $$targets[$targetindex][13]\\g\' GPRINT:percbout:AVERAGE:\' (%.1lf%%)\' GPRINT:kbitsout:MAX:\'Max\\: %.$targets->[$targetindex][20]lf $$targets[$targetindex][13]\\g\' GPRINT:percbout:MA
 X:\' (%.1lf%%)\\l\' COMMENT:\'Max bits for target $targets->[$targetindex][0]\: $bwidth_in - $bwidth_out bits/sec \\l\' $opt_error\n") || die("criaGraficoBits() Fatal: Could not print to filehandle RRDTOOL: $!\n");
++	  print(RRDTOOL "graph $global->[3]/$targets->[$targetindex][0]$start.$opt_imgformat -a $$global[5] -b 1000 $opt_rigid -s $start -e -$targets->[$targetindex][19] $opt_legend $opt_nominor -w $dim_width -h $dim_height -c BACK$color_back -c CANVAS$color_canvas -c SHADEA$color_shadea -c SHADEB$color_shadeb -c GRID$color_grid -c MGRID$color_mgrid -c FONT$color_font -c FRAME$color_frame -c ARROW$color_arrow -v \"$$targets[$targetindex][9]\" -t \"$$targets[$targetindex][10]\" $opt_inout_def  CDEF:deltain=totalin,errin,-,0,LT,0,totalin,errin,-,IF CDEF:in=deltain,0,LT,0,deltain,IF,$bytes_bwidth_in,GT,$bytes_bwidth_in,deltain,IF CDEF:deltaout=totalout,errout,-,0,LT,0,totalout,errout,-,IF CDEF:out=deltaout,0,LT,0,deltaout,IF,$bytes_bwidth_out,GT,$bytes_bwidth_out,deltaout,IF CDEF:bitsin=in,8,* CDEF:bitsout=out,8,* CDEF:kbitsin=bitsin,1000,\/ CDEF:kbitsout=bitsout,1000,\/ CDEF:percbin=bitsin,100,*,$bwidth_in,\/ CDEF:percbout=bitsout,100,*,$bwidth_out,\/ CDEF:berrin=errin,8,\/ CDEF:ber
 rout=errout,8,\/ AREA:bitsin$color_in:\"$$targets[$targetindex][11]->[0]\" LINE2:bitsout$color_out:\"$$targets[$targetindex][11]->[1]\\l\" GPRINT:kbitsin:LAST:\'$$targets[$targetindex][11]->[0] - Now\\: %.$targets->[$targetindex][20]lf $$targets[$targetindex][13]\\g\' GPRINT:percbin:LAST:\' (%.1lf%%)\' GPRINT:kbitsin:AVERAGE:\'Avg\\: %.$targets->[$targetindex][20]lf $$targets[$targetindex][13]\\g\' GPRINT:percbin:AVERAGE:\' (%.1lf%%)\' GPRINT:kbitsin:MAX:\'Max\\: %.$targets->[$targetindex][20]lf $$targets[$targetindex][13]\\g\' GPRINT:percbin:MAX:\' (%.1lf%%)\\l\' GPRINT:kbitsout:LAST:\'$$targets[$targetindex][11]->[1] - Now\\: %.$targets->[$targetindex][20]lf $$targets[$targetindex][13]\\g\' GPRINT:percbout:LAST:\' (%.1lf%%)\' GPRINT:kbitsout:AVERAGE:\'Avg\\: %.$targets->[$targetindex][20]lf $$targets[$targetindex][13]\\g\' GPRINT:percbout:AVERAGE:\' (%.1lf%%)\' GPRINT:kbitsout:MAX:\'Max\\: %.$targets->[$targetindex][20]lf $$targets[$targetindex][13]\\g\' GPRINT:percbout:MA
 X:\' (%.1lf%%)\\l\' COMMENT:\\l $opt_error\n") || die("criaGraficoBits() Fatal: Could not print to filehandle RRDTOOL: $!\n");
+   }
+ }
+ 
+@@ -832,7 +823,7 @@
+  # Setting targets defaults
+  my(@default)=("name","1G","localhost","public",161,0,"","460x150","back#FFFFFF","","","","1000","",1,10,"-1day,-1week,-1month,-1year",0,"",600,2);
+  # Setting global defaults
+- @global[1,2,3,4,5]=("/usr/local/bin/rrdtool","/usr/local/rrdfiles/","/usr/local/htdocs/","$FindBin::Bin/templates/en/","PNG");
++ @global[1,2,3,4,5]=("/usr/local/bin/rrdtool","/usr/local/rrdfiles/","/usr/local/htdocs/","/usr/local/ifgraph/templates/en/","PNG");
+  my($accept_new_target)=1;
+  my($index)=-1; # target targetindex
+  open(CONF,"$configfile") || die("readconf() Fatal: Could not read configuration file $configfile ($!)\n"); 
diff -ur /usr/ports/net-mgmt/ifgraph.orig/pkg-plist /usr/ports/net-mgmt/ifgraph/pkg-plist
--- /usr/ports/net-mgmt/ifgraph.orig/pkg-plist	Sat Apr  1 11:50:10 2006
+++ /usr/ports/net-mgmt/ifgraph/pkg-plist	Thu Jun  1 18:50:42 2006
@@ -6,6 +6,7 @@
 bin/makegraph.pl
 etc/ifgraph.conf.sample
 ifgraph/crontab.in
+ifgraph/lib/rgb.txt
 ifgraph/templates/en/if-data.html
 ifgraph/templates/en/if-header.html
 ifgraph/templates/en/if-trailer.html
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list