Build.PL
branchModule::Build
changeset 18 6ebc687219db
parent 17 bd500305861e
equal deleted inserted replaced
17:bd500305861e 18:6ebc687219db
     4 use warnings;
     4 use warnings;
     5 
     5 
     6 # b0rken umlauts in MYMETA.* files otherwise
     6 # b0rken umlauts in MYMETA.* files otherwise
     7 use utf8;
     7 use utf8;
     8 
     8 
     9 use Module::Build;
     9 use lib '.';
    10 
    10 use My::Builder;
    11 my $class = Module::Build->subclass
    11 my $build = My::Builder->new(
    12 (
       
    13     class => 'My::Builder',
       
    14     relpath => { nagiosplugins => 'lib/nagios/plugins/ius' },
       
    15     code => q{
       
    16         sub ACTION_install {
       
    17                 my $self = shift;
       
    18                 my $relpath;
       
    19                 $relpath->{nagiosplugins} = 'lib/nagios/plugins/ius';
       
    20 #                for (qw(nagiosplugins)) {
       
    21 #                    $self->install_base_relpaths($_, $relpath->{$_});
       
    22 #                    $self->prefix_base_relpaths($_, $relpath->{$_});
       
    23 #                }
       
    24                 use Data::Dumper;
       
    25                 print Dumper($self);
       
    26                 print Dumper($self->install_base_relpaths());
       
    27                 print Dumper($self->prefix_relpaths());
       
    28                 print Dumper($self->installdirs());
       
    29                 print Dumper($self->install_path());
       
    30                 print Dumper($self->install_base());
       
    31                 print Dumper($self->install_destination('nagiosplugins'));
       
    32                 print Dumper($self->install_types());
       
    33                 $self->SUPER::ACTION_install;
       
    34         }
       
    35     },
       
    36 );
       
    37 
       
    38 #my $build = Module::Build->new
       
    39 my $build = $class->new
       
    40 (
       
    41     dist_name => 'nagios-plugin-cert',
    12     dist_name => 'nagios-plugin-cert',
    42     dist_author => 'Matthias Förste',
    13     dist_author => 'Matthias Förste',
    43     dist_version_from => 'check_cert.pl',
    14     dist_version_from => 'check_cert.pl',
    44     requires => {
    15     requires => {
    45         'Nagios::Plugin' => 0,
    16         'Nagios::Plugin' => 0,
    46         'Crypt::OpenSSL::PKCS12' => 0,
    17         'Crypt::OpenSSL::PKCS12' => 0,
    47         'Crypt::OpenSSL::X509' => 0
    18         'Crypt::OpenSSL::X509' => 0
    48     },
    19     },
    49     extra_files => {
    20     check_files => {
    50         'check_cert.pl' => 'nagiosplugins/check_cert'
    21         'check_cert.pl' => 'nagiosplugins/check_cert'
    51     }
    22     }
    52 );
    23 );
    53 $build->add_build_element('extra');
       
    54 for my $e (qw(nagiosplugins)) {
       
    55     # these seem to be used only when --install-base or --prefix is explicitly given; if only --installdirs or nothing at all is given we probably need to set install_path
       
    56     $build->install_base_relpaths($e => $build->{relpath}->{$e});
       
    57     $build->prefix_relpaths($_, $e => $build->{relpath}->{$e}) for (qw(site core vendor));
       
    58 }
       
    59 #$build->install_path(nagiosplugin => Module::Build::install_base() . 'lib/nagios/plugins/ius');
       
    60 
    24 
       
    25 $build->add_build_element('check');
    61 $build->create_build_script;
    26 $build->create_build_script;
    62 use Data::Dumper;
       
    63 #print Dumper($build->install_base_relpaths());
       
    64 #print Dumper($build->prefix_relpaths());
       
    65 #print Dumper($build->installdirs());
       
    66 #print Dumper($build->install_path());
       
    67 #print Dumper($build->install_base());
       
    68 print Dumper($build);