1 use inc::Module::Install 0.67;
6 use 5.006001; # delete this line if you want to send patches for earlier.
9 perl_version '5.006001';
10 all_from 'lib/DBIx/Class.pm';
12 requires 'Data::Page' => 2.00;
13 requires 'Scalar::Util' => 0;
14 requires 'SQL::Abstract' => 1.49;
15 requires 'SQL::Abstract::Limit' => 0.13;
16 requires 'Class::C3' => 0.20;
17 requires 'Class::C3::Componentised' => 0;
18 requires 'Storable' => 0;
19 requires 'Carp::Clan' => 0;
20 requires 'DBI' => 1.40;
21 requires 'Module::Find' => 0;
22 requires 'Class::Inspector' => 0;
23 requires 'Class::Accessor::Grouped' => 0.08002;
24 requires 'JSON::Any' => 1.17;
25 requires 'Scope::Guard' => 0.03;
26 requires 'Path::Class' => 0;
27 requires 'List::Util' => 1.19;
28 requires 'Sub::Name' => 0.04;
30 # Perl 5.8.0 doesn't have utf8::is_utf8()
31 requires 'Encode' => 0 if ($] <= 5.008000);
33 # configure_requires so the sanity check below can run
34 configure_requires 'DBD::SQLite' => 1.14;
36 test_requires 'Test::Builder' => 0.33;
37 test_requires 'Test::Warn' => 0.11;
38 test_requires 'Test::Exception' => 0;
39 test_requires 'Test::Deep' => 0;
41 recommends 'SQL::Translator' => 0.09004;
43 install_script 'script/dbicadmin';
47 # re-build README and require extra modules for testing if we're in a checkout
49 my %force_requires_if_author = (
50 'Test::Pod::Coverage' => 1.04,
51 'SQL::Translator' => 0.09004,
54 'DBIx::ContextualFetch' => 0,
55 'Class::Trigger' => 0,
60 'Test::Memory::Cycle' => 0,
63 'DateTime::Format::MySQL' => 0,
65 # t/93storage_replication.t
67 'MooseX::AttributeHelpers' => 0.12,
69 # t/96_is_deteministic_value.t
70 'DateTime::Format::Strptime' => 0,
73 if ($Module::Install::AUTHOR) {
75 foreach my $module (keys %force_requires_if_author) {
76 requires ($module => $force_requires_if_author{$module});
79 system('pod2text lib/DBIx/Class.pm > README');
86 # Have all prerequisites, check DBD::SQLite sanity
87 if (! $ENV{DBICTEST_NO_SQLITE_CHECK} ) {
90 if (not defined $pid) {
91 die "Unable to fork(): $!";
95 # Win32 does not have real fork()s so a segfault will bring
96 # everything down. Warn about it.
97 if ($^O eq 'MSWin32') {
100 ######################################################################
102 # A short stress-testing of DBD::SQLite will follow. If you have a #
103 # buggy library this might very well be the last text you will see #
104 # before the installation silently terminates. If this happens it #
105 # would mean that you are running a buggy version of DBD::SQLite #
106 # known to randomly segfault on errors. Even if you have the latest #
107 # CPAN module version, the system sqlite3 dynamic library might have #
108 # been compiled against an older buggy sqlite3 dev library (oddly #
109 # DBD::SQLite will prefer the system library against the one bundled #
110 # with it). You are strongly advised to resolve this issue before #
113 # If this happens to you (this text is the last thing you see), and #
114 # you just want to install this module without worrying about the #
115 # tests (which will almost certainly fail) - set the environment #
116 # variable DBICTEST_NO_SQLITE_CHECK to a true value and try again. #
118 ######################################################################
126 $dbh = DBI->connect ('dbi:SQLite::memory:', undef, undef, {
131 or die "Unable to connect to database: $@";
132 $dbh->do ('CREATE TABLE name_with_no_columns'); # a subtle syntax error
133 $dbh->do ('COMMIT'); # followed by commit
141 local $SIG{ALRM} = sub { die "timeout\n" };
150 # make sure process actually dies
151 $exception && kill POSIX::SIGKILL(), $pid;
153 if ($exception || $sig == POSIX::SIGSEGV() || $sig == POSIX::SIGABRT()
154 || $sig == 7) { # 7 == SIGBUS, haven't seen it but just in case
157 ############################### WARNING #################################
159 # You are running a buggy version of DBD::SQLite known to randomly #
160 # segfault on errors. Even if you have the latest CPAN module version, #
161 # the sqlite3 dynamic library on this system might have been compiled #
162 # against an older buggy sqlite3 dev library (oddly DBD::SQLite will #
163 # prefer the system library against the one bundled with it). You are #
164 # strongly advised to resolve this issue before proceeding. #
166 #########################################################################
170 "The test suite of this module is almost certain to fail.\n"
171 . 'Do you really want to continue?',
174 exit 0 unless ($ans =~ /^y(es)?$/i);
183 if ($Module::Install::AUTHOR) {
184 # Need to do this _after_ WriteAll else it looses track of them
185 Meta->{values}{build_requires} = [ grep {
187 foreach my $module (keys %force_requires_if_author) {
188 if ($_->[0] =~ /$module/) {
194 } @{Meta->{values}{build_requires}} ];
196 my @scalar_keys = Module::Install::Metadata::Meta_TupleKeys();
197 my $cr = Module::Install::Metadata->can("Meta_TupleKeys");
199 no warnings 'redefine';
200 *Module::Install::Metadata::Meta_TupleKeys = sub {
201 return $cr->(@_), 'resources';
204 Meta->{values}{resources} = [
205 [ 'MailingList', 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class' ],
206 [ 'IRC', 'irc://irc.perl.org/#dbix-class' ],
207 [ 'license', 'http://dev.perl.org/licenses/' ],
208 [ 'repository', 'http://dev.catalyst.perl.org/svnweb/bast/browse/DBIx-Class/' ],