[arch-commits] Commit in munin/trunk (PKGBUILD rrdtool-utf8-only.diff)

Dan McGee dan at archlinux.org
Sun Nov 1 21:21:05 EST 2009


    Date: Sunday, November 1, 2009 @ 21:21:05
  Author: dan
Revision: 57767

Fix UTF-8 and rrdtool issues

Added:
  munin/trunk/rrdtool-utf8-only.diff
Modified:
  munin/trunk/PKGBUILD

------------------------+
 PKGBUILD               |    9 ++++++---
 rrdtool-utf8-only.diff |   44 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2009-11-02 02:13:38 UTC (rev 57766)
+++ PKGBUILD	2009-11-02 02:21:05 UTC (rev 57767)
@@ -3,7 +3,7 @@
 # Contributor: Evan LeCompte <evanlec at gmail.com>
 pkgname=munin
 pkgver=1.2.6
-pkgrel=12
+pkgrel=13
 pkgdesc="A distributed monitoring/graphing tool"
 arch=('i686' 'x86_64')
 url="http://munin.projects.linpro.no/"
@@ -12,11 +12,13 @@
 backup=(etc/munin/munin.conf etc/logrotate.d/munin)
 install=munin.install
 source=(http://downloads.sourceforge.net/sourceforge/munin/munin_$pkgver.tar.gz
-        Makefile.config munin-cron-entry logrotate.munin)
+        Makefile.config munin-cron-entry logrotate.munin
+        rrdtool-utf8-only.diff)
 
 build() { 
 	cd $srcdir/$pkgname-$pkgver
 	cp $srcdir/Makefile.config $srcdir/$pkgname-$pkgver || exit 1
+	patch -Np3 < $srcdir/rrdtool-utf8-only.diff
 	make PREFIX='' || exit 1
 }
 
@@ -30,4 +32,5 @@
 md5sums=('45f84d58f80642ce914f147232f0d396'
          '5f9b83e0c876821cf2b20012f7cb63f0'
          'dc9c83aa2a278466fb475364462f4119'
-         'db77b53150a906256a71a9f539c7fac2')
+         'db77b53150a906256a71a9f539c7fac2'
+         '36f52b88d6465e198b5cf40e06d30b4d')

Added: rrdtool-utf8-only.diff
===================================================================
--- rrdtool-utf8-only.diff	                        (rev 0)
+++ rrdtool-utf8-only.diff	2009-11-02 02:21:05 UTC (rev 57767)
@@ -0,0 +1,44 @@
+Index: /branches/1.2-stable/server/munin-graph.in
+===================================================================
+--- /branches/1.2-stable/server/munin-graph.in (revision 1588)
++++ /branches/1.2-stable/server/munin-graph.in (revision 1797)
+@@ -31,4 +31,5 @@
+ use Getopt::Long;
+ use Time::HiRes;
++if ($RRDs::VERSION >= 1.3) { use Encode; }
+ 
+ my $graph_time= Time::HiRes::time;
+@@ -832,8 +833,15 @@
+ 	    my @complete = ();
+ 	    if ($RRDkludge) {
+-		push (@complete,
+- 		      '--font' ,'LEGEND:7:@@LIBDIR@@/VeraMono.ttf',
++		# since rrdtool 1.3 with libpango the LEGEND column alignment 
++		# only works with monospace fonts
++	  	if ( $RRDs::VERSION >= 1.3 ) { 
++		    push (@complete,
++ 		      '--font' ,'LEGEND:7:monospace');
++		} else {
++		    push (@complete,
++ 		      '--font' ,'LEGEND:7:@@LIBDIR@@/VeraMono.ttf');
++		}
++		    push (@complete,
+  		      '--font' ,'UNIT:7:@@LIBDIR@@/VeraMono.ttf',
+-
+  		      '--font' ,'AXIS:7:@@LIBDIR@@/VeraMono.ttf');
+ 	    }
+@@ -859,4 +867,14 @@
+ 	    print "\n\nrrdtool \"graph\" \"",
+ 	      join ("\"\n\t\"", at complete), "\"\n" if $DEBUG;
++
++	    # Since version 1.3 rrdtool uses libpango which needs its input  
++	    # as utf8 string. So we assume that every input is in latin1 
++	    # and decode it to perl's internal representation and then to utf8. 
++     	    if ( $RRDs::VERSION >= 1.3 ) { 
++ 	        @complete = map { 
++		    $_ = encode("utf8", (decode("latin1", $_)));
++		} @complete;
++	    }
++
+ 	    RRDs::graph (@complete);
+ 	    if (my $ERROR = RRDs::error) {



More information about the arch-commits mailing list