rrdtool.patch 9.7 KB

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