View | Details | Raw Unified | Return to bug 16083
Collapse All | Expand All

(-)a/Makefile.PL (-4 / +116 lines)
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 483-496 my %valid_config_values = ( Link Here
483
511
484
# get settings from command-line
512
# get settings from command-line
485
my $koha_install_log = "";
513
my $koha_install_log = "";
514
my $cli_koha_install_mode = "";
515
my $cli_koha_db_type = "";
516
my $cli_koha_db_host = "";
517
my $cli_koha_db_port = "";
518
my $cli_koha_db_name = "";
519
my $cli_koha_db_user = "";
520
my $cli_koha_db_pass = "";
521
my $cli_zebra_marc_format = "";
522
my $cli_zebra_language = "",
523
my $cli_zebra_tokenizer = "";
524
my $cli_zebra_user = "";
525
my $cli_zebra_pass = "";
526
my $cli_koha_auth_index_mode = "";
527
my $cli_koha_bib_index_mode = "";
528
my $cli_koha_user = "";
529
my $cli_koha_group = "";
530
my $cli_koha_install_sru = "";
531
my $cli_koha_install_pazpar2 = "";
532
my $cli_koha_use_memcached = "";
533
my $cli_koha_font_dir = "";
534
my $cli_koha_run_database_tests = "";
535
my $cli_koha_install_base = "";
486
Getopt::Long::Configure('pass_through');
536
Getopt::Long::Configure('pass_through');
487
my $results = GetOptions(
537
my $results = GetOptions(
488
    "prev-install-log=s" => \$koha_install_log
538
    "prev-install-log=s"   => \$koha_install_log,
489
);
539
    "install_mode=s"       => \$cli_koha_install_mode,
540
    "db_type=s"            => \$cli_koha_db_type,
541
    "db_host=s"            => \$cli_koha_db_host,
542
    "db_port=s"            => \$cli_koha_db_port,
543
    "db_name=s"            => \$cli_koha_db_name,
544
    "db_user=s"            => \$cli_koha_db_user,
545
    "db_pass=s"            => \$cli_koha_db_pass,
546
    "zebra_marc_format=s"  => \$cli_zebra_marc_format,
547
    "zebra_language=s"     => \$cli_zebra_language,
548
    "zebra_tokenizer=s"    => \$cli_zebra_tokenizer,
549
    "zebra_user=s"         => \$cli_zebra_user,
550
    "zebra_pass=s"         => \$cli_zebra_pass,
551
    "auth_index_mode=s"    => \$cli_koha_auth_index_mode,
552
    "bib_index_mode=s"     => \$cli_koha_bib_index_mode,
553
    "koha_user=s"          => \$cli_koha_user,
554
    "koha_group=s"         => \$cli_koha_group,
555
    "install_sru=s"        => \$cli_koha_install_sru,
556
    "install_pazpar2=s"    => \$cli_koha_install_pazpar2,
557
    "use_memcached=s"      => \$cli_koha_use_memcached,
558
    "font_dir=s"           => \$cli_koha_font_dir,
559
    "run_database_tests=s" => \$cli_koha_run_database_tests,
560
    "install_base=s"       => \$cli_koha_install_base,
561
    "help"                 => sub { HelpMessage(0) },
562
) or HelpMessage(1);
490
563
491
my %install_log_values = ();
564
my %install_log_values = ();
492
if ($koha_install_log ne "") {
565
if ($koha_install_log ne "") {
493
    get_install_log_values($koha_install_log, \%install_log_values);
566
    get_install_log_values($koha_install_log, \%install_log_values);
567
} else {
568
    # Try to set install_log_values for provided values;
569
    get_cli_values(\%install_log_values);
494
}
570
}
495
571
496
my %config = get_configuration(\%config_defaults, \%valid_config_values, \%install_log_values);
572
my %config = get_configuration(\%config_defaults, \%valid_config_values, \%install_log_values);
Lines 736-741 sub _add_to_file_map { Link Here
736
    }
812
    }
737
}
813
}
738
814
815
=head2 get_cli_values
816
817
Reads values provided on cli for configuration values
818
819
=cut
820
821
sub get_cli_values {
822
    my $values = shift;
823
    my $map = {
824
        INSTALL_MODE       => $cli_koha_install_mode,
825
        DB_TYPE            => $cli_koha_db_type,
826
        DB_HOST            => $cli_koha_db_host,
827
        DB_PORT            => $cli_koha_db_port,
828
        DB_NAME            => $cli_koha_db_name,
829
        DB_USER            => $cli_koha_db_user,
830
        DB_PASS            => $cli_koha_db_pass,
831
        ZEBRA_MARC_FORMAT  => $cli_zebra_marc_format,
832
        ZEBRA_LANGUAGE     => $cli_zebra_language,
833
        ZEBRA_TOKENIZER    => $cli_zebra_tokenizer,
834
        ZEBRA_USER         => $cli_zebra_user,
835
        ZEBRA_PASS         => $cli_zebra_pass,
836
        AUTH_INDEX_MODE    => $cli_koha_auth_index_mode,
837
        BIB_INDEX_MODE     => $cli_koha_bib_index_mode,
838
        KOHA_USER          => $cli_koha_user,
839
        KOHA_GROUP         => $cli_koha_group,
840
        INSTALL_SRU        => $cli_koha_install_sru,
841
        INSTALL_PAZPAR2    => $cli_koha_install_pazpar2,
842
        USE_MEMCACHED      => $cli_koha_use_memcached,
843
        FONT_DIR           => $cli_koha_font_dir,
844
        RUN_DATABASE_TESTS => $cli_koha_run_database_tests,
845
        INSTALL_BASE       => $cli_koha_install_base
846
    };
847
    foreach my $key (keys %{$map}) {
848
        $values->{$key} = $map->{$key} if ($map->{$key});
849
    }
850
}
851
739
=head2 get_install_log_values
852
=head2 get_install_log_values
740
853
741
Reads value from the Koha install log specified by
854
Reads value from the Koha install log specified by
742
- 

Return to bug 16083