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.

     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	2010-12-27 08:45:34.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.31/lib/RRDTool/OO.pm
    58 --- RRDTool-OO-0.31/lib/RRDTool/OO.pm.orig	2010-05-26 02:26:34.000000000 +0200
    59 +++ RRDTool-OO-0.31/lib/RRDTool/OO.pm	2010-12-27 08:45:34.000000000 +0100
    60 @@ -5,7 +5,6 @@
    61  use warnings;
    62  use Carp;
    63  use RRDs;
    64 -use Log::Log4perl qw(:easy);
    66  our $VERSION = '0.31';
    68 @@ -189,7 +188,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 @@ -201,7 +200,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	2010-12-17 17:10:20.000000000 +0100
    88 +++ bindings/perl-shared/Makefile.PL	2010-12-27 08:47:23.000000000 +0100
    89 @@ -1,52 +1,6 @@
    90  use ExtUtils::MakeMaker;
    91  use Config;
    92 -# See lib/ExtUtils/MakeMaker.pm for details of how to influence
    93 -# the contents of the Makefile that is written.
    94 -
    95 -if (($Config{'osname'} eq 'MSWin32' && $ENV{'OSTYPE'} eq '')) {
    96 -	WriteMakefile(
    97 -		'NAME'         => 'RRDs',
    98 -		'VERSION_FROM' => 'RRDs.pm',
    99 -		'DEFINE'       => "-DPERLPATCHLEVEL=$Config{PATCHLEVEL} -D_CRT_SECURE_NO_WARNINGS -DWIN32",
   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"',
   101 -		'LDDLFLAGS'    => '-dll -nologo -opt:ref,icf -ltcg -libpath:"C:\Perl\lib\CORE" -machine:X86',
   102 -		'LDFLAGS'      => '-nologo -opt:ref,icf -ltcg -libpath:"C:\Perl\lib\CORE" -machine:X86',
   103 -		'OPTIMIZE'     => '-O2 -MD',
   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"',
   105 -		'realclean'    => {FILES => 't/demo?.rrd t/demo?.png' },
   106 -		($] ge '5.005') ? (
   107 -			'AUTHOR'   => 'Tobias Oetiker (tobi@oetiker.ch)',
   108 -			'ABSTRACT' => 'Round Robin Database Tool',
   109 -		) : ()
   110 -	);
   111 -}else{
   112 -	# if the last argument when calling Makefile.PL is RPATH=/... and ... is the
   113 -	# path to librrd.so then the Makefile will be written such that RRDs.so knows
   114 -	# where to find librrd.so later on ... 
   115 -	my $R="";
   116 -	if ($ARGV[-1] =~ /RPATH=(\S+)/){
   117 -		pop @ARGV;
   118 -		my $rp = $1;
   119 -		for ($^O){
   120 -			/linux/   && do{ $R = "-Wl,--rpath -Wl,$rp"};
   121 -			/hpux/    && do{ $R = "+b$rp"};
   122 -			/solaris/ && do{ $R = "-R$rp"};
   123 -			/bsd/     && do{ $R = "-R$rp"};
   124 -			/aix/     && do{ $R = "-blibpath:$rp"};
   125 -		}
   126 -	}
   127 -
   128 -	# darwin works without this because librrd contains its
   129 -	# install_name which will includes the final location of the
   130 -	# library after it is installed. This install_name gets transfered
   131 -	# to the perl shared object.
   132 -	my $librrd;
   133 -	if ($^O eq 'darwin'){
   134 -        $librrd = '-lrrd';
   135 -	} else {
   136 -		$librrd = "-L../../src/.libs/ $R -lrrd";
   137 -	}
   138 -
   139 +my $librrd = "-L../../src/.libs/ -lrrd -L$Config{prefix}/lib @l_pangocairo@";
   140  	WriteMakefile(
   141  		'NAME'         => 'RRDs',
   142  		'VERSION_FROM' => 'RRDs.pm', # finds $VERSION
   143 @@ -59,5 +13,4 @@
   144  		'realclean'    => {FILES => 't/demo?.rrd t/demo?.png' },
   145  		($^O eq 'darwin') ? ( 'LDDLFLAGS'    => "-L../../src/.libs/ $Config{lddlflags}" ) : ()
   146  	);
   147 -}
   149 Index: bindings/python/setup.py
   150 --- bindings/python/setup.py.orig	2008-03-15 11:39:48.000000000 +0100
   151 +++ bindings/python/setup.py	2010-12-27 08:45:34.000000000 +0100
   152 @@ -47,7 +47,7 @@
   153            Extension(
   154              "rrdtoolmodule",
   155              ["rrdtoolmodule.c"],
   156 -            libraries=['rrd'],
   157 +            libraries=['rrd', 'freetype', 'png', 'z'],
   158              library_dirs=[library_dir],
   159              include_dirs=[include_dir],
   160            )
   161 Index: configure
   162 --- configure.orig	2010-12-26 20:51:06.000000000 +0100
   163 +++ configure	2010-12-27 08:45:34.000000000 +0100
   164 @@ -25560,7 +25560,7 @@
   165    $as_echo_n "(cached) " >&6
   166  else
   167    ac_check_lib_save_LIBS=$LIBS
   168 -LIBS="-lpangocairo-1.0  $LIBS"
   169 +LIBS="-lpangocairo  $LIBS"
   170  cat >conftest.$ac_ext <<_ACEOF
   171  /* confdefs.h.  */
   172  _ACEOF
   173 @@ -25749,7 +25749,7 @@
   175  fi
   176  if test "x$ac_cv_header_pango_pango_h" = x""yes; then
   177 -  LIBS="-lpangocairo-1.0 ${LIBS}";EX_CHECK_STATE=YES
   178 +  LIBS="-lpangocairo ${LIBS}";EX_CHECK_STATE=YES
   179  fi
   182 @@ -25812,7 +25812,7 @@
   183    $as_echo_n "(cached) " >&6
   184  else
   185    ac_check_lib_save_LIBS=$LIBS
   186 -LIBS="-lpangocairo-1.0  $LIBS"
   187 +LIBS="-lpangocairo  $LIBS"
   188  cat >conftest.$ac_ext <<_ACEOF
   189  /* confdefs.h.  */
   190  _ACEOF
   191 @@ -26100,13 +26100,13 @@
   192   if test "x""" != "x"; then
   193     CPPFLAGS="$CPPFLAGS -I"""
   194   fi
   195 -  { $as_echo "$as_me:$LINENO: checking for glib_check_version in -lglib-2.0" >&5
   196 -$as_echo_n "checking for glib_check_version in -lglib-2.0... " >&6; }
   197 +  { $as_echo "$as_me:$LINENO: checking for glib_check_version in -lglib2" >&5
   198 +$as_echo_n "checking for glib_check_version in -lglib2... " >&6; }
   199  if test "${ac_cv_lib_glib_2_0_glib_check_version+set}" = set; then
   200    $as_echo_n "(cached) " >&6
   201  else
   202    ac_check_lib_save_LIBS=$LIBS
   203 -LIBS="-lglib-2.0  $LIBS"
   204 +LIBS="-lglib2  $LIBS"
   205  cat >conftest.$ac_ext <<_ACEOF
   206  /* confdefs.h.  */
   207  _ACEOF
   208 @@ -26295,7 +26295,7 @@
   210  fi
   211  if test "x$ac_cv_header_glib_h" = x""yes; then
   212 -  LIBS="-lglib-2.0 ${LIBS}";EX_CHECK_STATE=YES
   213 +  LIBS="-lglib2 ${LIBS}";EX_CHECK_STATE=YES
   214  fi
   217 @@ -26358,7 +26358,7 @@
   218    $as_echo_n "(cached) " >&6
   219  else
   220    ac_check_lib_save_LIBS=$LIBS
   221 -LIBS="-lglib-2.0  $LIBS"
   222 +LIBS="-lglib2  $LIBS"
   223  cat >conftest.$ac_ext <<_ACEOF
   224  /* confdefs.h.  */
   225  _ACEOF
   226 @@ -29709,9 +29709,9 @@
   227  $as_echo_n "checking for headers required to compile python extensions... " >&6; }
   228  py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
   229  py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
   230 -PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
   231 +PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION} -I${py_prefix}/include/python"
   232  if test "$py_prefix" != "$py_exec_prefix"; then
   233 -  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
   234 +  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION} -I${py_exec_prefix}/include/python"
   235  fi
   237  save_CPPFLAGS="$CPPFLAGS"
   238 Index: src/rrd_daemon.c
   239 --- src/rrd_daemon.c.orig	2010-12-21 17:06:32.000000000 +0100
   240 +++ src/rrd_daemon.c	2010-12-27 08:45:34.000000000 +0100
   241 @@ -105,7 +105,7 @@
   242  #include <tcpd.h>
   243  #endif /* HAVE_LIBWRAP */
   245 -#include <glib-2.0/glib.h>
   246 +#include <glib2/glib.h>
   247  /* }}} */
   249  #define RRDD_LOG(severity, ...) \
   250 Index: src/rrd_open.c
   251 --- src/rrd_open.c.orig	2010-12-26 20:24:48.000000000 +0100
   252 +++ src/rrd_open.c	2010-12-27 08:45:34.000000000 +0100
   253 @@ -296,7 +296,7 @@
   254  #endif
   255      if (rdwr & RRD_CREAT)
   256          goto out_done;
   257 -#ifdef USE_MADVISE
   258 +#if defined(USE_MADVISE) && defined(MADV_WILLNEED) && defined(MADV_SEQUENTIAL) && defined(MADV_RANDOM)
   259      if (rdwr & RRD_COPY) {
   260          /* We will read everything in a moment (copying) */
   261          madvise(data, rrd_file->file_len, MADV_WILLNEED );
   262 @@ -331,7 +331,7 @@
   263                        rrd->stat_head->version);
   264          goto out_nullify_head;
   265      }
   266 -#if defined USE_MADVISE
   267 +#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
   268      /* the ds_def will be needed soonish, so hint accordingly */
   269      madvise(data + PAGE_START(offset),
   270              sizeof(ds_def_t) * rrd->stat_head->ds_cnt, MADV_WILLNEED);
   271 @@ -339,7 +339,7 @@
   272      __rrd_read(rrd->ds_def, ds_def_t,
   273                 rrd->stat_head->ds_cnt);
   275 -#if defined USE_MADVISE
   276 +#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
   277      /* the rra_def will be needed soonish, so hint accordingly */
   278      madvise(data + PAGE_START(offset),
   279              sizeof(rra_def_t) * rrd->stat_head->rra_cnt, MADV_WILLNEED);
   280 @@ -354,7 +354,7 @@
   281              rrd_set_error("live_head_t malloc");
   282              goto out_close;
   283          }
   284 -#if defined USE_MADVISE
   285 +#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
   286          /* the live_head will be needed soonish, so hint accordingly */
   287          madvise(data + PAGE_START(offset), sizeof(time_t), MADV_WILLNEED);
   288  #endif
   289 @@ -364,7 +364,7 @@
   290          rrd->live_head->last_up = *rrd->legacy_last_up;
   291          rrd->live_head->last_up_usec = 0;
   292      } else {
   293 -#if defined USE_MADVISE
   294 +#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
   295          /* the live_head will be needed soonish, so hint accordingly */
   296          madvise(data + PAGE_START(offset),
   297                  sizeof(live_head_t), MADV_WILLNEED);
   298 @@ -535,7 +535,7 @@
   299                         + rrd->rra_ptr[i].cur_row
   300                         * rrd->stat_head->ds_cnt * sizeof(rrd_value_t));
   301          if (active_block > dontneed_start) {
   302 -#ifdef USE_MADVISE
   303 +#if defined(USE_MADVISE) && defined(MADV_DONTNEED)
   304              madvise(rrd_simple_file->file_start + dontneed_start,
   305                      active_block - dontneed_start - 1, MADV_DONTNEED);
   306  #endif
   307 @@ -560,7 +560,7 @@
   308      }
   310      if (dontneed_start < rrd_file->file_len) {
   311 -#ifdef USE_MADVISE
   312 +#if defined(USE_MADVISE) && defined(MADV_DONTNEED)
   313  	    madvise(rrd_simple_file->file_start + dontneed_start,
   314  		    rrd_file->file_len - dontneed_start, MADV_DONTNEED);
   315  #endif

mercurial