package Module::Install::Build; use strict; use Module::Install::Base; use vars qw{$VERSION $ISCORE @ISA}; BEGIN { $VERSION = '0.67'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } sub Build { $_[0] } sub write { my $self = shift; die "Build->write() takes no arguments\n" if @_; my %args; my $build; $args{dist_name} = $self->name || $self->determine_NAME($self->{args}); $args{license} = $self->license; $args{test_files} = $self->tests; $args{dist_version} = $self->version || $self->determine_VERSION($self->{args}); $args{dist_abstract} = $self->abstract; $args{dist_author} = $self->author; $args{sign} = $self->sign; $args{no_index} = $self->no_index; foreach my $key (qw(build_requires requires recommends conflicts)) { my $val = eval "\$self->$key" or next; $args{$key} = { map @$_, @$val }; } %args = map {($_, $args{$_})} grep {defined($args{$_})} keys %args; require Module::Build; $build = Module::Build->new(%args); $build->add_to_cleanup(split /\s+/, $self->clean_files); $build->create_build_script; } sub ACTION_reset { my ($self) = @_; die "XXX - Can't get this working yet"; require File::Path; warn "Removing inc\n"; rmpath('inc'); } sub ACTION_dist { my ($self) = @_; die "XXX - Can't get this working yet"; } # DrMath: is there an OO way to add actions to Module::Build?? # ingy: yeah # ingy: package MyBuilder; use w(Module::Build; @ISA = qw(w(Module::Build); sub ACTION_ingy # {...} # ingy: then my $build = new MyBuilder( ...parameters... ); # $build->write_build_script; 1; __END__ =head1 NAME Module::Install::Build - Extension Rules for Module::Build =head1 VERSION This document describes version 0.01 of Module::Install::Build, released March 1, 2003. =head1 SYNOPSIS In your F: use inc::Module::Install; &Build->write; =head1 DESCRIPTION This module is a wrapper around B. The C<&Build-Ewrite> function will pass on keyword/value pair functions to C. =head2 VERSION B requires either the C or C parameter. If this module can guess the package's C, it will attempt to parse the C from it. If this module can't find a default for C it will ask you to specify it manually. =head1 MAKE TARGETS B provides you with many useful C targets. A C B is the word you specify after C, like C for C. Some of the more useful targets are: =over 4 =item * all This is the default target. When you type C it is the same as entering C. This target builds all of your code and stages it in the C directory. =item * test Run your distribution's test suite. =item * install Copy the contents of the C directory into the appropriate directories in your Perl installation. =item * dist Create a distribution tarball, ready for uploading to CPAN or sharing with a friend. =item * clean distclean purge Remove the files created by C and C. =item * help Same as typing C. =back This module modifies the behaviour of some of these targets, depending on your requirements, and also adds the following targets to your Makefile: =over 4 =item * cpurge Just like purge, except that it also deletes the files originally added by this module itself. =item * chelp Short cut for typing C. =item * distsign Short cut for typing C, for B users to sign the distribution before release. =back =head1 SEE ALSO L, L, L =head1 AUTHORS Audrey Tang Eautrijus@autrijus.orgE Based on original works by Brian Ingerson EINGY@cpan.orgE =head1 COPYRIGHT Copyright 2002, 2003, 2004 by Audrey Tang Eautrijus@autrijus.orgE, Brian Ingerson Eingy@cpan.orgE This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L =cut