r26359 - in /trunk/libnagios-object-perl/debian: ./ patches/

ryan52-guest at users.alioth.debian.org ryan52-guest at users.alioth.debian.org
Thu Oct 30 04:39:26 UTC 2008


Author: ryan52-guest
Date: Thu Oct 30 04:39:23 2008
New Revision: 26359

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=26359
Log:
added my changes

Added:
    trunk/libnagios-object-perl/debian/README.source
    trunk/libnagios-object-perl/debian/patches/
    trunk/libnagios-object-perl/debian/patches/add-useful-whatis-entry-for-manpages
    trunk/libnagios-object-perl/debian/patches/mention-version-3-in-man-pages
    trunk/libnagios-object-perl/debian/patches/series
    trunk/libnagios-object-perl/debian/patches/use-correct-path-to-status.dat
    trunk/libnagios-object-perl/debian/patches/work-with-nagios-3
Modified:
    trunk/libnagios-object-perl/debian/changelog
    trunk/libnagios-object-perl/debian/control
    trunk/libnagios-object-perl/debian/rules

Added: trunk/libnagios-object-perl/debian/README.source
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-object-perl/debian/README.source?rev=26359&op=file
==============================================================================
--- trunk/libnagios-object-perl/debian/README.source (added)
+++ trunk/libnagios-object-perl/debian/README.source Thu Oct 30 04:39:23 2008
@@ -1,0 +1,3 @@
+This debian package uses quilt to manage changes to the upstream
+sources. To get the sources that will be built, run "quilt push
+-a". For more information see /usr/share/doc/quilt/README.source .

