1 use inc::Module::Install 0.67;
5 use 5.006001; # delete this line if you want to send patches for earlier.
8 perl_version '5.006001';
9 all_from 'lib/DBIx/Class.pm';
11 requires 'Data::Page' => 2.00;
12 requires 'Scalar::Util' => 0;
13 requires 'SQL::Abstract' => 1.24;
14 requires 'SQL::Abstract::Limit' => 0.13;
15 requires 'Class::C3' => 0.20;
16 requires 'Class::C3::Componentised' => 0;
17 requires 'Storable' => 0;
18 requires 'Carp::Clan' => 0;
19 requires 'DBI' => 1.40;
20 requires 'Module::Find' => 0;
21 requires 'Class::Inspector' => 0;
22 requires 'Class::Accessor::Grouped' => 0.08002;
23 requires 'JSON::Any' => 1.17;
24 requires 'Scope::Guard' => 0.03;
25 requires 'Path::Class' => 0;
26 requires 'List::Util' => 1.19;
27 requires 'Sub::Name' => 0.04;
29 # Perl 5.8.0 doesn't have utf8::is_utf8()
30 requires 'Encode' => 0 if ($] <= 5.008000);
32 test_requires 'DBD::SQLite' => 1.14;
33 test_requires 'Test::Builder' => 0.33;
34 test_requires 'Test::Warn' => 0.11;
35 test_requires 'Test::Exception' => 0;
36 test_requires 'Test::Deep' => 0;
38 install_script 'script/dbicadmin';
42 # re-build README and require CDBI modules for testing if we're in a checkout
44 my @force_build_requires_if_author = qw(
53 if ($Module::Install::AUTHOR) {
55 foreach my $module (@force_build_requires_if_author) {
56 build_requires $module;
59 system('pod2text lib/DBIx/Class.pm > README');
66 # Have all prerequisites, check DBD::SQLite sanity
67 if (! $ENV{DBICTEST_NO_SQLITE_CHECK} ) {
70 if (not defined $pid) {
71 die "Unable to fork(): $!";
75 # Win32 does not have real fork()s so a segfault will bring
76 # everything down. Warn about it.
77 if ($^O eq 'MSWin32') {
80 ######################################################################
82 # A short stress-testing of DBD::SQLite will follow. If you have a #
83 # buggy library this might very well be the last text you will see #
84 # before the installation silently terminates. If this happens it #
85 # would mean that you are running a buggy version of DBD::SQLite #
86 # known to randomly segfault on errors. Even if you have the latest #
87 # CPAN module version, the system sqlite3 dynamic library might have #
88 # been compiled against an older buggy sqlite3 dev library (oddly #
89 # DBD::SQLite will prefer the system library against the one bundled #
90 # with it). You are strongly advised to resolve this issue before #
93 # If this happens to you (this text is the last thing you see), and #
94 # you just want to install this module without worrying about the #
95 # tests (which will almost certainly fail) - set the environment #
96 # variable DBICTEST_NO_SQLITE_CHECK to a true value and try again. #
98 ######################################################################
106 $dbh = DBI->connect ('dbi:SQLite::memory:', undef, undef, {
111 or die "Unable to connect to database: $@";
112 $dbh->do ('CREATE TABLE name_with_no_columns'); # a subtle syntax error
113 $dbh->do ('COMMIT'); # followed by commit
125 ############################### WARNING #################################
127 # You are running a buggy version of DBD::SQLite known to randomly #
128 # segfault on errors. Even if you have the latest CPAN module version, #
129 # the sqlite3 dynamic library on this system might have been compiled #
130 # against an older buggy sqlite3 dev library (oddly DBD::SQLite will #
131 # prefer the system library against the one bundled with it). You are #
132 # strongly advised to resolve this issue before proceeding. #
134 #########################################################################
138 "The test suite of this module is almost certain to fail.\n"
139 . 'Do you really want to continue?',
142 exit 0 unless ($ans =~ /^y(es)?$/i);
151 if ($Module::Install::AUTHOR) {
152 # Need to do this _after_ WriteAll else it looses track of them
153 Meta->{values}{build_requires} = [ grep {
155 foreach my $module (@force_build_requires_if_author) {
156 if ($_->[0] =~ /$module/) {
162 } @{Meta->{values}{build_requires}} ];
164 my @scalar_keys = Module::Install::Metadata::Meta_TupleKeys();
165 my $cr = Module::Install::Metadata->can("Meta_TupleKeys");
167 no warnings 'redefine';
168 *Module::Install::Metadata::Meta_TupleKeys = sub {
169 return $cr->(@_), 'resources';
172 Meta->{values}{resources} = [
173 [ 'MailingList', 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class' ],
174 [ 'IRC', 'irc://irc.perl.org/#dbix-class' ],
175 [ 'license', 'http://dev.perl.org/licenses/' ],
176 [ 'repository', 'http://dev.catalyst.perl.org/svnweb/bast/browse/DBIx-Class/' ],