Lines 1-4
Link Here
|
1 |
# Copyright 2007 MJ Ray |
1 |
# Copyright 2007 MJ Ray |
|
|
2 |
# Copyright 2016 PTFS Europe |
2 |
# |
3 |
# |
3 |
# This file is part of Koha. |
4 |
# This file is part of Koha. |
4 |
# |
5 |
# |
Lines 23-29
use warnings;
Link Here
|
23 |
use ExtUtils::MakeMaker; |
24 |
use ExtUtils::MakeMaker; |
24 |
use POSIX; |
25 |
use POSIX; |
25 |
use File::Spec; |
26 |
use File::Spec; |
26 |
use Getopt::Long; |
27 |
use Getopt::Long qw/HelpMessage/; |
27 |
use FindBin; # we need to enforce which C4::Installer::PerlModule is used in case more than one is installed |
28 |
use FindBin; # we need to enforce which C4::Installer::PerlModule is used in case more than one is installed |
28 |
|
29 |
|
29 |
use lib $FindBin::Bin; |
30 |
use lib $FindBin::Bin; |
Lines 72-77
Makefile.PL - Koha packager and installer
Link Here
|
72 |
|
73 |
|
73 |
make clean |
74 |
make clean |
74 |
|
75 |
|
|
|
76 |
=head2 CLI PARAMETERS |
77 |
|
78 |
--prev-install-log Read configuration from previous installation |
79 |
--install_mode Installation mode (dev, standard, single) |
80 |
--db_type Database (mysql, Pg) |
81 |
--db_host Database host (e.g. localhost) |
82 |
--db_port Database port (e.g. 3306) |
83 |
--db_name Database name (e.g. koha) |
84 |
--db_user Database user (e.g. kohaadmin) |
85 |
--db_pass Database password (e.g. katikoan) |
86 |
--zebra_marc_format Zebra MARC format (marc21, normarc, unimarc) |
87 |
--zebra_language Zebra language (e.g. en) |
88 |
--zebra_tokenizer Zebra tokenizer (chr, icu) |
89 |
--zebra_user Zebra user (e.g. kohauser) |
90 |
--zebra_pass Zebra password (e.g. zebrastripes) |
91 |
--auth_index_mode Authority index mode (grs1, dom) |
92 |
--bib_index_mode Bibliographic index mode (grs1, dom) |
93 |
--koha_user Koha Unix user (e.g. koha) |
94 |
--koha_group Koha Unix group (e.g. koha) |
95 |
--install_sru Install the SRU server (yes, no) |
96 |
--install_pazpar2 Install PazPar2 (yes, no) |
97 |
--use_memcached Use Memcached (yes, no) |
98 |
--font_dir Location of fonts (e.g. /usr/share/fonts/truetype/ttf-dejavu) |
99 |
--run_database_tests Run database dependent tests (yes, no) |
100 |
--install_base Base directory of installation (e.g. /usr/share/koha) |
101 |
--help Display this help message |
102 |
|
75 |
=head1 DESCRIPTION |
103 |
=head1 DESCRIPTION |
76 |
|
104 |
|
77 |
This is a packager and installer that uses |
105 |
This is a packager and installer that uses |
Lines 482-495
my %valid_config_values = (
Link Here
|
482 |
|
510 |
|
483 |
# get settings from command-line |
511 |
# get settings from command-line |
484 |
my $koha_install_log = ""; |
512 |
my $koha_install_log = ""; |
|
|
513 |
my $cli_koha_install_mode = ""; |
514 |
my $cli_koha_db_type = ""; |
515 |
my $cli_koha_db_host = ""; |
516 |
my $cli_koha_db_port = ""; |
517 |
my $cli_koha_db_name = ""; |
518 |
my $cli_koha_db_user = ""; |
519 |
my $cli_koha_db_pass = ""; |
520 |
my $cli_zebra_marc_format = ""; |
521 |
my $cli_zebra_language = "", |
522 |
my $cli_zebra_tokenizer = ""; |
523 |
my $cli_zebra_user = ""; |
524 |
my $cli_zebra_pass = ""; |
525 |
my $cli_koha_auth_index_mode = ""; |
526 |
my $cli_koha_bib_index_mode = ""; |
527 |
my $cli_koha_user = ""; |
528 |
my $cli_koha_group = ""; |
529 |
my $cli_koha_install_sru = ""; |
530 |
my $cli_koha_install_pazpar2 = ""; |
531 |
my $cli_koha_use_memcached = ""; |
532 |
my $cli_koha_font_dir = ""; |
533 |
my $cli_koha_run_database_tests = ""; |
534 |
my $cli_koha_install_base = ""; |
485 |
Getopt::Long::Configure('pass_through'); |
535 |
Getopt::Long::Configure('pass_through'); |
486 |
my $results = GetOptions( |
536 |
my $results = GetOptions( |
487 |
"prev-install-log=s" => \$koha_install_log |
537 |
"prev-install-log=s" => \$koha_install_log, |
488 |
); |
538 |
"install_mode=s" => \$cli_koha_install_mode, |
|
|
539 |
"db_type=s" => \$cli_koha_db_type, |
540 |
"db_host=s" => \$cli_koha_db_host, |
541 |
"db_port=s" => \$cli_koha_db_port, |
542 |
"db_name=s" => \$cli_koha_db_name, |
543 |
"db_user=s" => \$cli_koha_db_user, |
544 |
"db_pass=s" => \$cli_koha_db_pass, |
545 |
"zebra_marc_format=s" => \$cli_zebra_marc_format, |
546 |
"zebra_language=s" => \$cli_zebra_language, |
547 |
"zebra_tokenizer=s" => \$cli_zebra_tokenizer, |
548 |
"zebra_user=s" => \$cli_zebra_user, |
549 |
"zebra_pass=s" => \$cli_zebra_pass, |
550 |
"auth_index_mode=s" => \$cli_koha_auth_index_mode, |
551 |
"bib_index_mode=s" => \$cli_koha_bib_index_mode, |
552 |
"koha_user=s" => \$cli_koha_user, |
553 |
"koha_group=s" => \$cli_koha_group, |
554 |
"install_sru=s" => \$cli_koha_install_sru, |
555 |
"install_pazpar2=s" => \$cli_koha_install_pazpar2, |
556 |
"use_memcached=s" => \$cli_koha_use_memcached, |
557 |
"font_dir=s" => \$cli_koha_font_dir, |
558 |
"run_database_tests=s" => \$cli_koha_run_database_tests, |
559 |
"install_base=s" => \$cli_koha_install_base, |
560 |
"help" => sub{HelpMessage(0)} |
561 |
) or HelpMessage(1); |
489 |
|
562 |
|
490 |
my %install_log_values = (); |
563 |
my %install_log_values = (); |
491 |
if ($koha_install_log ne "") { |
564 |
if ($koha_install_log ne "") { |
492 |
get_install_log_values($koha_install_log, \%install_log_values); |
565 |
get_install_log_values($koha_install_log, \%install_log_values); |
|
|
566 |
} else { |
567 |
# Try to set install_log_values for provided values; |
568 |
get_cli_values(\%install_log_values); |
493 |
} |
569 |
} |
494 |
|
570 |
|
495 |
my %config = get_configuration(\%config_defaults, \%valid_config_values, \%install_log_values); |
571 |
my %config = get_configuration(\%config_defaults, \%valid_config_values, \%install_log_values); |
Lines 735-740
sub _add_to_file_map {
Link Here
|
735 |
} |
811 |
} |
736 |
} |
812 |
} |
737 |
|
813 |
|
|
|
814 |
=head2 get_cli_values |
815 |
|
816 |
Reads values provided on cli for configuration values |
817 |
|
818 |
=cut |
819 |
|
820 |
sub get_cli_values { |
821 |
my $values = shift; |
822 |
my $map = { |
823 |
INSTALL_MODE => $cli_koha_install_mode, |
824 |
DB_TYPE => $cli_koha_db_type, |
825 |
DB_HOST => $cli_koha_db_host, |
826 |
DB_PORT => $cli_koha_db_port, |
827 |
DB_NAME => $cli_koha_db_name, |
828 |
DB_USER => $cli_koha_db_user, |
829 |
DB_PASS => $cli_koha_db_pass, |
830 |
ZEBRA_MARC_FORMAT => $cli_zebra_marc_format, |
831 |
ZEBRA_LANGUAGE => $cli_zebra_language, |
832 |
ZEBRA_TOKENIZER => $cli_zebra_tokenizer, |
833 |
ZEBRA_USER => $cli_zebra_user, |
834 |
ZEBRA_PASS => $cli_zebra_pass, |
835 |
AUTH_INDEX_MODE => $cli_koha_auth_index_mode, |
836 |
BIB_INDEX_MODE => $cli_koha_bib_index_mode, |
837 |
KOHA_USER => $cli_koha_user, |
838 |
KOHA_GROUP => $cli_koha_group, |
839 |
INSTALL_SRU => $cli_koha_install_sru, |
840 |
INSTALL_PAZPAR2 => $cli_koha_install_pazpar2, |
841 |
USE_MEMCACHED => $cli_koha_use_memcached, |
842 |
FONT_DIR => $cli_koha_font_dir, |
843 |
RUN_DATABASE_TESTS => $cli_koha_run_database_tests, |
844 |
INSTALL_BASE => $cli_koha_install_base |
845 |
}; |
846 |
foreach my $key (keys %{$map}) { |
847 |
$values->{$key} = $map->{$key} if ($map->{$key}); |
848 |
} |
849 |
} |
850 |
|
738 |
=head2 get_install_log_values |
851 |
=head2 get_install_log_values |
739 |
|
852 |
|
740 |
Reads value from the Koha install log specified by |
853 |
Reads value from the Koha install log specified by |
741 |
- |
|
|