[Koha-patches] [PATCH] Enhancement [3.4] Add separate Perl module verification script
Chris Nighswonger
cnighswonger at foundations.edu
Fri Feb 19 08:23:18 CET 2010
From: Chris Nighswonger <chris.nighswonger at gmail.com>
This patch moves the dependency list to C4::Installer and adds
a script to check Perl modules.
---
C4/Installer.pm | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++
Makefile.PL | 93 ++---------------------------------------------------
koha_perl_deps.pl | 86 +++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 180 insertions(+), 90 deletions(-)
create mode 100755 koha_perl_deps.pl
diff --git a/C4/Installer.pm b/C4/Installer.pm
index 442ea73..64e2cd1 100644
--- a/C4/Installer.pm
+++ b/C4/Installer.pm
@@ -22,6 +22,97 @@ use strict;
our $VERSION = 3.00;
use C4::Context;
+our $PREREQ_PM = {
+ 'Algorithm::CheckDigits' => 0.50,
+ 'Authen::CAS::Client' => 0.05,
+ 'Biblio::EndnoteStyle' => 0.05,
+ 'CGI' => 3.15,
+ 'CGI::Carp' => 1.29,
+ 'CGI::Session' => 4.20,
+ 'CGI::Session::Serialize::yaml' => 4.20,
+ 'Class::Factory::Util' => 1.6,
+ 'Class::Accessor' => 0.30,
+ 'DBD::mysql' => 4.004,
+ 'DBD::SQLite2' => 0.33, # optional, used for offline circulation
+ 'DBI' => 1.53,
+ 'Data::Dumper' => 2.121,
+ 'Data::ICal' => 0.13,
+ 'Date::Calc' => 5.4,
+ 'Date::ICal' => 1.72,
+ 'Date::Manip' => 5.44,
+ 'Digest::MD5' => 2.36,
+ 'Digest::SHA' => 5.43,
+ 'Email::Date' => 1.103,
+ 'File::Temp' => 0.16,
+ 'GD' => 2.39, #optional, used for patron image feature
+ 'GD::Barcode::UPCE' => 1.1,
+ 'Graphics::Magick' => '1.3.7', #optional, used for patron cards creator
+ 'Getopt::Long' => 2.35,
+ 'Getopt::Std' => 1.05,
+ 'HTML::Template::Pro' => 0.69,
+ 'HTML::Scrubber' => 0.08,
+ 'HTTP::Cookies' => 1.39,
+ 'HTTP::OAI' => 3.20,
+ 'HTTP::Request::Common' => 1.26,
+ 'IPC::Cmd' => 0.46,
+ 'JSON' => 2.07, # Needed by admin/item_circulation_alerts.pl
+ 'LWP::Simple' => 1.41,
+ 'LWP::UserAgent' => 2.033,
+ 'Lingua::Stem' => 0.82,
+ 'Lingua::Stem::Snowball' => 0.952,
+ 'List::Util' => 1.18,
+ 'List::MoreUtils' => 0.21,
+ 'Locale::Currency::Format' => 1.28,
+ 'Locale::Language' => 2.07,
+ 'Locale::PO' => 0.17,
+ 'MARC::Charset' => 0.98,
+ 'MARC::Crosswalk::DublinCore' => 0.02,
+ 'MARC::File::XML' => 0.88,
+ 'MARC::Record' => 2.00,
+ 'MIME::Base64' => 3.07,
+ 'MIME::Lite' => 3.00,
+ 'MIME::QuotedPrint' => 3.07,
+ 'Mail::Sendmail' => 0.79,
+ 'Memoize::Memcached' => 0.03, # optional
+ 'Net::LDAP' => 0.33, # optional
+ 'Net::LDAP::Filter' => 0.14, # optional
+ 'Net::Z3950::ZOOM' => 1.16,
+ 'Number::Format' => 1.52,
+ 'PDF::API2' => 2.000,
+ 'PDF::API2::Page' => 2.000,
+ 'PDF::API2::Util' => 2.000,
+ 'PDF::API2::Simple' => 1.000,
+ 'PDF::Table' => '0.9.3',
+ 'PDF::Reuse' => 0.33,
+ 'PDF::Reuse::Barcode' => 0.05,
+ 'POE' => 0.9999,
+ 'POSIX' => 1.09,
+ 'Schedule::At' => 1.06,
+ 'Storable' => 2.21,
+ 'SMS::Send' => 0.05, # optional
+ 'Term::ANSIColor' => 1.10,
+ 'Test' => 1.25,
+ 'Test::Harness' => 2.56,
+ 'Test::More' => 0.80,
+ 'Text::CSV' => 0.01,
+ 'Text::CSV_XS' => 0.32,
+ 'Text::CSV::Encoded' => 0.09,
+ 'Text::Iconv' => 1.7,
+ 'Text::Wrap' => 2005.082401,
+ 'Time::HiRes' => 1.86,
+ 'Time::localtime' => 1.02,
+ 'Unicode::Normalize' => 0.32,
+ 'URI::Escape' => 1.36,
+ 'XML::Dumper' => 0.81,
+ 'XML::LibXML' => 1.59,
+ 'XML::LibXSLT' => 1.59,
+ 'XML::SAX::ParserFactory' => 1.01,
+ 'XML::SAX::Writer' => 0.44,
+ 'XML::Simple' => 2.14,
+ 'XML::RSS' => 1.31,
+ 'YAML::Syck' => 0.71,
+};
+
=head1 NAME
C4::Installer
diff --git a/Makefile.PL b/Makefile.PL
index 9adf81b..24f1865 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -26,6 +26,8 @@ use POSIX;
use File::Spec;
use Getopt::Long;
+use C4::Installer;
+
my $DEBUG = 0;
die "perl 5.6.1 or later required" unless ($] >= 5.006001);
@@ -537,96 +539,7 @@ WriteMakefile(
ABSTRACT => 'Award-winning integrated library system (ILS) and Web OPAC',
AUTHOR => 'Koha Developers <koha-devel at nongnu.org>',
NO_META => 1,
- PREREQ_PM => {
- 'Algorithm::CheckDigits' => 0.50,
- 'Authen::CAS::Client' => 0.05,
- 'Biblio::EndnoteStyle' => 0.05,
- 'CGI' => 3.15,
- 'CGI::Carp' => 1.29,
- 'CGI::Session' => 4.20,
- 'CGI::Session::Serialize::yaml' => 4.20,
- 'Class::Factory::Util' => 1.6,
- 'Class::Accessor' => 0.30,
- 'DBD::mysql' => 4.004,
- 'DBD::SQLite2' => 0.33, # optional, used for offline circulation
- 'DBI' => 1.53,
- 'Data::Dumper' => 2.121,
- 'Data::ICal' => 0.13,
- 'Date::Calc' => 5.4,
- 'Date::ICal' => 1.72,
- 'Date::Manip' => 5.44,
- 'Digest::MD5' => 2.36,
- 'Digest::SHA' => 5.43,
- 'Email::Date' => 1.103,
- 'File::Temp' => 0.16,
- 'GD' => 2.39, #optional, used for patron image feature
- 'GD::Barcode::UPCE' => 1.1,
- 'Graphics::Magick' => 1.3.7, #optional, used for patron cards creator
- 'Getopt::Long' => 2.35,
- 'Getopt::Std' => 1.05,
- 'HTML::Template::Pro' => 0.69,
- 'HTML::Scrubber' => 0.08,
- 'HTTP::Cookies' => 1.39,
- 'HTTP::OAI' => 3.20,
- 'HTTP::Request::Common' => 1.26,
- 'IPC::Cmd' => 0.46,
- 'JSON' => 2.07, # Needed by admin/item_circulation_alerts.pl
- 'LWP::Simple' => 1.41,
- 'LWP::UserAgent' => 2.033,
- 'Lingua::Stem' => 0.82,
- 'Lingua::Stem::Snowball' => 0.952,
- 'List::Util' => 1.18,
- 'List::MoreUtils' => 0.21,
- 'Locale::Currency::Format' => 1.28,
- 'Locale::Language' => 2.07,
- 'Locale::PO' => 0.17,
- 'MARC::Charset' => 0.98,
- 'MARC::Crosswalk::DublinCore' => 0.02,
- 'MARC::File::XML' => 0.88,
- 'MARC::Record' => 2.00,
- 'MIME::Base64' => 3.07,
- 'MIME::Lite' => 3.00,
- 'MIME::QuotedPrint' => 3.07,
- 'Mail::Sendmail' => 0.79,
- 'Memoize::Memcached' => 0.03, # optional
- 'Net::LDAP' => 0.33, # optional
- 'Net::LDAP::Filter' => 0.14, # optional
- 'Net::Z3950::ZOOM' => 1.16,
- 'Number::Format' => 1.52,
- 'PDF::API2' => 2.000,
- 'PDF::API2::Page' => 2.000,
- 'PDF::API2::Util' => 2.000,
- 'PDF::API2::Simple' => 1.000,
- 'PDF::Table' => 0.9.3,
- 'PDF::Reuse' => 0.33,
- 'PDF::Reuse::Barcode' => 0.05,
- 'POE' => 0.9999,
- 'POSIX' => 1.09,
- 'Schedule::At' => 1.06,
- 'Storable' => 2.21,
- 'SMS::Send' => 0.05, # optional
- 'Term::ANSIColor' => 1.10,
- 'Test' => 1.25,
- 'Test::Harness' => 2.56,
- 'Test::More' => 0.80,
- 'Text::CSV' => 0.01,
- 'Text::CSV_XS' => 0.32,
- 'Text::CSV::Encoded' => 0.09,
- 'Text::Iconv' => 1.7,
- 'Text::Wrap' => 2005.082401,
- 'Time::HiRes' => 1.86,
- 'Time::localtime' => 1.02,
- 'Unicode::Normalize' => 0.32,
- 'URI::Escape' => 1.36,
- 'XML::Dumper' => 0.81,
- 'XML::LibXML' => 1.59,
- 'XML::LibXSLT' => 1.59,
- 'XML::SAX::ParserFactory' => 1.01,
- 'XML::SAX::Writer' => 0.44,
- 'XML::Simple' => 2.14,
- 'XML::RSS' => 1.31,
- 'YAML::Syck' => 0.71,
- },
+ PREREQ_PM => $C4::Installer::PREREQ_PM,
# File tree mapping
PM => $file_map,
diff --git a/koha_perl_deps.pl b/koha_perl_deps.pl
new file mode 100755
index 0000000..efe6774
--- /dev/null
+++ b/koha_perl_deps.pl
@@ -0,0 +1,86 @@
+#!/usr/bin/perl
+
+use Getopt::Long;
+use Pod::Usage;
+
+use C4::Installer;
+
+my $color = 0;
+my $help = 0;
+
+GetOptions(
+ 'c|color' => \$color,
+ 'h|help|?'=> \$help,
+ );
+
+pod2usage(1) if $help;
+
+printf("\n\n\x1b\x5b0;37;40m%-30s %10s %20s\n\n", "Module", "Installed", "Required")if $color;
+printf("\n\n%-30s %10s %20s\n\n", "Module", "Installed", "Required")if !$color;
+
+for (keys (%$C4::Installer::PREREQ_PM)) {
+ eval "require $_";
+ printf( "\x1b\x5b0;37;40m%-30s %10s %20s\x1b\x5b0;37;40m\n",
+ $_,
+ $@ ? "\x1b\x5b0;31;40m<- NEEDS INSTALLATION OF VER ".$C4::Installer::PREREQ_PM->{$_}."!!" :
+ $_->VERSION < $C4::Installer::PREREQ_PM->{$_} ? "\x1b\x5b0;31;40m".$_->VERSION : "\x1b\x5b0;32;40m".$_->VERSION,
+ $_->VERSION < $C4::Installer::PREREQ_PM->{$_} && !$@ ? "<- NEEDS UPGRADE TO VER ".$C4::Installer::PREREQ_PM->{$_}."!!" : !$@ ? $C4::Installer::PREREQ_PM->{$_} : '',
+ ) if $color;
+ printf( "%-30s %10s %20s\n",
+ $_,
+ $@ ? "<- NEEDS INSTALLATION OF VER ".$C4::Installer::PREREQ_PM->{$_}."!!" :
+ $_->VERSION,
+ $_->VERSION < $C4::Installer::PREREQ_PM->{$_} && !$@ ? "<- NEEDS UPGRADE TO VER ".$C4::Installer::PREREQ_PM->{$_}."!!" : !$@ ? $C4::Installer::PREREQ_PM->{$_} : '',
+ ) if !$color;
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+koha_perl_deps.pl
+
+=head1 SYNOPSIS
+
+./koha_perl_deps.pl -c
+
+=head1 OPTIONS
+
+=over 8
+
+=item B<-c|--color>
+
+sets output to color
+
+=item B<-h|--help|?>
+
+prints this help text
+
+=back
+
+=head1 AUTHOR
+
+Chris Nighswonger <cnighswonger AT foundations DOT edu>
+
+=head1 COPYRIGHT
+
+Copyright 2010 Foundations Bible College.
+
+=head1 LICENSE
+
+This file is part of Koha.
+
+Koha 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 2 of the License, or (at your option) any later version.
+
+You should have received a copy of the GNU General Public License along with Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+Suite 330, Boston, MA 02111-1307 USA
+
+=head1 DISCLAIMER OF WARRANTY
+
+Koha 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.
+
+=cut
--
1.6.0.4
More information about the Koha-patches
mailing list