add travis config
[p5sagit/Config-Any.git] / Makefile.PL
1 use strict;
2 use warnings FATAL => 'all';
3 use 5.006;
4
5 my %META = (
6   name => 'Config-Any',
7   license => 'perl_5',
8   prereqs => {
9     test => { requires => {
10       'Test::More'  => 0,
11     } },
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     },
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 );
55
56 my %MM_ARGS = (
57   PREREQ_PM => {
58     (eval { require Config::General } ? ('Config::General' => '2.47') : ()),
59   },
60 );
61
62 ## BOILERPLATE ###############################################################
63 require ExtUtils::MakeMaker;
64 (do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
65
66 # have to do this since old EUMM dev releases miss the eval $VERSION line
67 my $eumm_version  = eval $ExtUtils::MakeMaker::VERSION;
68 my $mymeta        = $eumm_version >= 6.57_02;
69 my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
70
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';
81
82 for (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;
89 }
90
91 $MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
92
93 delete $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;
99 delete $MM_ARGS{CONFIGURE_REQUIRES}
100   if $eumm_version < 6.51_03;
101
102 ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
103 ## END BOILERPLATE ###########################################################