module-build-checkins Mailing List for Module::Build (Page 10)
Status: Beta
Brought to you by:
kwilliams
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(82) |
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(49) |
Feb
(57) |
Mar
(49) |
Apr
(49) |
May
(2) |
Jun
(147) |
Jul
(60) |
Aug
(55) |
Sep
(51) |
Oct
(68) |
Nov
(61) |
Dec
(44) |
2006 |
Jan
(27) |
Feb
(38) |
Mar
(89) |
Apr
(31) |
May
(17) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Randy W. S. <si...@us...> - 2005-12-04 05:41:31
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18712/t Modified Files: ppm.t Log Message: Only test files that are generated when manpages or HTML features are not enabled. Also, work around some idiosyncrasies with Archive::Tar on perl 5.005. Index: ppm.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/ppm.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ppm.t 2 Dec 2005 22:37:28 -0000 1.4 +++ ppm.t 4 Dec 2005 05:41:22 -0000 1.5 @@ -13,12 +13,16 @@ use Module::Build; -{ # Copied mostly verbatim from t/xs.t; should probably cache in t/common.pl - local $SIG{__WARN__} = sub {}; +my( $manpage_support, $HTML_support ); + +{ local $SIG{__WARN__} = sub {}; my $mb = Module::Build->current; $mb->verbose( 0 ); + $manpage_support = $mb->feature('manpage_support'); + $HTML_support = $mb->feature('HTML_support'); + my $have_c_compiler; stderr_of( sub {$have_c_compiler = $mb->have_c_compiler} ); @@ -27,7 +31,9 @@ } elsif ( ! $have_c_compiler ) { plan skip_all => 'C_support enabled, but no compiler found'; } elsif ( ! eval {require Archive::Tar} ) { - plan skip_all => "Archive::Tar not installed; can't test archives."; + plan skip_all => "Archive::Tar not installed to read archives."; + } elsif ( ! eval {IO::Zlib->VERSION(1.01)} ) { + plan skip_all => "IO::Zlib 1.01 required to read compressed archives."; } else { plan tests => 12; } @@ -82,10 +88,13 @@ installdirs => 'site', config => { - installsiteman1dir => catdir($tmp, 'site', 'man', 'man1'), - installsiteman3dir => catdir($tmp, 'site', 'man', 'man3'), - installsitehtml1dir => catdir($tmp, 'site', 'html'), - installsitehtml3dir => catdir($tmp, 'site', 'html'), + manpage_reset(), html_reset(), + ( $manpage_support ? + ( installsiteman1dir => catdir($tmp, 'site', 'man', 'man1'), + installsiteman3dir => catdir($tmp, 'site', 'man', 'man3') ) : () ), + ( $HTML_support ? + ( installsitehtml1dir => catdir($tmp, 'site', 'html'), + installsitehtml3dir => catdir($tmp, 'site', 'html') ) : () ), }, ); @@ -126,13 +135,25 @@ my $tarfile = $mb->ppm_name . '.tar.gz'; $tar->read( $tarfile, 1 ); -ok $tar->contains_file('blib/arch/auto/Simple/Simple.' . $mb->config('dlext')); -ok $tar->contains_file('blib/lib/Simple.pm'); -ok $tar->contains_file('blib/script/hello'); -ok $tar->contains_file('blib/man3/Simple.' . $mb->config('man3ext')); -ok $tar->contains_file('blib/man1/hello.' . $mb->config('man1ext')); -ok $tar->contains_file('blib/html/site/lib/Simple.html'); -ok $tar->contains_file('blib/html/bin/hello.html'); +my $files = { map { $_ => 1 } $tar->list_files }; + +exists_ok($files, 'blib/arch/auto/Simple/Simple.' . $mb->config('dlext')); +exists_ok($files, 'blib/lib/Simple.pm'); +exists_ok($files, 'blib/script/hello'); + +SKIP: { + skip( "manpage_support not enabled.", 2 ) unless $manpage_support; + + exists_ok($files, 'blib/man3/Simple.' . $mb->config('man3ext')); + exists_ok($files, 'blib/man1/hello.' . $mb->config('man1ext')); +} + +SKIP: { + skip( "HTML_support not enabled.", 2 ) unless $HTML_support; + + exists_ok($files, 'blib/html/site/lib/Simple.html'); + exists_ok($files, 'blib/html/bin/hello.html'); +} $tar->clear; undef( $tar ); @@ -141,33 +162,39 @@ $dist->clean; -# Make sure html documents are generated for the ppm distro even when -# they would not be built during a normal build. -$mb = Module::Build->new_from_context( - verbose => 0, - quiet => 1, +SKIP: { + skip( "HTML_support not enabled.", 3 ) unless $HTML_support; - installdirs => 'site', - config => { - html_reset(), - installsiteman1dir => catdir($tmp, 'site', 'man', 'man1'), - installsiteman3dir => catdir($tmp, 'site', 'man', 'man3'), - }, -); + # Make sure html documents are generated for the ppm distro even when + # they would not be built during a normal build. + $mb = Module::Build->new_from_context( + verbose => 0, + quiet => 1, -$mb->dispatch('ppmdist'); -is $@, ''; + installdirs => 'site', + config => { + html_reset(), + installsiteman1dir => catdir($tmp, 'site', 'man', 'man1'), + installsiteman3dir => catdir($tmp, 'site', 'man', 'man3'), + }, + ); -$tar = Archive::Tar->new; -$tar->read( $tarfile, 1 ); + $mb->dispatch('ppmdist'); + is $@, ''; -ok $tar->contains_file('blib/html/site/lib/Simple.html'); -ok $tar->contains_file('blib/html/bin/hello.html'); + $tar = Archive::Tar->new; + $tar->read( $tarfile, 1 ); -$tar->clear; + $files = {map { $_ => 1 } $tar->list_files}; -$mb->dispatch('realclean'); -$dist->clean; + exists_ok($files, 'blib/html/site/lib/Simple.html'); + exists_ok($files, 'blib/html/bin/hello.html'); + + $tar->clear; + + $mb->dispatch('realclean'); + $dist->clean; +} chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; @@ -175,3 +202,14 @@ use File::Path; rmtree( $tmp ); + + +######################################## + +sub exists_ok { + my $files = shift; + my $file = shift; + local $Test::Builder::Level = $Test::Builder::Level + 1; + ok exists( $files->{$file} ) && $files->{$file}, $file; +} + |
From: Ken W. <kwi...@us...> - 2005-12-04 03:48:15
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2142/lib/Module/Build Modified Files: Authoring.pod Log Message: Add docs for rscan_dir() Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- Authoring.pod 2 Dec 2005 12:12:21 -0000 1.27 +++ Authoring.pod 4 Dec 2005 03:48:06 -0000 1.28 @@ -1094,6 +1094,26 @@ might be useful for writing wrapper tools that might need to chdir() back out. +=item rscan_dir($dir, $pattern) + +Uses C<File::Find> to traverse the directory C<$dir>, returning a +reference to an array of entries matching C<$pattern>. C<$pattern> +may either be a regular expression (using C<qr//> or just a plain +string), or a reference to a subroutine that will return true for +wanted entries. If C<$pattern> is not given, all entries will be +returned. + +Examples: + + # All the *.pm files in lib/ + $m->rscan_dir('lib', qr/\.pm$/) + + # All the files in blib/ that aren't *.html files + $m->rscan_dir('blib', sub {-f $_ and not /\.html$/}); + + # All the files in t/ + $m->rscan_dir('t'); + =item runtime_params() =item runtime_params($key) |
From: Randy W. S. <si...@us...> - 2005-12-04 03:12:03
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29478/lib/Module/Build Modified Files: Base.pm Log Message: The css argument to Pod::Html is not supported in older versions. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.535 retrieving revision 1.536 diff -u -d -r1.535 -r1.536 --- Base.pm 3 Dec 2005 03:08:13 -0000 1.535 +++ Base.pm 4 Dec 2005 03:11:55 -0000 1.536 @@ -2326,11 +2326,12 @@ "--outfile=$outfile", '--podroot=' . $self->blib, "--htmlroot=$htmlroot", - eval {Pod::Html->VERSION(1.03); 1} ? - ('--header', '--backlink=Back to Top') : (), ); - push( @opts, "--css=$path2root/". $self->html_css ) if $self->html_css; + if ( eval{Pod::Html->VERSION(1.03)} ) { + push( @opts, ('--header', '--backlink=Back to Top') ); + push( @opts, "--css=$path2root/" . $self->html_css) if $self->html_css; + } $self->log_info("HTMLifying $infile -> $outfile\n"); $self->log_verbose("pod2html @opts\n"); |
From: Randy W. S. <si...@us...> - 2005-12-04 03:10:15
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29213/t Modified Files: metadata2.t Log Message: Use the slurp() routine from t/common.pl Index: metadata2.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/metadata2.t,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- metadata2.t 1 Dec 2005 08:20:17 -0000 1.7 +++ metadata2.t 4 Dec 2005 03:10:05 -0000 1.8 @@ -69,20 +69,6 @@ =cut --- -sub _slurp { - my $filename = shift; - die "$filename doesn't exist. Aborting" if not -e $filename; - - use IO::File; - my $fh = IO::File->new( "< $filename" ) - or die "Couldn't open $filename: $!. Aborting."; - local $/; - my $content = <$fh>; - $fh->close; - return $content; -} - - my $dist = DistGen->new( dir => $tmp ); $dist->change_file( 'Build.PL', <<"---" ); @@ -112,7 +98,7 @@ ok( -e "lib/Simple.pm", "Creating Simple.pm" ); my $mb = Module::Build->new_from_context; $mb->do_create_readme; -like( _slurp("README"), qr/NAME/, +like( slurp("README"), qr/NAME/, "Generating README from .pm"); is( $mb->dist_author->[0], 'Simple Simon <si...@si...m>', "Extracting AUTHOR from .pm"); @@ -133,7 +119,7 @@ ok( -e "lib/Simple.pod", "Creating Simple.pod" ); $mb = Module::Build->new_from_context; $mb->do_create_readme; -like( _slurp("README"), qr/NAME/, "Generating README from .pod"); +like( slurp("README"), qr/NAME/, "Generating README from .pod"); is( $mb->dist_author->[0], 'Simple Simon <si...@si...m>', "Extracting AUTHOR from .pod"); is( $mb->dist_abstract, "A simple module", @@ -158,10 +144,10 @@ ok( -e "lib/Simple.pod", "Creating Simple.pod" ); $mb = Module::Build->new_from_context; $mb->do_create_readme; -like( _slurp("README"), qr/NAME/, "Generating README from .pod over .pm"); -is( $mb->dist_author->[0], 'Simple Simon <si...@si...m>', +like( slurp("README"), qr/NAME/, "Generating README from .pod over .pm"); +is( $mb->dist_author->[0], 'Simple Simon <si...@si...m>', "Extracting AUTHOR from .pod over .pm"); -is( $mb->dist_abstract, "A simple module", +is( $mb->dist_abstract, "A simple module", "Extracting abstract from .pod over .pm"); |
From: Ken W. <kwi...@us...> - 2005-12-04 01:37:29
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15603/lib/Module/Build Modified Files: Tag: release-0_26_branch Base.pm Log Message: Don't die without dist_author Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.340.2.33 retrieving revision 1.340.2.34 diff -u -d -r1.340.2.33 -r1.340.2.34 --- Base.pm 28 Aug 2005 15:04:44 -0000 1.340.2.33 +++ Base.pm 4 Dec 2005 01:37:21 -0000 1.340.2.34 @@ -2229,7 +2229,7 @@ name: $p->{dist_name} version: $p->{dist_version} author: -@{[ join "\n", map " - $_", @{$self->dist_author} ]} +@{[ join "\n", map " - $_", @{$self->dist_author || []} ]} abstract: @{[ $self->dist_abstract ]} license: $p->{license} generated_by: Module::Build version $Module::Build::VERSION, without YAML.pm |
From: Ken W. <kwi...@us...> - 2005-12-04 01:37:29
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15603 Modified Files: Tag: release-0_26_branch Changes Log Message: Don't die without dist_author Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.299.2.50 retrieving revision 1.299.2.51 diff -u -d -r1.299.2.50 -r1.299.2.51 --- Changes 28 Aug 2005 15:04:44 -0000 1.299.2.50 +++ Changes 4 Dec 2005 01:37:21 -0000 1.299.2.51 @@ -6,6 +6,10 @@ directory when checking for a C compiler, because sometimes the latter doesn't exist (yet). [Jerry D. Hedden] + - Under certain conditions we could croak when creating the META.yml + and no author could be determined for this distribution - this has + now been fixed. + 0.2611 Mon Jun 13 22:22:53 CDT 2005 - Fix the output of an informational message that we output when |
From: Ken W. <kwi...@us...> - 2005-12-03 03:08:22
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build/Platform In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7389/lib/Module/Build/Platform Modified Files: Amiga.pm Default.pm EBCDIC.pm MPEiX.pm RiscOS.pm Unix.pm VMS.pm VOS.pm Windows.pm aix.pm darwin.pm os2.pm Log Message: I want to start using my cpan address in this spot Index: aix.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/aix.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- aix.pm 2 Dec 2005 12:12:21 -0000 1.4 +++ aix.pm 3 Dec 2005 03:08:14 -0000 1.5 @@ -28,7 +28,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...> +Ken Williams <ke...@cp...> =head1 SEE ALSO Index: Default.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/Default.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Default.pm 2 Dec 2005 12:12:21 -0000 1.3 +++ Default.pm 3 Dec 2005 03:08:14 -0000 1.4 @@ -21,7 +21,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...> +Ken Williams <ke...@cp...> =head1 SEE ALSO Index: MPEiX.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/MPEiX.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- MPEiX.pm 2 Dec 2005 12:12:21 -0000 1.3 +++ MPEiX.pm 3 Dec 2005 03:08:14 -0000 1.4 @@ -22,7 +22,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...> +Ken Williams <ke...@cp...> =head1 SEE ALSO Index: Windows.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/Windows.pm,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Windows.pm 2 Dec 2005 12:12:21 -0000 1.24 +++ Windows.pm 3 Dec 2005 03:08:14 -0000 1.25 @@ -141,7 +141,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...>, Randy W. Sims <Ra...@Th...> +Ken Williams <ke...@cp...>, Randy W. Sims <Ra...@Th...> =head1 SEE ALSO Index: VMS.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/VMS.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- VMS.pm 26 Jun 2005 15:38:16 -0000 1.9 +++ VMS.pm 3 Dec 2005 03:08:14 -0000 1.10 @@ -123,7 +123,7 @@ =head1 AUTHOR -Michael G Schwern <sc...@po...>, Ken Williams <ke...@ma...> +Michael G Schwern <sc...@po...>, Ken Williams <ke...@cp...> =head1 SEE ALSO Index: Amiga.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/Amiga.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Amiga.pm 2 Dec 2005 12:12:21 -0000 1.3 +++ Amiga.pm 3 Dec 2005 03:08:14 -0000 1.4 @@ -22,7 +22,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...> +Ken Williams <ke...@cp...> =head1 SEE ALSO Index: darwin.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/darwin.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- darwin.pm 2 Dec 2005 12:12:21 -0000 1.6 +++ darwin.pm 3 Dec 2005 03:08:14 -0000 1.7 @@ -28,7 +28,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...> +Ken Williams <ke...@cp...> =head1 SEE ALSO Index: Unix.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/Unix.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Unix.pm 2 Dec 2005 12:12:21 -0000 1.12 +++ Unix.pm 3 Dec 2005 03:08:14 -0000 1.13 @@ -43,7 +43,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...> +Ken Williams <ke...@cp...> =head1 SEE ALSO Index: VOS.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/VOS.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- VOS.pm 2 Dec 2005 12:12:21 -0000 1.3 +++ VOS.pm 3 Dec 2005 03:08:14 -0000 1.4 @@ -22,7 +22,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...> +Ken Williams <ke...@cp...> =head1 SEE ALSO Index: EBCDIC.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/EBCDIC.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- EBCDIC.pm 2 Dec 2005 12:12:21 -0000 1.3 +++ EBCDIC.pm 3 Dec 2005 03:08:14 -0000 1.4 @@ -22,7 +22,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...> +Ken Williams <ke...@cp...> =head1 SEE ALSO Index: RiscOS.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/RiscOS.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- RiscOS.pm 2 Dec 2005 12:12:21 -0000 1.3 +++ RiscOS.pm 3 Dec 2005 03:08:14 -0000 1.4 @@ -22,7 +22,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...> +Ken Williams <ke...@cp...> =head1 SEE ALSO Index: os2.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/os2.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- os2.pm 2 Dec 2005 12:12:21 -0000 1.5 +++ os2.pm 3 Dec 2005 03:08:14 -0000 1.6 @@ -25,7 +25,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...> +Ken Williams <ke...@cp...> =head1 SEE ALSO |
From: Ken W. <kwi...@us...> - 2005-12-03 03:08:22
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7389/lib/Module/Build Modified Files: Base.pm Compat.pm Cookbook.pm ModuleInfo.pm PPMMaker.pm Log Message: I want to start using my cpan address in this spot Index: Compat.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Compat.pm,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- Compat.pm 2 Dec 2005 12:12:21 -0000 1.72 +++ Compat.pm 3 Dec 2005 03:08:14 -0000 1.73 @@ -432,7 +432,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...> +Ken Williams <ke...@cp...> =head1 COPYRIGHT Index: Cookbook.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Cookbook.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Cookbook.pm 2 Dec 2005 12:12:21 -0000 1.18 +++ Cookbook.pm 3 Dec 2005 03:08:14 -0000 1.19 @@ -326,7 +326,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...> +Ken Williams <ke...@cp...> =head1 COPYRIGHT Index: ModuleInfo.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/ModuleInfo.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- ModuleInfo.pm 2 Dec 2005 12:12:21 -0000 1.15 +++ ModuleInfo.pm 3 Dec 2005 03:08:14 -0000 1.16 @@ -421,7 +421,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...>, Randy W. Sims <Ra...@Th...> +Ken Williams <ke...@cp...>, Randy W. Sims <Ra...@Th...> =head1 COPYRIGHT Index: PPMMaker.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/PPMMaker.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- PPMMaker.pm 2 Dec 2005 12:12:21 -0000 1.11 +++ PPMMaker.pm 3 Dec 2005 03:08:14 -0000 1.12 @@ -173,7 +173,7 @@ =head1 AUTHOR -Dave Rolsky <au...@ur...>, Ken Williams <ke...@ma...> +Dave Rolsky <au...@ur...>, Ken Williams <ke...@cp...> =head1 COPYRIGHT Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.534 retrieving revision 1.535 diff -u -d -r1.534 -r1.535 --- Base.pm 2 Dec 2005 12:12:21 -0000 1.534 +++ Base.pm 3 Dec 2005 03:08:13 -0000 1.535 @@ -3736,7 +3736,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...> +Ken Williams <ke...@cp...> =head1 COPYRIGHT |
From: Randy W. S. <si...@us...> - 2005-12-02 22:37:35
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15308/t Modified Files: ppm.t Log Message: Fix broken conditional. Index: ppm.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/ppm.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ppm.t 1 Dec 2005 09:00:37 -0000 1.3 +++ ppm.t 2 Dec 2005 22:37:28 -0000 1.4 @@ -24,9 +24,9 @@ if ( ! $mb->feature('C_support') ) { plan skip_all => 'C_support not enabled'; - } elsif ( !$have_c_compiler ) { + } elsif ( ! $have_c_compiler ) { plan skip_all => 'C_support enabled, but no compiler found'; - } elsif ( eval {require Archive::Tar} ) { + } elsif ( ! eval {require Archive::Tar} ) { plan skip_all => "Archive::Tar not installed; can't test archives."; } else { plan tests => 12; |
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32185/lib/Module/Build Modified Files: Authoring.pod Base.pm Compat.pm Cookbook.pm ModuleInfo.pm Notes.pm PPMMaker.pm PodParser.pm Log Message: Move some code examples from the Module::Build module documentation to Module::Build::Authoring. Attempt to add more consistency across all documents (while trying to maintain Ken's style): * Use consistent two space indentation for verbatim paragraphs. * Add some consistency to example code: variable & module names; indentation; etc * Use consistent commandline syntax: "./Build" rather than "perl Build" or "Build"; and use long option style for most options. * Use standard quoting for various URI, email addresses. * Misc. pod formatting. Index: PPMMaker.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/PPMMaker.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- PPMMaker.pm 17 Apr 2005 03:38:29 -0000 1.10 +++ PPMMaker.pm 2 Dec 2005 12:12:21 -0000 1.11 @@ -151,14 +151,17 @@ 1; __END__ + =head1 NAME Module::Build::PPMMaker - Perl Package Manager file creation + =head1 SYNOPSIS - On the command line, builds a .ppd file: - % ./Build ppd + On the command line, builds a .ppd file: + ./Build ppd + =head1 DESCRIPTION @@ -167,10 +170,12 @@ Manager". Details are here: L<http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/> + =head1 AUTHOR Dave Rolsky <au...@ur...>, Ken Williams <ke...@ma...> + =head1 COPYRIGHT Copyright (c) 2001-2005 Ken Williams. All rights reserved. @@ -178,6 +183,7 @@ This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. + =head1 SEE ALSO perl(1), Module::Build(3) Index: Compat.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Compat.pm,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- Compat.pm 1 Dec 2005 02:11:06 -0000 1.71 +++ Compat.pm 2 Dec 2005 12:12:21 -0000 1.72 @@ -273,15 +273,17 @@ Module::Build::Compat - Compatibility with ExtUtils::MakeMaker + =head1 SYNOPSIS - # In a Build.PL : - use Module::Build; - my $build = Module::Build->new - ( module_name => 'Foo::Bar', - license => 'perl', - create_makefile_pl => 'passthrough' ); - ... + # In a Build.PL : + use Module::Build; + my $build = Module::Build->new + ( module_name => 'Foo::Bar', + license => 'perl', + create_makefile_pl => 'passthrough' ); + ... + =head1 DESCRIPTION @@ -295,11 +297,12 @@ Module::Build::Compat also provides some code that helps out the Makefile.PL at runtime. + =head1 METHODS =over 4 -=item create_makefile_pl( $style, $build ) +=item create_makefile_pl($style, $build) Creates a Makefile.PL in the current directory in one of several styles, based on the supplied Module::Build object C<$build>. This is @@ -340,7 +343,7 @@ =back -=item run_build_pl( args => \@ARGV ) +=item run_build_pl(args => \@ARGV) This method runs the Build.PL script, passing it any arguments the user may have supplied to the C<perl Makefile.PL> command. Because @@ -363,7 +366,6 @@ =back - =item write_makefile() This method writes a 'dummy' Makefile that will pass all commands @@ -381,6 +383,7 @@ =back + =head1 SCENARIOS So, some common scenarios are: @@ -393,7 +396,7 @@ script), and give installation directions in a README or INSTALL document explaining how to install the module. In particular, explain that the user must install Module::Build before installing your -module. +module. Note that if you do this, you may make things easier for yourself, but harder for people with older versions of CPAN or CPANPLUS on their @@ -426,9 +429,11 @@ =back + =head1 AUTHOR -Ken Williams, ke...@ma... +Ken Williams <ke...@ma...> + =head1 COPYRIGHT @@ -437,8 +442,10 @@ This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. + =head1 SEE ALSO Module::Build(3), ExtUtils::MakeMaker(3) + =cut Index: Notes.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Notes.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Notes.pm 14 Jul 2005 03:03:56 -0000 1.8 +++ Notes.pm 2 Dec 2005 12:12:21 -0000 1.9 @@ -186,6 +186,7 @@ $notes_name - Configuration for $module_name + =head1 SYNOPSIS use $notes_name; @@ -199,6 +200,7 @@ $notes_name->set_feature(bar => \$new_value); $notes_name->write; # Save changes + =head1 DESCRIPTION This module holds the configuration data for the C<$module_name> @@ -208,6 +210,7 @@ module, and you should attempt to understand the repercussions of your actions. + =head1 METHODS =over 4 @@ -259,6 +262,7 @@ =back + =head1 AUTHOR C<$notes_name> was automatically created using C<Module::Build>. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.533 retrieving revision 1.534 diff -u -d -r1.533 -r1.534 --- Base.pm 1 Dec 2005 08:48:10 -0000 1.533 +++ Base.pm 2 Dec 2005 12:12:21 -0000 1.534 @@ -449,7 +449,7 @@ my $module_name = $self->module_name or die "The config_data feature requires that 'module_name' be set"; - my $notes_name = $module_name . '::ConfigData'; + my $notes_name = $module_name . '::ConfigData'; # TODO: Customize name ??? my $notes_pm = File::Spec->catfile($self->blib, 'lib', split /::/, "$notes_name.pm"); return if $self->up_to_date([$self->config_file('config_data'), $self->config_file('features')], $notes_pm); @@ -3736,7 +3736,7 @@ =head1 AUTHOR -Ken Williams, ke...@ma... +Ken Williams <ke...@ma...> =head1 COPYRIGHT Index: Cookbook.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Cookbook.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Cookbook.pm 27 Nov 2005 02:53:30 -0000 1.17 +++ Cookbook.pm 2 Dec 2005 12:12:21 -0000 1.18 @@ -1,9 +1,11 @@ package Module::Build::Cookbook; + =head1 NAME Module::Build::Cookbook - Examples of Module::Build Usage + =head1 DESCRIPTION C<Module::Build> isn't conceptually very complicated, but examples are @@ -15,17 +17,19 @@ The definitional of how stuff works is in the main C<Module::Build> documentation. It's best to get familiar with that too. + =head1 BASIC RECIPES + =head2 The basic installation recipe for modules that use Module::Build In most cases, you can just issue the following commands from your shell: - perl Build.PL - Build - Build test - Build install + perl Build.PL + Build + Build test + Build install There's nothing complicated here - first you're running a script called F<Build.PL>, then you're running a (newly-generated) script @@ -37,10 +41,10 @@ of perl installed, you can install to one particular perl's library directories like so: - /usr/bin/perl5.8.1 Build.PL - Build - Build test - Build install + /usr/bin/perl5.8.1 Build.PL + Build + Build test + Build install The F<Build> script knows what perl was used to run C<Build.PL>, so you don't need to re-invoke the F<Build> script with the complete perl @@ -50,10 +54,11 @@ If the current directory (usually called '.') isn't in your path, you can do C<./Build> or C<perl Build> to run the script: - /usr/bin/perl Build.PL - ./Build - ./Build test - ./Build install + /usr/bin/perl Build.PL + ./Build + ./Build test + ./Build install + =head2 Making a CPAN.pm-compatible distribution @@ -62,11 +67,11 @@ versions, do the following: Create a file in your distribution named F<Makefile.PL>, with the -following contents: +following contents: - use Module::Build::Compat; - Module::Build::Compat->run_build_pl(args => \@ARGV); - Module::Build::Compat->write_makefile(); + use Module::Build::Compat; + Module::Build::Compat->run_build_pl(args => \@ARGV); + Module::Build::Compat->write_makefile(); Now CPAN will work as usual, i.e.: `perl Makefile.PL`, `make`, `make test`, and `make install`. @@ -74,6 +79,7 @@ Alternatively, see the C<create_makefile_pl> parameter to the C<< Module::Build->new() >> method. + =head2 Installing modules using the programmatic interface If you need to build, test, and/or install modules from within some @@ -83,14 +89,15 @@ subclass) and then invoke its C<dispatch()> method to run various actions. - my $b = Module::Build->new( - module_name => 'Foo::Bar', - license => 'perl', - requires => { 'Some::Module' => '1.23' }, - ); - $b->dispatch('build'); - $b->dispatch('test', verbose => 1); - $b->dispatch('install'); + my $build = Module::Build->new + ( + module_name => 'Foo::Bar', + license => 'perl', + requires => { 'Some::Module' => '1.23' }, + ); + $build->dispatch('build'); + $build->dispatch('test', verbose => 1); + $build->dispatch('install'); The first argument to C<dispatch()> is the name of the action, and any following arguments are named parameters. @@ -98,6 +105,7 @@ This is the interface we use to test Module::Build itself in the regression tests. + =head2 Installing to a temporary directory To create packages for package managers like RedHat's C<rpm> or @@ -105,7 +113,8 @@ first and then create the package from that temporary installation. To do this, specify the C<destdir> parameter to the C<install> action: - Build install destdir=/tmp/my-package-1.003 + ./Build install --destdir /tmp/my-package-1.003 + =head2 Running a single test file @@ -128,16 +137,17 @@ =head1 ADVANCED RECIPES + =head2 Changing the order of the build process The C<build_elements> property specifies the steps C<Module::Build> will take when building a distribution. To change the build order, change the order of the entries in that property: - # Process pod files first - my @e = @{$build->build_elements}; - my $i = grep {$e[$_] eq 'pod'} 0..$#e; - unshift @e, splice @e, $i, 1; + # Process pod files first + my @e = @{$build->build_elements}; + my $i = grep {$e[$_] eq 'pod'} 0..$#e; + unshift @e, splice @e, $i, 1; Currently, C<build_elements> has the following default value: @@ -147,6 +157,7 @@ non-obvious (and non-documented!) ordering dependencies in the C<Module::Build> code. + =head2 Dealing with more than one perl installation If you have more than one C<perl> interpreter installed on your @@ -175,18 +186,18 @@ Sometimes you might have extra types of files that you want to install alongside the standard types like F<.pm> and F<.pod> files. For -instance, you might have a F<Foo.dat> file containing some data -related to the C<Boo::Baz> module. Assuming the data doesn't need to +instance, you might have a F<Bar.dat> file containing some data +related to the C<Foo::Bar> module. Assuming the data doesn't need to be created on the fly, the best place for it to end up is probably as -F<Boo/Baz/Foo.dat> somewhere in perl's C<@INC> path so C<Boo::Baz> can +F<Foo/Bar.dat> somewhere in perl's C<@INC> path so C<Foo::Bar> can access it easily at runtime. The following code from a sample C<Build.PL> file demonstrates how to accomplish this: use Module::Build; - my $build = new Module::Build + my $build = Module::Build->new ( - module_name => 'Boo::Baz', - ... + module_name => 'Foo::Bar', + ...other stuff here... ); $build->add_build_element('dat'); $build->create_build_script; @@ -202,9 +213,9 @@ use Module::Build; my $build = new Module::Build ( - module_name => 'Boo::Baz', - dat_files => {'some/dir/Foo.dat' => 'lib/Boo/Baz/Foo.dat'}, - ... + module_name => 'Foo::Bar', + dat_files => {'some/dir/Bar.dat' => 'lib/Foo/Bar.dat'}, + ...other stuff here... ); $build->add_build_element('dat'); $build->create_build_script; @@ -224,8 +235,8 @@ EOF my $build = $class->new ( - module_name => 'Boo::Baz', - ... + module_name => 'Foo::Bar', + ...other stuff here... ); $build->add_build_element('dat'); $build->create_build_script; @@ -238,6 +249,7 @@ that first appeared in version 0.26. Before that it could certainly still be done, but the simple cases took a bit more work. + =head2 Adding new elements to the install process By default, Module::Build creates seven subdirectories of the F<blib/> @@ -252,14 +264,15 @@ should be installed. To do this, use the C<install_path> parameter to the C<new()> method: - my $b = Module::Build->new - (... - install_path => { conf => $installation_path } - ); + my $build = Module::Build->new + ( + ...other stuff here... + install_path => { conf => $installation_path } + ); Or you can call the C<install_path()> method later: - $b->install_path->{conf} || $installation_path; + $build->install_path->{conf} || $installation_path; (Sneakily, or perhaps uglily, C<install_path()> returns a reference to a hash of install paths, and you can modify that hash to your heart's @@ -276,11 +289,13 @@ See also L<"Adding new file types to the build process"> for how to create the stuff in F<blib/conf/> in the first place. + =head1 EXAMPLES ON CPAN Several distributions on CPAN are making good use of various features of Module::Build. They can serve as real-world examples for others. + =head2 SVN-Notify-Mirror L<http://search.cpan.org/~jpeacock/SVN-Notify-Mirror/> @@ -311,7 +326,8 @@ =head1 AUTHOR -Ken Williams, ke...@ma... +Ken Williams <ke...@ma...> + =head1 COPYRIGHT @@ -320,6 +336,7 @@ This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. + =head1 SEE ALSO perl(1), Module::Build(3) Index: ModuleInfo.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/ModuleInfo.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- ModuleInfo.pm 14 Oct 2005 00:45:52 -0000 1.14 +++ ModuleInfo.pm 2 Dec 2005 12:12:21 -0000 1.15 @@ -346,16 +346,19 @@ ModuleInfo - Gather package and POD information from a perl module files + =head1 DESCRIPTION -=head2 new_from_file( $filename [ , collect_pod => 1 ] ) +=over 4 + +=item new_from_file($filename, collect_pod => 1) Construct a ModuleInfo object given the path to a file. Takes an optional arguement C<collect_pod> which is a boolean that determines whether POD data is collected and stored for reference. POD data is not collected by default. POD headings are always collected. -=head2 new_from_module( $module [ , collect_pod => 1, inc => \@dirs ] ) +=item new_from_module($module, collect_pod => 1, inc => \@dirs) Construct a ModuleInfo object given a module or package name. In addition to accepting the C<collect_pod> argument as described above, this @@ -363,41 +366,41 @@ of directories to search for the module. If none are given, the default is @INC. -=head2 name( ) +=item name() Returns the name of the package represented by this module. If there are more than one packages, it makes a best guess based on the filename. If it's a script (i.e. not a *.pm) the package name is 'main'. -=head2 version( [ $package ] ) +=item version($package) Returns the version as defined by the $VERSION variable for the package as returned by the C<name> method if no arguments are given. If given the name of a package it will attempt to return the version of that package if it is specified in the file. -=head2 filename( ) +=item filename() Returns the absolute path to the file. -=head2 packages_inside( ) +=item packages_inside() Returns a list of packages. -=head2 pod_inside( ) +=item pod_inside() Returns a list of POD sections. -=head2 contains_pod( ) +=item contains_pod() Returns true if there is any POD in the file. -=head2 pod( $section ) +=item pod($section) Returns the POD data in the given section. -=head2 find_module_by_name( $module [ , \@dirs ] ) +=item find_module_by_name($module, \@dirs) Returns the path to a module given the module or package name. A list of directories can be passed in as an optional paramater, otherwise @@ -405,7 +408,7 @@ Can be called as either an object or a class method. -=head2 find_module_dir_by_name( $module [ , \@dirs ] ) +=item find_module_dir_by_name($module, \@dirs) Returns the entry in C<@dirs> (or C<@INC> by default) that contains the module C<$module>. A list of directories can be passed in as an @@ -413,4 +416,25 @@ Can be called as either an object or a class method. +=back + + +=head1 AUTHOR + +Ken Williams <ke...@ma...>, Randy W. Sims <Ra...@Th...> + + +=head1 COPYRIGHT + +Copyright (c) 2001-2005 Ken Williams. All rights reserved. + +This library is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + + +=head1 SEE ALSO + +perl(1), Module::Build(3) + =cut + Index: PodParser.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/PodParser.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- PodParser.pm 9 Sep 2005 18:35:27 -0000 1.7 +++ PodParser.pm 2 Dec 2005 12:12:21 -0000 1.8 @@ -85,7 +85,6 @@ } } - sub textblock { my ($self, $text) = @_; $text =~ s/^\s+//; Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- Authoring.pod 30 Nov 2005 10:46:04 -0000 1.26 +++ Authoring.pod 2 Dec 2005 12:12:21 -0000 1.27 @@ -12,11 +12,11 @@ my $build = Module::Build->new ( module_name => 'Foo::Bar', - license => 'perl', + license => 'perl', requires => { - 'perl' => '5.6.1', - 'Some::Module' => '1.23', - 'Other::Module' => '>= 1.2, != 1.5, < 2.0', + 'perl' => '5.6.1', + 'Some::Module' => '1.23', + 'Other::Module' => '>= 1.2, != 1.5, < 2.0', }, ); $build->create_build_script; @@ -26,8 +26,8 @@ use Module::Build; Module::Build->new( - module_name => 'Foo::Bar', - license => 'perl', + module_name => 'Foo::Bar', + license => 'perl', )->create_build_script; The model used by C<Module::Build> is a lot like the C<MakeMaker> @@ -75,15 +75,15 @@ the user a question during C<perl Build.PL>, then use their answer during a regression test: - # In Build.PL: - my $color = $build->prompt("What is your favorite color?"); - $build->notes(color => $color); + # In Build.PL: + my $color = $build->prompt("What is your favorite color?"); + $build->notes(color => $color); - # In t/colortest.t: - use Module::Build; - my $build = Module::Build->current; - my $color = $build->notes('color'); - ... + # In t/colortest.t: + use Module::Build; + my $build = Module::Build->current; + my $color = $build->notes('color'); + ... The way the C<current()> method is currently implemented, there may be slight differences between the C<$build> object in Build.PL and the @@ -119,24 +119,22 @@ instance, for a module that could optionally use either MySQL or PostgreSQL databases, you might use C<auto_features> like this: - my $b = Module::Build->new + my $build = Module::Build->new ( - ... other stuff here... - auto_features => - { - pg_support => - { - description => "Interface with Postgres databases", - requires => { 'DBD::Pg' => 23.3, - 'DateTime::Format::Pg' => 0 }, - }, - mysql_support => - { - description => "Interface with MySQL databases", - requires => { 'DBD::mysql' => 17.9, - 'DateTime::Format::MySQL' => 0}, - }, - ); + ...other stuff here... + auto_features => { + pg_support => { + description => "Interface with Postgres databases", + requires => { 'DBD::Pg' => 23.3, + 'DateTime::Format::Pg' => 0 }, + }, + mysql_support => { + description => "Interface with MySQL databases", + requires => { 'DBD::mysql' => 17.9, + 'DateTime::Format::MySQL' => 0 }, + }, + } + ); For each feature named, the required prerequisites will be checked, and if there are no failures, the feature will be enabled (set to C<1>). @@ -295,19 +293,21 @@ and linker phases when compiling/linking C code. For example, to tell the compiler that your code is C++, you might do: - my build = Module::Build->new( - module_name => 'Spangly', + my $build = Module::Build->new + ( + module_name => 'Foo::Bar', extra_compiler_flags => ['-x', 'c++'], - ); + ); To link your XS code against glib you might write something like: - my build = Module::Build->new( - module_name => 'Spangly', + my $build = Module::Build->new + ( + module_name => 'Foo::Bar', dynamic_config => 1, extra_compiler_flags => scalar `glib-config --cflags`, extra_linker_flags => scalar `glib-config --libs`, - ); + ); =item get_options @@ -354,24 +354,25 @@ unreferenced specifications, for which the result will also be stored in the hash returned by C<args()>. For example: - my $loud = 0; - my $build = Module::Build->new( - module_name => 'Spangly', + my $loud = 0; + my $build = Module::Build->new + ( + module_name => 'Foo::Bar', get_options => { - loud => { store => \$loud }, - dbd => { type => '=s' }, - quantity => { type => '+' }, + loud => { store => \$loud }, + dbd => { type => '=s' }, + quantity => { type => '+' }, } - ); + ); - print STDERR "HEY, ARE YOU LISTENING??\n" if $loud; - print "We'll use the ", $build->args('dbd'), " DBI driver\n"; - print "Are you sure you want that many?\n" - if $build->args('quantity') > 2; + print STDERR "HEY, ARE YOU LISTENING??\n" if $loud; + print "We'll use the ", $build->args('dbd'), " DBI driver\n"; + print "Are you sure you want that many?\n" + if $build->args('quantity') > 2; The arguments for such a specification can be called like so: - % perl Build.PL --loud --dbd=DBD::pg --quantity --quantity --quantity + perl Build.PL --loud --dbd=DBD::pg --quantity --quantity --quantity B<WARNING:> Any option specifications that conflict with Module::Build's own options (defined by its properties) will throw an exception. @@ -384,6 +385,20 @@ files. May be given as a string indicating a single directory, or as a list reference indicating multiple directories. +=item install_path + +You can set paths for individual installable elements by using the +C<install_path> parameter: + + my $build = Module::Build->new + ( + ...other stuff here... + install_path => { + lib => '/foo/lib', + arch => '/foo/lib/arch', + } + ); + =item installdirs Determines where files are installed within the normal perl hierarchy @@ -522,17 +537,27 @@ The files are specified with the C<.PL> files as hash keys, and the file(s) they generate as hash values, like so: - my $build = Module::Build->new - ( module_name => 'Foo::Bar', + my $build = Module::Build->new + ( + module_name => 'Foo::Bar', ... - PL_files => { 'lib/Bar.pm.PL' => 'lib/Bar.pm', - 'lib/Foo.PL' => [ 'lib/Foo1.pm', 'lib/Foo2.pm' ], - }, - ); + PL_files => { 'lib/Foo/Bar.pm.PL' => 'lib/Foo/Bar.pm' }, + ); Note that the path specifications are I<always> given in Unix-like format, not in the style of the local system. +If your C<.PL> scripts don't create any files, or if they create files +with unexpected names, or even if they create multiple files, you can +indicate that so that Module::Build can properly handle these created +files: + + PL_files => { + 'lib/Foo/Bar.pm.PL' => 'lib/Foo/Bar.pm', + 'lib/something.PL' => ['/lib/something', '/lib/else'], + 'lib/funny.PL' => [], + } + =item pm_files An optional parameter specifying the set of C<.pm> files in this @@ -547,11 +572,12 @@ distribution, you could specify your layout in your C<Build.PL> like this: - my $build = Module::Build->new - ( module_name => 'Foo::Bar', + my $build = Module::Build->new + ( + module_name => 'Foo::Bar', ... pm_files => { 'Bar.pm' => 'lib/Foo/Bar.pm' }, - ); + ); Note that the values should include C<lib/>, because this is where they would be found in a "normal" Module::Build-style distribution. @@ -766,12 +792,12 @@ The returned hash reference has the following structure: - { - ok => $whether_the_dependency_is_satisfied, - have => $version_already_installed, - need => $version_requested, # Same as incoming $version argument - message => $informative_error_message, - } + { + ok => $whether_the_dependency_is_satisfied, + have => $version_already_installed, + need => $version_requested, # Same as incoming $version argument + message => $informative_error_message, + } If no version of C<$module> is currently installed, the C<have> value will be the string C<< "<none>" >>. Otherwise the C<have> value will @@ -795,12 +821,12 @@ C<$module> installed on the system. This allows you to do the following: - my $installed = $m->check_installed_version('DBI', '1.15'); - if ($installed) { - print "Congratulations, version $installed of DBI is installed.\n"; - } else { - die "Sorry, you must install DBI.\n"; - } + my $installed = $build->check_installed_version('DBI', '1.15'); + if ($installed) { + print "Congratulations, version $installed of DBI is installed.\n"; + } else { + die "Sorry, you must install DBI.\n"; + } If the check fails, we return false and set C<$@> to an informative error message. @@ -941,7 +967,7 @@ Custom options that have not been registered must be passed in as a hash reference in a key named "args": - $mb->dispatch('foo', verbose => 1, args => { my_option => 'value' }); + $build->dispatch('foo', verbose => 1, args => { my_option => 'value' }); This method is intended to be used to programmatically invoke build actions, e.g. by applications controlling Module::Build-based builds @@ -1131,19 +1157,19 @@ conflicting) modules. The associated values of those are hash references indicating some information about the failure. For example: - { - have => '0.42', - need => '0.59', - message => 'Version 0.42 is installed, but we need version 0.59', - } + { + have => '0.42', + need => '0.59', + message => 'Version 0.42 is installed, but we need version 0.59', + } or - { - have => '<none>', - need => '0.59', - message => 'Prerequisite Foo isn't installed', - } + { + have => '<none>', + need => '0.59', + message => 'Prerequisite Foo isn't installed', + } This hash has the same structure as the hash returned by the C<check_installed_status()> method, except that in the case of @@ -1153,13 +1179,13 @@ Examples: # Check a required dependency on Foo::Bar - if ( $m->prereq_failures->{requires}{Foo::Bar} ) { ... + if ( $build->prereq_failures->{requires}{Foo::Bar} ) { ... # Check whether there were any failures - if ( $m->prereq_failures ) { ... + if ( $build->prereq_failures ) { ... # Show messages for all failures - my $failures = $m->prereq_failures; + my $failures = $build->prereq_failures; while (my ($type, $list) = each %$failures) { while (my ($name, $hash) = each %$list) { print "Failure for $name: $hash->{message}\n"; @@ -1278,10 +1304,12 @@ The prerequisites are given in a hash reference, where the keys are the module names and the values are version specifiers: - requires => {Foo::Module => '2.4', - Bar::Module => 0, - Ken::Module => '>= 1.2, != 1.5, < 2.0', - perl => '5.6.0'}, + requires => { + Foo::Module => '2.4', + Bar::Module => 0, + Ken::Module => '>= 1.2, != 1.5, < 2.0', + perl => '5.6.0' + }, These four version specifiers have different effects. The value C<'2.4'> means that B<at least> version 2.4 of C<Foo::Module> must be @@ -1321,20 +1349,20 @@ a module non-interactively. For instance, the following Perl script will invoke the entire build/install procedure: - my $m = Module::Build->new(module_name => 'MyModule'); - $m->dispatch('build'); - $m->dispatch('test'); - $m->dispatch('install'); + my $build = Module::Build->new(module_name => 'MyModule'); + $build->dispatch('build'); + $build->dispatch('test'); + $build->dispatch('install'); If any of these steps encounters an error, it will throw a fatal exception. You can also pass arguments as part of the build process: - my $m = Module::Build->new(module_name => 'MyModule'); - $m->dispatch('build'); - $m->dispatch('test', verbose => 1); - $m->dispatch('install', sitelib => '/my/secret/place/'); + my $build = Module::Build->new(module_name => 'MyModule'); + $build->dispatch('build'); + $build->dispatch('test', verbose => 1); + $build->dispatch('install', sitelib => '/my/secret/place/'); Building and installing modules in this way skips creating the C<Build> script. @@ -1374,16 +1402,18 @@ ------ in Build.PL: ---------- #!/usr/bin/perl - - use lib qw(/nonstandard/library/path); + + use lib q(/nonstandard/library/path); use My::Builder; # Or whatever you want to call it - - my $m = My::Builder->new - (module_name=> 'Next::Big::Thing', # All the regular args... - license=> 'perl', - dist_author=> 'A N Other <me...@he...>', - requires=> {Carp => 0}); - $m->create_build_script; + + my $build = My::Builder->new + ( + module_name => 'Foo::Bar', # All the regular args... + license => 'perl', + dist_author => 'A N Other <me...@he...>', + requires => { Carp => 0 } + ); + $build->create_build_script; This is relatively straightforward, and is the best way to do things if your My::Builder class contains lots of code. The @@ -1398,24 +1428,26 @@ ------ in Build.PL: ---------- #!/usr/bin/perl - + use Module::Build; my $class = Module::Build->subclass ( class => 'My::Builder', code => q{ - sub ACTION_foo { - print "I'm fooing to death!\n"; - } + sub ACTION_foo { + print "I'm fooing to death!\n"; + } }, ); - - my $m = $class->new - (module_name=> 'Next::Big::Thing', # All the regular args... - license=> 'perl', - dist_author=> 'A N Other <me...@he...>', - requires=> {Carp => 0}); - $m->create_build_script; + + my $build = $class->new + ( + module_name => 'Foo::Bar', # All the regular args... + license => 'perl', + dist_author => 'A N Other <me...@he...>', + requires => { Carp => 0 } + ); + $build->create_build_script; Behind the scenes, this actually does create a C<.pm> file, since the code you provide must persist after Build.PL is run if it is to be @@ -1446,7 +1478,7 @@ following to C<WriteMakefile> in your F<Makefile.PL> so that MakeMaker doesn't try to run your F<Build.PL> as a normal F<.PL> file: - PL_FILES => {}, + PL_FILES => {}, You may also be interested in looking at the C<Module::Build::Compat> module, which can automatically create various kinds of F<Makefile.PL> |
From: Randy W. S. <si...@us...> - 2005-12-02 12:12:42
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build/Platform In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32185/lib/Module/Build/Platform Modified Files: Amiga.pm Default.pm EBCDIC.pm MPEiX.pm MacOS.pm RiscOS.pm Unix.pm VOS.pm Windows.pm aix.pm cygwin.pm darwin.pm os2.pm Log Message: Move some code examples from the Module::Build module documentation to Module::Build::Authoring. Attempt to add more consistency across all documents (while trying to maintain Ken's style): * Use consistent two space indentation for verbatim paragraphs. * Add some consistency to example code: variable & module names; indentation; etc * Use consistent commandline syntax: "./Build" rather than "perl Build" or "Build"; and use long option style for most options. * Use standard quoting for various URI, email addresses. * Misc. pod formatting. Index: MacOS.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/MacOS.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- MacOS.pm 5 Nov 2004 01:51:54 -0000 1.9 +++ MacOS.pm 2 Dec 2005 12:12:21 -0000 1.10 @@ -135,6 +135,7 @@ Michael G Schwern <sc...@po...> + =head1 SEE ALSO perl(1), Module::Build(3), ExtUtils::MakeMaker(3) Index: aix.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/aix.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- aix.pm 10 Oct 2004 04:39:34 -0000 1.3 +++ aix.pm 2 Dec 2005 12:12:21 -0000 1.4 @@ -28,7 +28,7 @@ =head1 AUTHOR -Ken Williams, ke...@ma... +Ken Williams <ke...@ma...> =head1 SEE ALSO Index: Default.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/Default.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Default.pm 28 Nov 2003 17:10:23 -0000 1.2 +++ Default.pm 2 Dec 2005 12:12:21 -0000 1.3 @@ -21,7 +21,7 @@ =head1 AUTHOR -Ken Williams, ke...@ma... +Ken Williams <ke...@ma...> =head1 SEE ALSO Index: MPEiX.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/MPEiX.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MPEiX.pm 28 Nov 2003 17:10:23 -0000 1.2 +++ MPEiX.pm 2 Dec 2005 12:12:21 -0000 1.3 @@ -22,7 +22,7 @@ =head1 AUTHOR -Ken Williams, ke...@ma... +Ken Williams <ke...@ma...> =head1 SEE ALSO Index: Windows.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/Windows.pm,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- Windows.pm 31 Mar 2005 06:03:09 -0000 1.23 +++ Windows.pm 2 Dec 2005 12:12:21 -0000 1.24 @@ -141,9 +141,7 @@ =head1 AUTHOR -Ken Williams <ke...@ma...> - -Most of the code here was written by Randy W. Sims <Ra...@Th...>. +Ken Williams <ke...@ma...>, Randy W. Sims <Ra...@Th...> =head1 SEE ALSO Index: RiscOS.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/RiscOS.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- RiscOS.pm 28 Nov 2003 17:10:23 -0000 1.2 +++ RiscOS.pm 2 Dec 2005 12:12:21 -0000 1.3 @@ -22,7 +22,7 @@ =head1 AUTHOR -Ken Williams, ke...@ma... +Ken Williams <ke...@ma...> =head1 SEE ALSO Index: Amiga.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/Amiga.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Amiga.pm 28 Nov 2003 17:10:23 -0000 1.2 +++ Amiga.pm 2 Dec 2005 12:12:21 -0000 1.3 @@ -22,7 +22,7 @@ =head1 AUTHOR -Ken Williams, ke...@ma... +Ken Williams <ke...@ma...> =head1 SEE ALSO Index: darwin.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/darwin.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- darwin.pm 10 Oct 2004 04:39:34 -0000 1.5 +++ darwin.pm 2 Dec 2005 12:12:21 -0000 1.6 @@ -28,7 +28,7 @@ =head1 AUTHOR -Ken Williams, ke...@ma... +Ken Williams <ke...@ma...> =head1 SEE ALSO Index: Unix.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/Unix.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Unix.pm 5 Jan 2005 04:38:52 -0000 1.11 +++ Unix.pm 2 Dec 2005 12:12:21 -0000 1.12 @@ -43,7 +43,7 @@ =head1 AUTHOR -Ken Williams, ke...@ma... +Ken Williams <ke...@ma...> =head1 SEE ALSO Index: VOS.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/VOS.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- VOS.pm 28 Nov 2003 17:10:23 -0000 1.2 +++ VOS.pm 2 Dec 2005 12:12:21 -0000 1.3 @@ -22,7 +22,7 @@ =head1 AUTHOR -Ken Williams, ke...@ma... +Ken Williams <ke...@ma...> =head1 SEE ALSO Index: EBCDIC.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/EBCDIC.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- EBCDIC.pm 28 Nov 2003 17:10:23 -0000 1.2 +++ EBCDIC.pm 2 Dec 2005 12:12:21 -0000 1.3 @@ -22,7 +22,7 @@ =head1 AUTHOR -Ken Williams, ke...@ma... +Ken Williams <ke...@ma...> =head1 SEE ALSO Index: cygwin.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/cygwin.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- cygwin.pm 10 Oct 2004 04:39:34 -0000 1.3 +++ cygwin.pm 2 Dec 2005 12:12:21 -0000 1.4 @@ -27,7 +27,7 @@ =head1 AUTHOR -Initial stub by Yitzchak Scott-Thoennes, sth...@ef... +Initial stub by Yitzchak Scott-Thoennes <sth...@ef...> =head1 SEE ALSO Index: os2.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/os2.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- os2.pm 10 Oct 2004 04:39:34 -0000 1.4 +++ os2.pm 2 Dec 2005 12:12:21 -0000 1.5 @@ -25,7 +25,7 @@ =head1 AUTHOR -Ken Williams, ke...@ma... +Ken Williams <ke...@ma...> =head1 SEE ALSO |
From: Randy W. S. <si...@us...> - 2005-12-02 12:12:42
|
Update of /cvsroot/module-build/Module-Build/lib/Module In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32185/lib/Module Modified Files: Build.pm Log Message: Move some code examples from the Module::Build module documentation to Module::Build::Authoring. Attempt to add more consistency across all documents (while trying to maintain Ken's style): * Use consistent two space indentation for verbatim paragraphs. * Add some consistency to example code: variable & module names; indentation; etc * Use consistent commandline syntax: "./Build" rather than "perl Build" or "Build"; and use long option style for most options. * Use standard quoting for various URI, email addresses. * Misc. pod formatting. Index: Build.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build.pm,v retrieving revision 1.203 retrieving revision 1.204 diff -u -d -r1.203 -r1.204 --- Build.pm 30 Nov 2005 10:46:04 -0000 1.203 +++ Build.pm 2 Dec 2005 12:12:21 -0000 1.204 @@ -107,18 +107,18 @@ Standard process for building & installing modules: - perl Build.PL - ./Build - ./Build test - ./Build install + perl Build.PL + ./Build + ./Build test + ./Build install Or, if you're on a platform (like DOS or Windows) that doesn't like the "./" notation, you can do this: - perl Build.PL - perl Build - perl Build test - perl Build install + perl Build.PL + perl Build + perl Build test + perl Build install =head1 DESCRIPTION @@ -239,22 +239,13 @@ the same one that built perl itself) for the compilation to work properly. -The C<build> action also runs any C<.PL> files in your F<lib/> +The C<code> action also runs any C<.PL> files in your F<lib/> directory. Typically these create other files, named the same but without the C<.PL> ending. For example, a file F<lib/Foo/Bar.pm.PL> could create the file F<lib/Foo/Bar.pm>. The C<.PL> files are processed first, so any C<.pm> files (or other kinds that we deal with) will get copied correctly. -If your C<.PL> scripts don't create any files, or if they create files -with unexpected names, or even if they create multiple files, you -should tell us that so that we can clean up properly after these -created files. Use the C<PL_files> parameter to C<new()>: - - PL_files => { 'lib/Foo/Bar_pm.PL' => 'lib/Foo/Bar.pm', - 'lib/something.PL' => ['/lib/something', '/lib/else'], - 'lib/funny.PL' => [] } - =item config_data ... @@ -271,7 +262,7 @@ to the 'diff' program. Consult your 'diff' documentation for the parameters it will accept - a good one is C<-u>: - ./Build diff flags=-u + ./Build diff flags=-u =item dist @@ -285,7 +276,7 @@ elsewhere. However, you can force it to use whatever executable you want by supplying an explicit C<tar> (and optional C<gzip>) parameter: - perl Build dist --tar C:\path\to\tar.exe --gzip C:\path\to\zip.exe + ./Build dist --tar C:\path\to\tar.exe --gzip C:\path\to\zip.exe =item distcheck @@ -378,7 +369,7 @@ you can use the C<uninst> parameter, which tells C<ExtUtils::Install> to do so: - Build install uninst=1 + ./Build install uninst=1 This can be a good idea, as it helps prevent multiple versions of a module from being present on your system, which can be a confusing @@ -398,13 +389,13 @@ The following is a reasonable F<MANIFEST.SKIP> starting point, you can add your own stuff to it: - ^_build - ^Build$ - ^blib - ~$ - \.bak$ - ^MANIFEST\.SKIP$ - CVS + ^_build + ^Build$ + ^blib + ~$ + \.bak$ + ^MANIFEST\.SKIP$ + CVS See the L<distcheck> and L<skipcheck> actions if you want to find out what the C<manifest> action would do, without actually doing anything. @@ -429,7 +420,7 @@ Example: - perl Build ppd codebase="MSWin32-x86-multi-thread/Module-Build-0.21.tar.gz" + ./Build ppd --codebase "MSWin32-x86-multi-thread/Module-Build-0.21.tar.gz" =item ppmdist @@ -490,15 +481,15 @@ run. This is especially useful in development, when you only want to run a single test to see whether you've squashed a certain bug yet: - ./Build test --test_files t/something_failing.t + ./Build test --test_files t/something_failing.t You may also pass several C<test_files> arguments separately: - ./Build test --test_files t/one.t --test_files t/two.t + ./Build test --test_files t/one.t --test_files t/two.t or use a C<glob()>-style pattern: - ./Build test --test_files 't/01-*.t' + ./Build test --test_files 't/01-*.t' =item testcover @@ -533,17 +524,17 @@ trees. This means that you can have several versions of the same module installed and C<use> a specific one like this: - use only MyModule => 0.55; + use only MyModule => 0.55; To override the default installation libraries in C<only::config>, specify the C<versionlib> parameter when you run the C<Build.PL> script: - perl Build.PL versionlib=/my/version/place/ + perl Build.PL --versionlib /my/version/place/ To override which version the module is installed as, specify the C<versionlib> parameter when you run the C<Build.PL> script: - perl Build.PL version=0.50 + perl Build.PL --version 0.50 See the C<only.pm> documentation for more information on version-specific installs. @@ -555,9 +546,10 @@ =head2 Command Line Options -The following options can be used during any invocation of Build.PL or -the Build script, during any action. For information on other options -specific to an action, see the documentation for the respective action. +The following options can be used during any invocation of C<Build.PL> +or the Build script, during any action. For information on other +options specific to an action, see the documentation for the +respective action. NOTE: There is some preliminary support for options to use the more familiar long option style. Most options can be preceded with the @@ -606,10 +598,10 @@ to all actions, and the key 'Build_PL' specifies options to be applied when you invoke C<perl Build.PL>. - * verbose=1 # global options - diff flags=-u - install install_base=/home/ken - --install_path html=/home/ken/docs/html + * verbose=1 # global options + diff flags=-u + install --install_base /home/ken + --install_path html=/home/ken/docs/html If you wish to locate your resource file in a different location, you can set the environment variable 'MODULEBUILDRC' to the complete @@ -689,30 +681,30 @@ 'installdirs' set to: core site vendor - + uses the following defaults from Config.pm: - - lib => installprivlib installsitelib installvendorlib - arch => installarchlib installsitearch installvendorarch - script => installscript installsitebin installvendorbin - bin => installbin installsitebin installvendorbin - bindoc => installman1dir installsiteman1dir installvendorman1dir - libdoc => installman3dir installsiteman3dir installvendorman3dir - binhtml => installhtml1dir installsitehtml1dir installvendorhtml1dir [*] - libhtml => installhtml3dir installsitehtml3dir installvendorhtml3dir [*] - * Under some OS (eg. MSWin32) the destination for html documents is - determined by the C<Config.pm> entry C<installhtmldir>. + lib => installprivlib installsitelib installvendorlib + arch => installarchlib installsitearch installvendorarch + script => installscript installsitebin installvendorbin + bin => installbin installsitebin installvendorbin + bindoc => installman1dir installsiteman1dir installvendorman1dir + libdoc => installman3dir installsiteman3dir installvendorman3dir + binhtml => installhtml1dir installsitehtml1dir installvendorhtml1dir [*] + libhtml => installhtml3dir installsitehtml3dir installvendorhtml3dir [*] + + * Under some OS (eg. MSWin32) the destination for html documents is + determined by the C<Config.pm> entry C<installhtmldir>. The default value of C<installdirs> is "site". If you're creating vendor distributions of module packages, you may want to do something like this: - perl Build.PL installdirs=vendor + perl Build.PL --installdirs vendor or - Build install installdirs=vendor + ./Build install --installdirs vendor If you're installing an updated version of a module that was included with perl itself (i.e. a "core module"), then you may set @@ -728,21 +720,15 @@ =item install_path -Once the defaults have been set, you can override them. You can set -individual entries by using the C<install_path> parameter: - - my $m = Module::Build->new - (...other options..., - install_path => {lib => '/foo/lib', - arch => '/foo/lib/arch'}); +Once the defaults have been set, you can override them. On the command line, that would look like this: - perl Build.PL --install_path lib=/foo/lib --install_path arch=/foo/lib/arch + perl Build.PL --install_path lib=/foo/lib --install_path arch=/foo/lib/arch or this: - Build install --install_path lib=/foo/lib --install_path arch=/foo/lib/arch + ./Build install --install_path lib=/foo/lib --install_path arch=/foo/lib/arch =item install_base @@ -751,14 +737,14 @@ instance, if you set C<install_base> to "/home/ken" on a Linux system, you'll install as follows: - lib => /home/ken/lib/perl5 - arch => /home/ken/lib/perl5/i386-linux - script => /home/ken/bin - bin => /home/ken/bin - bindoc => /home/ken/man/man1 - libdoc => /home/ken/man/man3 - binhtml => /home/ken/html - libhtml => /home/ken/html + lib => /home/ken/lib/perl5 + arch => /home/ken/lib/perl5/i386-linux + script => /home/ken/bin + bin => /home/ken/bin + bindoc => /home/ken/man/man1 + libdoc => /home/ken/man/man3 + binhtml => /home/ken/html + libhtml => /home/ken/html Note that this is I<different> from how MakeMaker's C<PREFIX> parameter works. See L</"Why PREFIX is not recommended"> for more @@ -776,11 +762,11 @@ manager like C<rpm> or C<dpkg> could create a package from), you can use the C<destdir> parameter: - perl Build.PL destdir=/tmp/foo + perl Build.PL --destdir /tmp/foo or - Build install destdir=/tmp/foo + ./Build install --destdir /tmp/foo This will effectively install to "/tmp/foo/$sitelib", "/tmp/foo/$sitearch", and the like, except that it will use @@ -978,16 +964,16 @@ =head1 AUTHOR -Ken Williams, kwi...@cp... +Ken Williams <kwi...@cp...> Development questions, bug reports, and patches should be sent to the -Module-Build mailing list at mod...@li... . +Module-Build mailing list at <mod...@li...>. Bug reports are also welcome at -http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build . +<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build>. An anonymous CVS repository containing the latest development version -is available; see http://sourceforge.net/cvs/?group_id=45731 for the +is available; see <http://sourceforge.net/cvs/?group_id=45731> for the details of how to access it. @@ -998,6 +984,7 @@ This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. + =head1 SEE ALSO perl(1), Module::Build::Cookbook(3), Module::Build::Authoring(3), |
From: Randy W. S. <si...@us...> - 2005-12-02 12:12:41
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32185 Modified Files: Build.PL Changes Log Message: Move some code examples from the Module::Build module documentation to Module::Build::Authoring. Attempt to add more consistency across all documents (while trying to maintain Ken's style): * Use consistent two space indentation for verbatim paragraphs. * Add some consistency to example code: variable & module names; indentation; etc * Use consistent commandline syntax: "./Build" rather than "perl Build" or "Build"; and use long option style for most options. * Use standard quoting for various URI, email addresses. * Misc. pod formatting. Index: Build.PL =================================================================== RCS file: /cvsroot/module-build/Module-Build/Build.PL,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- Build.PL 30 Nov 2005 10:47:33 -0000 1.61 +++ Build.PL 2 Dec 2005 12:12:21 -0000 1.62 @@ -17,7 +17,7 @@ my $build = new ModuleBuildBuilder ( - module_name => 'Module::Build', + module_name => 'Module::Build', license => 'perl', requires => { 'perl' => '5.005_03', Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.402 retrieving revision 1.403 diff -u -d -r1.402 -r1.403 --- Changes 1 Dec 2005 02:11:06 -0000 1.402 +++ Changes 2 Dec 2005 12:12:21 -0000 1.403 @@ -47,7 +47,7 @@ setting of 'NONE' tells Module::Build not to load any user settings, so tests can be run without tainting from user options. - - Documented and improved reliminary support for more Getopt::Long + - Documented and improved preliminary support for more Getopt::Long style options are supported, including boolean options (--verbose, --no-verbose), and use of hyphens in option names in addition to underscores. |
From: Randy W. S. <si...@us...> - 2005-12-01 09:00:45
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21714/t Modified Files: ppm.t Log Message: Skip tests when compiler not configured or present. Index: ppm.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/ppm.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ppm.t 22 Nov 2005 11:07:23 -0000 1.2 +++ ppm.t 1 Dec 2005 09:00:37 -0000 1.3 @@ -5,18 +5,35 @@ use Test::More; -unless ( eval {require Archive::Tar} ) { - plan skip_all => "Archive::Tar not installed; can't test archives."; -} else { - plan tests => 12; -} - - use File::Spec (); my $common_pl = File::Spec->catfile( 't', 'common.pl' ); require $common_pl; + +use Module::Build; + +{ # Copied mostly verbatim from t/xs.t; should probably cache in t/common.pl + local $SIG{__WARN__} = sub {}; + + my $mb = Module::Build->current; + $mb->verbose( 0 ); + + my $have_c_compiler; + stderr_of( sub {$have_c_compiler = $mb->have_c_compiler} ); + + if ( ! $mb->feature('C_support') ) { + plan skip_all => 'C_support not enabled'; + } elsif ( !$have_c_compiler ) { + plan skip_all => 'C_support enabled, but no compiler found'; + } elsif ( eval {require Archive::Tar} ) { + plan skip_all => "Archive::Tar not installed; can't test archives."; + } else { + plan tests => 12; + } +} + + use Cwd (); my $cwd = Cwd::cwd; my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); @@ -42,7 +59,6 @@ =cut --- $dist->change_file( 'Build.PL', <<"---" ); -use Module::Build; my \$build = new Module::Build( module_name => @{[$dist->name]}, |
From: Randy W. S. <si...@us...> - 2005-12-01 08:48:17
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19423/lib/Module/Build Modified Files: Base.pm Log Message: The glob() function under perl 5.005 sometimes return undef where we expect it to return the argument unmodified. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.532 retrieving revision 1.533 diff -u -d -r1.532 -r1.533 --- Base.pm 1 Dec 2005 08:20:16 -0000 1.532 +++ Base.pm 1 Dec 2005 08:48:10 -0000 1.533 @@ -1465,9 +1465,9 @@ sub _detildefy { my $arg = shift; - ($arg) = glob($arg) if $arg =~ /^~/; + my($new_arg) = glob($arg) if $arg =~ /^~/; - return $arg; + return defined($new_arg) ? $new_arg : $arg; } |
From: Randy W. S. <si...@us...> - 2005-12-01 08:26:43
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15851/t Modified Files: destinations.t Log Message: Oops. Revision 1.37 got borked. This time I really remove "no_plan". Index: destinations.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/destinations.t,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- destinations.t 1 Dec 2005 08:16:19 -0000 1.37 +++ destinations.t 1 Dec 2005 08:26:35 -0000 1.38 @@ -3,7 +3,7 @@ use lib 't/lib'; use strict; -use Test::More 'no_plan' => 1; #tests => 92; +use Test::More tests => 92; use File::Spec (); |
From: Randy W. S. <si...@us...> - 2005-12-01 08:20:25
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14270/t Modified Files: metadata2.t Log Message: Various fixes to run under Perl 5.005. Index: metadata2.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/metadata2.t,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- metadata2.t 30 Nov 2005 10:47:33 -0000 1.6 +++ metadata2.t 1 Dec 2005 08:20:17 -0000 1.7 @@ -49,6 +49,10 @@ ############################## Check generation of README file +# TODO: We need to test faking the absence of Pod::Readme when present +# so Pod::Text will be used. Also fake the absence of both to +# test that we fail gracefully. + my $provides; # Used a bunch of times below my $pod_text = <<'---'; @@ -68,10 +72,14 @@ sub _slurp { my $filename = shift; die "$filename doesn't exist. Aborting" if not -e $filename; - open my $fh, "< $filename" + + use IO::File; + my $fh = IO::File->new( "< $filename" ) or die "Couldn't open $filename: $!. Aborting."; local $/; - return scalar <$fh>; + my $content = <$fh>; + $fh->close; + return $content; } |
From: Randy W. S. <si...@us...> - 2005-12-01 08:20:25
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14270/lib/Module/Build Modified Files: Base.pm Log Message: Various fixes to run under Perl 5.005. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.531 retrieving revision 1.532 diff -u -d -r1.531 -r1.532 --- Base.pm 30 Nov 2005 10:47:33 -0000 1.531 +++ Base.pm 1 Dec 2005 08:20:16 -0000 1.532 @@ -943,7 +943,7 @@ my $self = shift; my %prereqs; foreach my $type ( @{ $self->prereq_action_types } ) { - if ( my $sub = $self->can( $type ) ) { + if ( $self->can( $type ) ) { my $prereq = $self->$type() || {}; $prereqs{$type} = $prereq if %$prereq; } @@ -2632,19 +2632,43 @@ sub do_create_readme { my $self = shift; $self->delete_filetree('README'); - my $parser = eval {require Pod::Readme; 1} ? Pod::Readme->new : - eval {require Pod::Text; 1} ? Pod::Text->new : - die "Can't load Pod::Readme or Pod::Text to create README"; - if ( my $docfile = $self->_main_docfile ) { - $self->log_info("Creating README using " . ref($parser) . "\n"); - $parser->parse_from_file($docfile, 'README', @_); - $self->_add_to_manifest('MANIFEST', 'README'); - } else { + + my $docfile = $self->_main_docfile; + unless ( $docfile ) { $self->log_warn(<<EOF); -Cannot create README; can't determine which file contains documentation; +Cannot create README: can't determine which file contains documentation; Must supply either 'dist_version_from', or 'module_name' parameter. EOF + return; + } + + if ( eval {require Pod::Readme; 1} ) { + $self->log_info("Creating README using Pod::Readme\n"); + + my $parser = Pod::Readme->new; + $parser->parse_from_file($docfile, 'README', @_); + + } elsif ( eval {require Pod::Text; 1} ) { + $self->log_info("Creating README using Pod::Text\n"); + + my $fh = IO::File->new('> README'); + if ( defined($fh) ) { + local $^W = 0; + Pod::Text::pod2text( $docfile, $fh ); + $fh->close; + } else { + $self->log_warn( + "Cannot create 'README' file: Can't open file for writing\n" ); + return; + } + + } else { + $self->log_warn("Can't load Pod::Readme or Pod::Text to create README\n"); + return; + } + + $self->_add_to_manifest('MANIFEST', 'README'); } sub _main_docfile { |
From: Randy W. S. <si...@us...> - 2005-12-01 08:16:27
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13331/t Modified Files: destinations.t Log Message: Temporary fix: The Test::Harness with perl 5.005 doesn't seem to like Test::More 'no_plan'. We'll soon rewrite these tests anyway to use fixed configurations to test on rather than using whatever configuration happens to exist on the testers system. Index: destinations.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/destinations.t,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- destinations.t 21 Nov 2005 03:29:42 -0000 1.36 +++ destinations.t 1 Dec 2005 08:16:19 -0000 1.37 @@ -3,7 +3,7 @@ use lib 't/lib'; use strict; -use Test::More 'no_plan'; # tests => 68; +use Test::More 'no_plan' => 1; #tests => 92; use File::Spec (); @@ -213,9 +213,13 @@ my $dest = $mb->install_destination( $type ); ok $mb->dir_contains($prefix, $dest), "$type prefixed"; - if( $test_config && $test_config->{$type} ) { - have_same_ending($dest, $test_config->{$type}, - " suffix correctish ($test_config->{$type} + $prefix = $dest)" ); + SKIP: { + skip( "'$type' not configured", 1 ) + unless $test_config && $test_config->{$type}; + + have_same_ending( $dest, $test_config->{$type}, + " suffix correctish " . + "($test_config->{$type} + $prefix = $dest)" ); } } } |
From: Ken W. <kwi...@us...> - 2005-12-01 02:11:16
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10706 Modified Files: Changes Log Message: Fix UNINST=1 Index: Changes =================================================================== RCS file: /cvsroot/module-build/Module-Build/Changes,v retrieving revision 1.401 retrieving revision 1.402 diff -u -d -r1.401 -r1.402 --- Changes 29 Nov 2005 05:18:40 -0000 1.401 +++ Changes 1 Dec 2005 02:11:06 -0000 1.402 @@ -15,6 +15,10 @@ YAML.pm - some common strings weren't quoted & escaped properly. Now only some uncommon ones are. [Spotted by Joshua ben Jore] + - Fixed a bug in which an "UNINST=1" argument specified to a + passthrough Makefile's "make install" wasn't actually seen by + Module::Build. + - Rather than dying when the Build script is run from the wrong directory, it now simply chdir()s into the right directory and keeps going. [Suggested by Dominique Quatravaux] |
From: Ken W. <kwi...@us...> - 2005-12-01 02:11:16
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10706/lib/Module/Build Modified Files: Compat.pm Log Message: Fix UNINST=1 Index: Compat.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Compat.pm,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- Compat.pm 14 Nov 2005 03:05:13 -0000 1.70 +++ Compat.pm 1 Dec 2005 02:11:06 -0000 1.71 @@ -21,7 +21,7 @@ LIB => sub { ('--install_path', 'lib='.shift()) }, # Some names they have in common - map {$_, lc($_)} qw(DESTDIR PREFIX INSTALL_BASE), + map {$_, lc($_)} qw(DESTDIR PREFIX INSTALL_BASE UNINST), ); |
From: Randy W. S. <si...@us...> - 2005-11-30 10:47:41
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17112 Modified Files: Build.PL Log Message: Some fixes against Perl version 5.005_03. Index: Build.PL =================================================================== RCS file: /cvsroot/module-build/Module-Build/Build.PL,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- Build.PL 3 Oct 2005 07:24:24 -0000 1.60 +++ Build.PL 30 Nov 2005 10:47:33 -0000 1.61 @@ -2,7 +2,7 @@ # On some platforms (*ahem*, MacPerl 5.6.1) "use lib qw(lib);" doesn't # find the local "lib" directory, so we use File::Spec to do it properly. -use File::Spec; +use File::Spec 0.82; use lib File::Spec->catdir('lib'); # use our self to install use lib File::Spec->catdir('t', 'lib'); # use bundled Test::More @@ -27,7 +27,7 @@ 'File::Copy' => 0, 'File::Find' => 0, 'File::Path' => 0, - 'File::Spec' => 0, + 'File::Spec' => '0.82', # rel2abs() 'ExtUtils::Install' => 0, 'ExtUtils::Manifest' => 0, 'ExtUtils::Mkbootstrap' => 0, |
From: Randy W. S. <si...@us...> - 2005-11-30 10:47:41
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17112/t Modified Files: metadata2.t Log Message: Some fixes against Perl version 5.005_03. Index: metadata2.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/metadata2.t,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- metadata2.t 20 Oct 2005 22:13:41 -0000 1.5 +++ metadata2.t 30 Nov 2005 10:47:33 -0000 1.6 @@ -68,7 +68,7 @@ sub _slurp { my $filename = shift; die "$filename doesn't exist. Aborting" if not -e $filename; - open my $fh, "<", $filename + open my $fh, "< $filename" or die "Couldn't open $filename: $!. Aborting."; local $/; return scalar <$fh>; |
From: Randy W. S. <si...@us...> - 2005-11-30 10:47:41
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17112/lib/Module/Build Modified Files: Base.pm Log Message: Some fixes against Perl version 5.005_03. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.530 retrieving revision 1.531 diff -u -d -r1.530 -r1.531 --- Base.pm 29 Nov 2005 05:18:40 -0000 1.530 +++ Base.pm 30 Nov 2005 10:47:33 -0000 1.531 @@ -7,7 +7,7 @@ use File::Find (); use File::Path (); use File::Basename (); -use File::Spec (); +use File::Spec 0.82 (); use File::Compare (); use Data::Dumper (); use IO::File (); @@ -943,8 +943,8 @@ my $self = shift; my %prereqs; foreach my $type ( @{ $self->prereq_action_types } ) { - if ( $self->can( $type ) ) { - my $prereq = $self->$type || {}; + if ( my $sub = $self->can( $type ) ) { + my $prereq = $self->$type() || {}; $prereqs{$type} = $prereq if %$prereq; } } @@ -1292,11 +1292,15 @@ $args->{$k} = $v->{default} if exists $v->{default}; } + local @ARGV = @_; # No other way to dupe Getopt::Long + # Get the options values and return them. # XXX Add option to allow users to set options? - Getopt::Long::Configure('pass_through'); - local @ARGV = @_; # No other way to dupe Getopt::Long - Getopt::Long::GetOptions($args, @specs); + if ( @specs ) { + Getopt::Long::Configure('pass_through'); + Getopt::Long::GetOptions($args, @specs); + } + return $args, @ARGV; } |
From: Randy W. S. <si...@us...> - 2005-11-30 10:46:13
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16771/lib/Module/Build Modified Files: Authoring.pod Log Message: Minor doc fixes. Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- Authoring.pod 29 Nov 2005 05:18:40 -0000 1.25 +++ Authoring.pod 30 Nov 2005 10:46:04 -0000 1.26 @@ -352,7 +352,7 @@ You can combine references to your own variables or subroutines with unreferenced specifications, for which the result will also be stored in the -has returned by C<args()>. For example: +hash returned by C<args()>. For example: my $loud = 0; my $build = Module::Build->new( @@ -1170,7 +1170,7 @@ Returns a human-readable (table-form) string showing all prerequisites, the versions required, and the versions actually -installed. This can be useful for reviewing the configuration of your +installed. This can be useful for reviewing the configuration of your system prior to a build, or when compiling data to send for a bug report. The C<prereq_report> action is just a thin wrapper around the C<prereq_report()> method. @@ -1266,9 +1266,9 @@ cause problems with the distribution. Each of the three types of prerequisites listed above can be applied -to different aspects of the Build process. For the module distribution -itself you simply define "requires", "recommends", or "conflicts". The -types can also apply to other aspects of the Build process. Currently, +to different aspects of the Build process. For the module distribution +itself you simply define "requires", "recommends", or "conflicts". The +types can also apply to other aspects of the Build process. Currently, only "build_requires" is defined which is used for modules which are required during the Build process. |