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