6eca871891425fa10e15010a5ce3d638621610a7
[kivitendo-erp.git] / scripts / installation_check.pl
1 #!/usr/bin/perl -w
2
3 BEGIN {
4   unshift @INC, "modules/override"; # Use our own versions of various modules (e.g. YAML).
5   push    @INC, "modules/fallback"; # Only use our own versions of modules if there's no system version.
6 }
7
8 use SL::InstallationCheck;
9
10 $| = 1;
11
12 foreach my $module (@SL::InstallationCheck::required_modules) {
13   if ($module->{version}) {
14     print("Looking for $module->{name} $module->{version}...");
15   } else {
16     print("Looking for $module->{name}...");
17   }
18   if (!SL::InstallationCheck::module_available($module->{"name"})) {
19     print(" NOT found\n" .
20           "  The module '$module->{name}' is not available on your system.\n" .
21           "  Please install it with the CPAN shell, e.g.\n" .
22           "    perl -MCPAN -e \"install $module->{name}\"\n" .
23           "  or download it from this URL and install it manually:\n" .
24           "    $module->{url}\n\n");
25   } else {
26     print(" ok\n");
27   }
28 }
29
30 foreach my $module (@SL::InstallationCheck::optional_modules) {
31   print("Looking for $module->{name} (optional)...");
32   if (!SL::InstallationCheck::module_available($module->{"name"})) {
33     print(" NOT found\n" .
34           "  The module '$module->{name}' is not available on your system.\n" .
35           "  While it is not strictly needed it provides extra functionality\n" .
36           "  and should be installed.\n" .
37           "  You can install it with the CPAN shell, e.g.\n" .
38           "    perl -MCPAN -e \"install $module->{name}\"\n" .
39           "  or download it from this URL and install it manually:\n" .
40           "    $module->{url}\n\n");
41   } else {
42     print(" ok\n");
43   }
44 }