From: Matt S Trout Date: Tue, 16 Nov 2010 01:54:34 +0000 (+0000) Subject: apparently working MYMETA generation X-Git-Tag: 0.009001~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bb6d1b873a6fded811d125986f44ac357c8c8dca;hp=0d39f9d397a590b65690ec0ac4a2384c82f00944;p=gitmo%2FMoo.git apparently working MYMETA generation --- diff --git a/Makefile.PL b/Makefile.PL index c99c9e7..fdc8ba7 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,11 +1,48 @@ use strict; use warnings FATAL => 'all'; +use 5.008001; use ExtUtils::MakeMaker; +unless (-e 'META.yml') { + warn "MYMETA.yml is going to be completely wrong. Sorry.\n"; +} + +my %BUILD_DEPS = ( + 'Test::More' => 0.96, + 'Test::Fatal' => 0.003, +); + +my %RUN_DEPS = ( + 'Class::Method::Modifiers' => 1.05, + 'strictures' => 1, +); + +# have to do this since old EUMM dev releases miss the eval $VERSION line +my $mymeta_works = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.5707 }; +my $mymeta = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.5702 }; + WriteMakefile( NAME => 'Moo', VERSION_FROM => 'lib/Moo.pm', ABSTRACT_FROM => 'lib/Moo.pm', AUTHOR => 'Matt S Trout ', + PREREQ_PM => { + %RUN_DEPS, + ($] >= 5.010 ? () : ('MRO::Compat' => 0)), + ($mymeta_works ? () : (%BUILD_DEPS)), + }, + ($mymeta_works + ? ( # BUILD_REQUIRES makes MYMETA right, requires stops META being wrong + BUILD_REQUIRES => \%BUILD_DEPS, + META_ADD => { requires => \%RUN_DEPS } + ) + : ( # META_ADD both to get META right - only Makefile written + META_ADD => { + requires => \%RUN_DEPS, + build_requires => \%BUILD_DEPS, + } + ) + ), + ($mymeta && !$mymeta_works ? (NO_MYMETA => 1) : ()), LICENSE => 'perl', );