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