* Removed temporary notes file (WHATSNEW.txt).
[dbsrgits/DBIx-Class-Historic.git] / Makefile.PL
CommitLineData
737416a4 1use inc::Module::Install 0.67;
fe650234 2use strict;
3use warnings;
4
5use 5.006001; # delete this line if you want to send patches for earlier.
ce4c07df 6
7name 'DBIx-Class';
ce4c07df 8perl_version '5.006001';
8e0f16f1 9all_from 'lib/DBIx/Class.pm';
ce4c07df 10
ce4c07df 11requires 'Data::Page' => 2.00;
12requires 'Scalar::Util' => 0;
6881e2b2 13requires 'SQL::Abstract' => 1.20;
ce4c07df 14requires 'SQL::Abstract::Limit' => 0.101;
15requires 'Class::C3' => 0.13;
1680d317 16requires 'Class::C3::Componentised' => 0;
ce4c07df 17requires 'Storable' => 0;
ce4c07df 18requires 'Carp::Clan' => 0;
19requires 'DBI' => 1.40;
20requires 'Module::Find' => 0;
21requires 'Class::Inspector' => 0;
1d4e109a 22requires 'Class::Accessor::Grouped' => 0.05002;
c843f5e4 23requires 'JSON::Any' => 1.00;
9c6d6d93 24requires 'Scope::Guard' => 0.03;
8026d0eb 25requires 'Path::Class' => 0;
26ab719a 26requires 'List::Util' => 1.19;
ddc0a6c8 27requires 'Sub::Name' => 0.04;
ce4c07df 28
29# Perl 5.8.0 doesn't have utf8::is_utf8()
30requires 'Encode' => 0 if ($] <= 5.008000);
31
f4086911 32test_requires 'DBD::SQLite' => 1.14;
f947585b 33test_requires 'Test::Builder' => 0.33;
97aca715 34test_requires 'Test::Warn' => 0.11;
f947585b 35test_requires 'Test::Exception' => 0;
ce3b4eb9 36test_requires 'Test::Deep' => 0;
ce4c07df 37
38install_script 'script/dbicadmin';
39
40tests "t/*.t t/*/*.t";
41
1543db24 42# re-build README and require CDBI modules for testing if we're in a checkout
fe650234 43
44my @force_build_requires_if_author = qw(
45 DBIx::ContextualFetch
46 Class::Trigger
47 Time::Piece
a8e7500d 48 Clone
49 Test::Pod::Coverage
50 Test::Memory::Cycle
fe650234 51);
52
53if ($Module::Install::AUTHOR) {
54
55 foreach my $module (@force_build_requires_if_author) {
56 build_requires $module;
57 }
09d46657 58
1543db24 59 system('pod2text lib/DBIx/Class.pm > README');
ff132c6f 60}
61
62auto_provides;
63
3e110410 64auto_install;
65
e0b438fb 66# Have all prerequisites, check DBD::SQLite sanity
67{
68 my $pid = fork();
69 if (not defined $pid) {
70 die "Unable to fork(): $!";
71 }
72 elsif (! $pid) {
73 require DBI;
74 for (1 .. 10) {
75 my $dbh;
76 $dbh = DBI->connect ('dbi:SQLite::memory:', undef, undef, {
77 AutoCommit => 1,
78 RaiseError => 0,
79 PrintError => 0,
80 })
81 or die "Unable to connect to database: $@";
82 $dbh->do ('CREATE TABLE name_with_no_columns'); # a subtle syntax error
83 $dbh->do ('COMMIT'); # followed by commit
84 $dbh->disconnect;
85 }
86
87 exit 0;
88 }
89 else {
90 wait();
91 my $sig = $? & 127;
92 if ($sig == 11) {
93 warn (<<EOE);
94
95############################### WARNING ###################################
96# #
97# You are running a buggy version of DBD::SQLite known to randomly #
98# segfault on errors. Even if you have the latest CPAN module version, #
99# the actual sqlite3.so might have been compiled against an older buggy #
100# sqlite3 dev library. You are strongly advised to update DBD::SQLite. #
101# #
102###########################################################################
103
104EOE
105 my $ans = prompt (
106 "The test suite of this module is almost certain to fail.\n"
107 . 'Do you really want to continue?',
108 'no',
109 );
110 exit 0 unless ($ans =~ /^y(es)?$/i);
111 }
112 }
113}
114
115
ce4c07df 116WriteAll;
09d46657 117
118
119if ($Module::Install::AUTHOR) {
120 # Need to do this _after_ WriteAll else it looses track of them
121 Meta->{values}{build_requires} = [ grep {
fe650234 122 my $ok = 1;
123 foreach my $module (@force_build_requires_if_author) {
124 if ($_->[0] =~ /$module/) {
125 $ok = 0;
126 last;
127 }
128 }
129 $ok;
09d46657 130 } @{Meta->{values}{build_requires}} ];
131
132 my @scalar_keys = Module::Install::Metadata::Meta_TupleKeys();
fe650234 133 my $cr = Module::Install::Metadata->can("Meta_TupleKeys");
134 {
135 no warnings 'redefine';
136 *Module::Install::Metadata::Meta_TupleKeys = sub {
137 return $cr->(@_), 'resources';
138 };
09d46657 139 }
140 Meta->{values}{resources} = [
141 [ 'MailingList', 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class' ],
142 [ 'IRC', 'irc://irc.perl.org/#dbix-class' ],
100dd0a8 143 [ 'license', 'http://dev.perl.org/licenses/' ],
144 [ 'repository', 'http://dev.catalyst.perl.org/svnweb/bast/browse/DBIx-Class/' ],
09d46657 145 ];
146 Meta->write;
147}
148
149
150