normalize changelog formatting
[p5sagit/local-lib.git] / eg / scripted_install.pl
1 #!/usr/bin/perl
2 # contributed by hdp@cpan.org
3
4 use strict;
5 use warnings;
6 use CPAN;
7 use Cwd;
8 use File::Spec;
9 my $target = $ENV{TARGET} ? Cwd::abs_path($ENV{TARGET}) : undef;
10
11 my $mod = CPAN::Shell->expand(Module => "local::lib");
12 $mod->get;
13 my $dir = CPAN::Shell->expand(Distribution => $mod->cpan_file)->dir;
14 chdir($dir);
15 my $make = $CPAN::Config->{make};
16 my $bootstrap = $target ? "--bootstrap=$target" : "--bootstrap";
17 system($^X, 'Makefile.PL', $bootstrap) && exit 1;
18 system($make, 'test') && exit 1;
19 system($make, 'install') && exit 1;