Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
michael@491 | 1 | Index: RRDTool-OO-0.32/Makefile.PL |
michael@491 | 2 | --- RRDTool-OO-0.32/Makefile.PL.orig 2010-06-26 05:32:42.000000000 +0200 |
michael@491 | 3 | +++ RRDTool-OO-0.32/Makefile.PL 2012-03-08 10:57:56.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@491 | 57 | Index: RRDTool-OO-0.32/lib/RRDTool/OO.pm |
michael@491 | 58 | --- RRDTool-OO-0.32/lib/RRDTool/OO.pm.orig 2012-03-07 17:29:01.000000000 +0100 |
michael@491 | 59 | +++ RRDTool-OO-0.32/lib/RRDTool/OO.pm 2012-03-08 21:30:51.000000000 +0100 |
michael@491 | 60 | @@ -6,7 +6,6 @@ |
michael@166 | 61 | use Carp; |
michael@166 | 62 | use RRDs; |
michael@491 | 63 | use Data::Dumper; |
michael@166 | 64 | -use Log::Log4perl qw(:easy); |
michael@166 | 65 | |
michael@491 | 66 | our $VERSION = '0.32'; |
michael@166 | 67 | |
michael@491 | 68 | @@ -203,7 +202,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@491 | 77 | @@ -215,7 +214,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@491 | 87 | --- bindings/perl-shared/Makefile.PL.orig 2011-12-15 17:07:05.000000000 +0100 |
michael@491 | 88 | +++ bindings/perl-shared/Makefile.PL 2012-03-08 10:57:56.000000000 +0100 |
michael@491 | 89 | @@ -20,32 +20,7 @@ |
michael@491 | 90 | ) : () |
michael@491 | 91 | ); |
michael@491 | 92 | }else{ |
michael@490 | 93 | - # if the last argument when calling Makefile.PL is RPATH=/... and ... is the |
michael@490 | 94 | - # path to librrd.so then the Makefile will be written such that RRDs.so knows |
michael@490 | 95 | - # where to find librrd.so later on ... |
michael@490 | 96 | - my $R=""; |
michael@490 | 97 | - if ($ARGV[-1] =~ /RPATH=(\S+)/){ |
michael@490 | 98 | - pop @ARGV; |
michael@490 | 99 | - my $rp = $1; |
michael@490 | 100 | - for ($^O){ |
michael@490 | 101 | - /linux/ && do{ $R = "-Wl,--rpath -Wl,$rp"}; |
michael@490 | 102 | - /hpux/ && do{ $R = "+b$rp"}; |
michael@490 | 103 | - /solaris/ && do{ $R = "-R$rp"}; |
michael@490 | 104 | - /bsd/ && do{ $R = "-R$rp"}; |
michael@490 | 105 | - /aix/ && do{ $R = "-blibpath:$rp"}; |
michael@490 | 106 | - } |
michael@490 | 107 | - } |
michael@490 | 108 | - |
michael@490 | 109 | - # darwin works without this because librrd contains its |
michael@490 | 110 | - # install_name which will includes the final location of the |
michael@490 | 111 | - # library after it is installed. This install_name gets transfered |
michael@490 | 112 | - # to the perl shared object. |
michael@490 | 113 | - my $librrd; |
michael@490 | 114 | - if ($^O eq 'darwin'){ |
michael@490 | 115 | - $librrd = '-lrrd'; |
michael@490 | 116 | - } else { |
michael@490 | 117 | - $librrd = "-L../../src/.libs/ $R -lrrd"; |
michael@490 | 118 | - } |
michael@710 | 119 | + my $librrd = "-L../../src/.libs/ -lrrd -L$Config{prefix}/lib -lcairo -lpangocairo -lpixman-1 -lpango -lpangoft2 -lfreetype -lpng -lgobject -lgio -lgmodule -lglib -lfontconfig -lfreetype -lxml2 -lexpat -lpcre -lz -liconv -lintl -lffi"; |
michael@491 | 120 | |
michael@490 | 121 | WriteMakefile( |
michael@490 | 122 | 'NAME' => 'RRDs', |
michael@166 | 123 | Index: bindings/python/setup.py |
michael@368 | 124 | --- bindings/python/setup.py.orig 2008-03-15 11:39:48.000000000 +0100 |
michael@491 | 125 | +++ bindings/python/setup.py 2012-03-08 10:57:56.000000000 +0100 |
michael@166 | 126 | @@ -47,7 +47,7 @@ |
michael@166 | 127 | Extension( |
michael@166 | 128 | "rrdtoolmodule", |
michael@166 | 129 | ["rrdtoolmodule.c"], |
michael@166 | 130 | - libraries=['rrd'], |
michael@491 | 131 | + libraries=['rrd', 'freetype', 'art_lgpl', 'png', 'z'], |
michael@166 | 132 | library_dirs=[library_dir], |
michael@166 | 133 | include_dirs=[include_dir], |
michael@166 | 134 | ) |
michael@166 | 135 | Index: configure |
michael@491 | 136 | --- configure.orig 2012-01-24 11:09:06.000000000 +0100 |
michael@491 | 137 | +++ configure 2012-03-08 10:57:56.000000000 +0100 |
michael@490 | 138 | @@ -25560,7 +25560,7 @@ |
michael@490 | 139 | $as_echo_n "(cached) " >&6 |
michael@490 | 140 | else |
michael@490 | 141 | ac_check_lib_save_LIBS=$LIBS |
michael@490 | 142 | -LIBS="-lpangocairo-1.0 $LIBS" |
michael@490 | 143 | +LIBS="-lpangocairo $LIBS" |
michael@490 | 144 | cat >conftest.$ac_ext <<_ACEOF |
michael@490 | 145 | /* confdefs.h. */ |
michael@490 | 146 | _ACEOF |
michael@490 | 147 | @@ -25749,7 +25749,7 @@ |
michael@490 | 148 | |
michael@490 | 149 | fi |
michael@490 | 150 | if test "x$ac_cv_header_pango_pango_h" = x""yes; then |
michael@490 | 151 | - LIBS="-lpangocairo-1.0 ${LIBS}";EX_CHECK_STATE=YES |
michael@490 | 152 | + LIBS="-lpangocairo ${LIBS}";EX_CHECK_STATE=YES |
michael@490 | 153 | fi |
michael@490 | 154 | |
michael@490 | 155 | |
michael@490 | 156 | @@ -25812,7 +25812,7 @@ |
michael@490 | 157 | $as_echo_n "(cached) " >&6 |
michael@490 | 158 | else |
michael@490 | 159 | ac_check_lib_save_LIBS=$LIBS |
michael@490 | 160 | -LIBS="-lpangocairo-1.0 $LIBS" |
michael@490 | 161 | +LIBS="-lpangocairo $LIBS" |
michael@490 | 162 | cat >conftest.$ac_ext <<_ACEOF |
michael@490 | 163 | /* confdefs.h. */ |
michael@490 | 164 | _ACEOF |
michael@490 | 165 | @@ -26100,13 +26100,13 @@ |
michael@368 | 166 | if test "x""" != "x"; then |
michael@368 | 167 | CPPFLAGS="$CPPFLAGS -I""" |
michael@368 | 168 | fi |
michael@368 | 169 | - { $as_echo "$as_me:$LINENO: checking for glib_check_version in -lglib-2.0" >&5 |
michael@368 | 170 | -$as_echo_n "checking for glib_check_version in -lglib-2.0... " >&6; } |
michael@368 | 171 | + { $as_echo "$as_me:$LINENO: checking for glib_check_version in -lglib2" >&5 |
michael@368 | 172 | +$as_echo_n "checking for glib_check_version in -lglib2... " >&6; } |
michael@368 | 173 | if test "${ac_cv_lib_glib_2_0_glib_check_version+set}" = set; then |
michael@368 | 174 | $as_echo_n "(cached) " >&6 |
michael@166 | 175 | else |
michael@166 | 176 | ac_check_lib_save_LIBS=$LIBS |
michael@368 | 177 | -LIBS="-lglib-2.0 $LIBS" |
michael@368 | 178 | +LIBS="-lglib2 $LIBS" |
michael@166 | 179 | cat >conftest.$ac_ext <<_ACEOF |
michael@166 | 180 | /* confdefs.h. */ |
michael@166 | 181 | _ACEOF |
michael@490 | 182 | @@ -26295,7 +26295,7 @@ |
michael@166 | 183 | |
michael@166 | 184 | fi |
michael@368 | 185 | if test "x$ac_cv_header_glib_h" = x""yes; then |
michael@368 | 186 | - LIBS="-lglib-2.0 ${LIBS}";EX_CHECK_STATE=YES |
michael@368 | 187 | + LIBS="-lglib2 ${LIBS}";EX_CHECK_STATE=YES |
michael@166 | 188 | fi |
michael@166 | 189 | |
michael@166 | 190 | |
michael@490 | 191 | @@ -26358,7 +26358,7 @@ |
michael@368 | 192 | $as_echo_n "(cached) " >&6 |
michael@166 | 193 | else |
michael@166 | 194 | ac_check_lib_save_LIBS=$LIBS |
michael@368 | 195 | -LIBS="-lglib-2.0 $LIBS" |
michael@368 | 196 | +LIBS="-lglib2 $LIBS" |
michael@166 | 197 | cat >conftest.$ac_ext <<_ACEOF |
michael@166 | 198 | /* confdefs.h. */ |
michael@166 | 199 | _ACEOF |
michael@490 | 200 | @@ -29709,9 +29709,9 @@ |
michael@368 | 201 | $as_echo_n "checking for headers required to compile python extensions... " >&6; } |
michael@166 | 202 | py_prefix=`$PYTHON -c "import sys; print sys.prefix"` |
michael@166 | 203 | py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` |
michael@166 | 204 | -PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" |
michael@166 | 205 | +PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION} -I${py_prefix}/include/python" |
michael@166 | 206 | if test "$py_prefix" != "$py_exec_prefix"; then |
michael@166 | 207 | - PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" |
michael@166 | 208 | + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION} -I${py_exec_prefix}/include/python" |
michael@166 | 209 | fi |
michael@166 | 210 | |
michael@166 | 211 | save_CPPFLAGS="$CPPFLAGS" |
michael@368 | 212 | Index: src/rrd_daemon.c |
michael@491 | 213 | --- src/rrd_daemon.c.orig 2011-12-16 08:29:44.000000000 +0100 |
michael@491 | 214 | +++ src/rrd_daemon.c 2012-03-08 10:57:56.000000000 +0100 |
michael@490 | 215 | @@ -105,7 +105,7 @@ |
michael@368 | 216 | #include <tcpd.h> |
michael@368 | 217 | #endif /* HAVE_LIBWRAP */ |
michael@368 | 218 | |
michael@368 | 219 | -#include <glib-2.0/glib.h> |
michael@368 | 220 | +#include <glib2/glib.h> |
michael@368 | 221 | /* }}} */ |
michael@368 | 222 | |
michael@368 | 223 | #define RRDD_LOG(severity, ...) \ |
michael@166 | 224 | Index: src/rrd_open.c |
michael@491 | 225 | --- src/rrd_open.c.orig 2012-01-24 11:08:48.000000000 +0100 |
michael@491 | 226 | +++ src/rrd_open.c 2012-03-08 10:57:56.000000000 +0100 |
michael@490 | 227 | @@ -296,7 +296,7 @@ |
michael@166 | 228 | #endif |
michael@166 | 229 | if (rdwr & RRD_CREAT) |
michael@166 | 230 | goto out_done; |
michael@166 | 231 | -#ifdef USE_MADVISE |
michael@166 | 232 | +#if defined(USE_MADVISE) && defined(MADV_WILLNEED) && defined(MADV_SEQUENTIAL) && defined(MADV_RANDOM) |
michael@166 | 233 | if (rdwr & RRD_COPY) { |
michael@166 | 234 | /* We will read everything in a moment (copying) */ |
michael@368 | 235 | madvise(data, rrd_file->file_len, MADV_WILLNEED ); |
michael@490 | 236 | @@ -331,7 +331,7 @@ |
michael@166 | 237 | rrd->stat_head->version); |
michael@166 | 238 | goto out_nullify_head; |
michael@166 | 239 | } |
michael@166 | 240 | -#if defined USE_MADVISE |
michael@166 | 241 | +#if defined(USE_MADVISE) && defined(MADV_WILLNEED) |
michael@166 | 242 | /* the ds_def will be needed soonish, so hint accordingly */ |
michael@166 | 243 | madvise(data + PAGE_START(offset), |
michael@166 | 244 | sizeof(ds_def_t) * rrd->stat_head->ds_cnt, MADV_WILLNEED); |
michael@490 | 245 | @@ -339,7 +339,7 @@ |
michael@166 | 246 | __rrd_read(rrd->ds_def, ds_def_t, |
michael@166 | 247 | rrd->stat_head->ds_cnt); |
michael@166 | 248 | |
michael@166 | 249 | -#if defined USE_MADVISE |
michael@166 | 250 | +#if defined(USE_MADVISE) && defined(MADV_WILLNEED) |
michael@166 | 251 | /* the rra_def will be needed soonish, so hint accordingly */ |
michael@166 | 252 | madvise(data + PAGE_START(offset), |
michael@166 | 253 | sizeof(rra_def_t) * rrd->stat_head->rra_cnt, MADV_WILLNEED); |
michael@490 | 254 | @@ -354,7 +354,7 @@ |
michael@166 | 255 | rrd_set_error("live_head_t malloc"); |
michael@166 | 256 | goto out_close; |
michael@166 | 257 | } |
michael@166 | 258 | -#if defined USE_MADVISE |
michael@166 | 259 | +#if defined(USE_MADVISE) && defined(MADV_WILLNEED) |
michael@166 | 260 | /* the live_head will be needed soonish, so hint accordingly */ |
michael@166 | 261 | madvise(data + PAGE_START(offset), sizeof(time_t), MADV_WILLNEED); |
michael@166 | 262 | #endif |
michael@490 | 263 | @@ -364,7 +364,7 @@ |
michael@166 | 264 | rrd->live_head->last_up = *rrd->legacy_last_up; |
michael@166 | 265 | rrd->live_head->last_up_usec = 0; |
michael@166 | 266 | } else { |
michael@166 | 267 | -#if defined USE_MADVISE |
michael@166 | 268 | +#if defined(USE_MADVISE) && defined(MADV_WILLNEED) |
michael@166 | 269 | /* the live_head will be needed soonish, so hint accordingly */ |
michael@166 | 270 | madvise(data + PAGE_START(offset), |
michael@166 | 271 | sizeof(live_head_t), MADV_WILLNEED); |
michael@490 | 272 | @@ -535,7 +535,7 @@ |
michael@166 | 273 | + rrd->rra_ptr[i].cur_row |
michael@166 | 274 | * rrd->stat_head->ds_cnt * sizeof(rrd_value_t)); |
michael@166 | 275 | if (active_block > dontneed_start) { |
michael@166 | 276 | -#ifdef USE_MADVISE |
michael@166 | 277 | +#if defined(USE_MADVISE) && defined(MADV_DONTNEED) |
michael@368 | 278 | madvise(rrd_simple_file->file_start + dontneed_start, |
michael@166 | 279 | active_block - dontneed_start - 1, MADV_DONTNEED); |
michael@166 | 280 | #endif |
michael@490 | 281 | @@ -560,7 +560,7 @@ |
michael@166 | 282 | } |
michael@166 | 283 | |
michael@166 | 284 | if (dontneed_start < rrd_file->file_len) { |
michael@166 | 285 | -#ifdef USE_MADVISE |
michael@166 | 286 | +#if defined(USE_MADVISE) && defined(MADV_DONTNEED) |
michael@368 | 287 | madvise(rrd_simple_file->file_start + dontneed_start, |
michael@166 | 288 | rrd_file->file_len - dontneed_start, MADV_DONTNEED); |
michael@166 | 289 | #endif |