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