Build.PL
changeset 21 2247be0e2a13
parent 16 647c46fe92cf
child 24 ae403e3c2a41
equal deleted inserted replaced
20:92818898bb2c 21:2247be0e2a13
     4 use strict;
     4 use strict;
     5 use warnings;
     5 use warnings;
     6 use Module::Build;
     6 use Module::Build;
     7 
     7 
     8 my $builder = Module::Build->new(
     8 my $builder = Module::Build->new(
     9     dist_name => 'nagios-plugin-amanda-client',
     9     dist_name         => 'nagios-plugin-amanda-client',
    10     dist_version_from => 'plugins/check_amanda-client',
    10     dist_version_from => 'plugins/check_amanda-client',
    11     dist_abstract => 'nagios check for amanda clients',
    11     dist_abstract     => 'nagios check for amanda clients',
       
    12 
    12     # new type 'plugins'
    13     # new type 'plugins'
    13     #
    14     #
    14 
    15 
    15     # where to find the sources -> where to put them under blib
    16     # where to find the sources -> where to put them under blib
    16     checks_files => {
    17     checks_files => {
    17 	'plugins/check_amanda-client' => 'nagios/plugins/ius/check_amanda-client',
    18         'plugins/check_amanda-client' =>
       
    19           'nagios/plugins/ius/check_amanda-client',
    18     },
    20     },
    19     license => 'perl',
    21     license       => 'perl',
    20     requires => {
    22     requires      => { perl => 5.014, },
    21 	perl => 5.010,
    23     test_requires => { 'Test::Exception' => 0, },
    22     },
       
    23 );
    24 );
    24 
    25 
    25 
    26 # some magic to install it to the proper location}
    26 if (not defined $builder->install_path('nagios')) {
    27 if (not defined $builder->install_path('nagios')) {
    27     my $base = do {
    28     my $base = do {
    28 	if ($builder->installdirs eq 'vendor') { '/usr/lib' }
    29         if ($builder->installdirs eq 'vendor') { '/usr/lib' }
    29 	elsif (defined $builder->install_base) { $builder->install_base }
    30         elsif (defined $builder->install_base) { $builder->install_base }
    30 	else { '/usr/local/lib' }
    31         else                                   { '/usr/local/lib' }
    31     };
    32     };
    32     $builder->install_path('nagios' => $base . '/nagios');
    33     $builder->install_path('nagios' => $base . '/nagios');
    33 }
    34 }
    34 
    35 
    35 $builder->bindoc_dirs([@{$builder->bindoc_dirs}, 'blib/nagios/plugins/ius']);
    36 $builder->bindoc_dirs([@{ $builder->bindoc_dirs }, 'blib/nagios/plugins/ius']);
    36 $builder->add_build_element('checks');
    37 $builder->add_build_element('checks');
    37 
    38 
    38 $builder->create_build_script;
    39 $builder->create_build_script;
    39 
    40 
    40 __END__
    41 __END__