Two fixes to speed up (a little bit) installation process

Add a explanation on DBD::mysql installation without test suite.
Add /misc/translator/install-code.pl script that creates templates
for specified language codes.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Frederic Demians 2008-04-15 18:10:24 +02:00 committed by Joshua Ferraro
parent 9b47b82a77
commit e7bf746d6c
2 changed files with 63 additions and 2 deletions

19
INSTALL.debian Normal file → Executable file
View File

@ -171,11 +171,26 @@ When the configuration is completed CPAN will install the Perl modules.
/etc/perl/XML/SAX/ParserDetails.ini
2.4 Create test database in order to install DBD::mysql
2.4 Install DBD::mysql Perl module
In order to handle UTF-8 correctly, Koha requires at least version 4.004
of the DBD::mysql Perl module. However, Debian Etch has a stable package
of the DBD::mysql Perl module. However, Debian Etch has a stable package
only for version 3.0008, so it is necessary to install the module from CPAN.
DBD::mysql's test suite needs to use a MySQL 'test' DB which doesn't exist
anymore. So there are two options to install DBD::mysql:
(1) install without test suite,
(2) install with test suite requiring a test MySQL DB creation.
2.4.1 Install without test suite
Force install DBD::mysql:
$ sudo cpan
cpan> force install DBD::mysql
2.4.2 Create test database in order to install DBD::mysql
Because of DBD::mysql's test suite, it is necessary to temporarily create a
test database and user:

46
misc/translator/install-code.pl Executable file
View File

@ -0,0 +1,46 @@
#!/usr/bin/perl
use strict;
=head1 NAME
install-code.pl
=head1 USAGE
Install templates for given language codes.
For example:
./install-code fr-FR en-ES
creates templates for languages: fr-FR and en-ES
=cut
sub install_code {
my $code = shift;
opendir(PO_DIR, "po") or die "Unable to open po directory";
my @po_files = grep { /^$code-i-opac|^$code-i-staff/ } readdir PO_DIR;
closedir PO_DIR;
foreach ( @po_files ) {
my ($interface) = /(staff|opac)/;
$interface =~ s/staff/intranet/;
mkdir "../../koha-tmpl/$interface-tmpl/prog/$code";
print $_, " : ", $interface, "\n";
my $cmd = "./tmpl_process3.pl install -r " .
"-i ../../koha-tmpl/$interface-tmpl/prog/en/ " .
"-o ../../koha-tmpl/$interface-tmpl/prog/$code/ " .
"-s po/$_";
system $cmd;
}
}
# Main
install_code ( $_ ) foreach ( @ARGV );