lib/ExtUtils/t/00compile.t See if MakeMaker modules compile
lib/ExtUtils/t/backwards.t Check MakeMaker's backwards compatibility
lib/ExtUtils/t/basic.t See if MakeMaker can build a module
+lib/ExtUtils/t/build_man.t Set if MakeMaker builds manpages
lib/ExtUtils/t/bytes.t Test ExtUtils::MakeMaker::bytes
lib/ExtUtils/t/Command.t See if ExtUtils::Command works (Win32 only)
lib/ExtUtils/t/config.t Test ExtUtils::MakeMaker::Config
lib/ExtUtils/t/parse_version.t See if parse_version works
lib/ExtUtils/t/PL_FILES.t Test PL_FILES in MakeMaker
lib/ExtUtils/t/postamble.t See if postamble works
+lib/ExtUtils/t/pm.t See if Makemaker can handle PM
lib/ExtUtils/t/prefixify.t See if MakeMaker can apply a PREFIX
lib/ExtUtils/t/prereq_print.t See if PREREQ_PRINT works
lib/ExtUtils/t/problems.t How MakeMaker reacts to build problems
+6.30_04 Mon Sep 11 16:14:06 EDT 2006
+ - EXTRA_META has been undocumented as I don't like the way the
+ interface works but I don't want to hold up 6.31. It will be
+ replaced with something better next version.
+ - Added explaination of distclean behavior and instructions on how to
+ blow away anything not in the MANIFEST to the FAQ.
+ * 6.30_01 broke overrides of PM. MakeMaker would add to a user
+ suplied PM rather than simply accepting it.
+ * Document INSTALL_BASE.
+ * Added "How do I install a module into my home directory?" to the FAQ
+ * Added "How do I get MakeMaker and Module::Build to install to the
+ same place?"
+ - Moving ExtUtils::Mksymlists and ExtUtils::Mkbootstrap back into
+ lib/ because no independent distribution has taken them over.
+
+6.30_03 Fri Sep 1 17:03:11 EDT 2006
+ - Minor fix to Command.t for Win32.
+
+6.30_02 Fri Sep 1 15:03:55 EDT 2006
+ - Updated to ExtUtils::Install 1.41
+ * Won't scan for and build man pages when MAN3PODS is deliberately set
+ empty.
+ - Minor VMS fixes. [bleadperl@26813]
+ - VMS->one_liner must quote "--" argument. [bleadperl@27613]
+ * Split INSTALLSCRIPT into INSTALLSCRIPT, INSTALLSITESCRIPT and
+ INSTALLVENDORSCRIPT so it now honors INSTALLDIRS. [bleadperl@26536]
+ - Minor fix to work with Pod::man 2.04. [bleadperl@26457]
+ - $Revision was broken.
+ - Updated our internal version of Test::More to catch a few warnings.
+ - ExtUtils::Command::test_f() test was broken.
+ - Clarified that test_f() exits.
+
6.30_01 Tue Aug 16 23:53:27 PDT 2005
* Fixed compiling modules using an uninstalled Perl on Win32 by using
the proper perl header location for Windows (which is different from
$meta .= <<YAML;
requires: $prereq_pm
meta-spec:
- url: <http://module-build.sourceforge.net/META-spec-new.html>;
+ url: http://module-build.sourceforge.net/META-spec-new.html
version: 1.1
YAML
use File::Basename;
use vars qw(@ISA $VERSION);
-$VERSION = '2.08_01';
+$VERSION = '2.08_02';
require ExtUtils::MM_Win32;
@ISA = qw(ExtUtils::MM_Win32);
use ExtUtils::MakeMaker qw($Verbose neatvalue);
-# $VERSION needs to stay numeric to avoid test warnings
-$VERSION = '1.5003';
+$VERSION = '1.50_04';
require ExtUtils::MM_Any;
@ISA = qw(ExtUtils::MM_Any);
# Set up names of manual pages to generate from pods
foreach my $man (qw(MAN1 MAN3)) {
- unless ($self->{"${man}PODS"}) {
- $self->{"${man}PODS"} = {};
- unless ($self->{"INSTALL${man}DIR"} =~ /^(none|\s*)$/) {
- my $init = "init_${man}PODS";
- $self->$init();
- }
+ if ( $self->{"${man}PODS"}
+ or $self->{"INSTALL${man}DIR"} =~ /^(none|\s*)$/
+ ) {
+ $self->{"${man}PODS"} ||= {};
+ }
+ else {
+ my $init_method = "init_${man}PODS";
+ $self->$init_method();
}
}
}
sub init_PM {
my $self = shift;
- my $pm = $self->{PM};
-
# Some larger extensions often wish to install a number of *.pm/pl
# files into the library in various locations.
@{$self->{PMLIBPARENTDIRS}} = ('lib');
}
+ return if $self->{PM} and $self->{ARGS}{PM};
+
if (@{$self->{PMLIBDIRS}}){
print "Searching PMLIBDIRS: @{$self->{PMLIBDIRS}}\n"
if ($Verbose >= 2);
$inst = $self->libscan($inst);
print "libscan($path) => '$inst'\n" if ($Verbose >= 2);
return unless $inst;
- $pm->{$path} = $inst;
+ $self->{PM}{$path} = $inst;
}, @{$self->{PMLIBDIRS}});
}
}
# $Revision can't be on the same line or SVN/K gets confused
use vars qw($Revision
$VERSION @ISA);
-$VERSION = '5.73_03';
+$VERSION = '5.73_02';
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
# Switches must be quoted else they will be lowercased.
$switches = join ' ', map { qq{"$_"} } @$switches;
- return qq{\$(ABSPERLRUN) $switches -e $cmd \"--\"};
+ return qq{\$(ABSPERLRUN) $switches -e $cmd "--"};
}
package ExtUtils::MM_Win95;
use vars qw($VERSION @ISA);
-$VERSION = '0.04_01';
+$VERSION = '0.04_02';
require ExtUtils::MM_Win32;
@ISA = qw(ExtUtils::MM_Win32);
-# $Id: /local/svn.schwern.org/CPAN/ExtUtils-MakeMaker/trunk/lib/ExtUtils/MakeMaker.pm 2539 2005-08-17T06:53:55.009300Z schwern $
+# $Id: /local/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 18035 2006-09-11T20:18:19.209066Z schwern $
package ExtUtils::MakeMaker;
BEGIN {require 5.005_03;}
use vars qw($Revision);
use strict;
-$VERSION = '6.30_02';
-$Revision = (q$Revision: 2539 $) =~ /Revision:\s+(\S+)/;
+$VERSION = '6.30_04';
+($Revision) = q$Revision: 18035 $ =~ /Revision:\s+(\S+)/;
@ISA = qw(Exporter);
@EXPORT = qw(&WriteMakefile &writeMakefile $Verbose &prompt);
The Makefile to be produced may be altered by adding arguments of the
form C<KEY=VALUE>. E.g.
- perl Makefile.PL PREFIX=~
+ perl Makefile.PL INSTALL_BASE=~
Other interesting targets in the generated Makefile are
make install UNINST=1
+=head2 INSTALL_BASE
+
+INSTALL_BASE can be passed into Makefile.PL to change where your
+module will be installed. INSTALL_BASE is more like what everyone
+else calls "prefix" than PREFIX is.
+
+To have everything installed in your home directory, do the following.
+
+ perl Makefile.PL INSTALL_BASE=~
+
+Like PREFIX, it sets several INSTALL* attributes at once. Unlike
+PREFIX it is easy to predict where the module will end up. The
+installation pattern looks like this:
+
+ INSTALLARCHLIB INSTALL_BASE/lib/perl5/$Config{archname}
+ INSTALLPRIVLIB INSTALL_BASE/lib/perl5
+ INSTALLBIN INSTALL_BASE/bin
+ INSTALLSCRIPT INSTALL_BASE/bin
+ INSTALLMAN1DIR INSTALL_BASE/man/man1
+ INSTALLMAN3DIR INSTALL_BASE/man/man3
+
+INSTALL_BASE in MakeMaker and C<--install_base> in Module::Build (as
+of 0.28) install to the same location. If you want MakeMaker and
+Module::Build to install to the same location simply set INSTALL_BASE
+and C<--install_base> to the same location.
+
+INSTALL_BASE was added in 6.31.
+
+
=head2 PREFIX and LIB attribute
PREFIX and LIB can be used to set several INSTALL* attributes in one
-go. The quickest way to install a module in a non-standard place might
-be
+go. Here's an example for installing into your home directory.
perl Makefile.PL PREFIX=~
This will install all files in the module under your home directory,
with man pages and libraries going into an appropriate place (usually
-~/man and ~/lib).
+~/man and ~/lib). How the exact location is determined is complicated
+and depends on how your Perl was configured. INSTALL_BASE works more
+like what other build systems call "prefix" than PREFIX and we
+recommend you use that instead.
Another way to specify many INSTALL directories with a single
parameter is LIB.
'Makefile.PL' was invoked with so the programs will be sure to run
properly even if perl is not in /usr/bin/perl.
-=item EXTRA_META
-
-Extra text to be appended to the generated META.yml.
-
=item FIRST_MAKEFILE
The name of the Makefile to be produced. This is used for the second
$VERSION = '1.00';
*VERSION = \'1.01';
- $VERSION = (q$Revision: 2539 $) =~ /(\d+)/g;
+ $VERSION = (q$Revision: 18035 $) =~ /(\d+)/g;
$FOO::VERSION = '1.10';
*FOO::VERSION = \'1.11';
our $VERSION = 1.2.3; # new for perl5.6.0
package ExtUtils::MakeMaker::FAQ;
use vars qw($VERSION);
-$VERSION = '1.11_01';
+$VERSION = '1.11_04';
1;
__END__
=over 4
+=item How do I install a module into my home directory?
+
+If you're not the Perl administrator you probably don't have
+permission to install a module to its default location. Then you
+should install it for your own use into your home directory like so:
+
+ perl Makefile.PL INSTALL_BASE=~
+
+This will put modules into F<~/lib/perl5>, man pages into F<~/man> and
+programs into F<~/bin>.
+
+To ensure your Perl programs can see these newly installed modules,
+set your C<PERL5LIB> environment variable to F<~/lib/perl5> or tell
+each of your programs to look in that directory with the following:
+
+ use lib "$ENV{HOME}/lib/perl5";
+
+
+=item How do I get MakeMaker and Module::Build to install to the same place?
+
+Module::Build, as of 0.28, supports two ways to install to the same
+location as MakeMaker.
+
+1) Use INSTALL_BASE / C<--install_base>
+
+MakeMaker (as of 6.31) and Module::Build (as of 0.28) both can install
+to the same locations using the "install_base" concept. See
+L<ExtUtils::MakeMaker/INSTALL_BASE> for details. To get MM and MB to
+install to the same location simply set INSTALL_BASE in MM and
+C<--install_base> in MB to the same location.
+
+ perl Makefile.PL INSTALL_BASE=/whatever
+ perl Build.PL --install_base /whatever
+
+2) Use PREFIX / C<--prefix>
+
+Module::Build 0.28 added support for C<--prefix> which works like
+MakeMaker's PREFIX.
+
+ perl Makefile.PL PREFIX=/whatever
+ perl Build.PL --prefix /whatever
+
+
=item How do I keep from installing man pages?
Recent versions of MakeMaker will only install man pages on Unix like
perl Makefile.PL
make
+ make test
...and then set the PERL5LIB environment variable to point at the
blib/lib and blib/arch directories.
The other is to install the module in a temporary location.
- perl Makefile.PL PREFIX=~/tmp LIB=~/tmp/lib/perl
+ perl Makefile.PL INSTALL_BASE=~/tmp
+ make
+ make test
+ make install
-And then set PERL5LIB to F<~/tmp/lib/perl>. This works well when you have
-multiple modules to work with. It also ensures that the module goes
-through its full installation process which may modify it.
+And then set PERL5LIB to F<~/tmp/lib/perl5>. This works well when you
+have multiple modules to work with. It also ensures that the module
+goes through its full installation process which may modify it.
=back
To shut off its generation, pass the C<NO_META> flag to C<WriteMakefile()>.
+
+=item How do I delete everything not in my F<MANIFEST>?
+
+Some folks are surpried that C<make distclean> does not delete
+everything not listed in their MANIFEST (thus making a clean
+distribution) but only tells them what they need to delete. This is
+done because it is considered too dangerous. While developing your
+module you might write a new file, not add it to the MANIFEST, then
+run a C<distclean> and be sad because your new work was deleted.
+
+If you really want to do this, you can use
+C<ExtUtils::Manifest::manifind()> to read the MANIFEST and File::Find
+to delete the files. But you have to be careful. Here's a script to
+do that. Use at your own risk. Have fun blowing holes in your foot.
+
+ #!/usr/bin/perl -w
+
+ use strict;
+
+ use File::Spec;
+ use File::Find;
+ use ExtUtils::Manifest qw(maniread);
+
+ my %manifest = map {( $_ => 1 )}
+ grep { File::Spec->canonpath($_) }
+ keys %{ maniread() };
+
+ if( !keys %manifest ) {
+ print "No files found in MANIFEST. Stopping.\n";
+ exit;
+ }
+
+ find({
+ wanted => sub {
+ my $path = File::Spec->canonpath($_);
+
+ return unless -f $path;
+ return if exists $manifest{ $path };
+
+ print "unlink $path\n";
+ unlink $path;
+ },
+ no_chdir => 1
+ },
+ "."
+ );
+
+
=back
=head2 XS
And of course a very basic test:
- test.pl:
+ t/cool.t:
--------
use Test;
BEGIN { plan tests => 1 };
BEGIN {
# bad neighbor, but test_f() uses exit()
- *CORE::GLOBAL::exit = ''; # quiet 'only once' warning.
- *CORE::GLOBAL::exit = sub { return @_ };
+ *CORE::GLOBAL::exit = ''; # quiet 'only once' warning.
+ *CORE::GLOBAL::exit = sub { return $_[0] };
use_ok( 'ExtUtils::Command' );
}
is( scalar( $$out =~ s/use_ok\( 'ExtUtils::Command'//g), 2,
'concatenation worked' );
- # the truth value here is reversed -- Perl true is C false
+ # the truth value here is reversed -- Perl true is shell false
@ARGV = ( $Testfile );
ok( test_f(), 'testing non-existent file' );
- @ARGV = ( $Testfile );
- cmp_ok( ! test_f(), '==', defined (-f $Testfile), 'testing non-existent file' );
-
# these are destructive, have to keep setting @ARGV
@ARGV = ( $Testfile );
touch();
@ARGV = ( $Testfile );
- ok( test_f(), 'now creating that file' );
+ ok( !test_f(), 'now creating that file' );
is_deeply( \@ARGV, [$Testfile], 'test_f preserves @ARGV' );
@ARGV = ( $Testfile );
$^O eq 'NetWare' || $^O eq 'dos' || $^O eq 'cygwin' ||
$^O eq 'MacOS'
) {
- skip( "different file permission semantics on $^O", 3);
+ skip( "different file permission semantics on $^O", 4);
}
# change a file to execute-only
is( ((stat('testdir'))[2] & 07777) & 0700,
0100, 'change a dir to execute-only' );
- # change a dir to read-only
- @ARGV = ( '0400', 'testdir' );
+ # change a dir to write-only
+ @ARGV = ( '0200', 'testdir' );
ExtUtils::Command::chmod();
is( ((stat('testdir'))[2] & 07777) & 0700,
- ($^O eq 'vos' ? 0500 : 0400), 'change a dir to read-only' );
+ ($^O eq 'vos' ? 0700 : 0200), 'change a dir to write-only' );
- # change a dir to write-only
- @ARGV = ( '0200', 'testdir' );
+ # change a dir to read-only
+ @ARGV = ( '0400', 'testdir' );
ExtUtils::Command::chmod();
is( ((stat('testdir'))[2] & 07777) & 0700,
- ($^O eq 'vos' ? 0700 : 0200), 'change a dir to write-only' );
+ ($^O eq 'vos' ? 0500 : 0400), 'change a dir to read-only' );
@ARGV = ('testdir');
rm_rf;
+ ok( ! -e 'testdir', 'rm_rf can delete a read-only dir' );
}
MAKEFILE => 'Makefile',
RM_RF => 'rm -rf',
MV => 'mv',
- MAKE => $Config{make},
+ MAKE => $Config{make}
}, 'MM';
}
sub catch_warning {
- my $warn;
+ my $warn = '';
local $SIG{__WARN__} = sub { $warn .= $_[0] };
return join('', $_[0]->() ), $warn;
}
ok( add_file('foo'), 'add a temporary file' );
# there shouldn't be a MANIFEST there
-my ($res, $warn) = catch_warning( \&mkmanifest );
+my ($res, $warn) = catch_warning( \&mkmanifest );
# Canonize the order.
$warn = join("", map { "$_|" }
sort { lc($a) cmp lc($b) } split /\r?\n/, $warn);
is( $res, 'bar', 'bar reported as new' );
# now quiet the warning that bar was added and test again
-($res, $warn) = do { local $ExtUtils::Manifest::Quiet = 1;
- catch_warning( \&skipcheck )
+($res, $warn) = do { local $ExtUtils::Manifest::Quiet = 1;
+ catch_warning( \&skipcheck )
};
-ok( ! defined $warn, 'disabled warnings' );
+is( $warn, '', 'disabled warnings' );
# add a skip file with a rule to skip itself (and the nonexistent glob '*baz*')
add_file( 'MANIFEST.SKIP', "baz\n.SKIP" );
my @skipped;
catch_warning( sub {
- @skipped = skipcheck()
+ @skipped = skipcheck();
});
is( join( ' ', @skipped ), 'MANIFEST.SKIP', 'listed skipped files' );
foreach my $orig (@copies) {
my $copy = "copy/$orig";
ok( -r $copy, "$copy: must be readable" );
-
- SKIP: {
- skip " original was not writable", 1 unless -w $orig;
- ok(-w $copy, " writable if original was" );
- }
-
- SKIP: {
- skip " original was not executable", 1 unless -x $orig;
- ok(-x $copy, " executable if original was" );
- }
+ is( -w $copy, -w $orig, " has orig write state" );
+ is( -x $copy, -x $orig, " has orig executable state" );
}
rmtree('copy');
add_file( 'MANIFEST' => "foobar\n" );
add_file( 'foobar' => '123' );
($res, $warn) = catch_warning( \&manicheck );
-is( $res, '', 'MANIFEST overrides MANIFEST.SKIP' );
-is( $warn, undef, 'MANIFEST overrides MANIFEST.SKIP, no warnings' );
+is( $res, '', 'MANIFEST overrides MANIFEST.SKIP' );
+is( $warn, '', 'MANIFEST overrides MANIFEST.SKIP, no warnings' );
$files = maniread;
ok( !$files->{wibble}, 'MANIFEST in good state' );
--- /dev/null
+#!/usr/bin/perl -w
+
+# Test if MakeMaker declines to build man pages under the right conditions.
+
+BEGIN {
+ if( $ENV{PERL_CORE} ) {
+ chdir 't' if -d 't';
+ @INC = ('../lib', 'lib');
+ }
+ else {
+ unshift @INC, 't/lib';
+ }
+}
+
+use strict;
+use Test::More tests => 9;
+
+use TieOut;
+use MakeMaker::Test::Utils;
+use MakeMaker::Test::Setup::BFD;
+
+use ExtUtils::MakeMaker;
+
+chdir 't';
+
+perl_lib();
+
+ok( setup_recurs(), 'setup' );
+END {
+ ok( chdir File::Spec->updir );
+ ok( teardown_recurs(), 'teardown' );
+}
+
+ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
+ diag("chdir failed: $!");
+
+ok( my $stdout = tie *STDOUT, 'TieOut' );
+
+{
+ my $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
+ );
+
+ ok( keys %{ $mm->{MAN3PODS} } );
+}
+
+{
+ my $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
+ INSTALLMAN3DIR => 'none'
+ );
+
+ ok( !keys %{ $mm->{MAN3PODS} } );
+}
+
+
+{
+ my $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
+ MAN3PODS => {}
+ );
+
+ is_deeply( $mm->{MAN3PODS}, { } );
+}
+
+
+{
+ my $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
+ MAN3PODS => { "Foo.pm" => "Foo.1" }
+ );
+
+ is_deeply( $mm->{MAN3PODS}, { "Foo.pm" => "Foo.1" } );
+}
--- /dev/null
+#!/usr/bin/perl -w
+
+# Test that MakeMaker honors user's PM override.
+
+BEGIN {
+ if( $ENV{PERL_CORE} ) {
+ chdir 't' if -d 't';
+ @INC = ('../lib', 'lib');
+ }
+ else {
+ unshift @INC, 't/lib';
+ }
+}
+
+use strict;
+use Test::More tests => 6;
+
+use TieOut;
+use MakeMaker::Test::Utils;
+use MakeMaker::Test::Setup::BFD;
+
+use ExtUtils::MakeMaker;
+
+chdir 't';
+
+perl_lib();
+
+ok( setup_recurs(), 'setup' );
+END {
+ ok( chdir File::Spec->updir );
+ ok( teardown_recurs(), 'teardown' );
+}
+
+ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
+ diag("chdir failed: $!");
+
+ok( my $stdout = tie *STDOUT, 'TieOut' );
+
+{
+ my $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION_FROM => 'lib/Big/Dummy.pm',
+ PM => { 'wibble' => 'woof' }
+ );
+
+ is_deeply( $mm->{PM}, { wibble => 'woof' } );
+}
use_ok 'ExtUtils::MM_VMS';
}
-like $ExtUtils::MakeMaker::Revision, qr/^(\d)+$/;
-like $ExtUtils::MM_VMS::Revision, qr/^(\d)+$/;
+# Why 1? Because a common mistake is for the regex to run in scalar context
+# thus getting the count of captured elements (1) rather than the value of $1
+cmp_ok $ExtUtils::MakeMaker::Revision, '>', 1;
+cmp_ok $ExtUtils::MM_VMS::Revision, '>', 1;