Image-Info-1.20.tar.gz
[Image-Info.git] / inc / Module / Install / Build.pm
blob38865f397d81a7fd34258f06ae3d71173ce4a377
1 #line 1
2 package Module::Install::Build;
4 use Module::Install::Base;
5 @ISA = qw(Module::Install::Base);
7 $VERSION = '0.60';
9 use strict;
11 sub Build { $_[0] }
13 sub write {
14 my $self = shift;
15 die "Build->write() takes no arguments\n" if @_;
17 my %args;
18 my $build;
20 $args{dist_name} = $self->name || $self->determine_NAME($self->{args});
21 $args{license} = $self->license;
22 $args{test_files} = $self->tests;
23 $args{dist_version} = $self->version || $self->determine_VERSION($self->{args});
24 $args{dist_abstract} = $self->abstract;
25 $args{dist_author} = $self->author;
26 $args{sign} = $self->sign;
27 $args{no_index} = $self->no_index;
29 foreach my $key (qw(build_requires requires recommends conflicts)) {
30 my $val = eval "\$self->$key" or next;
31 $args{$key} = { map @$_, @$val };
34 %args = map {($_, $args{$_})} grep {defined($args{$_})} keys %args;
36 require Module::Build;
37 $build = Module::Build->new(%args);
38 $build->add_to_cleanup(split /\s+/, $self->clean_files);
39 $build->create_build_script;
42 sub ACTION_reset {
43 my ($self) = @_;
44 die "XXX - Can't get this working yet";
45 require File::Path;
46 warn "Removing inc\n";
47 rmpath('inc');
50 sub ACTION_dist {
51 my ($self) = @_;
52 die "XXX - Can't get this working yet";
55 # <ingy> DrMath: is there an OO way to add actions to Module::Build??
56 # <DrMath> ingy: yeah
57 # <DrMath> ingy: package MyBuilder; use w(Module::Build; @ISA = qw(w(Module::Build); sub ACTION_ingy
58 # {...}
59 # <DrMath> ingy: then my $build = new MyBuilder( ...parameters... );
60 # $build->write_build_script;
64 __END__
66 #line 177