'smccam' => 'Stephen McCamant <smccam@cpan.org>',
'tels' => 'perl_dummy a-t bloodgate.com',
'tomhughes' => 'Tom Hughes <tomhughes@cpan.org>',
- 'tjenness' => 'Tim Jenness <tjenness@cpan.org>'
+ 'tjenness' => 'Tim Jenness <tjenness@cpan.org>',
+ 'yves' => 'Yves Orton <yves@cpan.org>',
);
# The FILES is either filenames, or glob patterns, or directory
'CPAN' => 1,
},
+ 'ExtUtils::Install' =>
+
+ {
+ 'MAINTAINER' => 'yves',
+ 'FILES' => q[lib/ExtUtils/{Install,Installed,Packlist}.pm],
+ 'CPAN' => 1,
+ },
+
'ExtUtils::MakeMaker' =>
{
'MAINTAINER' => 'mschwern',
- 'FILES' => q[lib/ExtUtils/{Command,Install,Installed,Liblist,MakeMaker,Manifest,Mkbootstrap,Mksymlists,MM*,MY,Packlist,testlib}.pm lib/ExtUtils/{Command,Liblist,MakeMaker,MANIFEST.SKIP}
+ 'FILES' => q[lib/ExtUtils/{Command,Liblist,MakeMaker,Manifest,Mkbootstrap,Mksymlists,MM*,MY,testlib}.pm lib/ExtUtils/{Command,Liblist,MakeMaker,MANIFEST.SKIP}
lib/ExtUtils/t t/lib/MakeMaker t/lib/TieIn.pm t/lib/TieOut.pm],
'CPAN' => 1,
},
use vars qw($VERSION @ISA);
@ISA = qw(Module::Build::Base);
-$VERSION = '0.27_08';
+$VERSION = '0.27_09';
$VERSION = eval $VERSION;
# Okay, this is the brute-force method of finding out what kind of
'actions'. In this case the actions run are 'build' (the default
action), 'test', and 'install'. Other actions defined so far include:
- build html
- clean install
- code manifest
- config_data manpages
- diff ppd
- dist ppmdist
- distcheck prereq_report
- distclean pure_install
- distdir realclean
- distmeta skipcheck
- distsign test
- disttest testcover
- docs testdb
- fakeinstall testpod
+ build install
+ clean manifest
+ code manpages
+ config_data ppd
+ diff ppmdist
+ dist prereq_report
+ distcheck pure_install
+ distclean realclean
+ distdir skipcheck
+ distmeta test
+ distsign testcover
+ disttest testdb
+ docs testpod
+ fakeinstall testpodcoverage
help versioninstall
+ html
You can run the 'help' action for a complete list of actions.
This is analogous to the MakeMaker 'make all' target.
+=item testpodcoverage
+
+This checks the pod coverage of the distribution and
+produces C<Test::Harness>-style output. If you are a module author,
+this is useful to run before creating a new release.
+
=item clean
This action will clean up any files that the build process may have
=item destdir()
-=item dist_version_from()
-
=item get_options()
=item html_css()
} elsif (defined $exe) {
$thisperl .= $exe unless $thisperl =~ m/$exe$/i;
}
-
- foreach my $perl ( $c->{perlpath},
+
+ my $uninstperl;
+ if ($ENV{PERL_CORE}) {
+ # CBuilder is also in the core, so it should be available here
+ require ExtUtils::CBuilder;
+ $uninstperl = File::Spec->catfile(ExtUtils::CBuilder::->perl_src, $thisperl);
+ }
+
+ foreach my $perl ( $uninstperl || (),
+ $c->{perlpath},
map File::Spec->catfile($_, $thisperl), File::Spec->path()
) {
return $perl if -f $perl and $proto->_perl_is_same($perl);
return $p->{dist_name} if defined $p->{dist_name};
die "Can't determine distribution name, must supply either 'dist_name' or 'module_name' parameter"
- unless $p->{module_name};
+ unless $self->module_name;
- ($p->{dist_name} = $p->{module_name}) =~ s/::/-/g;
+ ($p->{dist_name} = $self->module_name) =~ s/::/-/g;
return $p->{dist_name};
}
-sub _find_dist_version_from {
+sub dist_version_from {
my ($self) = @_;
my $p = $self->{properties};
if ($self->module_name) {
- return $p->{dist_version_from} ||=
+ $p->{dist_version_from} ||=
join( '/', 'lib', split(/::/, $self->module_name) ) . '.pm';
- } else {
- return undef;
}
+ return $p->{dist_version_from} || undef;
}
sub dist_version {
my $p = $self->{properties};
return $p->{dist_version} if defined $p->{dist_version};
-
- $self->_find_dist_version_from;
- if ( $p->{dist_version_from} ) {
- my $version_from = File::Spec->catfile( split( qr{/}, $p->{dist_version_from} ) );
+ if ( my $dist_version_from = $self->dist_version_from ) {
+ my $version_from = File::Spec->catfile( split( qr{/}, $dist_version_from ) );
my $pm_info = Module::Build::ModuleInfo->new_from_file( $version_from )
or die "Can't find file $version_from to determine version";
$p->{dist_version} = $pm_info->version();
}
}
+sub ACTION_testpodcoverage {
+ my $self = shift;
+
+ $self->depends_on('docs');
+
+ eval q{use Test::Pod::Coverage 1.00; 1}
+ or die "The 'testpodcoverage' action requires ",
+ "Test::Pod::Coverage version 1.00";
+
+ all_pod_coverage_ok();
+}
+
sub ACTION_docs {
my $self = shift;
($path2root,
$self->installdirs eq 'core' ? () : qw(site) ) );
- my $fh = IO::File->new($infile);
+ my $fh = IO::File->new($infile) or die "Can't read $infile: $!";
my $abstract = Module::Build::PodParser->new(fh => $fh)->get_abstract();
my $title = join( '::', (@dirs, $name) );
sub _main_docfile {
my $self = shift;
- $self->_find_dist_version_from;
if ( my $pm_file = $self->dist_version_from ) {
(my $pod_file = $pm_file) =~ s/.pm$/.pod/;
return (-e $pod_file ? $pod_file : $pm_file);
foreach (qw(dist_name dist_version dist_author dist_abstract license)) {
(my $name = $_) =~ s/^dist_//;
$node->{$name} = $self->$_();
- die "ERROR: Missing required field '$name' for META.yml\n"
+ die "ERROR: Missing required field '$_' for META.yml\n"
unless defined($node->{$name}) && length($node->{$name});
}
"WARNING: Can't figure out install path for types: @skipping\n" .
"Files will not be installed.\n"
) if @skipping;
-
+
# Write the packlist into the same place as ExtUtils::MakeMaker.
- my $archdir = $self->install_destination('arch');
- my @ext = split /::/, $self->module_name;
- $map{write} = File::Spec->catdir($archdir, 'auto', @ext, '.packlist');
-
+ if (my $module_name = $self->module_name) {
+ my $archdir = $self->install_destination('arch');
+ my @ext = split /::/, $module_name;
+ $map{write} = File::Spec->catdir($archdir, 'auto', @ext, '.packlist');
+ }
+
# Handle destdir
if (length(my $destdir = $self->destdir || '')) {
foreach (keys %map) {
Revision history for Perl extension Module::Build.
+0.27_09 Sat Mar 11 22:48:54 EST 2006
+
+ - Fixed find_perl_interpreter() so we can find the perl executable
+ when running from uninstalled perl even when $^X contains a
+ relative path. [Yitzchak Scott-Thoennes]
+
+ - Fixed warning message where we were printing the wrong field names.
+ [Chris Dolan]
+
+ - Added a 'testpodcoverage' action that runs a POD coverage check for
+ all modules in the distribution. [Yanick Champoux]
+
+ - Added a Cookbook example of subclassing to modify an action. [Dylan
+ Martin and David Golden]
+
+ - When building HTML documentation, we were opening the POD file and
+ not checking whether the open succeeded, which of course caused
+ problems down the line if it failed. Now we do "or die(...)" like
+ everywhere else. [Spotted by Joerg Braun]
+
0.27_08 Fri Mar 3 21:22:41 CST 2006
- Due to shell quoting issues and differences in syntax between
# Save this 'cause CPAN will chdir all over the place.
my $cwd = Cwd::cwd();
- # There seems to be no way to determine if this install was successful
CPAN::Shell->install('Module::Build::Compat');
+ CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
+ or die "Couldn't install Module::Build, giving up.\n";
chdir $cwd or die "Cannot chdir() back to $cwd: $!";
}
=back 4
+=head2 Modifying an action
+
+Sometimes you might need an to have an action, say C<./Build install>,
+do something unusual. For instance, you might need to change the
+ownership of a file or do something else peculiar to your application.
+
+You can subclass C<Module::Build> on the fly using the C<subclass()>
+method and override the methods that perform the actions. You may need
+to read through C<Module::Build::Authoring> to find the methods you
+want to override, but the general pattern is C<ACTION_> followed by
+the name of the action you want to modify. Here's an example of how
+it would work for C<install>:
+
+ # Build.PL
+ use Module::Build;
+ my $class = Module::Build->subclass(
+ class => "Module::Build::Custom",
+ code => <<'SUBCLASS' );
+
+ sub ACTION_install {
+ my $self = shift;
+ # YOUR CODE HERE
+ $self->SUPER::ACTION_install;
+ }
+ SUBCLASS
+
+ $class->new(
+ module_name => 'Your::Module',
+ # rest of the usual Module::Build parameters
+ )->create_build_script;
+
+See the C<Module::Build::Authoring> pod in 0.27 or above for more
+complete documentation on this.
+
=head1 AUTHOR
Ken Williams <ken@cpan.org>