5d05239d5f514481e9949572dc1a31cb8df81e97
[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
13 test_requires 'Test::Builder'       => 0.33;
14 test_requires 'Test::Deep'          => 0;
15 test_requires 'Test::Exception'     => 0;
16 test_requires 'Test::More'          => 0.92;
17 test_requires 'Test::Warn'          => 0.11;
18
19 test_requires 'File::Temp'          => 0.22;
20
21 # Core
22 requires 'List::Util'               => 0;
23 requires 'Scalar::Util'             => 0;
24 requires 'Storable'                 => 0;
25
26 # Perl 5.8.0 doesn't have utf8::is_utf8()
27 requires 'Encode'                   => 0 if ($] <= 5.008000);
28
29 # Dependencies (keep in alphabetical order)
30 requires 'Carp::Clan'               => 6.0;
31 requires 'Class::Accessor::Grouped' => 0.08003;
32 requires 'Class::C3::Componentised' => 1.0005;
33 requires 'Class::Inspector'         => 1.24;
34 requires 'Data::Page'               => 2.00;
35 requires 'DBD::SQLite'              => 1.25;
36 requires 'DBI'                      => 1.605;
37 requires 'JSON::Any'                => 1.18;
38 requires 'MRO::Compat'              => 0.09;
39 requires 'Module::Find'             => 0.06;
40 requires 'Path::Class'              => 0.16;
41 requires 'Scope::Guard'             => 0.03;
42 requires 'SQL::Abstract'            => 1.56;
43 requires 'SQL::Abstract::Limit'     => 0.13;
44 requires 'Sub::Name'                => 0.04;
45
46 recommends 'SQL::Translator'        => 0.09004;
47
48 install_script (qw|
49     script/dbicadmin
50 |);
51
52 tests_recursive (qw|
53     t
54 |);
55
56 resources 'IRC'         => 'irc://irc.perl.org/#dbix-class';
57 resources 'license'     => 'http://dev.perl.org/licenses/';
58 resources 'repository'  => 'http://dev.catalyst.perl.org/svnweb/bast/browse/DBIx-Class/';
59 resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
60
61
62 # re-build README and require extra modules for testing if we're in a checkout
63
64 my %force_requires_if_author = (
65 #  'Module::Install::Pod::Inherit' => 0.01,
66   'Test::Pod::Coverage'       => 1.04,
67   'SQL::Translator'           => 0.09007,
68
69   # CDBI-compat related
70   'DBIx::ContextualFetch'     => 0,
71   'Class::DBI::Plugin::DeepAbstractSearch' => 0,
72   'Class::Trigger'            => 0,
73   'Time::Piece::MySQL'        => 0,
74   'Clone'                     => 0,
75   'Date::Simple'              => 3.03,
76
77   # t/52cycle.t
78   'Test::Memory::Cycle'       => 0,
79   'Devel::Cycle'              => 1.10,
80
81   # t/36datetime.t
82   # t/60core.t
83   'DateTime::Format::SQLite'  => 0,
84
85   # t/96_is_deteministic_value.t
86   'DateTime::Format::Strptime'=> 0,
87
88   # t/93storage_replication.t
89   'Moose',                    => 0.87,
90   'MooseX::AttributeHelpers'  => 0.21,
91   'MooseX::Types',            => 0.16,
92   'namespace::clean'          => 0.11,
93   'Hash::Merge',              => 0.11,
94
95   # database-dependent reqs
96   #
97   $ENV{DBICTEST_PG_DSN}
98     ? (
99       'Sys::SigAction' => 0,
100       'DBD::Pg' => 2.009002,
101       'DateTime::Format::Pg' => 0,
102     ) : ()
103   ,
104
105   $ENV{DBICTEST_MYSQL_DSN}
106     ? (
107       'DateTime::Format::MySQL' => 0,
108     ) : ()
109   ,
110
111   $ENV{DBICTEST_ORACLE_DSN}
112     ? (
113       'DateTime::Format::Oracle' => 0,
114     ) : ()
115   ,
116
117   $ENV{DBICTEST_SYBASE_DSN}
118     ? (
119       'DateTime::Format::Sybase' => 0,
120     ) : ()
121   ,
122 );
123
124 if ($Module::Install::AUTHOR) {
125   warn <<'EOW';
126 ******************************************************************************
127 ******************************************************************************
128 ***                                                                        ***
129 *** AUTHOR MODE: all optional test dependencies converted to hard requires ***
130 ***                                                                        ***
131 ******************************************************************************
132 ******************************************************************************
133
134 EOW
135
136   foreach my $module (sort keys %force_requires_if_author) {
137     build_requires ($module => $force_requires_if_author{$module});
138   }
139
140   print "Regenerating README\n";
141   system('pod2text lib/DBIx/Class.pm > README');
142
143   if (-f 'MANIFEST') {
144     print "Removing MANIFEST\n";
145     unlink 'MANIFEST';
146   }
147
148 #  eval { require Module::Install::Pod::Inherit };
149 #  PodInherit() if !$@;
150 }
151
152 auto_install();
153
154 WriteAll();
155
156 # Re-write META.yml to _exclude_ all forced requires (we do not want to ship this)
157 if ($Module::Install::AUTHOR) {
158
159   Meta->{values}{build_requires} = [ grep 
160     { not exists $force_requires_if_author{$_->[0]} }
161     ( @{Meta->{values}{build_requires}} )
162   ];
163
164   Meta->write;
165 }