1 |
dpavlin |
1 |
#line 1 |
2 |
|
|
package Module::Install::Build; |
3 |
|
|
|
4 |
|
|
use Module::Install::Base; |
5 |
|
|
@ISA = qw(Module::Install::Base); |
6 |
|
|
|
7 |
|
|
$VERSION = '0.61'; |
8 |
|
|
|
9 |
|
|
use strict; |
10 |
|
|
|
11 |
|
|
sub Build { $_[0] } |
12 |
|
|
|
13 |
|
|
sub write { |
14 |
|
|
my $self = shift; |
15 |
|
|
die "Build->write() takes no arguments\n" if @_; |
16 |
|
|
|
17 |
|
|
my %args; |
18 |
|
|
my $build; |
19 |
|
|
|
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; |
28 |
|
|
|
29 |
|
|
foreach my $key (qw(build_requires requires recommends conflicts)) { |
30 |
|
|
my $val = eval "\$self->$key" or next; |
31 |
|
|
$args{$key} = { map @$_, @$val }; |
32 |
|
|
} |
33 |
|
|
|
34 |
|
|
%args = map {($_, $args{$_})} grep {defined($args{$_})} keys %args; |
35 |
|
|
|
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; |
40 |
|
|
} |
41 |
|
|
|
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'); |
48 |
|
|
} |
49 |
|
|
|
50 |
|
|
sub ACTION_dist { |
51 |
|
|
my ($self) = @_; |
52 |
|
|
die "XXX - Can't get this working yet"; |
53 |
|
|
} |
54 |
|
|
|
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; |
61 |
|
|
|
62 |
|
|
1; |
63 |
|
|
|
64 |
|
|
__END__ |
65 |
|
|
|
66 |
|
|
#line 177 |