9 unshift @INC, "modules/override"; # Use our own versions of various modules (e.g. YAML).
10 push @INC, "modules/fallback"; # Only use our own versions of modules if there's no system version.
13 use SL::InstallationCheck;
16 Getopt::Long::Configure ("bundling");
18 "v|verbose" => \ my $v,
19 "a|all" => \ $check{a},
20 "o|optional!" => \ $check{o},
21 "d|devel!" => \ $check{d},
22 "r|required!" => \ $check{r},
23 "h|help" => sub { pod2usage(-verbose => 2) },
24 "c|color!" => \ ( my $c = 1 ),
27 # if notihing is requested check "required"
28 $check{r} = 1 unless defined $check{a} ||
33 foreach my $check (keys %check) {
34 $check{$check} = 1 unless defined $check{$check};
42 check_module($_, required => 1) for @SL::InstallationCheck::required_modules;
45 check_module($_, optional => 1) for @SL::InstallationCheck::optional_modules;
48 check_module($_, devel => 1) for @SL::InstallationCheck::developer_modules;
52 my ($module, %role) = @_;
54 my $line = "Looking for $module->{fullname}";
55 my $res = SL::InstallationCheck::module_available($module->{"name"}, $module->{version});
56 print_result($line, $res);
61 $role{optional} ? 'It is OPTIONAL for Lx-Office but RECOMMENDED for improved functionality.'
62 : $role{required} ? 'It is NEEDED by Lx-Office and must be installed.'
63 : $role{devel} ? 'It is OPTIONAL for Lx-Office and only useful for developers.'
64 : 'It is not listed as a dependancy yet. Please tell this the developers.';
66 my @source_texts = module_source_texts($module);
68 print STDERR <<EOL if $v;
69 +------------------------------------------------------------------------------+
70 $module->{fullname} could not be loaded.
72 This module is either too old or not available on your system.
75 Here are some ideas how to get it:
78 +------------------------------------------------------------------------------+
82 sub module_source_texts {
86 - You can get it from CPAN:
87 perl -MCPAN -e "install $module->{name}"
89 push @texts, <<EOL if $module->{url};
90 - You can download it from this URL and install it manually:
93 push @texts, <<EOL if $module->{debian};
94 - On Debian, Ubuntu and other distros you can install it with apt-get:
95 sudo apt-get install $module->{debian}
96 Note: These may be out of date as well if your system is old.
98 # TODO: SuSE and Fedora packaging. Windows packaging.
104 return $_[0] unless $c;
109 my ($test, $exit) = @_;
110 print $test, " ", ('.' x (72 - length $test));
111 print $exit ? '.... '. mycolor('ok', 'green') : ' '. mycolor('NOT ok', 'red');
124 scripts/installation_check.pl - check Lx-Office dependancies
128 scripts/installation_check.pl [OPTION]
132 Check dependencys. List all perl modules needed by Lx-Office, probes for them,
133 and warns if one is not available.
141 Probe for all perl modules and all LaTeX master templates.
145 Color output. Default on.
149 No color output. Helpful to avoid terminal escape problems.
153 Probe for perl developer dependancies. (Used for console and tags file)
157 Dont't probe for perl developer dependancies. (Usefull in combination with --all)
163 =item C<-o, --optional>
165 Probe for optional modules.
167 =item C<--no-optional>
169 Dont't probe for optional perl modules. (Usefull in combination with --all)
171 =item C<-r, --required>
173 Probe for required perl modules (default).
175 =item C<--no-required>
177 Dont't probe for required perl modules. (Usefull in combination with --all)
179 =item C<-v. --verbose>
181 Print additional info for missing dependancies
185 =head1 BUGS, CAVEATS and TODO
191 Fedora packages not listed yet.
195 Not possible yet to generate a combined cpan/apt-get string to install all needed.
199 Not able to handle devel cpan modules yet.
203 Version requirements not fully tested yet.
209 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>
210 Sven Schöling E<lt>s.schoeling@linet-services.deE<gt>
211 Wulf Coulmann E<lt>wulf@coulmann.deE<gt>