multi-dsn support for common tests
[dbsrgits/DBIx-Class-Schema-Loader.git] / Makefile.PL
CommitLineData
0662c9b3 1use inc::Module::Install 0.91;
3fe9c5d9 2
3name 'DBIx-Class-Schema-Loader';
4all_from 'lib/DBIx/Class/Schema/Loader.pm';
5
9cb983b3 6test_requires 'Test::Exception';
d27f2b7b 7test_requires 'Test::More' => '0.94';
390bbe3f 8test_requires 'DBI' => '1.56';
83d82c02 9test_requires 'DBD::SQLite' => '1.29';
9cb983b3 10test_requires 'File::Copy';
11test_requires 'File::Temp' => '0.16';
502b65d4 12test_requires 'File::Path' => '2.07';
ff746964 13test_requires 'IPC::Open3' => 0;
baff904e 14test_requires 'List::MoreUtils' => 0;
3fe9c5d9 15
16requires 'File::Spec' => 0;
17requires 'Scalar::Util' => 0;
18requires 'Data::Dump' => '1.06';
3fe9c5d9 19requires 'Lingua::EN::Inflect::Number' => '1.1';
20requires 'Text::Balanced' => 0;
21requires 'Digest::MD5' => '2.36';
c16e6d28 22requires 'Class::Accessor::Grouped' => '0.09002';
3fe9c5d9 23requires 'Class::C3' => '0.18';
ee1c392c 24requires 'Class::C3::Componentised' => '1.0005';
3fe9c5d9 25requires 'Carp::Clan' => 0;
26requires 'Class::Inspector' => 0;
309e2aa1 27requires 'DBIx::Class' => '0.08114';
af31090c 28requires 'Class::Unload' => 0;
281d0f3e 29requires 'File::Slurp' => '9999.13';
8793567f 30requires 'List::MoreUtils' => 0;
31requires 'namespace::autoclean' => 0;
f170d55b 32requires 'Data::Dumper::Concise' => '1.200';
3a89a69f 33requires 'Scope::Guard' => 0;
3fe9c5d9 34
ff746964 35install_script 'script/dbicdump';
36
01012543 37tests_recursive;
38
7507c8ce 39# This is my manual hack for better feature control
40# If you want to change the default answer for a feature,
41# set the appropriate environment variable, like
42# DBIC_FEATURE_MYSQL. If you want the defaults to
43# apply automatically without asking any questions,
44# set DBIC_FEATURE_NOQUESTIONS. Hopefully this will
45# save someone some pain when trying to automate
46# the installation of this software.
47
48# Maintainer shouldn't set these, as they would affect
49# the META.yml shipped to CPAN.
50
51my $_features = [
52 SQLITE => {
53 label => 'SQLite Support',
54 def => $ENV{DBIC_FEATURE_SQLITE} || 0,
55 deps => [
56 'DBI' => '1.56',
57 'DBD::SQLite' => '1.12',
58 ],
59 },
60 MYSQL => {
61 label => 'MySQL Support',
62 def => $ENV{DBIC_FEATURE_MYSQL} || 0,
63 deps => [
64 'DBI' => '1.56',
65 'DBD::mysql' => '4.004',
66 ],
67 },
68 PG => {
69 label => 'PostgreSQL Support',
70 def => $ENV{DBIC_FEATURE_PG} || 0,
71 deps => [
72 'DBI' => '1.56',
73 'DBD::Pg' => '1.49', # Soon to be 1.50
74 ],
75 },
76 DB2 => {
77 label => 'DB2 Support',
78 def => $ENV{DBIC_FEATURE_DB2} || 0,
79 deps => [
80 'DBI' => '1.56',
81 'DBD::DB2' => '1.0',
82 ],
83 },
84 ORACLE => {
f7a20962 85 label => 'Oracle Support',
7507c8ce 86 def => $ENV{DBIC_FEATURE_ORACLE} || 0,
87 deps => [
88 'DBI' => '1.56',
89 'DBD::Oracle' => '0.19',
90 ],
91 },
3ea1f8cc 92 SYBASE => {
f7a20962 93 label => 'Sybase Support',
3ea1f8cc 94 def => $ENV{DBIC_FEATURE_SYBASE} || 0,
95 deps => [
96 'DBI' => '1.56',
97 'DBD::Sybase' => '1.09',
98 ],
99 },
100 MSSQL => {
8793567f 101 label => 'Microsoft SQL Server Support via DBD::Sybase',
3ea1f8cc 102 def => $ENV{DBIC_FEATURE_MSSQL} || 0,
103 deps => [
104 'DBI' => '1.56',
105 'DBD::Sybase' => '1.09',
106 ],
107 },
108 MSSQL_ODBC => {
8793567f 109 label => 'Microsoft SQL Server Support via DBD::ODBC',
3ea1f8cc 110 def => $ENV{DBIC_FEATURE_MSSQL} || 0,
111 deps => [
112 'DBI' => '1.56',
113 'DBD::ODBC' => '1.22',
114 ],
115 },
7507c8ce 116];
117
118for(my $i = 0; $i <= $#$_features - 1; $i += 2) {
119 my $name = $_features->[$i];
120 my $attrs = $_features->[$i+1];
121
122 if($ENV{DBIC_FEATURE_NOQUESTIONS}) {
123 if($attrs->{def}) {
124 requires @{$attrs->{deps}};
125 }
126 }
127 else {
128 feature $attrs->{label} =>
129 -default => $attrs->{def},
130 @{$attrs->{deps}};
131 }
132}
3fe9c5d9 133
134# Rebuild README for maintainers
fdd8ff16 135if ($Module::Install::AUTHOR) {
3fe9c5d9 136 system("pod2text lib/DBIx/Class/Schema/Loader.pm > README");
137}
138
fdd8ff16 139realclean_files 'README';
140
64b844d0 141resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
142resources 'license' => 'http://dev.perl.org/licenses/';
edfab8b3 143resources 'repository' => 'git://git.shadowcat.co.uk/dbsrgits/DBIx-Class-Schema-Loader.git';
64b844d0 144resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
145
3fe9c5d9 146auto_provides;
147auto_install;
148WriteAll;