X-Git-Url: http://erislabs.net/gitweb/?p=libwww-opensearch-perl.git;a=blobdiff_plain;f=inc%2FModule%2FInstall%2FMakefile.pm;fp=inc%2FModule%2FInstall%2FMakefile.pm;h=3bfaf4c6525892874b6b626e7f65e78ebc77a885;hp=17bd8a7a8cc8a261a9eca8020229329a14bfa73c;hb=8a4c5378ad9614e2d4d066968b85f215fd5671d3;hpb=3e29d833e4fbe59c83e7ae52a7413b193c1083bd diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm index 17bd8a7..3bfaf4c 100644 --- a/inc/Module/Install/Makefile.pm +++ b/inc/Module/Install/Makefile.pm @@ -7,7 +7,7 @@ use ExtUtils::MakeMaker (); use vars qw{$VERSION $ISCORE @ISA}; BEGIN { - $VERSION = '0.68'; + $VERSION = '0.71'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } @@ -37,7 +37,7 @@ sub prompt { sub makemaker_args { my $self = shift; my $args = ($self->{makemaker_args} ||= {}); - %$args = ( %$args, @_ ) if @_; + %$args = ( %$args, @_ ) if @_; $args; } @@ -63,18 +63,18 @@ sub build_subdirs { sub clean_files { my $self = shift; my $clean = $self->makemaker_args->{clean} ||= {}; - %$clean = ( + %$clean = ( %$clean, - FILES => join(' ', grep length, $clean->{FILES}, @_), + FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_), ); } sub realclean_files { - my $self = shift; + my $self = shift; my $realclean = $self->makemaker_args->{realclean} ||= {}; - %$realclean = ( + %$realclean = ( %$realclean, - FILES => join(' ', grep length, $realclean->{FILES}, @_), + FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_), ); } @@ -104,8 +104,8 @@ sub tests_recursive { unless ( -d $dir ) { die "tests_recursive dir '$dir' does not exist"; } - require File::Find; %test_dir = (); + require File::Find; File::Find::find( \&_wanted_t, $dir ); $self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir ); } @@ -114,10 +114,15 @@ sub write { my $self = shift; die "&Makefile->write() takes no arguments\n" if @_; + # Make sure we have a new enough + require ExtUtils::MakeMaker; + $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION ); + + # Generate the my $args = $self->makemaker_args; $args->{DISTNAME} = $self->name; - $args->{NAME} = $self->module_name || $self->name || $self->determine_NAME($args); - $args->{VERSION} = $self->version || $self->determine_VERSION($args); + $args->{NAME} = $self->module_name || $self->name; + $args->{VERSION} = $self->version; $args->{NAME} =~ s/-/::/g; if ( $self->tests ) { $args->{test} = { TESTS => $self->tests }; @@ -142,9 +147,12 @@ sub write { map { @$_ } map { @$_ } grep $_, - ($self->build_requires, $self->requires) + ($self->configure_requires, $self->build_requires, $self->requires) ); + # Remove any reference to perl, PREREQ_PM doesn't support it + delete $args->{PREREQ_PM}->{perl}; + # merge both kinds of requires into prereq_pm my $subdirs = ($args->{DIR} ||= []); if ($self->bundles) { @@ -205,7 +213,7 @@ sub fix_up_makefile { #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m; # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well. - $makefile =~ s/("?)-I\$\(PERL_LIB\)\1//g; + $makefile =~ s/(\"?)-I\$\(PERL_LIB\)\1//g; # XXX - This is currently unused; not sure if it breaks other MM-users # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg; @@ -234,4 +242,4 @@ sub postamble { __END__ -#line 363 +#line 371