rrdtool/rrdtool.patch

changeset 166
5802a00cd337
child 170
88a7941704d2
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/rrdtool/rrdtool.patch	Sat Apr 18 18:41:04 2009 +0200
     1.3 @@ -0,0 +1,257 @@
     1.4 +Index: RRDTool-OO-0.24/Makefile.PL
     1.5 +--- RRDTool-OO-0.24/Makefile.PL.orig	2008-01-24 04:29:54 +0100
     1.6 ++++ RRDTool-OO-0.24/Makefile.PL	2008-12-16 08:35:38 +0100
     1.7 +@@ -2,55 +2,12 @@
     1.8 + use ExtUtils::MakeMaker;
     1.9 + use File::Basename;
    1.10 + 
    1.11 +-# Check if RRDs is installed
    1.12 +-my $v = rrdtool_version();
    1.13 +-#print "v=$v\n";
    1.14 +-
    1.15 +-eval { require RRDs; };
    1.16 +-
    1.17 +-    # (1) libcgi is missing on most Linux/FreeBSD systems, and we
    1.18 +-    #     don't need it anyway.
    1.19 +-    # (2) as of rrdtool-1.2.11, tcl libs didn't compile, so let's
    1.20 +-    #     leave them out.
    1.21 +-my $CONFIGURE_OPTS = "--enable-perl-site-install --prefix=/usr --disable-tcl --disable-rrdcgi";
    1.22 +-
    1.23 +-my $DIST_URL = 
    1.24 +-"http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz";
    1.25 +-
    1.26 +-if($@ or !$v or $v < 1.002011) {
    1.27 +-    print <<EOT;
    1.28 +-This module requires rrdtool 1.2.x and the RRDs module to be 
    1.29 +-installed. They are available in the rrdtool distribution:
    1.30 +- $DIST_URL
    1.31 +-EOT
    1.32 +-
    1.33 +-    $| = 1;
    1.34 +-    print "Do you want me to install it for you right now ([y]/n)?";
    1.35 +-    my $in = <>;
    1.36 +-    chomp $in;
    1.37 +-    if($in =~ /^\s*$/ or $in =~ /y/i) {
    1.38 +-        if($> != 0) {
    1.39 +-            die "\nYou need to be root to do this.\n";
    1.40 +-        }
    1.41 +-        eval { install_RRDs() };
    1.42 +-        if($@) {
    1.43 +-            print $@;
    1.44 +-            note();
    1.45 +-            exit 0;
    1.46 +-        }
    1.47 +-    } else {
    1.48 +-        note();
    1.49 +-        exit 0;
    1.50 +-    }
    1.51 +-}
    1.52 +-
    1.53 + # See lib/ExtUtils/MakeMaker.pm for details of how to influence
    1.54 + # the contents of the Makefile that is written.
    1.55 + WriteMakefile(
    1.56 +     NAME              => 'RRDTool::OO',
    1.57 +     VERSION_FROM      => 'lib/RRDTool/OO.pm', # finds $VERSION
    1.58 +     PREREQ_PM         => {
    1.59 +-                         Log::Log4perl => '0.40',
    1.60 +                          RRDs          => 0,
    1.61 +                          }, # e.g., Module::Name => 1.1
    1.62 +     ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
    1.63 +Index: RRDTool-OO-0.24/lib/RRDTool/OO.pm
    1.64 +--- RRDTool-OO-0.24/lib/RRDTool/OO.pm.orig	2008-05-20 11:17:57 +0200
    1.65 ++++ RRDTool-OO-0.24/lib/RRDTool/OO.pm	2008-12-16 08:35:38 +0100
    1.66 +@@ -5,7 +5,6 @@
    1.67 + use warnings;
    1.68 + use Carp;
    1.69 + use RRDs;
    1.70 +-use Log::Log4perl qw(:easy);
    1.71 + 
    1.72 + our $VERSION = '0.22';
    1.73 + 
    1.74 +@@ -183,7 +182,7 @@
    1.75 +         # Check if we got all mandatory parameters
    1.76 +     for(@{$ref->{mandatory}}) {
    1.77 +         if(! exists $options_hash{$_}) {
    1.78 +-            Log::Log4perl->get_logger("")->logcroak(
    1.79 ++            croak(
    1.80 +                 "Mandatory parameter '$_' not set " .
    1.81 +                 "in $method() (@{[%mandatory]}) (@$options)");
    1.82 +         }
    1.83 +@@ -195,7 +194,7 @@
    1.84 +         for(keys %options_hash) {
    1.85 +             if(! exists $optional{$_} and
    1.86 +                ! exists $mandatory{$_}) {
    1.87 +-                Log::Log4perl->get_logger("")->logcroak(
    1.88 ++               croak(
    1.89 +                     "Illegal parameter '$_' in $method()");
    1.90 +             }
    1.91 +         }
    1.92 +Index: bindings/perl-shared/Makefile.PL
    1.93 +--- bindings/perl-shared/Makefile.PL.orig	2008-12-05 16:39:55 +0100
    1.94 ++++ bindings/perl-shared/Makefile.PL	2008-12-16 08:37:40 +0100
    1.95 +@@ -1,36 +1,7 @@
    1.96 + use ExtUtils::MakeMaker;
    1.97 + use Config;
    1.98 +-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
    1.99 +-# the contents of the Makefile that is written.
   1.100 + 
   1.101 +-# if the last argument when calling Makefile.PL is RPATH=/... and ... is the
   1.102 +-# path to librrd.so then the Makefile will be written such that RRDs.so knows
   1.103 +-# where to find librrd.so later on ... 
   1.104 +-my $R="";
   1.105 +-if ($ARGV[-1] =~ /RPATH=(\S+)/){
   1.106 +-	pop @ARGV;
   1.107 +-	my $rp = $1;
   1.108 +-	for ($^O){
   1.109 +-	        /linux/   && do{ $R = "-Wl,--rpath -Wl,$rp"};
   1.110 +-	        /hpux/    && do{ $R = "+b$rp"};
   1.111 +-	        /solaris/ && do{ $R = "-R$rp"};
   1.112 +-	        /bsd/     && do{ $R = "-R$rp"};
   1.113 +-                /aix/     && do{ $R = "-Wl,-blibpath:$rp"};
   1.114 +-	}
   1.115 +-}
   1.116 +-
   1.117 +-# darwin works without this because librrd contains its
   1.118 +-# install_name which will includes the final location of the
   1.119 +-# library after it is installed. This install_name gets transfered
   1.120 +-# to the perl shared object.
   1.121 +-
   1.122 +-my $librrd;
   1.123 +-if ($^O eq 'darwin'){
   1.124 +-        $librrd = '-lrrd';
   1.125 +-}
   1.126 +-else {
   1.127 +-        $librrd = "-L../../src/.libs/ $R -lrrd";
   1.128 +-}
   1.129 ++my $librrd = "-L../../src/.libs/ -lrrd -L$Config{prefix}/lib -lfreetype -lpng -lz -lart_lgpl";
   1.130 + 
   1.131 + WriteMakefile(
   1.132 +     'NAME'         => 'RRDs',
   1.133 +Index: bindings/python/setup.py
   1.134 +--- bindings/python/setup.py.orig	2008-03-15 11:39:48 +0100
   1.135 ++++ bindings/python/setup.py	2008-12-16 08:35:38 +0100
   1.136 +@@ -47,7 +47,7 @@
   1.137 +           Extension(
   1.138 +             "rrdtoolmodule",
   1.139 +             ["rrdtoolmodule.c"],
   1.140 +-            libraries=['rrd'],
   1.141 ++            libraries=['rrd', 'freetype', 'art_lgpl', 'png', 'z'],
   1.142 +             library_dirs=[library_dir],
   1.143 +             include_dirs=[include_dir],
   1.144 +           )
   1.145 +Index: configure
   1.146 +--- configure.orig	2008-12-15 23:06:39 +0100
   1.147 ++++ configure	2008-12-16 08:35:38 +0100
   1.148 +@@ -30827,7 +30827,7 @@
   1.149 +   echo $ECHO_N "(cached) $ECHO_C" >&6
   1.150 + else
   1.151 +   ac_check_lib_save_LIBS=$LIBS
   1.152 +-LIBS="-lpango-1.0  $LIBS"
   1.153 ++LIBS="-lpango $LIBS"
   1.154 + cat >conftest.$ac_ext <<_ACEOF
   1.155 + /* confdefs.h.  */
   1.156 + _ACEOF
   1.157 +@@ -31010,7 +31010,7 @@
   1.158 + 
   1.159 + fi
   1.160 + if test $ac_cv_header_pango_pango_h = yes; then
   1.161 +-  LIBS="-lpango-1.0 ${LIBS}";EX_CHECK_STATE=YES
   1.162 ++  LIBS="-lpango ${LIBS}";EX_CHECK_STATE=YES
   1.163 + fi
   1.164 + 
   1.165 + 
   1.166 +@@ -31066,14 +31066,14 @@
   1.167 +              LDFLAGS=${LDFLAGS}" "`$PKGCONFIG --libs-only-L pangocairo`
   1.168 +              LDFLAGS=${LDFLAGS}" "`$PKGCONFIG --libs-only-other pangocairo`
   1.169 +              LIBS=${LIBS}" "`$PKGCONFIG --libs-only-l pangocairo`
   1.170 +-	         	     unset ac_cv_lib_`echo pango-1.0 | sed 's/[^_a-zA-Z0-9]/_/g;s/^[0-9]/_/'`_pango_cairo_context_set_font_options
   1.171 ++	         	     unset ac_cv_lib_`echo pango | sed 's/[^_a-zA-Z0-9]/_/g;s/^[0-9]/_/'`_pango_cairo_context_set_font_options
   1.172 +              { echo "$as_me:$LINENO: checking for pango_cairo_context_set_font_options in -lpango-1.0" >&5
   1.173 + echo $ECHO_N "checking for pango_cairo_context_set_font_options in -lpango-1.0... $ECHO_C" >&6; }
   1.174 + if test "${ac_cv_lib_pango_1_0_pango_cairo_context_set_font_options+set}" = set; then
   1.175 +   echo $ECHO_N "(cached) $ECHO_C" >&6
   1.176 + else
   1.177 +   ac_check_lib_save_LIBS=$LIBS
   1.178 +-LIBS="-lpango-1.0  $LIBS"
   1.179 ++LIBS="-lpango $LIBS"
   1.180 + cat >conftest.$ac_ext <<_ACEOF
   1.181 + /* confdefs.h.  */
   1.182 + _ACEOF
   1.183 +@@ -32551,9 +32551,9 @@
   1.184 + echo $ECHO_N "checking for headers required to compile python extensions... $ECHO_C" >&6; }
   1.185 + py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
   1.186 + py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
   1.187 +-PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
   1.188 ++PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION} -I${py_prefix}/include/python"
   1.189 + if test "$py_prefix" != "$py_exec_prefix"; then
   1.190 +-  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
   1.191 ++  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION} -I${py_exec_prefix}/include/python"
   1.192 + fi
   1.193 + 
   1.194 + save_CPPFLAGS="$CPPFLAGS"
   1.195 +Index: src/rrd_open.c
   1.196 +--- src/rrd_open.c.orig	2008-12-15 23:06:22 +0100
   1.197 ++++ src/rrd_open.c	2008-12-16 08:35:38 +0100
   1.198 +@@ -218,7 +218,7 @@
   1.199 + #endif
   1.200 +     if (rdwr & RRD_CREAT)
   1.201 +         goto out_done;
   1.202 +-#ifdef USE_MADVISE
   1.203 ++#if defined(USE_MADVISE) && defined(MADV_WILLNEED) && defined(MADV_SEQUENTIAL) && defined(MADV_RANDOM)
   1.204 +     if (rdwr & RRD_COPY) {
   1.205 +         /* We will read everything in a moment (copying) */
   1.206 +         madvise(data, rrd_file->file_len, MADV_WILLNEED | MADV_SEQUENTIAL);
   1.207 +@@ -251,7 +251,7 @@
   1.208 +                       rrd->stat_head->version);
   1.209 +         goto out_nullify_head;
   1.210 +     }
   1.211 +-#if defined USE_MADVISE
   1.212 ++#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
   1.213 +     /* the ds_def will be needed soonish, so hint accordingly */
   1.214 +     madvise(data + PAGE_START(offset),
   1.215 +             sizeof(ds_def_t) * rrd->stat_head->ds_cnt, MADV_WILLNEED);
   1.216 +@@ -259,7 +259,7 @@
   1.217 +     __rrd_read(rrd->ds_def, ds_def_t,
   1.218 +                rrd->stat_head->ds_cnt);
   1.219 + 
   1.220 +-#if defined USE_MADVISE
   1.221 ++#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
   1.222 +     /* the rra_def will be needed soonish, so hint accordingly */
   1.223 +     madvise(data + PAGE_START(offset),
   1.224 +             sizeof(rra_def_t) * rrd->stat_head->rra_cnt, MADV_WILLNEED);
   1.225 +@@ -274,7 +274,7 @@
   1.226 +             rrd_set_error("live_head_t malloc");
   1.227 +             goto out_close;
   1.228 +         }
   1.229 +-#if defined USE_MADVISE
   1.230 ++#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
   1.231 +         /* the live_head will be needed soonish, so hint accordingly */
   1.232 +         madvise(data + PAGE_START(offset), sizeof(time_t), MADV_WILLNEED);
   1.233 + #endif
   1.234 +@@ -284,7 +284,7 @@
   1.235 +         rrd->live_head->last_up = *rrd->legacy_last_up;
   1.236 +         rrd->live_head->last_up_usec = 0;
   1.237 +     } else {
   1.238 +-#if defined USE_MADVISE
   1.239 ++#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
   1.240 +         /* the live_head will be needed soonish, so hint accordingly */
   1.241 +         madvise(data + PAGE_START(offset),
   1.242 +                 sizeof(live_head_t), MADV_WILLNEED);
   1.243 +@@ -414,7 +414,7 @@
   1.244 +                        + rrd->rra_ptr[i].cur_row
   1.245 +                        * rrd->stat_head->ds_cnt * sizeof(rrd_value_t));
   1.246 +         if (active_block > dontneed_start) {
   1.247 +-#ifdef USE_MADVISE
   1.248 ++#if defined(USE_MADVISE) && defined(MADV_DONTNEED)
   1.249 +             madvise(rrd_file->file_start + dontneed_start,
   1.250 +                     active_block - dontneed_start - 1, MADV_DONTNEED);
   1.251 + #endif
   1.252 +@@ -439,7 +439,7 @@
   1.253 +     }
   1.254 + 
   1.255 +     if (dontneed_start < rrd_file->file_len) {
   1.256 +-#ifdef USE_MADVISE
   1.257 ++#if defined(USE_MADVISE) && defined(MADV_DONTNEED)
   1.258 + 	    madvise(rrd_file->file_start + dontneed_start,
   1.259 + 		    rrd_file->file_len - dontneed_start, MADV_DONTNEED);
   1.260 + #endif

mercurial