Commit | Line | Data |
737416a4 |
1 | use inc::Module::Install 0.67; |
ce4c07df |
2 | |
3 | name 'DBIx-Class'; |
ce4c07df |
4 | perl_version '5.006001'; |
8e0f16f1 |
5 | all_from 'lib/DBIx/Class.pm'; |
ce4c07df |
6 | |
ce4c07df |
7 | requires 'Data::Page' => 2.00; |
8 | requires 'Scalar::Util' => 0; |
9 | requires 'SQL::Abstract' => 1.20; |
10 | requires 'SQL::Abstract::Limit' => 0.101; |
11 | requires 'Class::C3' => 0.13; |
1680d317 |
12 | requires 'Class::C3::Componentised' => 0; |
ce4c07df |
13 | requires 'Storable' => 0; |
ce4c07df |
14 | requires 'Carp::Clan' => 0; |
15 | requires 'DBI' => 1.40; |
16 | requires 'Module::Find' => 0; |
17 | requires 'Class::Inspector' => 0; |
1d4e109a |
18 | requires 'Class::Accessor::Grouped' => 0.05002; |
4cda44f2 |
19 | requires 'JSON::Any' => 1.17; |
9c6d6d93 |
20 | requires 'Scope::Guard' => 0.03; |
ce4c07df |
21 | |
22 | # Perl 5.8.0 doesn't have utf8::is_utf8() |
23 | requires 'Encode' => 0 if ($] <= 5.008000); |
24 | |
7ec5622e |
25 | test_requires 'DBD::SQLite' => 1.14; |
26 | test_requires 'Test::Builder' => 0.33; |
ce4c07df |
27 | |
28 | install_script 'script/dbicadmin'; |
29 | |
30 | tests "t/*.t t/*/*.t"; |
31 | |
1543db24 |
32 | # re-build README and require CDBI modules for testing if we're in a checkout |
33 | if( -e 'inc/.author' ) { |
34 | build_requires 'DBIx::ContextualFetch'; |
35 | build_requires 'Class::Trigger'; |
36 | system('pod2text lib/DBIx/Class.pm > README'); |
ff132c6f |
37 | } |
38 | |
39 | auto_provides; |
40 | |
3e110410 |
41 | auto_install; |
7ec5622e |
42 | # Have all prerequisites, check DBD::SQLite sanity |
43 | if (! $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 | |
76 | EOW |
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 | |
112 | EOE |
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 |
123 | WriteAll; |