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 0.97
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.008};
197 print "...missing.\n";
198 eval {require 5.006001};
200 print " RT is known to be non-functional on versions of perl older than 5.6.1. Please upgrade to 5.8.0 or newer";
203 print " RT is not supported on perl 5.6.1\n";
211 foreach my $type (keys %args) {
212 next unless ($type =~ /^with-(.*?)$/);
214 print "$type dependencies:\n";
215 my @deps = (@{$deps{$type}});
217 my $module = shift @deps;
218 my $version = shift @deps;
220 $ret =test_dep($module, $version);
222 if ($args{'install'} && !$ret) {
223 resolve_dep($module);
231 print "\t$module $version";
232 eval "use $module $version" ;
235 $error =~ s/\n(.*)$//s;
236 print "...MISSING\n";
237 print "\t\t$error\n" if $error =~ /this is only/;
249 CPAN::Shell->install($module);
260 $0 is a tool for RT that will tell you if you've got all
261 the modules RT depends on properly installed.
263 Flags: (only one flag is valid for a given run)
265 -quiet will check to see if we've got everything we need
266 and will exit with a return code of (1) if we don't.
268 -warn will tell you what isn't properly installed
270 -fix will use CPANPLUS.pm or CPAN.pm to magically make everything better