root/trunk/contrib/check-perl-modules

Revision 1165, 2.0 kB (checked in by zothos, 4 months ago)

Fixed #1278

Line 
1 #!/usr/bin/perl
2
3 # ispCP ω (OMEGA) a Virtual Hosting Control Panel
4 # Copyright (c) 2006-2008 by isp Control Panel
5 # http://isp-control.net
6 #
7 #
8 # License:
9 #    This program is free software; you can redistribute it and/or
10 #    modify it under the terms of the MPL Mozilla Public License
11 #    as published by the Free Software Foundation; either version 1.1
12 #    of the License, or (at your option) any later version.
13 #
14 #    This program is distributed in the hope that it will be useful,
15 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
16 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 #    MPL Mozilla Public License for more details.
18 #
19 #    You may have received a copy of the MPL Mozilla Public License
20 #    along with this program.
21 #
22 #    An on-line copy of the MPL Mozilla Public License can be found
23 #    http://www.mozilla.org/MPL/MPL-1.1.html
24 #
25 #
26 # The ispCP ω Home Page is at:
27 #
28 #    http://isp-control.net
29 #
30
31
32
33 my @needed = (strict, warnings, IO::Socket, DBI, DBD::mysql, Mail::Address, MIME::Entity,
34 MIME::Parser, Crypt::CBC, Crypt::Blowfish, MIME::Base64,
35 Term::ReadPassword, Net::LibIDN);
36
37 my ($mod, $mod_err, $mod_missing) = ('', '_off_', '');
38
39 for $mod (@needed) {
40     print STDERR "Checking for '$mod'...\t";
41
42     if (eval "require $mod") {
43         $mod -> import();
44         printf " Ok.\n";
45     } else {
46         print STDERR "CRITICAL ERROR: Module '$mod' WAS NOT FOUND !\n" ;
47
48         $mod_err = '_on_';
49
50         if ($mod_missing eq '') {
51             $mod_missing .= $mod;
52         } else {
53             $mod_missing .= ", $mod";
54         }
55     }
56 }
57
58 if ($mod_err eq '_on_') {
59     print STDERR "\nModules [$mod_missing] WERE NOT FOUND in your system...\n";
60     print STDERR "\nPlease INSTALL them before using ispCP Omega !\n";
61     exit 1;
62 } else {
63     $| = 1;
64 }
65
66 return 0;
67
68 # hack for dh_perl
69
70 require IO::Socket;
71 require DBI;
72 require DBD::mysql;
73 require Mail::Address;
74 require MIME::Entity;
75 require MIME::Parser;
76 require Crypt::CBC;
77 require Crypt::Blowfish;
78 require MIME::Base64;
79 require Term::ReadPassword;
80 require Net::LibIDN;
Note: See TracBrowser for help on using the browser.