X-Git-Url: http://git.equinoxoli.org/?p=koha-equinox.git;a=blobdiff_plain;f=Makefile.PL;h=0a0d4b7a0e06a02a883ed910ab4fab8a6561cd60;hp=0068424a9d856b5022eea70499aa8c2ef033b56e;hb=HEAD;hpb=64be74b3380441b645ec808e0c30455e76b326e1 diff --git a/Makefile.PL b/Makefile.PL index 0068424..7d5a230 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -29,7 +29,7 @@ use FindBin; # we need to enforce which C4::Installer::PerlModule is used in cas use lib $FindBin::Bin; -use C4::Installer; +use C4::Installer::PerlModules; my $koha_pm = C4::Installer::PerlModules->new; @@ -91,14 +91,12 @@ Makefile.PL - Koha packager and installer --zebra_sru_host Zebra SRU servername (e.g. localhost) --zebra_sru_biblios_port Zebra SRU biblios port (e.g. 9998) --zebra_sru_authorities_port Zebra SRU biblios port (e.g. 9999) - --auth_index_mode Authority index mode (grs1, dom) - --bib_index_mode Bibliographic index mode (grs1, dom) --koha_user Koha Unix user (e.g. koha) --koha_group Koha Unix group (e.g. koha) --install_sru Install the SRU server (yes, no) --install_pazpar2 Install PazPar2 (yes, no) --use_memcached Use Memcached (yes, no) - --font_dir Location of fonts (e.g. /usr/share/fonts/truetype/ttf-dejavu) + --font_dir Location of fonts (e.g. /usr/share/fonts/truetype/dejavu) --run_database_tests Run database dependent tests (yes, no) --install_base Base directory of installation (e.g. /usr/share/koha) --template-cache-dir Specify a template cache directory (e.g. /var/cache/koha) @@ -230,6 +228,16 @@ Directory for Zebra's data files. Directory for Zebra's UNIX-domain sockets. +=item ELASTICSEARCH_SERVERS + +Server:port of the Elasticsearch server to use, as a comma separated list: +eg. 192.168.0.100:9200, localhost:9200 + +=item ELASTICSEARCH_INDEX + +Unique index in Elasticsearch, for this Koha-instance +eg. koha-mykoha or just koha + =item MISC_DIR Directory for for miscellaenous scripts, among other @@ -256,6 +264,10 @@ contain information of interest to Koha developers. Directory for Koha documentation accessed from the command-line, e.g., READMEs. +=item LOCK_DIR + +Directory for Koha scripts to put their locks. + =item LOG_DIR Directory for Apache and Zebra logs produced by Koha. @@ -306,11 +318,14 @@ my $target_map = { './circ' => 'INTRANET_CGI_DIR', './clubs' => 'INTRANET_CGI_DIR', './course_reserves' => 'INTRANET_CGI_DIR', + './cpanfile' => 'PERL_MODULE_DIR', './docs/history.txt' => { target => 'DOC_DIR', trimdir => -1 }, + './docs/contributors.yaml' => { target => 'DOC_DIR', trimdir => -1 }, + './docs/teams.yaml' => { target => 'DOC_DIR', trimdir => -1 }, './offline_circ' => 'INTRANET_CGI_DIR', - './edithelp.pl' => 'INTRANET_CGI_DIR', './etc' => { target => 'KOHA_CONF_DIR', trimdir => -1 }, './etc/zebradb' => { target => 'ZEBRA_CONF_DIR', trimdir => -1 }, + './etc/z3950' => { target => 'Z3950_CONF_DIR', trimdir => -1 }, './etc/pazpar2' => { target => 'PAZPAR2_CONF_DIR', trimdir => -1 }, './help.pl' => 'INTRANET_CGI_DIR', './ill' => 'INTRANET_CGI_DIR', @@ -339,6 +354,7 @@ my $target_map = { './patroncards' => 'INTRANET_CGI_DIR', './patron_lists' => 'INTRANET_CGI_DIR', './plugins' => 'INTRANET_CGI_DIR', + './pos' => 'INTRANET_CGI_DIR', './reports' => 'INTRANET_CGI_DIR', './reserve' => 'INTRANET_CGI_DIR', './reviews' => 'INTRANET_CGI_DIR', @@ -348,6 +364,7 @@ my $target_map = { './serials' => 'INTRANET_CGI_DIR', './services' => 'INTRANET_CGI_DIR', './skel' => 'NONE', + './skel/var/lock/koha' => { target => 'LOCK_DIR', trimdir => -1 }, './skel/var/log/koha' => { target => 'LOG_DIR', trimdir => -1 }, './skel/var/spool/koha' => { target => 'BACKUP_DIR', trimdir => -1 }, './skel/var/run/koha/zebradb' => { target => 'ZEBRA_RUN_DIR', trimdir => -1 }, @@ -367,16 +384,22 @@ my $target_map = { './suggestion' => 'INTRANET_CGI_DIR', './svc' => 'INTRANET_CGI_DIR', './t' => 'NONE', + './xt' => 'NONE', './tags' => 'INTRANET_CGI_DIR', './tmp' => 'NONE', # FIXME need to determine whether # Koha generates any persistent temp files # that should go in /var/tmp/koha './tools' => 'INTRANET_CGI_DIR', './virtualshelves' => 'INTRANET_CGI_DIR', - './xml_sax.pl' => 'PERL_MODULE_DIR', # ignore files and directories created by the install itself './pm_to_blib' => 'NONE', './blib' => 'NONE', + '.sass-lint.yml' => 'NONE', + '.scss-lint.yml' => 'NONE', + '.eslintrc.json' => 'NONE', + 'gulpfile.js' => 'NONE', + 'package.json' => 'NONE', + 'yarn.lock' => 'NONE', }; =head1 CONFIGURATION OPTIONS @@ -465,8 +488,6 @@ my %config_defaults = ( 'DB_TLS_CLIENT_KEY' => '/etc/mysql-ssl/client-key.pem', 'INSTALL_SRU' => 'yes', 'INSTALL_PAZPAR2' => 'no', - 'AUTH_INDEX_MODE' => 'dom', - 'BIB_INDEX_MODE' => 'dom', 'ZEBRA_MARC_FORMAT' => 'marc21', 'ZEBRA_LANGUAGE' => 'en', 'ZEBRA_TOKENIZER' => 'chr', @@ -487,7 +508,10 @@ my %config_defaults = ( 'MEMCACHED_SERVERS' => '127.0.0.1:11211', 'MEMCACHED_NAMESPACE' => 'KOHA', 'TEMPLATE_CACHE_DIR' => '/tmp/koha', - 'FONT_DIR' => '/usr/share/fonts/truetype/ttf-dejavu' + 'USE_ELASTICSEARCH' => 'no', + 'ELASTICSEARCH_SERVERS' => 'localhost:9200', + 'ELASTICSEARCH_INDEX' => 'koha', + 'FONT_DIR' => '/usr/share/fonts/truetype/dejavu' ); # set some default configuration options based on OS @@ -512,13 +536,12 @@ my %valid_config_values = ( 'DB_TYPE' => { 'mysql' => 1, 'Pg' => 1 }, 'DB_USE_TLS' => {'yes', 'no'}, 'INSTALL_SRU' => { 'yes' => 1, 'no' => 1 }, - 'AUTH_INDEX_MODE' => { 'grs1' => 1, 'dom' => 1 }, - 'BIB_INDEX_MODE' => { 'grs1' => 1, 'dom' => 1 }, 'ZEBRA_MARC_FORMAT' => { 'marc21' => 1, 'normarc' => 1, 'unimarc' => 1 }, # FIXME should generate from contents of distributation - 'ZEBRA_LANGUAGE' => { 'cs' => 1, 'en' => 1, 'es' => 1, 'fr' => 1, 'gr' => 1, 'nb' => 1, 'ru' => 1, 'uk' => 1 }, # FIXME should generate from contents of distribution + 'ZEBRA_LANGUAGE' => { 'cs' => 1, 'el' => 1, 'en' => 1, 'es' => 1, 'fr' => 1, 'nb' => 1, 'ru' => 1, 'uk' => 1 }, # FIXME should generate from contents of distribution 'ZEBRA_TOKENIZER' => { chr => 1, icu => 1 }, 'RUN_DATABASE_TESTS' => { 'yes' => 1, 'no' => 1 }, 'USE_MEMCACHED' => { 'yes' => 1, 'no' => 1 }, + 'USE_ELASTICSEARCH' => { 'yes' => 1, 'no' => 1 }, ); # get settings from command-line @@ -538,8 +561,6 @@ my $cli_zebra_pass = ""; my $cli_zebra_sru_host = ""; my $cli_zebra_sru_bib_port = ""; my $cli_zebra_sru_auth_port = ""; -my $cli_koha_auth_index_mode = ""; -my $cli_koha_bib_index_mode = ""; my $cli_koha_user = ""; my $cli_koha_group = ""; my $cli_koha_install_sru = ""; @@ -567,8 +588,6 @@ my $results = GetOptions( "zebra_sru_host=s" => \$cli_zebra_sru_host, "zebra_sru_biblios_port=s" => \$cli_zebra_sru_bib_port, "zebra_sru_authorities_port=s" => \$cli_zebra_sru_auth_port, - "auth_index_mode=s" => \$cli_koha_auth_index_mode, - "bib_index_mode=s" => \$cli_koha_bib_index_mode, "koha_user=s" => \$cli_koha_user, "koha_group=s" => \$cli_koha_group, "install_sru=s" => \$cli_koha_install_sru, @@ -610,15 +629,11 @@ my $pl_files = { push @{ $pl_files->{'rewrite-config.PL'} }, ( 'blib/ZEBRA_CONF_DIR/etc/passwd', - 'blib/ZEBRA_CONF_DIR/zebra-biblios.cfg', 'blib/ZEBRA_CONF_DIR/zebra-biblios-dom.cfg', - 'blib/ZEBRA_CONF_DIR/zebra-authorities.cfg', 'blib/ZEBRA_CONF_DIR/zebra-authorities-dom.cfg', 'blib/ZEBRA_CONF_DIR/explain-authorities.xml', 'blib/ZEBRA_CONF_DIR/explain-biblios.xml', - 'blib/ZEBRA_CONF_DIR/retrieval-info-auth-grs1.xml', 'blib/ZEBRA_CONF_DIR/retrieval-info-auth-dom.xml', - 'blib/ZEBRA_CONF_DIR/retrieval-info-bib-grs1.xml', 'blib/ZEBRA_CONF_DIR/retrieval-info-bib-dom.xml', ); push @{ $pl_files->{'rewrite-config.PL'} }, ( @@ -632,19 +647,10 @@ if ($config{'INSTALL_PAZPAR2'} eq 'yes') { 'blib/PAZPAR2_CONF_DIR/pazpar2.xml' ); } -$config{'ZEBRA_AUTH_CFG'} = $config{'AUTH_INDEX_MODE'} eq 'dom' - ? 'zebra-authorities-dom.cfg' - : 'zebra-authorities.cfg'; -$config{'ZEBRA_BIB_CFG'} = $config{'BIB_INDEX_MODE'} eq 'dom' - ? 'zebra-biblios-dom.cfg' - : 'zebra-biblios.cfg'; -$config{'AUTH_RETRIEVAL_CFG'} = $config{'AUTH_INDEX_MODE'} eq 'dom' - ? 'retrieval-info-auth-dom.xml' - : 'retrieval-info-auth-grs1.xml'; -$config{'BIB_RETRIEVAL_CFG'} = $config{'BIB_INDEX_MODE'} eq 'dom' - ? 'retrieval-info-bib-dom.xml' - : 'retrieval-info-bib-grs1.xml'; - +$config{'ZEBRA_AUTH_CFG'} = 'zebra-authorities-dom.cfg'; +$config{'ZEBRA_BIB_CFG'} = 'zebra-biblios-dom.cfg'; +$config{'AUTH_RETRIEVAL_CFG'} = 'retrieval-info-auth-dom.xml'; +$config{'BIB_RETRIEVAL_CFG'} = 'retrieval-info-bib-dom.xml'; if ($config{'INSTALL_MODE'} ne "dev") { push @{ $pl_files->{'rewrite-config.PL'} }, ( @@ -664,6 +670,8 @@ $config{ZEBRA_PTOKENIZER_STMT} = $config{ZEBRA_TOKENIZER} eq 'icu' my %test_suite_override_dirs = ( KOHA_CONF_DIR => ['etc'], ZEBRA_CONF_DIR => ['etc', 'zebradb'], + Z3950_CONF_DIR => ['etc', 'z3950'], + LOCK_DIR => ['var', 'lock'], LOG_DIR => ['var', 'log'], BACKUP_DIR => ['var', 'spool'], SCRIPT_DIR => ['bin'], @@ -856,8 +864,6 @@ sub get_cli_values { ZEBRA_SRU_HOST => $cli_zebra_sru_host, ZEBRA_SRU_BIBLIOS_PORT => $cli_zebra_sru_bib_port, ZEBRA_SRU_AUTHORITIES_PORT => $cli_zebra_sru_auth_port, - AUTH_INDEX_MODE => $cli_koha_auth_index_mode, - BIB_INDEX_MODE => $cli_koha_bib_index_mode, KOHA_USER => $cli_koha_user, KOHA_GROUP => $cli_koha_group, INSTALL_SRU => $cli_koha_install_sru, @@ -884,8 +890,8 @@ sub get_install_log_values { my $install_log = shift; my $values = shift; - open LOG, "<$install_log" or die "Cannot open install log $install_log: $!\n"; - while () { + open my $log, '<', $install_log or die "Cannot open install log $install_log: $!\n"; + while (<$log>) { chomp; next if /^#/ or /^\s*$/; next if /^=/; @@ -894,7 +900,7 @@ sub get_install_log_values { my ($key, $value) = split /=/, $_, 2; $values->{$key} = $value; } - close LOG; + close $log; print <<_EXPLAIN_INSTALL_LOG_; Reading values from install log $install_log. You @@ -1116,33 +1122,6 @@ Primary language for Zebra indexing); $config{'ZEBRA_LANGUAGE'} = _get_value('ZEBRA_LANGUAGE', $msg, $defaults->{'ZEBRA_LANGUAGE'}, $valid_values, $install_log_values); $msg = q( -Koha can use one of two different indexing modes -for the MARC bibliographic records: - -dom - uses the DOM XML filter; offers improved - functionality. -grs1 - [DEPRECATED] uses the Zebra GRS-1 filter, - available for legacy support - -Bibliographic indexing mode); - $msg .= _add_valid_values_disp('BIB_INDEX_MODE', $valid_values); - $config{'BIB_INDEX_MODE'} = _get_value('BIB_INDEX_MODE', $msg, $defaults->{'BIB_INDEX_MODE'}, $valid_values, $install_log_values); - - - $msg = q( -Koha can use one of two different indexing modes -for the MARC authorities records: - -dom - uses the DOM XML filter; offers improved - functionality. -grs1 - [DEPRECATED] uses the Zebra GRS-1 filter, - available for legacy support - -Authorities indexing mode); - $msg .= _add_valid_values_disp('AUTH_INDEX_MODE', $valid_values); - $config{'AUTH_INDEX_MODE'} = _get_value('AUTH_INDEX_MODE', $msg, $defaults->{'AUTH_INDEX_MODE'}, $valid_values, $install_log_values); - - $msg = q( Zebra has two methods to perform records tokenization and characters normalization: CHR and ICU. ICU is recommended for catalogs containing non-Latin @@ -1229,7 +1208,7 @@ PazPar2 port?); $msg = q( Use memcached to cache the results of some function calls? -This provides a signficant performance improvement. +This provides a significant performance improvement. You will need a Memcached server running.); $msg .= _add_valid_values_disp('USE_MEMCACHED', $valid_values); $config{'USE_MEMCACHED'} = _get_value('USE_MEMCACHED', $msg, $defaults->{'USE_MEMCACHED'}, $valid_values, $install_log_values); @@ -1246,6 +1225,29 @@ Memcached namespace?); $config{'MEMCACHED_NAMESPACE'} = _get_value('MEMCACHED_NAMESPACE', $msg, $defaults->{'MEMCACHED_NAMESPACE'}, $valid_values, $install_log_values); } + + $msg = q( +Use Elasticsearch to serve search results? +You will need a Elasticsearch server running.); + $msg .= _add_valid_values_disp('USE_ELASTICSEARCH', $valid_values); + $config{'USE_ELASTICSEARCH'} = _get_value('USE_ELASTICSEARCH', $msg, $defaults->{'USE_ELASTICSEARCH'}, $valid_values, $install_log_values); + if ($config{'USE_ELASTICSEARCH'} eq 'yes'){ + $msg = q( +Define the ELASTICSEARCH_SERVERS with a comma-separated list. Eg +localhost:9200, 192.168.0.100:9200 +); + $msg = q( +Elasticsearch server addresses?); + $config{'ELASTICSEARCH_SERVERS'} = _get_value('ELASTICSEARCH_SERVERS', $msg, $defaults->{'ELASTICSEARCH_SERVERS'}, $valid_values, $install_log_values); + + $msg = q( +What index name to use for this Koha-instance? It must be unique for each Koha +sharing the same Elasticsearch-cluster + +Elasticsearch index?); + $config{'ELASTICSEARCH_INDEX'} = _get_value('ELASTICSEARCH_INDEX', $msg, $defaults->{'ELASTICSEARCH_INDEX'}, $valid_values, $install_log_values); + } + $msg = q( Template cache directory?); $config{'TEMPLATE_CACHE_DIR'} = _get_value('TEMPLATE_CACHE_DIR', $msg, $defaults->{'TEMPLATE_CACHE_DIR'}, $valid_values, $install_log_values); @@ -1267,7 +1269,7 @@ Would you like to run the database-dependent test suite?); THE DATA IN THIS DATABASE WILL BE DESTROYED during the process of testing. Please don't do this on your production database. It is not -reversable. +reversible. YOU WILL SUFFER DATA LOSS if you run this test suite on your test database. You are better off not running this optional test suite than @@ -1391,6 +1393,7 @@ sub get_target_directories { $dirmap{'PERL_MODULE_DIR'} = File::Spec->catdir(@basedir, $package, 'lib'); $dirmap{'KOHA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc'); $dirmap{'ZEBRA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'zebradb'); + $dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'z3950'); $dirmap{'PAZPAR2_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'pazpar2'); $dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc'); $dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin'); @@ -1398,6 +1401,7 @@ sub get_target_directories { $dirmap{'MAN_DIR'} = File::Spec->catdir(@basedir, $package, 'man'); $dirmap{'DOC_DIR'} = File::Spec->catdir(@basedir, $package, 'doc'); $dirmap{'ZEBRA_LOCK_DIR'} = File::Spec->catdir(@basedir, $package, 'var', 'lock', 'zebradb'); + $dirmap{'LOCK_DIR'} = File::Spec->catdir(@basedir, $package, 'var', 'lock'); $dirmap{'LOG_DIR'} = File::Spec->catdir(@basedir, $package, 'var', 'log'); $dirmap{'BACKUP_DIR'} = File::Spec->catdir(@basedir, $package, 'var', 'spool'); $dirmap{'PLUGINS_DIR'} = File::Spec->catdir(@basedir, $package, 'var', 'lib', 'koha', 'plugins'); @@ -1423,6 +1427,7 @@ sub get_target_directories { $skipdirs{'PERL_MODULE_DIR'} = 1; $dirmap{'KOHA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc'); $dirmap{'ZEBRA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'zebradb'); + $dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'z3950'); $dirmap{'PAZPAR2_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'pazpar2'); $dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc'); $dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin'); @@ -1433,6 +1438,7 @@ sub get_target_directories { $dirmap{'MAN_DIR'} = File::Spec->catdir(@basedir, $package, 'man'); $dirmap{'DOC_DIR'} = File::Spec->catdir(@basedir, $package, 'doc'); $dirmap{'ZEBRA_LOCK_DIR'} = File::Spec->catdir(@basedir, $package, 'var', 'lock', 'zebradb'); + $dirmap{'LOCK_DIR'} = File::Spec->catdir(@basedir, $package, 'var', 'lock'); $dirmap{'LOG_DIR'} = File::Spec->catdir(@basedir, $package, 'var', 'log'); $dirmap{'BACKUP_DIR'} = File::Spec->catdir(@basedir, $package, 'var', 'spool'); $dirmap{'PLUGINS_DIR'} = File::Spec->catdir(@basedir, $package, 'var', 'lib', 'plugins'); @@ -1450,6 +1456,7 @@ sub get_target_directories { $dirmap{'PERL_MODULE_DIR'} = File::Spec->catdir(@basedir, $package, 'lib'); $dirmap{'KOHA_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package); $dirmap{'ZEBRA_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package, 'zebradb'); + $dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package, 'z3950'); $dirmap{'PAZPAR2_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package, 'pazpar2'); $dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc'); $dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin'); @@ -1457,6 +1464,7 @@ sub get_target_directories { $dirmap{'MAN_DIR'} = File::Spec->catdir(@basedir, $package, 'man'); $dirmap{'DOC_DIR'} = File::Spec->catdir(@basedir, $package, 'doc'); $dirmap{'ZEBRA_LOCK_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'var', 'lock', $package, 'zebradb'); + $dirmap{'LOCK_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'var', 'lock', $package); $dirmap{'LOG_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'var', 'log', $package); $dirmap{'BACKUP_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'var', 'spool', $package); $dirmap{'PLUGINS_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'var', 'lib', $package, 'plugins');