4 # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
6 # (Except where explictly superceded by other copyright notices)
8 # This work is made available to you under the terms of Version 2 of
9 # the GNU General Public License. A copy of that license should have
10 # been provided with this software, but in any event can be snarfed
13 # This work is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # Unless otherwise specified, all modifications, corrections or
19 # extensions to this work which alter its source code become the
20 # property of Best Practical Solutions, LLC when submitted for
21 # inclusion in the work.
27 # This is just a basic script that checks to make sure that all
28 # the modules needed by RT before you can install it.
32 no warnings qw(numeric redefine);
37 GetOptions(\%args,'install', 'with-MYSQL', 'with-POSTGRESQL|with-pg|with-pgsql', 'with-SQLITE', 'with-ORACLE', 'with-FASTCGI', 'with-SPEEDYCGI', 'with-MODPERL1', 'with-MODPERL2' ,'with-DEV');
43 if ($args{'with-MODPERL2'}) {
47 $args{'with-MASON'} = 1;
48 $args{'with-CORE'} = 1;
51 $args{'with-MAILGATE'} =1;
53 $args{'with-I18N-COMPAT'} = 1;
58 NOTE: mod_perl 2.0 isn't quite ready for prime_time just yet;
59 Best Practical Solutions strongly recommends that sites use
60 Apache 1.3 or FastCGI. If you MUST use mod_perl 2.0 (or 1.99),
61 please read the mailing list archives before asking for help.
71 By default, testdeps determine whether you have
72 installed all the perl modules RT needs to run.
74 --install Install missing modules
76 The following switches will tell the tool to check for specific dependencies
78 --with-mysql Database interface for MySQL
79 --with-postgresql Database interface for PostgreSQL
80 --with-sqlite Database interface and driver for SQLite (unsupported)
81 --with-oracle Database interface for oracle (unsupported)
83 --with-fastcgi Libraries needed to support the fastcgi handler
84 --with-speedycgi Libraries needed to support the speedycgi handler
85 --with-modperl1 Libraries needed to support the modperl 1 handler
86 --with-modperl2 Libraries needed to support the modperl 2 handler
88 --with-dev Tools needed for RT development
94 map { /(\S+)\s*(\S*)/; $1 => ($2 ? $2 :'') } split ( /\n/, $_[0] );
97 $deps{'CORE'} = [ _( << '.') ];
101 Class::ReturnValue 0.40
102 DBIx::SearchBuilder 1.01
108 Locale::Maketext 1.06
109 Locale::Maketext::Lexicon 0.32
110 Locale::Maketext::Fuzzy
123 $deps{'MASON'} = [ _( << '.') ];
124 Params::Validate 0.02
137 $deps{'MAILGATE'} = [ _( << '.') ];
144 $deps{'CLI'} = [ _( << '.') ];
148 $deps{'DEV'} = [ _( << '.') ];
155 $deps{'FASTCGI'} = [ _( << '.') ];
161 $deps{'SPEEDYCGI'} = [ _( << '.') ];
167 $deps{'MODPERL1'} = [ _( << '.') ];
173 $deps{'MODPERL2'} = [ _( << '.') ];
178 $deps{'I18N-COMPAT'} = [ _( << '.') ];
183 $deps{'MYSQL'} = [ _( << '.') ];
186 $deps{'ORACLE'} = [ _( << '.') ];
189 $deps{'POSTGRESQL'} = [ _( << '.') ];
195 eval {require 5.008003};
197 print "...MISSING.\n";
198 eval {require 5.008000};
200 print "\nRT is known to be non-functional on versions of perl older than 5.8.3.\nPlease upgrade to 5.8.3 or newer\n\n";
204 eval {require 5.008003};
206 print "\nRT is known to be non-functional on versions of perl older than 5.8.3.\nPlease upgrade to 5.8.3 or newer\n\n";
214 foreach my $type (keys %args) {
215 next unless ($type =~ /^with-(.*?)$/);
217 print "$type dependencies:\n";
218 my @deps = (@{$deps{$type}});
220 my $module = shift @deps;
221 my $version = shift @deps;
223 $ret =test_dep($module, $version);
225 if ($args{'install'} && !$ret) {
226 resolve_dep($module);
234 print "\t$module $version";
235 eval "use $module $version" ;
238 $error =~ s/\n(.*)$//s;
239 print "...MISSING\n";
240 print "\t\t$error\n" if $error =~ /this is only/;
252 CPAN::Shell->install($module);
263 $0 is a tool for RT that will tell you if you've got all
264 the modules RT depends on properly installed.
266 Flags: (only one flag is valid for a given run)
268 -quiet will check to see if we've got everything we need
269 and will exit with a return code of (1) if we don't.
271 -warn will tell you what isn't properly installed
273 -fix will use CPANPLUS.pm or CPAN.pm to magically make everything better