Release commit for 1.84
[dbsrgits/SQL-Abstract.git] / Makefile.PL
1 use strict;
2 use warnings FATAL => 'all';
3 use 5.006;
4
5 my %META = (
6   name => 'SQL-Abstract',
7   license => 'perl_5',
8   dynamic_config => 0,
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',
37       },
38     },
39     develop   => {
40       requires => {},
41     },
42   },
43   resources => {
44     repository => {
45       url => 'https://github.com/dbsrgits/sql-abstract.git',
46       web => 'https://github.com/dbsrgits/sql-abstract',
47       type => 'git',
48     },
49     x_IRC => 'irc://irc.perl.org/#dbix-class',
50     bugtracker => {
51       web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=SQL-Abstract',
52       mailto => 'bug-SQL-Abstract@rt.cpan.org',
53     },
54     license => [ 'http://dev.perl.org/licenses/' ],
55   },
56   no_index => {
57     package => 'DBIx::Class::Storage::Debug::PrettyPrint',
58     directory => [ 't', 'xt', 'examples' ],
59   },
60 );
61
62 my %MM_ARGS = (
63   test => { TESTS => 't/*.t t/*/*.t' },
64 );
65
66 ## BOILERPLATE ###############################################################
67 require ExtUtils::MakeMaker;
68 (do './maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
69
70 # have to do this since old EUMM dev releases miss the eval $VERSION line
71 my $eumm_version  = eval $ExtUtils::MakeMaker::VERSION;
72 my $mymeta        = $eumm_version >= 6.57_02;
73 my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
74
75 ($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
76 ($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
77 $META{license} = [ $META{license} ]
78   if $META{license} && !ref $META{license};
79 $MM_ARGS{LICENSE} = $META{license}[0]
80   if $META{license} && $eumm_version >= 6.30;
81 $MM_ARGS{NO_MYMETA} = 1
82   if $mymeta_broken;
83 $MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
84   unless -f 'META.yml';
85
86 for (qw(configure build test runtime)) {
87   my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
88   my $r = $MM_ARGS{$key} = {
89     %{$META{prereqs}{$_}{requires} || {}},
90     %{delete $MM_ARGS{$key} || {}},
91   };
92   defined $r->{$_} or delete $r->{$_} for keys %$r;
93 }
94
95 $MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
96
97 delete $MM_ARGS{MIN_PERL_VERSION}
98   if $eumm_version < 6.47_01;
99 $MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
100   if $eumm_version < 6.63_03;
101 $MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
102   if $eumm_version < 6.55_01;
103 delete $MM_ARGS{CONFIGURE_REQUIRES}
104   if $eumm_version < 6.51_03;
105
106 ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
107 ## END BOILERPLATE ###########################################################