check for load failure rather than empty result
[p5sagit/Config-Any.git] / Makefile.PL
CommitLineData
88fedacf 1use strict;
2use warnings FATAL => 'all';
3use 5.006;
e23825ec 4
88fedacf 5my %META = (
6 name => 'Config-Any',
7 license => 'perl_5',
8 prereqs => {
9 test => { requires => {
10 'Test::More' => 0,
11 } },
12 runtime => { requires => {
13 'Module::Pluggable::Object' => '3.6',
14 } },
15 },
16 resources => {
17 repository => {
18 url => 'git://git.shadowcat.co.uk/p5sagit/Config-Any.git',
19 web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Config-Any.git;a=summary',
20 type => 'git',
21 },
22 bugtracker => {
23 web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Config-Any',
24 mailto => 'bug-Config-Any@rt.cpan.org',
25 },
26 license => [ 'http://dev.perl.org/licenses/' ],
27 },
28 no_index => {
29 directory => [ 't', 'xt' ]
30 },
31 x_authority => 'cpan:RATAXIS',
32);
5f5b9e4c 33
88fedacf 34my %MM_ARGS = (
35 PREREQ_PM => {
36 (eval { require Config::General } ? ('Config::General' => '2.47') : ()),
37 },
38);
f0e3c221 39
88fedacf 40## BOILERPLATE ###############################################################
41require ExtUtils::MakeMaker;
42(do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
f0e3c221 43
88fedacf 44# have to do this since old EUMM dev releases miss the eval $VERSION line
45my $eumm_version = eval $ExtUtils::MakeMaker::VERSION;
46my $mymeta = $eumm_version >= 6.57_02;
47my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
e3c5f84b 48
88fedacf 49($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
50($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
51$META{license} = [ $META{license} ]
52 if $META{license} && !ref $META{license};
53$MM_ARGS{LICENSE} = $META{license}[0]
54 if $META{license} && $eumm_version >= 6.30;
55$MM_ARGS{NO_MYMETA} = 1
56 if $mymeta_broken;
57$MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
58 unless -f 'META.yml';
f0e3c221 59
88fedacf 60for (qw(configure build test runtime)) {
61 my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
62 my $r = $MM_ARGS{$key} = {
63 %{$META{prereqs}{$_}{requires} || {}},
64 %{delete $MM_ARGS{$key} || {}},
65 };
66 defined $r->{$_} or delete $r->{$_} for keys %$r;
e3c5f84b 67}
68
88fedacf 69$MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
70
71delete $MM_ARGS{MIN_PERL_VERSION}
72 if $eumm_version < 6.47_01;
73$MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
74 if $eumm_version < 6.63_03;
75$MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
76 if $eumm_version < 6.55_01;
77delete $MM_ARGS{CONFIGURE_REQUIRES}
78 if $eumm_version < 6.51_03;
45758652 79
88fedacf 80ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
81## END BOILERPLATE ###########################################################