add $VERSIONs to every module (RT#116427)
[p5sagit/Data-Dumper-Concise.git] / Makefile.PL
1 use strict;
2 use warnings FATAL => 'all';
3 use ExtUtils::MakeMaker;
4 (do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
5
6 my %WriteMakefileArgs = (
7   NAME => 'Data::Dumper::Concise',
8   VERSION_FROM => 'lib/Data/Dumper/Concise.pm',
9
10   META_MERGE => {
11     'meta-spec' => { version => 2 },
12     dynamic_config => 0,
13     resources => {
14       # GitHub mirrors from Shadowcat. We list it so we can get pull requests.
15       # The canonical repo is:
16       # r/o: git://git.shadowcat.co.uk/p5sagit/Data-Dumper-Concise.git
17       # r/w: p5sagit@git.shadowcat.co.uk:Data-Dumper-Concise.git
18       # web: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Data-Dumper-Concise.git
19       repository => {
20         url => 'https://github.com/p5sagit/Data-Dumper-Concise.git',
21         web => 'https://github.com/p5sagit/Data-Dumper-Concise',
22         type => 'git',
23       },
24       bugtracker => {
25         mailto => 'bug-Data-Dumper-Concise@rt.cpan.org',
26         web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Dumper-Concise',
27       },
28     },
29     x_contributors => [ # manually added, from git shortlog -e -s -n
30       'Arthur Axel \'fREW\' Schmidt <frioux@gmail.com>',
31       'Matt S Trout <matthewt@hercule.scsys.co.uk>',
32       'Karen Etheridge <ether@cpan.org>',
33     ],
34   },
35
36   META_ADD => {
37     'meta-spec' => { version => 2 },
38     prereqs => {
39       configure => {
40         requires => {
41           'ExtUtils::MakeMaker' => '0',
42         },
43       },
44       runtime => {
45         requires => {
46           'Exporter' => '0',
47           'Data::Dumper' => '0',
48           'perl' => '5.006',
49         },
50       },
51       test => {
52         requires => {
53           'Test::More' => '0',
54         },
55       },
56     },
57   },
58 );
59
60 my $eumm_version  = eval $ExtUtils::MakeMaker::VERSION;
61
62 for (qw(configure build test runtime)) {
63   my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
64   next unless exists $WriteMakefileArgs{META_ADD}{prereqs}{$_}
65            or exists $WriteMakefileArgs{$key};
66   my $r = $WriteMakefileArgs{$key} = {
67     %{$WriteMakefileArgs{META_ADD}{prereqs}{$_}{requires} || {}},
68     %{delete $WriteMakefileArgs{$key} || {}},
69   };
70   defined $r->{$_} or delete $r->{$_} for keys %$r;
71 }
72
73 # dynamic prereqs get added here...
74
75 $WriteMakefileArgs{MIN_PERL_VERSION} = delete $WriteMakefileArgs{PREREQ_PM}{perl} || 0;
76
77 die 'attention developer: you need to do a sane meta merge here!'
78   if keys %{$WriteMakefileArgs{BUILD_REQUIRES}};
79
80 $WriteMakefileArgs{BUILD_REQUIRES} = {
81     %{$WriteMakefileArgs{BUILD_REQUIRES} || {}},
82     %{delete $WriteMakefileArgs{TEST_REQUIRES}}
83 } if $eumm_version < 6.63_03;
84
85 $WriteMakefileArgs{PREREQ_PM} = {
86     %{$WriteMakefileArgs{PREREQ_PM}},
87     %{delete $WriteMakefileArgs{BUILD_REQUIRES}}
88 } if $eumm_version < 6.55_01;
89
90 delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
91   if $eumm_version < 6.51_03;
92
93 delete $WriteMakefileArgs{MIN_PERL_VERSION}
94   if $eumm_version < 6.48;
95
96 delete @WriteMakefileArgs{qw(META_ADD META_MERGE)}
97   if $eumm_version < 6.46;
98
99 delete $WriteMakefileArgs{LICENSE}
100   if $eumm_version < 6.31;
101
102 WriteMakefile(%WriteMakefileArgs);