X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=dc36dd2af8e751011459c6e0f08c4863c3e8a3ea;hb=1c93a64319ca3ada66ddceb86bb537e2a7af5893;hp=0b79b06a334e4cba9b5aab6375034363431e3d37;hpb=cc15434fcb28de3640e235b300d89971320929cc;p=gitmo%2FRole-Tiny.git diff --git a/Makefile.PL b/Makefile.PL index 0b79b06..dc36dd2 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,37 +1,103 @@ use strict; use warnings FATAL => 'all'; use 5.006; -use ExtUtils::MakeMaker; -(do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; -my %BUILD_DEPS = ( - 'Test::More' => 0.96, - 'Test::Fatal' => 0.003, +my %META = ( + name => 'Role-Tiny', + license => 'perl_5', + prereqs => { + configure => { requires => { + 'ExtUtils::MakeMaker' => 0, + } }, + build => { requires => { + } }, + test => { requires => { + 'Test::More' => 0.96, + 'Test::Fatal' => 0.003, + } }, + runtime => { + requires => { + Exporter => '5.57', + ($] >= 5.010 ? () : ('MRO::Compat' => 0)), + }, + recommends => { + 'Class::Method::Modifiers' => 1.05, + }, + }, + develop => { requires => { + Moo => 0, + ($] >= 5.008004 ? () : ('namespace::clean' => 0)), + } }, + }, + resources => { + # r/w: gitmo@git.shadowcat.co.uk:Role-Tiny.git + repository => { + url => 'git://git.shadowcat.co.uk/gitmo/Role-Tiny.git', + web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/Role-Tiny.git', + type => 'git', + }, + bugtracker => { + mailto => 'bug-Role-Tiny@rt.cpan.org', + web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Role-Tiny', + }, + x_IRC => 'irc://irc.perl.org/#moose', + license => [ 'http://dev.perl.org/licenses/' ], + }, + no_index => { + directory => [ 't', 'xt' ] + }, ); +my %MM_ARGS = (); + +############################################################################## +require ExtUtils::MakeMaker; +ExtUtils::MakeMaker->import; + +(do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; + # 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 $eumm_version = eval $ExtUtils::MakeMaker::VERSION; +my $mymeta_works = $eumm_version >= 6.57_07; +my $mymeta = $eumm_version >= 6.57_02; +my $has_test_requires = $eumm_version >= 6.63_03; + +my %configure_deps = %{$META{prereqs}{configure}{requires}}; +my %build_deps = %{$META{prereqs}{build}{requires}}; +my %test_deps = %{$META{prereqs}{test}{requires}}; +my %run_deps = %{$META{prereqs}{runtime}{requires}}; + +my $min_perl_version = delete $run_deps{perl}; + +if (not $has_test_requires) { + %build_deps = (%build_deps, %test_deps); + %test_deps = (); +} +if (not $mymeta_works) { + %run_deps = (%run_deps, %build_deps); + %build_deps = (); +} + +(my $module_name = $META{name}) =~ s/-/::/g; +(my $module_file = "lib/$module_name.pm") =~ s{::}{/}g; WriteMakefile( - NAME => 'Role::Tiny', - VERSION_FROM => 'lib/Role/Tiny.pm', - PREREQ_PM => { - Exporter => '5.57', - ($] >= 5.010 ? () : ('MRO::Compat' => 0)), - ($mymeta_works ? () : (%BUILD_DEPS)), - }, - $mymeta_works ? (BUILD_REQUIRES => \%BUILD_DEPS) : (), + NAME => $module_name, + VERSION_FROM => $module_file, + LICENSE => $META{license}, - META_ADD => { - resources => { - # r/w: gitmo@git.shadowcat.co.uk:Role-Tiny.git - repository => 'git://git.shadowcat.co.uk/gitmo/Role-Tiny.git', - }, - }, + $eumm_version >= 6.47_01 && $min_perl_version + ? ( MIN_PERL_VERSION => $min_perl_version ) : (), + $eumm_version >= 6.51_03 + ? ( CONFIGURE_REQUIRES => \%configure_deps ) : (), + $eumm_version >= 6.55_01 + ? ( BUILD_REQUIRES => \%build_deps ) : (), + $eumm_version >= 6.63_03 + ? ( TEST_REQUIRES => \%test_deps ) : (), + PREREQ_PM => \%run_deps, - META_MERGE => { - no_index => { - directory => [ 'xt' ] - } - }, + ($mymeta && !$mymeta_works ? (NO_MYMETA => 1) : ()), + -f 'META.yml' ? () : (META_ADD => { 'meta-spec' => { version => 2 }, %META }), + + %MM_ARGS, );