Restore perl version requirement missed in the Distar port
[dbsrgits/SQL-Abstract.git] / Makefile.PL
CommitLineData
d4705371 1use strict;
b5f5aae4 2use warnings FATAL => 'all';
1a6addf7 3use 5.006;
d4705371 4
b5f5aae4 5my %META = (
6 name => 'SQL-Abstract',
7 license => 'perl_5',
743a28db 8 dynamic_config => 0,
b5f5aae4 9 prereqs => {
10 configure => {
11 requires => {
12 'ExtUtils::MakeMaker' => 0,
13 }
14 },
15 build => {
16 requires => {}
17 },
18 test => {
19 requires => {
20 "Test::More" => '0.88',
21 "Test::Exception" => '0.31',
22 "Test::Warn" => '0',
23 "Test::Deep" => '0.101',
24 "Storable" => '0', # for cloning in tests
25 },
26 },
27 runtime => {
28 requires => {
29 'List::Util' => '0',
30 'Scalar::Util' => '0',
31 'Exporter' => '5.57',
32 'MRO::Compat' => '0.12',
33 'Moo' => '2.000001',
34 'Sub::Quote' => '2.000001',
35 'Hash::Merge' => '0.12',
36 'Text::Balanced' => '2.00',
b3ecfcfa 37 'perl' => '5.006',
b5f5aae4 38 },
39 },
40 develop => {
41 requires => {},
42 },
43 },
44 resources => {
45 repository => {
46 url => 'https://github.com/dbsrgits/sql-abstract.git',
47 web => 'https://github.com/dbsrgits/sql-abstract',
48 type => 'git',
49 },
50 x_IRC => 'irc://irc.perl.org/#dbix-class',
51 bugtracker => {
52 web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=SQL-Abstract',
53 mailto => 'bug-SQL-Abstract@rt.cpan.org',
54 },
55 license => [ 'http://dev.perl.org/licenses/' ],
56 },
57 no_index => {
58 package => 'DBIx::Class::Storage::Debug::PrettyPrint',
59 directory => [ 't', 'xt', 'examples' ],
60 },
61);
d4705371 62
b5f5aae4 63my %MM_ARGS = (
64 test => { TESTS => 't/*.t t/*/*.t' },
65);
d4705371 66
b5f5aae4 67## BOILERPLATE ###############################################################
68require ExtUtils::MakeMaker;
69(do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
b5f4fb92 70
b5f5aae4 71# have to do this since old EUMM dev releases miss the eval $VERSION line
72my $eumm_version = eval $ExtUtils::MakeMaker::VERSION;
73my $mymeta = $eumm_version >= 6.57_02;
74my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
187f46da 75
b5f5aae4 76($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
77($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
78$META{license} = [ $META{license} ]
79 if $META{license} && !ref $META{license};
80$MM_ARGS{LICENSE} = $META{license}[0]
81 if $META{license} && $eumm_version >= 6.30;
82$MM_ARGS{NO_MYMETA} = 1
83 if $mymeta_broken;
84$MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
85 unless -f 'META.yml';
d4705371 86
b5f5aae4 87for (qw(configure build test runtime)) {
88 my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
89 my $r = $MM_ARGS{$key} = {
90 %{$META{prereqs}{$_}{requires} || {}},
91 %{delete $MM_ARGS{$key} || {}},
92 };
93 defined $r->{$_} or delete $r->{$_} for keys %$r;
94}
1dc93d17 95
b5f5aae4 96$MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
d4705371 97
b5f5aae4 98delete $MM_ARGS{MIN_PERL_VERSION}
99 if $eumm_version < 6.47_01;
100$MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
101 if $eumm_version < 6.63_03;
102$MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
103 if $eumm_version < 6.55_01;
104delete $MM_ARGS{CONFIGURE_REQUIRES}
105 if $eumm_version < 6.51_03;
536dbae1 106
b5f5aae4 107ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
108## END BOILERPLATE ###########################################################