Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Module / Install / AutoInstall.pm
1 package Module::Install::AutoInstall;
2
3 use strict;
4 use Module::Install::Base ();
5
6 use vars qw{$VERSION @ISA $ISCORE};
7 BEGIN {
8         $VERSION = '0.91';
9         @ISA     = 'Module::Install::Base';
10         $ISCORE  = 1;
11 }
12
13 sub AutoInstall { $_[0] }
14
15 sub run {
16     my $self = shift;
17     $self->auto_install_now(@_);
18 }
19
20 sub write {
21     my $self = shift;
22     $self->auto_install(@_);
23 }
24
25 sub auto_install {
26     my $self = shift;
27     return if $self->{done}++;
28
29     # Flatten array of arrays into a single array
30     my @core = map @$_, map @$_, grep ref,
31                $self->build_requires, $self->requires;
32
33     my @config = @_;
34
35     # We'll need Module::AutoInstall
36     $self->include('Module::AutoInstall');
37     require Module::AutoInstall;
38
39     Module::AutoInstall->import(
40         (@config ? (-config => \@config) : ()),
41         (@core   ? (-core   => \@core)   : ()),
42         $self->features,
43     );
44
45     $self->makemaker_args( Module::AutoInstall::_make_args() );
46
47     my $class = ref($self);
48     $self->postamble(
49         "# --- $class section:\n" .
50         Module::AutoInstall::postamble()
51     );
52 }
53
54 sub auto_install_now {
55     my $self = shift;
56     $self->auto_install(@_);
57     Module::AutoInstall::do_install();
58 }
59
60 1;