X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FModule%2FBuild.pm;h=8ff3eab2671e1d9676ebd5b5b496f39674137c2e;hb=65395b02d2b87b841bc0ff0204dc0986c5a2eaee;hp=16880607ebf7c75ac85ae30cbc5c57d27f4fcbd6;hpb=dc8021d3927849eb56a64fd135702ae6516a52e2;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Module/Build.pm b/lib/Module/Build.pm index 1688060..8ff3eab 100644 --- a/lib/Module/Build.pm +++ b/lib/Module/Build.pm @@ -15,7 +15,7 @@ use Module::Build::Base; use vars qw($VERSION @ISA); @ISA = qw(Module::Build::Base); -$VERSION = '0.28'; +$VERSION = '0.31012'; $VERSION = eval $VERSION; # Okay, this is the brute-force method of finding out what kind of @@ -26,17 +26,22 @@ my %OSTYPES = qw( aix Unix bsdos Unix dgux Unix + dragonfly Unix dynixptx Unix freebsd Unix linux Unix + haiku Unix hpux Unix irix Unix darwin Unix machten Unix + midnightbsd Unix + mirbsd Unix next Unix openbsd Unix netbsd Unix dec_osf Unix + nto Unix svr4 Unix svr5 Unix sco_sv Unix @@ -46,7 +51,10 @@ my %OSTYPES = qw( sunos Unix cygwin Unix os2 Unix - + interix Unix + gnu Unix + gnukfreebsd Unix + dos Windows MSWin32 Windows @@ -93,6 +101,10 @@ if (grep {-e File::Spec->catfile($_, qw(Module Build Platform), $^O) . '.pm'} @I sub os_type { $OSTYPES{$^O} } +sub is_vmsish { return ((os_type() || '') eq 'VMS') } +sub is_windowsish { return ((os_type() || '') eq 'Windows') } +sub is_unixish { return ((os_type() || '') eq 'Unix') } + 1; __END__ @@ -149,22 +161,23 @@ This illustrates initial configuration and the running of three 'actions'. In this case the actions run are 'build' (the default action), 'test', and 'install'. Other actions defined so far include: - build install - clean manifest - code manpages + build manifest + clean manpages + code pardist 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 + distdir retest + distmeta skipcheck + distsign test + disttest testall + docs testcover + fakeinstall testdb + help testpod + html testpodcoverage + install versioninstall You can run the 'help' action for a complete list of actions. @@ -219,10 +232,8 @@ C), in which case their values last only for the lifetime of that command. Per-action command line parameters take precedence over parameters specified at C time. -The build process also relies heavily on the C module, and -all the key=value pairs in C are available in - -C<< $self->{config} >>. If the user wishes to override any of the +The build process also relies heavily on the C module. +If the user wishes to override any of the values in C, she may specify them like so: perl Build.PL --config cc=gcc --config ld=gcc @@ -347,7 +358,7 @@ F file must also be listed in F - if it's not, a warning will be issued. The current version of the F specification can be found at -L +L =item distsign @@ -466,6 +477,15 @@ also supply or override install paths by specifying there values on the command line with the C and C installation targets. +=item pardist + +[version 0.2806] + +Generates a PAR binary distribution for use with L or L. + +It requires that the PAR::Dist module (version 0.17 and up) is +installed on your system. + =item ppd [version 0.20] @@ -507,7 +527,7 @@ for a bug report. [version 0.28] This action is identical to the C action. In the future, -though, if C starts writing to the file file +though, when C starts writing to the file F<$(INSTALLARCHLIB)/perllocal.pod>, C won't, and that will be the only difference between them. @@ -520,6 +540,17 @@ C<_build> directory and the C script. If you run the C action, you are essentially starting over, so you will have to re-create the C script again. +=item retest + +[version 0.2806] + +This is just like the C action, but doesn't actually build the +distribution first, and doesn't add F to the load path, and +therefore will test against a I installed version of the +distribution. This can be used to verify that a certain installed +distribution still works, or to see whether newer versions of a +distribution still pass the old regression tests, and so on. + =item skipcheck [version 0.05] @@ -531,10 +562,10 @@ F file (See L for details) [version 0.01] -This will use C to run any regression tests and report -their results. Tests can be defined in the standard places: a file -called C in the top-level directory, or several files ending -with C<.t> in a C directory. +This will use C or C to run any regression +tests and report their results. Tests can be defined in the standard +places: a file called C in the top-level directory, or several +files ending with C<.t> in a C directory. If you want tests to be 'verbose', i.e. show details of test execution rather than just summary information, pass the argument C. @@ -542,6 +573,14 @@ rather than just summary information, pass the argument C. If you want to run tests under the perl debugger, pass the argument C. +If you want to have Module::Build find test files with different file +name extensions, pass the C argument with an array +of extensions, such as C<[qw( .t .s .z )]>. + +If you want test to be run by C, rather than C, +pass the argument C as an array reference of arguments to +pass to the TAP::Harness constructor. + In addition, if a file called C exists in the top-level directory, this file will be executed as a Perl script and its output will be shown to the user. This is a good place to put speed tests or @@ -562,6 +601,33 @@ or use a C-style pattern: ./Build test --test_files 't/01-*.t' +=item testall + +[verion 0.2807] + +[Note: the 'testall' action and the code snippets below are currently +in alpha stage, see +L<"http://www.nntp.perl.org/group/perl.module.build/2007/03/msg584.html"> ] + +Runs the C action plus each of the C actions defined by +the keys of the C parameter. + +Currently, you need to define the ACTION_test$type method yourself and +enumerate them in the test_types parameter. + + my $mb = Module::Build->subclass( + code => q( + sub ACTION_testspecial { shift->generic_test(type => 'special'); } + sub ACTION_testauthor { shift->generic_test(type => 'author'); } + ) + )->new( + ... + test_types => { + special => '.st', + author => ['.at', '.pt' ], + }, + ... + =item testcover [version 0.26] @@ -660,6 +726,13 @@ false to prevent the custom resource file from being loaded. Display extra information about the Build on output. +=item allow_mb_mismatch + +Suppresses the check upon startup that the version of Module::Build +we're now running under is the same version that was initially invoked +when building the distribution (i.e. when the C script was +first run). Use with caution. + =back @@ -841,8 +914,7 @@ system, you'll install as follows: libhtml => /home/ken/html Note that this is I from how MakeMaker's C -parameter works. See L for more -details. C just gives you a default layout under the +parameter works. C just gives you a default layout under the directory you specify, which may have little to do with the C layout. @@ -867,113 +939,29 @@ This will effectively install to "/tmp/foo/$sitelib", C to make the pathnames work correctly on whatever platform you're installing on. -=back - - -=head2 About PREFIX Support - -[version 0.28] - -First, it is necessary to understand the original idea behind -C. If, for example, the default installation locations for -your machine are F for modules, -F for executables, F and -F for manual pages, etc., then they all share the -same "prefix" F. MakeMaker's C mechanism was -intended as a way to change an existing prefix that happened to occur -in all those paths - essentially a C<< s{/usr/local}{/foo/bar} >> for -each path. - -However, the real world is more complicated than that. The C -idea is fundamentally broken when your machine doesn't jibe with -C's worldview. - - -=over 4 - -=item Why PREFIX is not recommended - -=over 4 - -=item * - -Many systems have Perl configs that make little sense with PREFIX. -For example, OS X, where core modules go in -F, user-installed modules go in -F, and man pages go in F. The -PREFIX is thus set to F. Install L on OS X with -C and you get things like -F and -F. Not too pretty. - -The problem is not limited to Unix-like platforms, either - on Windows -builds (e.g. ActiveState perl 5.8.0), we have user-installed modules -going in F, user-installed executables going in -F, and PREFIX=F. The prefix just doesn't -apply neatly to the executables. - -=item * - -The PREFIX logic is too complicated and hard to predict for the user. -It's hard to document what exactly is going to happen. You can't give -a user simple instructions like "run perl Makefile.PL PREFIX=~ and -then set PERL5LIB=~/lib/perl5". - -=item * - -The results from PREFIX will change if your configuration of Perl -changes (for example, if you upgrade Perl). This means your modules -will end up in different places. - -=item * - -The results from PREFIX can change with different releases of -MakeMaker. The logic of PREFIX is subtle and it has been altered in -the past (mostly to limit damage in the many "edge cases" when its -behavior was undesirable). - -=item * - -PREFIX imposes decisions made by the person who configured Perl onto -the person installing a module. The person who configured Perl could -have been you or it could have been some guy at Redhat. - -=back - - -=item Alternatives to PREFIX - -Module::Build offers L as a simple, predictable, and -user-configurable alternative to ExtUtils::MakeMaker's C. -What's more, MakeMaker will soon accept C -- we strongly -urge you to make the switch. - -Here's a quick comparison of the two when installing modules to your -home directory on a unix box: - -MakeMaker [*]: - - % perl Makefile.PL PREFIX=/home/spurkis - PERL5LIB=/home/spurkis/lib/perl5/5.8.5:/home/spurkis/lib/perl5/site_perl/5.8.5 - PATH=/home/spurkis/bin - MANPATH=/home/spurkis/man +=item prefix -Module::Build: +Provided for compatibility with ExtUtils::MakeMaker's PREFIX argument. +C should be used when you wish Module::Build to install your +modules, documentation and scripts in the same place +ExtUtils::MakeMaker does. - % perl Build.PL install_base=/home/spurkis - PERL5LIB=/home/spurkis/lib/perl5 - PATH=/home/spurkis/bin - MANPATH=/home/spurkis/man +The following are equivalent. -[*] Note that MakeMaker's behaviour cannot be guaranteed in even this -common scenario, and differs among different versions of MakeMaker. + perl Build.PL --prefix /tmp/foo + perl Makefile.PL PREFIX=/tmp/foo -In short, using C is similar to the following MakeMaker usage: +Because of the very complex nature of the prefixification logic, the +behavior of PREFIX in MakeMaker has changed subtly over time. +Module::Build's --prefix logic is equivalent to the PREFIX logic found +in ExtUtils::MakeMaker 6.30. - perl Makefile.PL PREFIX=/home/spurkis LIB=/home/spurkis/lib/perl5 +If you do not need to retain compatibility with ExtUtils::MakeMaker or +are starting a fresh Perl installation we recommand you use +C instead (and C in ExtUtils::MakeMaker). +See L for further information. -See L for details on other -installation options available and how to configure them. =back @@ -1064,7 +1052,7 @@ signature or the like, if available. See C for an example. Ken Williams Development questions, bug reports, and patches should be sent to the -Module-Build mailing list at . +Module-Build mailing list at . Bug reports are also welcome at . @@ -1075,7 +1063,7 @@ repository at =head1 COPYRIGHT -Copyright (c) 2001-2005 Ken Williams. All rights reserved. +Copyright (c) 2001-2006 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. @@ -1083,11 +1071,11 @@ modify it under the same terms as Perl itself. =head1 SEE ALSO -perl(1), L(3), L(3), -L(3), L(3), L(3) +perl(1), L, L, +L, L, L F Specification: -L +L L