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