From: Peter Rabbitson Date: Tue, 12 Mar 2013 23:52:00 +0000 (+0100) Subject: Moar meta (does not seem to be handled by distar :( X-Git-Tag: v0.001009~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3ed8308a9106538071b86d2ba17e3944e2509e35;p=p5sagit%2FSub-Exporter-Progressive.git Moar meta (does not seem to be handled by distar :( --- diff --git a/Makefile.PL b/Makefile.PL index b8f80dc..bf252b4 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -5,16 +5,71 @@ use 5.006; use ExtUtils::MakeMaker; (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; -my %deps = ( - PREREQ_PM => { - Exporter => '5.58', - }, +my %BUILD_DEPS = ( + 'Test::More' => '0.88' ); -my $key = eval { ExtUtils::MakeMaker->VERSION(6.56) } ? 'BUILD_REQUIRES' : 'PREREQ_PM' ; -$deps{$key}{'Test::More'} = '0.88'; -WriteMakefile( - NAME => 'Sub-Exporter-Progressive', - VERSION_FROM => 'lib/Sub/Exporter/Progressive.pm', - %deps, +my %RUN_DEPS = ( + 'Exporter' => '5.58', ); + +my %META_BITS = ( + resources => { + homepage => 'http://search.cpan.org/dist/Sub-Exporter-Progressive/', + repository => 'git://git.shadowcat.co.uk/p5sagit/Sub-Exporter-Progressive.git', + bugtracker => 'http://rt.cpan.org/Public/Dist/Display.html?Name=Sub-Exporter-Progressive', + }, + requires => \%RUN_DEPS, + dynamic_config => 0, +); + +my $mymeta_works = eval { ExtUtils::MakeMaker->VERSION('6.5707'); 1 }; +my $mymeta = $mymeta_works || eval { ExtUtils::MakeMaker->VERSION('6.5702'); 1 }; + +my %WriteMakefileArgs = ( + NAME => 'Sub-Exporter-Progressive', + VERSION_FROM => 'lib/Sub/Exporter/Progressive.pm', + ABSTRACT_FROM => 'lib/Sub/Exporter/Progressive.pm', + LICENSE => 'perl', + PREREQ_PM => { + %RUN_DEPS, + $mymeta_works ? () : (%BUILD_DEPS), + }, + + $mymeta_works + ? ( # BUILD_REQUIRES makes MYMETA right, requires stops META being wrong + 'BUILD_REQUIRES' => \%BUILD_DEPS, + 'META_ADD' => { + %META_BITS, + requires => \%RUN_DEPS, + }, + ) + : ( # META_ADD both to get META right - only Makefile written + 'META_ADD' => { + %META_BITS, + requires => \%RUN_DEPS, + build_requires => \%BUILD_DEPS, + }, + ) + , + + ($mymeta and !$mymeta_works) ? ( 'NO_MYMETA' => 1 ) : (), +); + +unless ( eval { ExtUtils::MakeMaker->VERSION('6.56') } ) { + my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; + my $pp = $WriteMakefileArgs{PREREQ_PM}; + for my $mod ( keys %$br ) { + if ( exists $pp->{$mod} ) { + $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; + } + else { + $pp->{$mod} = $br->{$mod}; + } + } +} + +delete $WriteMakefileArgs{CONFIGURE_REQUIRES} + unless eval { ExtUtils::MakeMaker->VERSION('6.52') }; + +WriteMakefile(%WriteMakefileArgs);