Makefile.PL and maint code
[gitmo/Role-Tiny.git] / Makefile.PL
1 use strict;
2 use warnings FATAL => 'all';
3 use 5.008003;
4 use ExtUtils::MakeMaker;
5 (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
6
7 unless (-e 'META.yml') {
8   warn "MYMETA.yml is going to be completely wrong. Sorry.\n";
9 }
10
11 my %BUILD_DEPS = (
12   'Test::More' => 0.96,
13   'Test::Fatal' => 0.003,
14 );
15
16 my %RUN_DEPS = (
17   'Class::Method::Modifiers' => 1.05,
18   'strictures' => 1,
19 );
20
21 # have to do this since old EUMM dev releases miss the eval $VERSION line
22 my $mymeta_works = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.5707 };
23 my $mymeta = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.5702 };
24
25 WriteMakefile(
26   NAME => 'Moo',
27   VERSION_FROM => 'lib/Moo.pm',
28   PREREQ_PM => {
29     %RUN_DEPS,
30     ($] >= 5.010 ? () : ('MRO::Compat' => 0)),
31     ($mymeta_works ? () : (%BUILD_DEPS)),
32   },
33   ($mymeta_works
34     ? ( # BUILD_REQUIRES makes MYMETA right, requires stops META being wrong
35         BUILD_REQUIRES => \%BUILD_DEPS,
36         META_ADD => { requires => \%RUN_DEPS }
37       )
38     : ( # META_ADD both to get META right - only Makefile written
39         META_ADD => {
40           requires => \%RUN_DEPS,
41           build_requires => \%BUILD_DEPS,
42         }
43       )
44   ),
45   ($mymeta && !$mymeta_works ? (NO_MYMETA => 1) : ()),
46   LICENSE => 'perl',
47 );