Commit | Line | Data |
6d71fae7 |
1 | use strict; |
2 | use warnings FATAL => 'all'; |
cde4d060 |
3 | use 5.006; |
6d71fae7 |
4 | |
6866984e |
5 | my %META = ( |
6 | name => 'Role-Tiny', |
7 | license => 'perl_5', |
8 | prereqs => { |
9 | configure => { requires => { |
6866984e |
10 | } }, |
11 | build => { requires => { |
12 | } }, |
13 | test => { requires => { |
14 | 'Test::More' => 0.96, |
15 | 'Test::Fatal' => 0.003, |
16 | } }, |
17 | runtime => { |
18 | requires => { |
66f15175 |
19 | perl => 5.006, |
6866984e |
20 | Exporter => '5.57', |
6866984e |
21 | }, |
22 | recommends => { |
23 | 'Class::Method::Modifiers' => 1.05, |
24 | }, |
25 | }, |
66f15175 |
26 | develop => { recommends => { |
27 | 'namespace::clean' => 0, |
6866984e |
28 | Moo => 0, |
29 | } }, |
30 | }, |
31 | resources => { |
6866984e |
32 | repository => { |
a58e26b1 |
33 | url => 'git://github.com/moose/Role-Tiny.git', |
34 | web => 'https://github.com/moose/Role-Tiny', |
6866984e |
35 | type => 'git', |
36 | }, |
37 | bugtracker => { |
38 | mailto => 'bug-Role-Tiny@rt.cpan.org', |
39 | web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Role-Tiny', |
40 | }, |
41 | x_IRC => 'irc://irc.perl.org/#moose', |
42 | license => [ 'http://dev.perl.org/licenses/' ], |
43 | }, |
44 | no_index => { |
45 | directory => [ 't', 'xt' ] |
46 | }, |
bb6d1b87 |
47 | ); |
48 | |
66f15175 |
49 | my %MM_ARGS = ( |
50 | PREREQ_PM => { |
51 | ($] >= 5.010 ? () : ('MRO::Compat' => 0)), |
52 | } |
45f07baa |
53 | realclean => { FILES => 'Distar/' }, |
66f15175 |
54 | ); |
6866984e |
55 | |
56 | ############################################################################## |
57 | require ExtUtils::MakeMaker; |
6866984e |
58 | (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; |
59 | |
bb6d1b87 |
60 | # have to do this since old EUMM dev releases miss the eval $VERSION line |
66f15175 |
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; |
6866984e |
64 | |
66f15175 |
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'; |
6866984e |
73 | |
66f15175 |
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; |
6866984e |
81 | } |
82 | |
66f15175 |
83 | $MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0; |
bb6d1b87 |
84 | |
66f15175 |
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; |
6866984e |
93 | |
66f15175 |
94 | ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS); |