Build.PL
branchModule::Build
changeset 17 bd500305861e
parent 16 9501cc7d9177
child 18 6ebc687219db
equal deleted inserted replaced
16:9501cc7d9177 17:bd500305861e
     1 #!/usr/bin/perl
     1 #!/usr/bin/perl
     2 
     2 
     3 use strict;
     3 use strict;
     4 use warnings;
     4 use warnings;
     5 
     5 
       
     6 # b0rken umlauts in MYMETA.* files otherwise
       
     7 use utf8;
       
     8 
     6 use Module::Build;
     9 use Module::Build;
     7 
    10 
     8 my $build = Module::Build->new
    11 my $class = Module::Build->subclass
       
    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
     9 (
    40 (
    10     dist_name => 'nagios-plugin-cert',
    41     dist_name => 'nagios-plugin-cert',
    11     dist_author => 'Matthias Förste',
    42     dist_author => 'Matthias Förste',
    12     dist_version_from => 'lib/nagios/plugins/ius/check_cert',
    43     dist_version_from => 'check_cert.pl',
    13     requires => {
    44     requires => {
    14         'Nagios::Plugin' => 0,
    45         'Nagios::Plugin' => 0,
    15         'Crypt::OpenSSL::PKCS12' => 0,
    46         'Crypt::OpenSSL::PKCS12' => 0,
    16         'Crypt::OpenSSL::X509' => 0
    47         'Crypt::OpenSSL::X509' => 0
    17     },
    48     },
       
    49     extra_files => {
       
    50         'check_cert.pl' => 'nagiosplugins/check_cert'
       
    51     }
    18 );
    52 );
       
    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 
    19 $build->create_build_script;
    61 $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);