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