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