backcompat mode now runs more than once
[dbsrgits/DBIx-Class-Schema-Loader.git] / Makefile.PL
1 use inc::Module::Install 0.91;
2
3 name           'DBIx-Class-Schema-Loader';
4 all_from       'lib/DBIx/Class/Schema/Loader.pm';
5
6 test_requires 'Test::More'    => '0.47';
7 test_requires 'DBI'           => '1.56';
8 test_requires 'DBD::SQLite'   => '1.12';
9 test_requires 'File::Path'    => 0;
10 test_requires 'IPC::Open3'    => 0;
11 test_requires 'Test::Exception';
12
13 requires 'File::Spec'                  => 0;
14 requires 'Scalar::Util'                => 0;
15 requires 'Data::Dump'                  => '1.06';
16 requires 'Lingua::EN::Inflect::Number' => '1.1';
17 requires 'Text::Balanced'              => 0;
18 requires 'Digest::MD5'                 => '2.36';
19 requires 'Class::Accessor::Fast'       => '0.30';
20 requires 'Class::Data::Accessor'       => '0.03';
21 requires 'Class::C3'                   => '0.18';
22 requires 'Class::C3::Componentised'    => '1.0005';
23 requires 'Carp::Clan'                  => 0;
24 requires 'Class::Inspector'            => 0;
25 requires 'DBIx::Class'                 => '0.08109';
26 requires 'Class::Unload'               => 0;
27
28 install_script 'script/dbicdump';
29
30 tests_recursive;
31
32 # This is my manual hack for better feature control
33 #  If you want to change the default answer for a feature,
34 #  set the appropriate environment variable, like
35 #  DBIC_FEATURE_MYSQL.  If you want the defaults to
36 #  apply automatically without asking any questions,
37 #  set DBIC_FEATURE_NOQUESTIONS.  Hopefully this will
38 #  save someone some pain when trying to automate
39 #  the installation of this software.
40
41 # Maintainer shouldn't set these, as they would affect
42 # the META.yml shipped to CPAN.
43
44 my $_features = [
45     SQLITE => {
46         label => 'SQLite Support',
47         def   => $ENV{DBIC_FEATURE_SQLITE} || 0,
48         deps  => [
49             'DBI'         => '1.56',
50             'DBD::SQLite' => '1.12',
51         ],
52     },
53     MYSQL => {
54         label => 'MySQL Support',
55         def   => $ENV{DBIC_FEATURE_MYSQL} || 0,
56         deps  => [
57             'DBI'         => '1.56',
58             'DBD::mysql'  => '4.004',
59         ],
60     },
61     PG => {
62         label => 'PostgreSQL Support',
63         def   => $ENV{DBIC_FEATURE_PG} || 0,
64         deps  => [
65             'DBI'         => '1.56',
66             'DBD::Pg'     => '1.49', # Soon to be 1.50
67         ],
68     },
69     DB2 => {
70         label => 'DB2 Support',
71         def   => $ENV{DBIC_FEATURE_DB2} || 0,
72         deps  => [
73             'DBI'         => '1.56',
74             'DBD::DB2'    => '1.0',
75         ],
76     },
77     ORACLE => {
78         label => 'Oracle Support (experimental)',
79         def   => $ENV{DBIC_FEATURE_ORACLE} || 0,
80         deps  => [
81             'DBI'         => '1.56',
82             'DBD::Oracle' => '0.19',
83         ],
84     },
85     SYBASE => {
86         label => 'Sybase Support (experimental)',
87         def   => $ENV{DBIC_FEATURE_SYBASE} || 0,
88         deps  => [
89             'DBI'         => '1.56',
90             'DBD::Sybase' => '1.09',
91         ],
92     },
93     MSSQL => {
94         label => 'Microsoft SQL Server Support via DBD::Sybase (experimental)',
95         def   => $ENV{DBIC_FEATURE_MSSQL} || 0,
96         deps  => [
97             'DBI'         => '1.56',
98             'DBD::Sybase' => '1.09',
99         ],
100     },
101     MSSQL_ODBC => {
102         label => 'Microsoft SQL Server Support via DBD::ODBC (experimental)',
103         def   => $ENV{DBIC_FEATURE_MSSQL} || 0,
104         deps  => [
105             'DBI'       => '1.56',
106             'DBD::ODBC' => '1.22',
107         ],
108     },
109 ];
110
111 for(my $i = 0; $i <= $#$_features - 1; $i += 2) {
112     my $name = $_features->[$i];
113     my $attrs = $_features->[$i+1];
114
115     if($ENV{DBIC_FEATURE_NOQUESTIONS}) {
116         if($attrs->{def}) {
117             requires @{$attrs->{deps}};
118         }
119     }
120     else {
121         feature $attrs->{label} =>
122             -default => $attrs->{def},
123             @{$attrs->{deps}};
124     }
125 }
126
127 # Rebuild README for maintainers
128 if(-e 'MANIFEST.SKIP') {
129     system("pod2text lib/DBIx/Class/Schema/Loader.pm > README");
130 }
131
132 resources 'IRC'         => 'irc://irc.perl.org/#dbix-class';
133 resources 'license'     => 'http://dev.perl.org/licenses/';
134 resources 'repository'  => 'http://dev.catalyst.perl.org/repos/bast/branches/DBIx-Class-Schema-Loader/current/';
135 resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class';
136
137 auto_provides;
138 auto_install;
139 WriteAll;