Koha/debian/list-deps
Jesse Weaver 8599b1dc5d Bug 12393 - Depend on SSL module for LWP, for OverDrive
The OverDrive integration needs to connect to an authentication server
over HTTPS, and many systems do not install the necessary module
(LWP::Protocol::https) by default.

Test plan (for patch):
  1) Run koha_perl_deps.pl -a, verify that LWP::Protocol::https appears in
     listing.

Test plan (to verify that LWP::Protocol::https is necessary, needs OverDrive access):
  1) Remove LWP::Protocol::https (liblwp-protocol-https-perl under Debian).
  2) Run an OverDrive search on the OPAC, it should fail.
  3) Reinstall LWP::Protocol::https.
  4) Rerun OverDrive search, it should now succeed.

Note: older versions of Debian do not need to install LWP::Protocol::https separately;
the Debian scripts have been updated to reflect this divide.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-06-22 20:35:46 -03:00

94 lines
3 KiB
Perl
Executable file

#!/usr/bin/perl
#
# Write dependency list from Koha PerlDependencies.pm, in Debian format.
#
# Copyright 2010 Catalyst IT, Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use warnings;
use C4::Installer::PerlDependencies;
# These are packages that may not be in the apt archive in a way that
# apt-file can find, e.g. in the Koha repo rather than the regular
# debian one.
my %overrides = (
'LWP::Protocol::https' => 'liblwp-protocol-https-perl|libwww-perl (<6.02), libio-socket-ssl-perl',
);
# These are packages we're going to ignore
my %ignore = (
'Data::Pagination' => 1,
'CHI' => 1,
'CHI::Driver::Memcached' => 1,
);
my $deps = $C4::Installer::PerlDependencies::PERL_DEPS;
my $prefix = "^/usr/((lib|share)/perl5|(lib|share)/perl/[0-9.]+)";
foreach my $module ( keys %$deps ) {
next if $ignore{$module};
my $ver = $deps->{$module}->{'min_ver'};
my $subpath = $module;
$subpath =~ s,::,/,g;
my $output = qx(apt-file -l -x search "$prefix/$subpath.pm\$");
my @temp = split( /\n/, $output );
my @lines = ();
# Remove packages that are required/essential and always installed on
# a Debian system. Debian packages should not have unversioned
# dependencies on such packages.
foreach my $line (@temp) {
if ( $line ne "perl-base" ) {
@lines = ( @lines, $line );
}
}
if ( exists $overrides{$module} ) {
print "$overrides{$module}\n";
}
elsif ( scalar(@lines) == 1 && $lines[0] ne "" ) {
my $pkg = $lines[0];
print "$pkg\n";
}
elsif ( scalar(@lines) > 1 ) {
foreach my $pkg (@lines) {
print " | " if ( $pkg ne $lines[0] );
print "$pkg";
}
print "\n";
}
elsif ( scalar(@temp) != 0 ) {
# I'm an Essential and I'm OK,
# I install all night, and work all day.
# I chomp up strings. I eat my bugs.
# I go to the base install.
# On Fridays I go drinking,
# and have buttered commits for git.
# (Beer O'Clock is more than two hours
# away. I don't even drink beer. There
# is no reason to be suspicious of this
# commit.)
# RM note: suspicious? me? always!
}
elsif ( ! $deps->{$module}->{'required'} ) {
# Ignore because we don't have it and we don't care.
}
else {
print "EEEK: unknown package for $module\n";
}
}