f861df26c04c4620c7a8028c07eb580f305737ca
[dbsrgits/DBIx-Class-Historic.git] / Makefile.PL
1 use inc::Module::Install 0.89;
2 use strict;
3 use warnings;
4 use POSIX ();
5
6 use 5.006001; # delete this line if you want to send patches for earlier.
7
8 name     'DBIx-Class';
9 perl_version '5.006001';
10 all_from 'lib/DBIx/Class.pm';
11
12 requires 'DBD::SQLite'              => 1.25;
13 requires 'Data::Page'               => 2.00;
14 requires 'SQL::Abstract'            => 1.55;
15 requires 'SQL::Abstract::Limit'     => 0.13;
16 requires 'Class::C3::Componentised' => 1.0005;
17 requires 'Carp::Clan'               => 6.0;
18 requires 'DBI'                      => 1.605;
19 requires 'Module::Find'             => 0.06;
20 requires 'Class::Inspector'         => 1.24;
21 requires 'Class::Accessor::Grouped' => 0.08003;
22 requires 'JSON::Any'                => 1.18;
23 requires 'Scope::Guard'             => 0.03;
24 requires 'Path::Class'              => 0.16;
25 requires 'Sub::Name'                => 0.04;
26 requires 'MRO::Compat'              => 0.09;
27
28 # Core
29 requires 'List::Util'               => 0;
30 requires 'Scalar::Util'             => 0;
31 requires 'Storable'                 => 0;
32
33 # Perl 5.8.0 doesn't have utf8::is_utf8()
34 requires 'Encode'                   => 0 if ($] <= 5.008000);
35
36 test_requires 'Test::More'          => 0.82;
37 test_requires 'Test::Builder'       => 0.33;
38 test_requires 'Test::Warn'          => 0.11;
39 test_requires 'Test::Exception'     => 0;
40 test_requires 'Test::Deep'          => 0;
41
42 recommends 'SQL::Translator'        => 0.09004;
43
44 install_script (qw|
45     script/dbicadmin
46 |);
47
48 tests_recursive (qw|
49     t
50 |);
51
52 resources 'IRC'         => 'irc://irc.perl.org/#dbix-class';
53 resources 'license'     => 'http://dev.perl.org/licenses/';
54 resources 'repository'  => 'http://dev.catalyst.perl.org/svnweb/bast/browse/DBIx-Class/';
55 resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
56
57
58 # re-build README and require extra modules for testing if we're in a checkout
59
60 my %force_requires_if_author = (
61   'Test::Pod::Coverage'       => 1.04,
62   'SQL::Translator'           => 0.09004,
63
64   # CDBI-compat related
65   'DBIx::ContextualFetch'     => 0,
66   'Class::DBI::Plugin::DeepAbstractSearch' => 0,
67   'Class::Trigger'            => 0,
68   'Time::Piece::MySQL'        => 0,
69   'Clone'                     => 0,
70   'Date::Simple'              => 0,
71
72   # t/52cycle.t
73   'Test::Memory::Cycle'       => 0,
74
75   # t/60core.t
76   'DateTime::Format::MySQL'   => 0,
77   
78   # t/89inflate_datetime.t
79   'DateTime::Format::Pg'      => 0,
80
81   # t/72pg.t
82   $ENV{DBICTEST_PG_DSN}
83     ? ('Sys::SigAction'=> 0)
84     : ()
85   ,
86
87   # t/93storage_replication.t
88   'Moose',                        => 0.77,
89   'MooseX::AttributeHelpers'      => 0.12,
90   'MooseX::Types',                => 0.10,
91   'namespace::clean'              => 0.11,
92   'Hash::Merge',                  => 0.11,
93
94   # t/96_is_deteministic_value.t
95   'DateTime::Format::Strptime' => 0,
96 );
97
98 if ($Module::Install::AUTHOR) {
99
100   foreach my $module (keys %force_requires_if_author) {
101     build_requires ($module => $force_requires_if_author{$module});
102   }
103
104   system('pod2text lib/DBIx/Class.pm > README');
105 }
106
107 auto_provides;
108
109 if ($Module::Install::AUTHOR) {
110   warn <<'EOW';
111 ******************************************************************************
112 ******************************************************************************
113 ***                                                                        ***
114 *** AUTHOR MODE: all optional test dependencies converted to hard requires ***
115 ***                                                                        ***
116 ******************************************************************************
117 ******************************************************************************
118
119 EOW
120 }
121
122 auto_install;
123
124 WriteAll();
125
126 if ($Module::Install::AUTHOR) {
127   # Need to do this _after_ WriteAll else it loses track of them
128   Meta->{values}{build_requires} = [ grep {
129     my $ok = 1;
130     foreach my $module (keys %force_requires_if_author) {
131       if ($_->[0] =~ /$module/) {
132         $ok = 0;
133         last;
134       }
135     }
136     $ok;
137   } @{Meta->{values}{build_requires}} ];
138   Meta->write;
139 }