Modified: trunk/libnagios-object-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-object-perl/debian/changelog?rev=26359&op=diff
==============================================================================
--- trunk/libnagios-object-perl/debian/changelog (original)
+++ trunk/libnagios-object-perl/debian/changelog Thu Oct 30 04:39:23 2008
@@ -1,3 +1,25 @@
+libnagios-object-perl (0.14-2) UNRELEASED; urgency=low
+
+  * New maintainer (Closes: #501941)
+  * bump standards version to 3.8.0
+    - added a README.source
+    - use the Homepage field
+  * nothing is compiled. no need for CFLAGS.
+  * Build distclean
+    - no need to run make clean, there is no makefile.
+  * use quilt
+  * don't install the scripts and their documentation. It seems that
+    the old package didn't have the scripts even though if I build it
+    from source it does. so, for now, just don't include it.
+  * Work with Nagios 3, the version in Debian Lenny. Patch from
+    http://rt.cpan.org/Public/Bug/Display.html?id=33125, thanks
+    TOMDAAE. (Closes: #503900)
+  * Added patch to use correct path to status.dat in man pages
+  * fix short description
+  * add whatis descriptions to man pages
+
+ -- Ryan Niebur <ryanryan52 at gmail.com>  Wed, 29 Oct 2008 01:36:31 -0700
+
 libnagios-object-perl (0.14-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/libnagios-object-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-object-perl/debian/control?rev=26359&op=diff
==============================================================================
--- trunk/libnagios-object-perl/debian/control (original)
+++ trunk/libnagios-object-perl/debian/control Thu Oct 30 04:39:23 2008
@@ -1,15 +1,16 @@
 Source: libnagios-object-perl
 Section: perl
 Priority: optional
-Maintainer: Thierry Randrianiriana <randrianiriana at gmail.com>
-Build-Depends: debhelper (>= 5)
+Maintainer: Ryan Niebur <ryanryan52 at gmail.com>
+Build-Depends: debhelper (>= 5), quilt
 Build-Depends-Indep: perl (>= 5.8.0-7), libmodule-build-perl, libtest-exception-perl
-Standards-Version: 3.7.2
+Standards-Version: 3.8.0
+Homepage: http://search.cpan.org/~tobeya/Nagios-Object/
 
 Package: libnagios-object-perl
 Architecture: all
 Depends: ${perl:Depends}, ${misc:Depends}
-Description: Parse and represent Nagios configuration as objects in Perl
+Description: Perl module to parse and represent Nagios configuration as objects
  Nagios::Object is a group of modules for parsing a Nagios configuration and
  representing it as objects in perl. Inheriting from templates is supported,
  encoraged, and kept intact within the perl representation(s).
@@ -20,5 +21,3 @@
  Nagios::Config creates a new Nagios::Config object,
  which will parse a Nagios main configuration file
  and all of it's object configuration files.
- .
-  Homepage: http://search.cpan.org/~tobeya/Nagios-Object/

Added: trunk/libnagios-object-perl/debian/patches/add-useful-whatis-entry-for-manpages
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-object-perl/debian/patches/add-useful-whatis-entry-for-manpages?rev=26359&op=file
==============================================================================
--- trunk/libnagios-object-perl/debian/patches/add-useful-whatis-entry-for-manpages (added)
+++ trunk/libnagios-object-perl/debian/patches/add-useful-whatis-entry-for-manpages Thu Oct 30 04:39:23 2008
@@ -1,0 +1,44 @@
+--- a/lib/Nagios/Config.pm
++++ b/lib/Nagios/Config.pm
+@@ -29,7 +29,7 @@
+ 
+ =head1 NAME
+ 
+-Nagios::Config
++Nagios::Config - Parser for the Nagios::Object set of perl modules
+ 
+ =head1 DESCRIPTION
+ 
+--- a/lib/Nagios/Object.pm
++++ b/lib/Nagios/Object.pm
+@@ -309,7 +309,7 @@
+ 
+ =head1 NAME
+ 
+-Nagios::Object
++Nagios::Object - Creates perl objects to represent Nagios objects
+ 
+ =head1 DESCRIPTION
+ 
+--- a/lib/Nagios/Object/Config.pm
++++ b/lib/Nagios/Object/Config.pm
+@@ -26,7 +26,7 @@
+ 
+ =head1 NAME
+ 
+-Nagios::Object::Config
++Nagios::Object::Config - Perl objects to represent Nagios configuration
+ 
+ =head1 DESCRIPTION
+ 
+--- a/lib/Nagios/StatusLog.pm
++++ b/lib/Nagios/StatusLog.pm
+@@ -84,7 +84,7 @@
+ 
+ =head1 NAME
+ 
+-Nagios::StatusLog, Nagios::(Service|Host|Program)::Status
++Nagios::StatusLog, Nagios::(Service|Host|Program)::Status - Perl objects to represent the Nagios status file
+ 
+ =head1 DESCRIPTION
+ 

Added: trunk/libnagios-object-perl/debian/patches/mention-version-3-in-man-pages
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-object-perl/debian/patches/mention-version-3-in-man-pages?rev=26359&op=file
==============================================================================
--- trunk/libnagios-object-perl/debian/patches/mention-version-3-in-man-pages (added)
+++ trunk/libnagios-object-perl/debian/patches/mention-version-3-in-man-pages Thu Oct 30 04:39:23 2008
@@ -1,0 +1,20 @@
+--- a/lib/Nagios/Config.pm
++++ b/lib/Nagios/Config.pm
+@@ -58,6 +58,7 @@
+  my $cf = Nagios::Config->new( Filename => $configfile );
+  my $cf = Nagios::Config->new( Filename => $configfile, Version => 1 );
+  my $cf = Nagios::Config->new( Filename => $configfile, Version => 2 );
++ my $cf = Nagios::Config->new( Filename => $configfile, Version => 3 );
+ 
+ =cut
+ 
+--- a/lib/Nagios/Object/Config.pm
++++ b/lib/Nagios/Object/Config.pm
+@@ -41,6 +41,7 @@
+ Create a new configuration object.  If Version is not specified, the already weak
+ validation will be weakened further to allow mixing of Nagios 1.0 and 2.0 configurations.
+ For now, the minor numbers of Version are ignored.  Do not specify any letters as in '2.0a1'.
++Currently only the features present in Nagios 2 are supported for Nagios 3.
+ 
+ To enable regular expression matching, use either the "regexp_matching" or "true_regexp_matching"
+ arguments to new().    See enable_regexp_matching() and enable_true_regexp_matching() below.

Added: trunk/libnagios-object-perl/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-object-perl/debian/patches/series?rev=26359&op=file
==============================================================================
--- trunk/libnagios-object-perl/debian/patches/series (added)
+++ trunk/libnagios-object-perl/debian/patches/series Thu Oct 30 04:39:23 2008
@@ -1,0 +1,4 @@
+mention-version-3-in-man-pages
+work-with-nagios-3
+use-correct-path-to-status.dat
+add-useful-whatis-entry-for-manpages

Added: trunk/libnagios-object-perl/debian/patches/use-correct-path-to-status.dat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-object-perl/debian/patches/use-correct-path-to-status.dat?rev=26359&op=file
==============================================================================
--- trunk/libnagios-object-perl/debian/patches/use-correct-path-to-status.dat (added)
+++ trunk/libnagios-object-perl/debian/patches/use-correct-path-to-status.dat Thu Oct 30 04:39:23 2008
@@ -1,0 +1,27 @@
+--- a/lib/Nagios/StatusLog.pm
++++ b/lib/Nagios/StatusLog.pm
+@@ -94,7 +94,7 @@
+ Version => 3.0 parameter to new() for Nagios version 3.x logs.
+ 
+  my $log = Nagios::StatusLog->new(
+-                Filename => "/var/opt/nagios/status.log",
++                Filename => "/var/cache/nagios/status.dat",
+                 Version  => 1.0
+            );
+  $localhost = $log->host( "localhost" );
+@@ -104,13 +104,13 @@
+ 
+  # for Nagios v2.0
+  my $log = Nagios::StatusLog->new(
+-                Filename => "/var/opt/nagios/status.dat",
++                Filename => "/var/cache/nagios2/status.dat",
+                 Version  => 2.0
+            );
+ 
+  # for Nagios v3.0
+  my $log = Nagios::StatusLog->new(
+-                Filename => "/var/opt/nagios/status.dat",
++                Filename => "/var/cache/nagios3/status.dat",
+                 Version  => 3.0
+            );
+ 

Added: trunk/libnagios-object-perl/debian/patches/work-with-nagios-3
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-object-perl/debian/patches/work-with-nagios-3?rev=26359&op=file
==============================================================================
--- trunk/libnagios-object-perl/debian/patches/work-with-nagios-3 (added)
+++ trunk/libnagios-object-perl/debian/patches/work-with-nagios-3 Thu Oct 30 04:39:23 2008
@@ -1,0 +1,196 @@
+--- a/lib/Nagios/StatusLog.pm
++++ b/lib/Nagios/StatusLog.pm
+@@ -28,18 +28,36 @@
+         Service => [qw(
+             host_name description status current_attempt state_type last_check next_check check_type checks_enabled accept_passive_service_checks event_handler_enabled last_state_change problem_has_been_acknowledged last_hard_state time_ok time_unknown time_warning time_critical last_notification current_notification_number notifications_enabled latency execution_time flap_detection_enabled is_flapping percent_state_change scheduled_downtime_depth failure_prediction_enabled process_performance_data obsess_over_service plugin_output
+             service_description modified_attributes check_command event_handler has_been_checked should_be_scheduled check_execution_time check_latency current_state max_attempts last_hard_state_change last_time_ok last_time_warning last_time_unknown last_time_critical performance_data next_notification no_more_notifications active_checks_enabled passive_checks_enabled acknowledgement_type last_update 
++            check_interval check_options check_period current_event_id current_notification_id current_problem_id last_event_id last_problem_id long_plugin_output notification_period retry_interval
+         )],
+ 
+         Host => [qw(
+             host_name status last_check last_state_change problem_has_been_acknowledged time_up time_down time_unreachable last_notification current_notification_number notifications_enabled event_handler_enabled checks_enabled flap_detection_enabled is_flapping percent_state_change scheduled_downtime_depth failure_prediction_enabled process_performance_data plugin_output
+             modified_attributes check_command event_handler has_been_checked should_be_scheduled check_execution_time check_latency current_state last_hard_state check_type performance_data next_check current_attempt max_attempts state_type last_hard_state_change last_time_up last_time_down last_time_unreachable next_notification no_more_notifications acknowledgement_type active_checks_enabled passive_checks_enabled obsess_over_host last_update
++            check_interval check_options check_period current_event_id current_notification_id current_problem_id last_event_id last_problem_id long_plugin_output notification_period retry_interval
+         )],
+ 
+         Program => [qw(
+             program_start nagios_pid daemon_mode last_command_check last_log_rotation enable_notifications execute_service_checks accept_passive_service_checks enable_event_handlers obsess_over_services enable_flap_detection enable_failure_prediction process_performance_data
+             modified_host_attributes modified_service_attributes active_service_checks_enabled passive_service_checks_enabled active_host_checks_enabled passive_host_checks_enabled obsess_over_hosts check_service_freshness check_host_freshness global_host_event_handler global_service_event_handler
++            active_ondemand_host_check_stats active_ondemand_service_check_stats active_scheduled_host_check_stats active_scheduled_service_check_stats cached_host_check_stats cached_service_check_stats external_command_stats high_external_command_buffer_slots next_comment_id next_downtime_id next_event_id next_notification_id next_problem_id parallel_host_check_stats passive_host_check_stats passive_service_check_stats serial_host_check_stats total_external_command_buffer_slots used_external_command_buffer_slots
+         )],
+-        Info => [qw( created version )]
++        Contact => [qw(
++            contact_name modified_attributes modified_host_attributes modified_service_attributes host_notification_period service_notification_period last_host_notification last_service_notification host_notifications_enabled service_notifications_enabled
++        )],
++        Servicecomment => [qw(
++            host_name service_description entry_type comment_id source persistent entry_time expires expire_time author comment_data
++        )],
++        Hostcomment => [qw(
++            host_name entry_type comment_id source persistent entry_time expires expire_time author comment_data
++        )],
++        Servicedowntime => [qw(
++             host_name service_description downtime_id entry_time start_time end_time triggered_by fixed duration author comment
++        )],
++        Hostdowntime => [qw(
++             host_name downtime_id entry_time start_time end_time triggered_by fixed duration author comment
++        )],
++        Info => [qw( created version  )]
+     );
+ 
+     GENESIS: {
+@@ -72,7 +90,8 @@
+ 
+ Reads the Nagios status log and returns ::Status objects that can
+ be used to get status information about a host.   For Nagios version 2.x logs,
+-pass in the Version => 2.0 parameter to new().
++pass in the Version => 2.0 parameter to new(). And similarly, pass in the
++Version => 3.0 parameter to new() for Nagios version 3.x logs.
+ 
+  my $log = Nagios::StatusLog->new(
+                 Filename => "/var/opt/nagios/status.log",
+@@ -89,6 +108,12 @@
+                 Version  => 2.0
+            );
+ 
++ # for Nagios v3.0
++ my $log = Nagios::StatusLog->new(
++                Filename => "/var/opt/nagios/status.dat",
++                Version  => 3.0
++           );
++
+ =head1 METHODS
+ 
+ =over 4
+@@ -123,12 +148,17 @@
+     }
+ 
+     my $self = bless( {
+-        LOGFILE => $logfile,
+-        VERSION => $version,
+-        INFO    => {},
+-        PROGRAM => {},
+-        HOST    => {},
+-        SERVICE => {}
++        LOGFILE         => $logfile,
++        VERSION         => $version,
++        INFO            => {},
++	CONTACT         => {},
++        PROGRAM         => {},
++        HOST            => {},
++        HOSTCOMMENT     => {},
++        HOSTDOWNTIME    => {},
++        SERVICE         => {},
++        SERVICECOMMENT  => {},
++        SERVICEDOWNTIME => {}
+     }, $type );
+ 
+     $self->update();
+@@ -144,7 +174,9 @@
+ 
+ sub update {
+     my $self = shift;
+-    if ( $self->{VERSION} >= 2 ) {
++    if ( $self->{VERSION} >= 3 ) {
++        return $self->update_v3( @_ );
++    } elsif ( $self->{VERSION} >= 2 && $self->{VERSION} < 3 ) {
+         return $self->update_v2( @_ );
+     }
+     return $self->update_v1( @_ );
+@@ -298,6 +330,97 @@
+     1;
+ }
+ 
++sub update_v3 ($) {
++    my $self = shift;
++
++    # be compatible with StatusLog which makes sure that references
++    # held in client code remain valid during update (also prevents
++    # some memory leaks)
++    sub _copy3 {
++        my( $from, $to ) = @_;
++        foreach my $key ( keys %$from ) {
++            $to->{$key} = $from->{$key};
++        }
++    }
++
++    my %handlers = (
++        hoststatus => sub {
++            my $item = shift;
++            my $host = $item->{host_name};
++            if ( !exists $self->{HOST}{$host} ) {
++                $self->{HOST}{$host} = {};
++            }
++            _copy3( $item, $self->{HOST}{$host} );
++        },
++        servicestatus => sub {
++            my $item = shift;
++            my $host = $item->{host_name};
++            my $svc  = $item->{service_description};
++
++            if ( !exists $self->{SERVICE}{$host}{$svc} ) {
++                $self->{SERVICE}{$host}{$svc} = {};
++            }
++            _copy3( $item, $self->{SERVICE}{$host}{$svc} );
++        },
++        info => sub {
++            _copy3( shift, $self->{INFO} );
++        },
++        programstatus => sub {
++            _copy3( shift, $self->{PROGRAM} );
++        },
++        contactstatus => sub {
++            _copy3( shift, $self->{CONTACT} );
++        },
++        servicecomment => sub {
++            _copy3( shift, $self->{SERVICECOMMENT} );
++        },
++        hostcomment => sub {
++            _copy3( shift, $self->{HOSTCOMMENT} );
++        },
++        servicedowntime => sub {
++            _copy3( shift, $self->{SERVICEDOWNTIME} );
++        },
++        hostdowntime => sub {
++            _copy3( shift, $self->{HOSTDOWNTIME} );
++        }
++
++    );
++
++    my $log_fh = gensym;
++    open( $log_fh, "<$self->{LOGFILE}" )
++        || croak "could not open file $self->{LOGFILE} for reading: $!";
++
++    # change the first line of the RE to this:
++    # (info|programstatus|hoststatus|servicestatus|contactstatus|servicecomment|hostcomment|servicedowntime|hostdowntime) \s* {(
++    # to make it a bit more careful, but it has a measurable cost on runtime
++    my $entry_re = qr/
++        # capture the type into $1
++        (\w+) \s*
++        # capture all of the text between the brackets into $2
++        {( .*? )}
++        # match the last bracket only if followed by another definition
++        (?=(?: \s* (?:info|programstatus|hoststatus|servicestatus|contacstatus|servicecomment|hostcomment|servicedowntime|hostdowntime) \s* { | \Z) )
++        # capture remaining text (1-2 lines) into $3 for re-processing
++        (.*)$
++    /xs;
++
++    my $entry = '';
++    while ( my $line = <$log_fh> ) {
++        next if ( $line =~ /^\s*#/ );
++        $entry .= $line;
++        if ( $entry =~ m/$entry_re/ ) {
++            ( my $type, my $text, $entry ) = ( $1, $2, $3 );
++            $text =~ s/[\r\n]+\s*/\n/g; # clean up whitespace and newlines
++            my %item = map { split /\s*=\s*/, $_, 2 } split /\n/, $text;
++            $handlers{$type}->( \%item );
++        }
++    }
++
++    close( $log_fh );
++
++    1;
++}
++
+ sub list_tags {
+     my $type = ref($_[0]) ? ref($_[0]) : $_[0];
+     my $listref = ${"$type\::tags"};

Modified: trunk/libnagios-object-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-object-perl/debian/rules?rev=26359&op=diff
==============================================================================
--- trunk/libnagios-object-perl/debian/rules (original)
+++ trunk/libnagios-object-perl/debian/rules Thu Oct 30 04:39:23 2008
@@ -3,6 +3,8 @@
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
+
+include /usr/share/quilt/quilt.make
 
 PACKAGE=$(shell dh_listpackages)
 
@@ -15,19 +17,11 @@
 endif
 TMP     =`pwd`/debian/$(PACKAGE)
 
-CFLAGS = -Wall -g
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-	CFLAGS += -O0
-else
-	CFLAGS += -O2
-endif
-
 configure: configure-stamp
 
-configure-stamp:
+configure-stamp: $(QUILT_STAMPFN)
 	dh_testdir
-	$(PERL) Build.PL --installdirs vendor destdir=$(TMP)
+	$(PERL) Build.PL --installdirs vendor destdir=$(TMP) --install_path script=temp --install_path bin=temp --install_path bindoc=temp
 	touch configure-stamp
 
 build: build-stamp
@@ -39,12 +33,11 @@
 
 	touch $@
 
-clean:
+clean: unpatch
 	dh_testdir
 	dh_testroot
+	[ ! -f Build ] || ./Build distclean
 	rm -rf build-stamp Build _build blib
-
-	-$(MAKE) clean
 	dh_clean configure-stamp build-stamp
 
 install: build
@@ -54,6 +47,7 @@
 	dh_installdirs
 
 	./Build install PREFIX=$(TMP)/usr
+	rm -fr $(TMP)/temp
 
 # Build architecture-dependent files here.
 binary-arch:;




More information about the Pkg-perl-cvs-commits mailing list