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;
18 "optional!" => \ my $o,
20 "required!" => \ ( my $r = 1 ),
21 "help" => sub { pod2usage(-verbose => 2) },
22 "color" => \ ( my $c = 1 ),
25 $d = $r = $o = 1 if $a;
30 check($_, required => 1) for @SL::InstallationCheck::required_modules;
33 check($_, optional => 1) for @SL::InstallationCheck::optional_modules;
36 check($_, devel => 1) for @SL::InstallationCheck::developer_modules;
40 my ($module, %role) = @_;
42 my $line = "Looking for $module->{fullname}";
44 my $res = SL::InstallationCheck::module_available($module->{"name"}, $module->{version});
45 print dot_pad(length $line, $res ? 2 : 6, $res ? mycolor("ok", 'green') : mycolor("NOT ok", 'red')), $/;
50 $role{optional} ? 'It is OPTIONAL for Lx-Office but RECOMMENDED for improved functionality.'
51 : $role{required} ? 'It is NEEDED by Lx-Office and must be installed.'
52 : $role{devel} ? 'It is OPTIONAL for Lx-Office and only useful for developers.'
53 : 'It is not listed as a dependancy yet. Please tell this the developers.';
55 my @source_texts = source_texts($module);
57 print STDERR <<EOL if $v;
58 +------------------------------------------------------------------------------+
59 $module->{fullname} could not be loaded.
61 This module is either too old or not available on your system.
64 Here are some ideas how to get it:
67 +------------------------------------------------------------------------------+
75 - You can get it from CPAN:
76 perl -MCPAN -e "install $module->{name}"
78 push @texts, <<EOL if $module->{url};
79 - You can download it from this URL and install it manually:
82 push @texts, <<EOL if $module->{debian};
83 - On Debian, Ubuntu and other distros you can install it with apt-get:
84 sudo apt-get install $module->{debian}
85 Note: These may be out of date as well if your system is old.
87 # TODO: SuSE and Fedora packaging. Windows packaging.
93 return $_[0] unless $c;
98 my ($s, $l, $text) = @_;
100 print '.' x (80 - $s - 2 - $l);
113 scripts/installation_check.pl - check Lx-Office dependancies
117 scripts/installation_check.pl [OPTION]
121 List all modules needed by Lx-Office, probes for them, and warns if one is not available.
127 Probe for all modules.
131 Color output. Default on.
135 Probe for developer dependancies. (Used for console and tags file)
141 =item C<-o, --optional>
143 Probe for optional modules.
145 =item C<-r, --required>
147 Probe for required modules (default).
149 =item C<-v. --verbose>
151 Print additional info for modules that are missing
155 =head1 BUGS, CAVEATS and TODO
161 Fedora packages not listed yet.
165 Not possible yet to generate a combined cpan/apt-get string to install all needed.
169 Not able to handle devel cpan modules yet.
173 Version requirements not fully tested yet.
179 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>
180 Sven Schöling E<lt>s.schoeling@linet-services.deE<gt>