fill out develop/suggests prereqs
[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 } },
cc97e845 12 runtime => {
13 requires => {
14 'Module::Pluggable::Object' => '3.6',
15 },
16 suggests => {
17 'Config::General' => '2.47',
18 'Config::Tiny' => 0,
19 'Cpanel::JSON::XS' => 0,
20 'XML::Simple' => 0,
21 'XML::NamespaceSupport' => 0,
22 'YAML::XS' => 0,
23 },
24 },
25 develop => {
26 requires => {
27 'Config::General' => '2.47',
28 'Config::Tiny' => 0,
29 'Cpanel::JSON::XS' => 0,
30 'XML::Simple' => 0,
31 'XML::NamespaceSupport' => 0,
32 'YAML::XS' => 0,
33 'Test::Pod' => 0,
34 'Test::Pod::Coverage' => 0,
35 },
36 },
88fedacf 37 },
38 resources => {
39 repository => {
40 url => 'git://git.shadowcat.co.uk/p5sagit/Config-Any.git',
41 web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Config-Any.git;a=summary',
42 type => 'git',
43 },
44 bugtracker => {
45 web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Config-Any',
46 mailto => 'bug-Config-Any@rt.cpan.org',
47 },
48 license => [ 'http://dev.perl.org/licenses/' ],
49 },
50 no_index => {
51 directory => [ 't', 'xt' ]
52 },
53 x_authority => 'cpan:RATAXIS',
54);
5f5b9e4c 55
88fedacf 56my %MM_ARGS = (
57 PREREQ_PM => {
58 (eval { require Config::General } ? ('Config::General' => '2.47') : ()),
59 },
60);
f0e3c221 61
88fedacf 62## BOILERPLATE ###############################################################
63require ExtUtils::MakeMaker;
64(do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
f0e3c221 65
88fedacf 66# have to do this since old EUMM dev releases miss the eval $VERSION line
67my $eumm_version = eval $ExtUtils::MakeMaker::VERSION;
68my $mymeta = $eumm_version >= 6.57_02;
69my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
e3c5f84b 70
88fedacf 71($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
72($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
73$META{license} = [ $META{license} ]
74 if $META{license} && !ref $META{license};
75$MM_ARGS{LICENSE} = $META{license}[0]
76 if $META{license} && $eumm_version >= 6.30;
77$MM_ARGS{NO_MYMETA} = 1
78 if $mymeta_broken;
79$MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
80 unless -f 'META.yml';
f0e3c221 81
88fedacf 82for (qw(configure build test runtime)) {
83 my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
84 my $r = $MM_ARGS{$key} = {
85 %{$META{prereqs}{$_}{requires} || {}},
86 %{delete $MM_ARGS{$key} || {}},
87 };
88 defined $r->{$_} or delete $r->{$_} for keys %$r;
e3c5f84b 89}
90
88fedacf 91$MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
92
93delete $MM_ARGS{MIN_PERL_VERSION}
94 if $eumm_version < 6.47_01;
95$MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
96 if $eumm_version < 6.63_03;
97$MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
98 if $eumm_version < 6.55_01;
99delete $MM_ARGS{CONFIGURE_REQUIRES}
100 if $eumm_version < 6.51_03;
45758652 101
88fedacf 102ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
103## END BOILERPLATE ###########################################################