Release commit for 1.003003
[gitmo/Role-Tiny.git] / Makefile.PL
1 use strict;
2 use warnings FATAL => 'all';
3 use 5.006;
4
5 my %META = (
6   name => 'Role-Tiny',
7   license => 'perl_5',
8   prereqs => {
9     configure => { requires => {
10     } },
11     build => { requires => {
12     } },
13     test => { requires => {
14       'Test::More' => 0.96,
15       'Test::Fatal' => 0.003,
16     } },
17     runtime => {
18       requires => {
19         perl     => 5.006,
20         Exporter => '5.57',
21       },
22       recommends => {
23         'Class::Method::Modifiers' => 1.05,
24       },
25     },
26     develop => { recommends => {
27       'namespace::clean' => 0,
28       Moo => 0,
29     } },
30   },
31   resources => {
32     # r/w: gitmo@git.shadowcat.co.uk:Role-Tiny.git
33     repository => {
34       url => 'git://git.shadowcat.co.uk/gitmo/Role-Tiny.git',
35       web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/Role-Tiny.git',
36       type => 'git',
37     },
38     bugtracker => {
39         mailto => 'bug-Role-Tiny@rt.cpan.org',
40         web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Role-Tiny',
41     },
42     x_IRC => 'irc://irc.perl.org/#moose',
43     license => [ 'http://dev.perl.org/licenses/' ],
44   },
45   no_index => {
46     directory => [ 't', 'xt' ]
47   },
48 );
49
50 my %MM_ARGS = (
51   PREREQ_PM => {
52     ($] >= 5.010 ? () : ('MRO::Compat' => 0)),
53   }
54 );
55
56 ##############################################################################
57 require ExtUtils::MakeMaker;
58 (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
59
60 # have to do this since old EUMM dev releases miss the eval $VERSION line
61 my $eumm_version  = eval $ExtUtils::MakeMaker::VERSION;
62 my $mymeta        = $eumm_version >= 6.57_02;
63 my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
64
65 ($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
66 ($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
67 $MM_ARGS{LICENSE} = $META{license}
68   if $eumm_version >= 6.30;
69 $MM_ARGS{NO_MYMETA} = 1
70   if $mymeta_broken;
71 $MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
72   unless -f 'META.yml';
73
74 for (qw(configure build test runtime)) {
75   my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
76   my $r = $MM_ARGS{$key} = {
77     %{$META{prereqs}{$_}{requires}},
78     %{delete $MM_ARGS{$key} || {}},
79   };
80   defined $r->{$_} or delete $r->{$_} for keys %$r;
81 }
82
83 $MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
84
85 delete $MM_ARGS{MIN_PERL_VERSION}
86   if $eumm_version < 6.47_01;
87 $MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
88   if $eumm_version < 6.63_03;
89 $MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
90   if $eumm_version < 6.55_01;
91 delete $MM_ARGS{CONFIGURE_REQUIRES}
92   if $eumm_version < 6.51_03;
93
94 ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);