Commit | Line | Data |
3fe9c5d9 |
1 | |
7507c8ce |
2 | use inc::Module::Install 0.65; |
3fe9c5d9 |
3 | |
4 | name 'DBIx-Class-Schema-Loader'; |
5 | all_from 'lib/DBIx/Class/Schema/Loader.pm'; |
6 | |
7 | test_requires 'Test::More' => '0.47'; |
8 | test_requires 'DBI' => '1.56'; |
9 | test_requires 'DBD::SQLite' => '1.12'; |
10 | test_requires 'File::Path' => 0; |
11 | |
12 | requires 'File::Spec' => 0; |
13 | requires 'Scalar::Util' => 0; |
14 | requires 'Data::Dump' => '1.06'; |
15 | requires 'UNIVERSAL::require' => '0.11'; |
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 'Carp::Clan' => 0; |
23 | requires 'Class::Inspector' => 0; |
24 | requires 'DBIx::Class' => '0.07006'; |
25 | |
7507c8ce |
26 | # This is my manual hack for better feature control |
27 | # If you want to change the default answer for a feature, |
28 | # set the appropriate environment variable, like |
29 | # DBIC_FEATURE_MYSQL. If you want the defaults to |
30 | # apply automatically without asking any questions, |
31 | # set DBIC_FEATURE_NOQUESTIONS. Hopefully this will |
32 | # save someone some pain when trying to automate |
33 | # the installation of this software. |
34 | |
35 | # Maintainer shouldn't set these, as they would affect |
36 | # the META.yml shipped to CPAN. |
37 | |
38 | my $_features = [ |
39 | SQLITE => { |
40 | label => 'SQLite Support', |
41 | def => $ENV{DBIC_FEATURE_SQLITE} || 0, |
42 | deps => [ |
43 | 'DBI' => '1.56', |
44 | 'DBD::SQLite' => '1.12', |
45 | ], |
46 | }, |
47 | MYSQL => { |
48 | label => 'MySQL Support', |
49 | def => $ENV{DBIC_FEATURE_MYSQL} || 0, |
50 | deps => [ |
51 | 'DBI' => '1.56', |
52 | 'DBD::mysql' => '4.004', |
53 | ], |
54 | }, |
55 | PG => { |
56 | label => 'PostgreSQL Support', |
57 | def => $ENV{DBIC_FEATURE_PG} || 0, |
58 | deps => [ |
59 | 'DBI' => '1.56', |
60 | 'DBD::Pg' => '1.49', # Soon to be 1.50 |
61 | ], |
62 | }, |
63 | DB2 => { |
64 | label => 'DB2 Support', |
65 | def => $ENV{DBIC_FEATURE_DB2} || 0, |
66 | deps => [ |
67 | 'DBI' => '1.56', |
68 | 'DBD::DB2' => '1.0', |
69 | ], |
70 | }, |
71 | ORACLE => { |
72 | label => 'Oracle Support (experimental)', |
73 | def => $ENV{DBIC_FEATURE_ORACLE} || 0, |
74 | deps => [ |
75 | 'DBI' => '1.56', |
76 | 'DBD::Oracle' => '0.19', |
77 | ], |
78 | }, |
79 | ]; |
80 | |
81 | for(my $i = 0; $i <= $#$_features - 1; $i += 2) { |
82 | my $name = $_features->[$i]; |
83 | my $attrs = $_features->[$i+1]; |
84 | |
85 | if($ENV{DBIC_FEATURE_NOQUESTIONS}) { |
86 | if($attrs->{def}) { |
87 | requires @{$attrs->{deps}}; |
88 | } |
89 | } |
90 | else { |
91 | feature $attrs->{label} => |
92 | -default => $attrs->{def}, |
93 | @{$attrs->{deps}}; |
94 | } |
95 | } |
3fe9c5d9 |
96 | |
97 | # Rebuild README for maintainers |
98 | if(-e 'MANIFEST.SKIP') { |
99 | system("pod2text lib/DBIx/Class/Schema/Loader.pm > README"); |
100 | } |
101 | |
102 | auto_provides; |
103 | auto_install; |
104 | WriteAll; |