patch from Robert Bohne <rbo@cpan.org> to check default_value in 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';
9test_requires 'DBD::SQLite' => '1.12';
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';
3fe9c5d9 30
ff746964 31install_script 'script/dbicdump';
32
01012543 33tests_recursive;
34
7507c8ce 35# This is my manual hack for better feature control
36# If you want to change the default answer for a feature,
37# set the appropriate environment variable, like
38# DBIC_FEATURE_MYSQL. If you want the defaults to
39# apply automatically without asking any questions,
40# set DBIC_FEATURE_NOQUESTIONS. Hopefully this will
41# save someone some pain when trying to automate
42# the installation of this software.
43
44# Maintainer shouldn't set these, as they would affect
45# the META.yml shipped to CPAN.
46
47my $_features = [
48 SQLITE => {
49 label => 'SQLite Support',
50 def => $ENV{DBIC_FEATURE_SQLITE} || 0,
51 deps => [
52 'DBI' => '1.56',
53 'DBD::SQLite' => '1.12',
54 ],
55 },
56 MYSQL => {
57 label => 'MySQL Support',
58 def => $ENV{DBIC_FEATURE_MYSQL} || 0,
59 deps => [
60 'DBI' => '1.56',
61 'DBD::mysql' => '4.004',
62 ],
63 },
64 PG => {
65 label => 'PostgreSQL Support',
66 def => $ENV{DBIC_FEATURE_PG} || 0,
67 deps => [
68 'DBI' => '1.56',
69 'DBD::Pg' => '1.49', # Soon to be 1.50
70 ],
71 },
72 DB2 => {
73 label => 'DB2 Support',
74 def => $ENV{DBIC_FEATURE_DB2} || 0,
75 deps => [
76 'DBI' => '1.56',
77 'DBD::DB2' => '1.0',
78 ],
79 },
80 ORACLE => {
81 label => 'Oracle Support (experimental)',
82 def => $ENV{DBIC_FEATURE_ORACLE} || 0,
83 deps => [
84 'DBI' => '1.56',
85 'DBD::Oracle' => '0.19',
86 ],
87 },
3ea1f8cc 88 SYBASE => {
89 label => 'Sybase Support (experimental)',
90 def => $ENV{DBIC_FEATURE_SYBASE} || 0,
91 deps => [
92 'DBI' => '1.56',
93 'DBD::Sybase' => '1.09',
94 ],
95 },
96 MSSQL => {
97 label => 'Microsoft SQL Server Support via DBD::Sybase (experimental)',
98 def => $ENV{DBIC_FEATURE_MSSQL} || 0,
99 deps => [
100 'DBI' => '1.56',
101 'DBD::Sybase' => '1.09',
102 ],
103 },
104 MSSQL_ODBC => {
105 label => 'Microsoft SQL Server Support via DBD::ODBC (experimental)',
106 def => $ENV{DBIC_FEATURE_MSSQL} || 0,
107 deps => [
108 'DBI' => '1.56',
109 'DBD::ODBC' => '1.22',
110 ],
111 },
7507c8ce 112];
113
114for(my $i = 0; $i <= $#$_features - 1; $i += 2) {
115 my $name = $_features->[$i];
116 my $attrs = $_features->[$i+1];
117
118 if($ENV{DBIC_FEATURE_NOQUESTIONS}) {
119 if($attrs->{def}) {
120 requires @{$attrs->{deps}};
121 }
122 }
123 else {
124 feature $attrs->{label} =>
125 -default => $attrs->{def},
126 @{$attrs->{deps}};
127 }
128}
3fe9c5d9 129
130# Rebuild README for maintainers
fdd8ff16 131if ($Module::Install::AUTHOR) {
3fe9c5d9 132 system("pod2text lib/DBIx/Class/Schema/Loader.pm > README");
133}
134
fdd8ff16 135realclean_files 'README';
136
64b844d0 137resources 'IRC' => 'irc://irc.perl.org/#dbix-class';
138resources 'license' => 'http://dev.perl.org/licenses/';
edfab8b3 139resources 'repository' => 'git://git.shadowcat.co.uk/dbsrgits/DBIx-Class-Schema-Loader.git';
64b844d0 140resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
141
3fe9c5d9 142auto_provides;
143auto_install;
144WriteAll;