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