rrdtool/rrdtool.patch

Wed, 08 Aug 2012 20:29:13 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 08 Aug 2012 20:29:13 +0200
changeset 490
615d51fb3fea
parent 368
603801a09393
child 491
ccaf26ae9b81
permissions
-rw-r--r--

Blind commit of old corrections, which probably are in order and needed.

michael@368 1 Index: RRDTool-OO-0.31/Makefile.PL
michael@368 2 --- RRDTool-OO-0.31/Makefile.PL.orig 2010-01-09 00:50:31.000000000 +0100
michael@368 3 +++ RRDTool-OO-0.31/Makefile.PL 2010-12-27 08:45:34.000000000 +0100
michael@368 4 @@ -10,52 +10,12 @@
michael@368 5 }
michael@368 6 };
michael@166 7
michael@166 8 -# Check if RRDs is installed
michael@166 9 -
michael@368 10 -eval "use RRDs 1.2011";
michael@166 11 -
michael@166 12 - # (1) libcgi is missing on most Linux/FreeBSD systems, and we
michael@166 13 - # don't need it anyway.
michael@166 14 - # (2) as of rrdtool-1.2.11, tcl libs didn't compile, so let's
michael@166 15 - # leave them out.
michael@166 16 -my $CONFIGURE_OPTS = "--enable-perl-site-install --prefix=/usr --disable-tcl --disable-rrdcgi";
michael@166 17 -
michael@166 18 -my $DIST_URL =
michael@166 19 -"http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz";
michael@166 20 -
michael@368 21 -if($@) {
michael@166 22 - print <<EOT;
michael@166 23 -This module requires rrdtool 1.2.x and the RRDs module to be
michael@166 24 -installed. They are available in the rrdtool distribution:
michael@166 25 - $DIST_URL
michael@166 26 -EOT
michael@166 27 -
michael@166 28 - $| = 1;
michael@368 29 - my $in = prompt ("Do you want me to install it for you right now (y/n)?","n");
michael@166 30 - chomp $in;
michael@166 31 - if($in =~ /^\s*$/ or $in =~ /y/i) {
michael@166 32 - if($> != 0) {
michael@166 33 - die "\nYou need to be root to do this.\n";
michael@166 34 - }
michael@166 35 - eval { install_RRDs() };
michael@166 36 - if($@) {
michael@166 37 - print $@;
michael@166 38 - note();
michael@166 39 - exit 0;
michael@166 40 - }
michael@166 41 - } else {
michael@166 42 - note();
michael@166 43 - exit 0;
michael@166 44 - }
michael@166 45 -}
michael@166 46 -
michael@166 47 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
michael@166 48 # the contents of the Makefile that is written.
michael@166 49 WriteMakefile(
michael@166 50 NAME => 'RRDTool::OO',
michael@166 51 VERSION_FROM => 'lib/RRDTool/OO.pm', # finds $VERSION
michael@166 52 PREREQ_PM => {
michael@166 53 - Log::Log4perl => '0.40',
michael@166 54 RRDs => 0,
michael@166 55 }, # e.g., Module::Name => 1.1
michael@368 56 $ExtUtils::MakeMaker::VERSION >= 6.50 ? (%$meta_merge) : (),
michael@368 57 Index: RRDTool-OO-0.31/lib/RRDTool/OO.pm
michael@368 58 --- RRDTool-OO-0.31/lib/RRDTool/OO.pm.orig 2010-05-26 02:26:34.000000000 +0200
michael@368 59 +++ RRDTool-OO-0.31/lib/RRDTool/OO.pm 2010-12-27 08:45:34.000000000 +0100
michael@166 60 @@ -5,7 +5,6 @@
michael@166 61 use warnings;
michael@166 62 use Carp;
michael@166 63 use RRDs;
michael@166 64 -use Log::Log4perl qw(:easy);
michael@166 65
michael@368 66 our $VERSION = '0.31';
michael@166 67
michael@368 68 @@ -189,7 +188,7 @@
michael@166 69 # Check if we got all mandatory parameters
michael@166 70 for(@{$ref->{mandatory}}) {
michael@166 71 if(! exists $options_hash{$_}) {
michael@166 72 - Log::Log4perl->get_logger("")->logcroak(
michael@166 73 + croak(
michael@166 74 "Mandatory parameter '$_' not set " .
michael@166 75 "in $method() (@{[%mandatory]}) (@$options)");
michael@166 76 }
michael@368 77 @@ -201,7 +200,7 @@
michael@166 78 for(keys %options_hash) {
michael@166 79 if(! exists $optional{$_} and
michael@166 80 ! exists $mandatory{$_}) {
michael@166 81 - Log::Log4perl->get_logger("")->logcroak(
michael@166 82 + croak(
michael@166 83 "Illegal parameter '$_' in $method()");
michael@166 84 }
michael@166 85 }
michael@166 86 Index: bindings/perl-shared/Makefile.PL
michael@368 87 --- bindings/perl-shared/Makefile.PL.orig 2010-12-17 17:10:20.000000000 +0100
michael@368 88 +++ bindings/perl-shared/Makefile.PL 2010-12-27 08:47:23.000000000 +0100
michael@490 89 @@ -1,52 +1,6 @@
michael@166 90 use ExtUtils::MakeMaker;
michael@166 91 use Config;
michael@166 92 -# See lib/ExtUtils/MakeMaker.pm for details of how to influence
michael@166 93 -# the contents of the Makefile that is written.
michael@490 94 -
michael@490 95 -if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
michael@490 96 - WriteMakefile(
michael@490 97 - 'NAME' => 'RRDs',
michael@490 98 - 'VERSION_FROM' => 'RRDs.pm',
michael@490 99 - 'DEFINE' => "-DPERLPATCHLEVEL=$Config{PATCHLEVEL} -D_CRT_SECURE_NO_WARNINGS -DWIN32",
michael@490 100 - 'INC' => '-I../../src/ "-IC:/Perl/lib/CORE" -I"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include" -I"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include"',
michael@490 101 - 'LDDLFLAGS' => '-dll -nologo -opt:ref,icf -ltcg -libpath:"C:\Perl\lib\CORE" -machine:X86',
michael@490 102 - 'LDFLAGS' => '-nologo -opt:ref,icf -ltcg -libpath:"C:\Perl\lib\CORE" -machine:X86',
michael@490 103 - 'OPTIMIZE' => '-O2 -MD',
michael@490 104 - 'LIBS' => '"..\..\win32\Release\rrdlib.lib" "..\..\win32\Release" "C:\Perl\lib\CORE\perl514.lib" -L../../contrib/lib -L"C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib" -L"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib" -L"C:\Perl\lib\CORE"',
michael@490 105 - 'realclean' => {FILES => 't/demo?.rrd t/demo?.png' },
michael@490 106 - ($] ge '5.005') ? (
michael@490 107 - 'AUTHOR' => 'Tobias Oetiker (tobi@oetiker.ch)',
michael@490 108 - 'ABSTRACT' => 'Round Robin Database Tool',
michael@490 109 - ) : ()
michael@490 110 - );
michael@490 111 -}else{
michael@490 112 - # if the last argument when calling Makefile.PL is RPATH=/... and ... is the
michael@490 113 - # path to librrd.so then the Makefile will be written such that RRDs.so knows
michael@490 114 - # where to find librrd.so later on ...
michael@490 115 - my $R="";
michael@490 116 - if ($ARGV[-1] =~ /RPATH=(\S+)/){
michael@490 117 - pop @ARGV;
michael@490 118 - my $rp = $1;
michael@490 119 - for ($^O){
michael@490 120 - /linux/ && do{ $R = "-Wl,--rpath -Wl,$rp"};
michael@490 121 - /hpux/ && do{ $R = "+b$rp"};
michael@490 122 - /solaris/ && do{ $R = "-R$rp"};
michael@490 123 - /bsd/ && do{ $R = "-R$rp"};
michael@490 124 - /aix/ && do{ $R = "-blibpath:$rp"};
michael@490 125 - }
michael@490 126 - }
michael@490 127 -
michael@490 128 - # darwin works without this because librrd contains its
michael@490 129 - # install_name which will includes the final location of the
michael@490 130 - # library after it is installed. This install_name gets transfered
michael@490 131 - # to the perl shared object.
michael@490 132 - my $librrd;
michael@490 133 - if ($^O eq 'darwin'){
michael@490 134 - $librrd = '-lrrd';
michael@490 135 - } else {
michael@490 136 - $librrd = "-L../../src/.libs/ $R -lrrd";
michael@490 137 - }
michael@490 138 -
michael@490 139 +my $librrd = "-L../../src/.libs/ -lrrd -L$Config{prefix}/lib @l_pangocairo@";
michael@490 140 WriteMakefile(
michael@490 141 'NAME' => 'RRDs',
michael@490 142 'VERSION_FROM' => 'RRDs.pm', # finds $VERSION
michael@490 143 @@ -59,5 +13,4 @@
michael@490 144 'realclean' => {FILES => 't/demo?.rrd t/demo?.png' },
michael@490 145 ($^O eq 'darwin') ? ( 'LDDLFLAGS' => "-L../../src/.libs/ $Config{lddlflags}" ) : ()
michael@490 146 );
michael@490 147 -}
michael@166 148
michael@166 149 Index: bindings/python/setup.py
michael@368 150 --- bindings/python/setup.py.orig 2008-03-15 11:39:48.000000000 +0100
michael@368 151 +++ bindings/python/setup.py 2010-12-27 08:45:34.000000000 +0100
michael@166 152 @@ -47,7 +47,7 @@
michael@166 153 Extension(
michael@166 154 "rrdtoolmodule",
michael@166 155 ["rrdtoolmodule.c"],
michael@166 156 - libraries=['rrd'],
michael@490 157 + libraries=['rrd', 'freetype', 'png', 'z'],
michael@166 158 library_dirs=[library_dir],
michael@166 159 include_dirs=[include_dir],
michael@166 160 )
michael@166 161 Index: configure
michael@368 162 --- configure.orig 2010-12-26 20:51:06.000000000 +0100
michael@368 163 +++ configure 2010-12-27 08:45:34.000000000 +0100
michael@490 164 @@ -25560,7 +25560,7 @@
michael@490 165 $as_echo_n "(cached) " >&6
michael@490 166 else
michael@490 167 ac_check_lib_save_LIBS=$LIBS
michael@490 168 -LIBS="-lpangocairo-1.0 $LIBS"
michael@490 169 +LIBS="-lpangocairo $LIBS"
michael@490 170 cat >conftest.$ac_ext <<_ACEOF
michael@490 171 /* confdefs.h. */
michael@490 172 _ACEOF
michael@490 173 @@ -25749,7 +25749,7 @@
michael@490 174
michael@490 175 fi
michael@490 176 if test "x$ac_cv_header_pango_pango_h" = x""yes; then
michael@490 177 - LIBS="-lpangocairo-1.0 ${LIBS}";EX_CHECK_STATE=YES
michael@490 178 + LIBS="-lpangocairo ${LIBS}";EX_CHECK_STATE=YES
michael@490 179 fi
michael@490 180
michael@490 181
michael@490 182 @@ -25812,7 +25812,7 @@
michael@490 183 $as_echo_n "(cached) " >&6
michael@490 184 else
michael@490 185 ac_check_lib_save_LIBS=$LIBS
michael@490 186 -LIBS="-lpangocairo-1.0 $LIBS"
michael@490 187 +LIBS="-lpangocairo $LIBS"
michael@490 188 cat >conftest.$ac_ext <<_ACEOF
michael@490 189 /* confdefs.h. */
michael@490 190 _ACEOF
michael@490 191 @@ -26100,13 +26100,13 @@
michael@368 192 if test "x""" != "x"; then
michael@368 193 CPPFLAGS="$CPPFLAGS -I"""
michael@368 194 fi
michael@368 195 - { $as_echo "$as_me:$LINENO: checking for glib_check_version in -lglib-2.0" >&5
michael@368 196 -$as_echo_n "checking for glib_check_version in -lglib-2.0... " >&6; }
michael@368 197 + { $as_echo "$as_me:$LINENO: checking for glib_check_version in -lglib2" >&5
michael@368 198 +$as_echo_n "checking for glib_check_version in -lglib2... " >&6; }
michael@368 199 if test "${ac_cv_lib_glib_2_0_glib_check_version+set}" = set; then
michael@368 200 $as_echo_n "(cached) " >&6
michael@166 201 else
michael@166 202 ac_check_lib_save_LIBS=$LIBS
michael@368 203 -LIBS="-lglib-2.0 $LIBS"
michael@368 204 +LIBS="-lglib2 $LIBS"
michael@166 205 cat >conftest.$ac_ext <<_ACEOF
michael@166 206 /* confdefs.h. */
michael@166 207 _ACEOF
michael@490 208 @@ -26295,7 +26295,7 @@
michael@166 209
michael@166 210 fi
michael@368 211 if test "x$ac_cv_header_glib_h" = x""yes; then
michael@368 212 - LIBS="-lglib-2.0 ${LIBS}";EX_CHECK_STATE=YES
michael@368 213 + LIBS="-lglib2 ${LIBS}";EX_CHECK_STATE=YES
michael@166 214 fi
michael@166 215
michael@166 216
michael@490 217 @@ -26358,7 +26358,7 @@
michael@368 218 $as_echo_n "(cached) " >&6
michael@166 219 else
michael@166 220 ac_check_lib_save_LIBS=$LIBS
michael@368 221 -LIBS="-lglib-2.0 $LIBS"
michael@368 222 +LIBS="-lglib2 $LIBS"
michael@166 223 cat >conftest.$ac_ext <<_ACEOF
michael@166 224 /* confdefs.h. */
michael@166 225 _ACEOF
michael@490 226 @@ -29709,9 +29709,9 @@
michael@368 227 $as_echo_n "checking for headers required to compile python extensions... " >&6; }
michael@166 228 py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
michael@166 229 py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
michael@166 230 -PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
michael@166 231 +PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION} -I${py_prefix}/include/python"
michael@166 232 if test "$py_prefix" != "$py_exec_prefix"; then
michael@166 233 - PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
michael@166 234 + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION} -I${py_exec_prefix}/include/python"
michael@166 235 fi
michael@166 236
michael@166 237 save_CPPFLAGS="$CPPFLAGS"
michael@368 238 Index: src/rrd_daemon.c
michael@368 239 --- src/rrd_daemon.c.orig 2010-12-21 17:06:32.000000000 +0100
michael@368 240 +++ src/rrd_daemon.c 2010-12-27 08:45:34.000000000 +0100
michael@490 241 @@ -105,7 +105,7 @@
michael@368 242 #include <tcpd.h>
michael@368 243 #endif /* HAVE_LIBWRAP */
michael@368 244
michael@368 245 -#include <glib-2.0/glib.h>
michael@368 246 +#include <glib2/glib.h>
michael@368 247 /* }}} */
michael@368 248
michael@368 249 #define RRDD_LOG(severity, ...) \
michael@166 250 Index: src/rrd_open.c
michael@368 251 --- src/rrd_open.c.orig 2010-12-26 20:24:48.000000000 +0100
michael@368 252 +++ src/rrd_open.c 2010-12-27 08:45:34.000000000 +0100
michael@490 253 @@ -296,7 +296,7 @@
michael@166 254 #endif
michael@166 255 if (rdwr & RRD_CREAT)
michael@166 256 goto out_done;
michael@166 257 -#ifdef USE_MADVISE
michael@166 258 +#if defined(USE_MADVISE) && defined(MADV_WILLNEED) && defined(MADV_SEQUENTIAL) && defined(MADV_RANDOM)
michael@166 259 if (rdwr & RRD_COPY) {
michael@166 260 /* We will read everything in a moment (copying) */
michael@368 261 madvise(data, rrd_file->file_len, MADV_WILLNEED );
michael@490 262 @@ -331,7 +331,7 @@
michael@166 263 rrd->stat_head->version);
michael@166 264 goto out_nullify_head;
michael@166 265 }
michael@166 266 -#if defined USE_MADVISE
michael@166 267 +#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
michael@166 268 /* the ds_def will be needed soonish, so hint accordingly */
michael@166 269 madvise(data + PAGE_START(offset),
michael@166 270 sizeof(ds_def_t) * rrd->stat_head->ds_cnt, MADV_WILLNEED);
michael@490 271 @@ -339,7 +339,7 @@
michael@166 272 __rrd_read(rrd->ds_def, ds_def_t,
michael@166 273 rrd->stat_head->ds_cnt);
michael@166 274
michael@166 275 -#if defined USE_MADVISE
michael@166 276 +#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
michael@166 277 /* the rra_def will be needed soonish, so hint accordingly */
michael@166 278 madvise(data + PAGE_START(offset),
michael@166 279 sizeof(rra_def_t) * rrd->stat_head->rra_cnt, MADV_WILLNEED);
michael@490 280 @@ -354,7 +354,7 @@
michael@166 281 rrd_set_error("live_head_t malloc");
michael@166 282 goto out_close;
michael@166 283 }
michael@166 284 -#if defined USE_MADVISE
michael@166 285 +#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
michael@166 286 /* the live_head will be needed soonish, so hint accordingly */
michael@166 287 madvise(data + PAGE_START(offset), sizeof(time_t), MADV_WILLNEED);
michael@166 288 #endif
michael@490 289 @@ -364,7 +364,7 @@
michael@166 290 rrd->live_head->last_up = *rrd->legacy_last_up;
michael@166 291 rrd->live_head->last_up_usec = 0;
michael@166 292 } else {
michael@166 293 -#if defined USE_MADVISE
michael@166 294 +#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
michael@166 295 /* the live_head will be needed soonish, so hint accordingly */
michael@166 296 madvise(data + PAGE_START(offset),
michael@166 297 sizeof(live_head_t), MADV_WILLNEED);
michael@490 298 @@ -535,7 +535,7 @@
michael@166 299 + rrd->rra_ptr[i].cur_row
michael@166 300 * rrd->stat_head->ds_cnt * sizeof(rrd_value_t));
michael@166 301 if (active_block > dontneed_start) {
michael@166 302 -#ifdef USE_MADVISE
michael@166 303 +#if defined(USE_MADVISE) && defined(MADV_DONTNEED)
michael@368 304 madvise(rrd_simple_file->file_start + dontneed_start,
michael@166 305 active_block - dontneed_start - 1, MADV_DONTNEED);
michael@166 306 #endif
michael@490 307 @@ -560,7 +560,7 @@
michael@166 308 }
michael@166 309
michael@166 310 if (dontneed_start < rrd_file->file_len) {
michael@166 311 -#ifdef USE_MADVISE
michael@166 312 +#if defined(USE_MADVISE) && defined(MADV_DONTNEED)
michael@368 313 madvise(rrd_simple_file->file_start + dontneed_start,
michael@166 314 rrd_file->file_len - dontneed_start, MADV_DONTNEED);
michael@166 315 #endif

mercurial