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