Apparently ready to roll as 0.08011
[dbsrgits/DBIx-Class.git] / Makefile.PL
CommitLineData
737416a4 1use inc::Module::Install 0.67;
ce4c07df 2
3name 'DBIx-Class';
ce4c07df 4perl_version '5.006001';
8e0f16f1 5all_from 'lib/DBIx/Class.pm';
ce4c07df 6
ce4c07df 7requires 'Data::Page' => 2.00;
8requires 'Scalar::Util' => 0;
a95945c8 9requires 'SQL::Abstract' => 1.24;
10requires 'SQL::Abstract::Limit' => 0.13;
11requires 'Class::C3' => 0.20;
1680d317 12requires 'Class::C3::Componentised' => 0;
ce4c07df 13requires 'Storable' => 0;
ce4c07df 14requires 'Carp::Clan' => 0;
15requires 'DBI' => 1.40;
16requires 'Module::Find' => 0;
17requires 'Class::Inspector' => 0;
a95945c8 18requires 'Class::Accessor::Grouped' => 0.08002;
4cda44f2 19requires 'JSON::Any' => 1.17;
9c6d6d93 20requires 'Scope::Guard' => 0.03;
ce4c07df 21
22# Perl 5.8.0 doesn't have utf8::is_utf8()
23requires 'Encode' => 0 if ($] <= 5.008000);
24
7ec5622e 25test_requires 'DBD::SQLite' => 1.14;
26test_requires 'Test::Builder' => 0.33;
ce4c07df 27
28install_script 'script/dbicadmin';
29
30tests "t/*.t t/*/*.t";
31
1543db24 32# re-build README and require CDBI modules for testing if we're in a checkout
33if( -e 'inc/.author' ) {
34 build_requires 'DBIx::ContextualFetch';
35 build_requires 'Class::Trigger';
36 system('pod2text lib/DBIx/Class.pm > README');
ff132c6f 37}
38
39auto_provides;
40
3e110410 41auto_install;
7ec5622e 42# Have all prerequisites, check DBD::SQLite sanity
43if (! $ENV{DBICTEST_NO_SQLITE_CHECK} ) {
44
45 my $pid = fork();
46 if (not defined $pid) {
47 die "Unable to fork(): $!";
48 }
49 elsif (! $pid) {
50
51 # Win32 does not have real fork()s so a segfault will bring
52 # everything down. Warn about it.
53 if ($^O eq 'MSWin32') {
54 print <<'EOW';
55
56######################################################################
57# #
58# A short stress-testing of DBD::SQLite will follow. If you have a #
59# buggy library this might very well be the last text you will see #
60# before the installation silently terminates. If this happens it #
61# would mean that you are running a buggy version of DBD::SQLite #
62# known to randomly segfault on errors. Even if you have the latest #
63# CPAN module version, the system sqlite3 dynamic library might have #
64# been compiled against an older buggy sqlite3 dev library (oddly #
65# DBD::SQLite will prefer the system library against the one bundled #
66# with it). You are strongly advised to resolve this issue before #
67# proceeding. #
68# #
69# If this happens to you (this text is the last thing you see), and #
70# you just want to install this module without worrying about the #
71# tests (which will almost certainly fail) - set the environment #
72# variable DBICTEST_NO_SQLITE_CHECK to a true value and try again. #
73# #
74######################################################################
75
76EOW
77 }
78
79 require DBI;
80 for (1 .. 100) {
81 my $dbh;
82 $dbh = DBI->connect ('dbi:SQLite::memory:', undef, undef, {
83 AutoCommit => 1,
84 RaiseError => 0,
85 PrintError => 0,
86 })
87 or die "Unable to connect to database: $@";
88 $dbh->do ('CREATE TABLE name_with_no_columns'); # a subtle syntax error
89 $dbh->do ('COMMIT'); # followed by commit
90 $dbh->disconnect;
91 }
92
93 exit 0;
94 }
95 else {
96 wait();
97 my $sig = $? & 127;
98 if ($sig == 11) {
99 warn (<<EOE);
100
101############################### WARNING #################################
102# #
103# You are running a buggy version of DBD::SQLite known to randomly #
104# segfault on errors. Even if you have the latest CPAN module version, #
105# the sqlite3 dynamic library on this system might have been compiled #
106# against an older buggy sqlite3 dev library (oddly DBD::SQLite will #
107# prefer the system library against the one bundled with it). You are #
108# strongly advised to resolve this issue before proceeding. #
109# #
110#########################################################################
111
112EOE
113 my $ans = prompt (
114 "The test suite of this module is almost certain to fail.\n"
115 . 'Do you really want to continue?',
116 'no',
117 );
118 exit 0 unless ($ans =~ /^y(es)?$/i);
119 }
120 }
121}
3e110410 122
ce4c07df 123WriteAll;