Bug 39149: Tidy .PL files
This patch is the result of running: ```shell perl misc/devel/tidy.pl *.PL ``` Commiting raised an error about fix-perl-path.PL calling `warn` which I dismiss for the time being. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
63cba14abd
commit
50d1acb3de
3 changed files with 710 additions and 622 deletions
210
Makefile.PL
210
Makefile.PL
|
@ -558,12 +558,12 @@ my %config_defaults = (
|
|||
warn "Your platform appears to be $^O.\n" if $DEBUG;
|
||||
|
||||
if ( $^O eq 'cygwin' ) {
|
||||
|
||||
# Most Unix2Win32 ports seem to poke everything into the Program Files directory
|
||||
# this could be changed to put some files (ie. libraries) into system32, etc.
|
||||
$config_defaults{'INSTALL_MODE'} = 'single';
|
||||
$config_defaults{'INSTALL_BASE'} = 'c:/progra~1/koha'; # Use 8.3 names to be safe...
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$config_defaults{'INSTALL_MODE'} = 'standard';
|
||||
$config_defaults{'INSTALL_BASE'} = '/usr/share/koha';
|
||||
}
|
||||
|
@ -575,7 +575,8 @@ my %valid_config_values = (
|
|||
'DB_USE_TLS' => { 'yes', 'no' },
|
||||
'INSTALL_SRU' => { 'yes' => 1, 'no' => 1 },
|
||||
'ZEBRA_MARC_FORMAT' => { 'marc21' => 1, 'unimarc' => 1 }, # FIXME should generate from contents of distributation
|
||||
'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_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 },
|
||||
|
@ -657,6 +658,7 @@ my %install_log_values = ();
|
|||
if ( $koha_install_log ne "" ) {
|
||||
get_install_log_values( $koha_install_log, \%install_log_values );
|
||||
} else {
|
||||
|
||||
# Try to set install_log_values for provided values;
|
||||
get_cli_values( \%install_log_values );
|
||||
}
|
||||
|
@ -675,8 +677,11 @@ $file_map->{'koha-tmpl/intranet-tmpl/prog/css/installer.css'} = 'blib/INTRANET_T
|
|||
$file_map->{'koha-tmpl/intranet-tmpl/prog/css/mainpage.css'} = 'blib/INTRANET_TMPL_DIR/prog/css/mainpage.css';
|
||||
$file_map->{'koha-tmpl/intranet-tmpl/prog/css/staff-global.css'} = 'blib/INTRANET_TMPL_DIR/prog/css/staff-global.css';
|
||||
$file_map->{'koha-tmpl/intranet-tmpl/prog/js/vue/dist/erm.js'} = 'blib/INTRANET_TMPL_DIR/prog/js/vue/dist/erm.js';
|
||||
$file_map->{'koha-tmpl/intranet-tmpl/prog/js/vue/dist/preservation.js'} = 'blib/INTRANET_TMPL_DIR/prog/js/vue/dist/preservation.js';
|
||||
$file_map->{'koha-tmpl/intranet-tmpl/prog/js/vue/dist/admin/record_sources.js'} = 'blib/INTRANET_TMPL_DIR/prog/js/vue/dist/admin/record_sources.js';
|
||||
$file_map->{'koha-tmpl/intranet-tmpl/prog/js/vue/dist/preservation.js'} =
|
||||
'blib/INTRANET_TMPL_DIR/prog/js/vue/dist/preservation.js';
|
||||
$file_map->{'koha-tmpl/intranet-tmpl/prog/js/vue/dist/admin/record_sources.js'} =
|
||||
'blib/INTRANET_TMPL_DIR/prog/js/vue/dist/admin/record_sources.js';
|
||||
|
||||
#OPAC_TMPL_DIR
|
||||
$file_map->{'koha-tmpl/opac-tmpl/bootstrap/css/opac.css'} = 'blib/OPAC_TMPL_DIR/bootstrap/css/opac.css';
|
||||
$file_map->{'koha-tmpl/opac-tmpl/bootstrap/css/opac-rtl.css'} = 'blib/OPAC_TMPL_DIR/bootstrap/css/opac-rtl.css';
|
||||
|
@ -684,6 +689,7 @@ $file_map->{'koha-tmpl/opac-tmpl/bootstrap/css/print.css'} = 'blib/OPAC_TMPL_DIR
|
|||
$file_map->{'koha-tmpl/opac-tmpl/bootstrap/css/print-rtl.css'} = 'blib/OPAC_TMPL_DIR/bootstrap/css/print-rtl.css';
|
||||
$file_map->{'koha-tmpl/opac-tmpl/bootstrap/css/sco.css'} = 'blib/OPAC_TMPL_DIR/bootstrap/css/sco.css';
|
||||
$file_map->{'koha-tmpl/opac-tmpl/bootstrap/css/sco-rtl.css'} = 'blib/OPAC_TMPL_DIR/bootstrap/css/sco-rtl.css';
|
||||
|
||||
#API_CGI_DIR
|
||||
$file_map->{'api/v1/swagger/swagger_bundle.json'} = 'blib/API_CGI_DIR/v1/swagger/swagger_bundle.json';
|
||||
|
||||
|
@ -724,11 +730,13 @@ if ($config{'INSTALL_MODE'} ne "dev") {
|
|||
);
|
||||
}
|
||||
|
||||
$config{ZEBRA_TOKENIZER_STMT} = $config{ZEBRA_TOKENIZER} eq 'icu'
|
||||
$config{ZEBRA_TOKENIZER_STMT} =
|
||||
$config{ZEBRA_TOKENIZER} eq 'icu'
|
||||
? 'icuchain words-icu.xml'
|
||||
: 'charmap word-phrase-utf.chr';
|
||||
|
||||
$config{ZEBRA_PTOKENIZER_STMT} = $config{ZEBRA_TOKENIZER} eq 'icu'
|
||||
$config{ZEBRA_PTOKENIZER_STMT} =
|
||||
$config{ZEBRA_TOKENIZER} eq 'icu'
|
||||
? 'icuchain phrases-icu.xml'
|
||||
: 'charmap word-phrase-utf.chr';
|
||||
|
||||
|
@ -747,6 +755,7 @@ my %test_suite_override_dirs = (
|
|||
|
||||
WriteMakefile(
|
||||
NAME => 'koha',
|
||||
|
||||
#VERSION => strftime('2.9.%Y%m%d%H',gmtime),
|
||||
VERSION_FROM => 'kohaversion.pl',
|
||||
ABSTRACT => 'Award-winning integrated library system (ILS) and Web OPAC',
|
||||
|
@ -812,10 +821,12 @@ sub get_file_map {
|
|||
# most specific match in the target_map
|
||||
foreach my $dir ( sort keys %{$dirtree} ) {
|
||||
if ( $dir eq '.' ) {
|
||||
|
||||
# deal with files in directory
|
||||
foreach my $file ( sort @{ $dirtree->{$dir} } ) {
|
||||
my $targetdir = undef;
|
||||
my $matchlevel = undef;
|
||||
|
||||
# first, see if there is a match on this specific
|
||||
# file in the target map
|
||||
my $filepath = join( "/", @$curr_path, $file );
|
||||
|
@ -823,6 +834,7 @@ sub get_file_map {
|
|||
$targetdir = $target_map->{$filepath};
|
||||
$matchlevel = scalar(@$curr_path) + 1;
|
||||
} else {
|
||||
|
||||
# no match on the specific file; look for
|
||||
# a directory match
|
||||
for ( my $i = scalar(@$curr_path) - 1 ; $i >= 0 ; $i-- ) {
|
||||
|
@ -842,6 +854,7 @@ sub get_file_map {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
# dealing with subdirectory
|
||||
push @$curr_path, $dir;
|
||||
get_file_map( $target_map, $dirtree->{$dir}, $file_map, $curr_path );
|
||||
|
@ -868,6 +881,7 @@ sub _add_to_file_map {
|
|||
if ( ref $targetdir eq 'HASH' ) {
|
||||
my $subtarget = $targetdir->{target};
|
||||
if ( exists $targetdir->{trimdir} ) {
|
||||
|
||||
# if we get here, we've specified that
|
||||
# rather than installing the file to
|
||||
# $(TARGET)/matching/dirs/subdirs/file,
|
||||
|
@ -884,6 +898,7 @@ sub _add_to_file_map {
|
|||
}
|
||||
_add_to_file_map( $file_map, $subtarget, $curr_path, $file, $matchlevel, \@new_dest_path );
|
||||
} else {
|
||||
|
||||
# actually getting here means that the
|
||||
# target was unnecessarily listed
|
||||
# as a hash, but we'll forgive that
|
||||
|
@ -892,6 +907,7 @@ sub _add_to_file_map {
|
|||
} elsif ( $targetdir ne 'NONE' and $targetdir ne '' ) {
|
||||
my $source = File::Spec->catfile( @$curr_path, $file );
|
||||
my $destination = File::Spec->catfile( 'blib', $targetdir, @$dest_path, $file );
|
||||
|
||||
#print "$source => $destination\n"; # DEBUG
|
||||
# quote spaces in file names
|
||||
# FIXME: this is of questionable portability and
|
||||
|
@ -1016,7 +1032,8 @@ dev: Create a set of symbolic links and configuration files to
|
|||
|
||||
Installation mode);
|
||||
$msg .= _add_valid_values_disp( 'INSTALL_MODE', $valid_values );
|
||||
$config{'INSTALL_MODE'} = _get_value('INSTALL_MODE', $msg, $defaults->{'INSTALL_MODE'}, $valid_values, $install_log_values);
|
||||
$config{'INSTALL_MODE'} =
|
||||
_get_value( 'INSTALL_MODE', $msg, $defaults->{'INSTALL_MODE'}, $valid_values, $install_log_values );
|
||||
|
||||
# set message and default value for INSTALL_BASE
|
||||
# depending on value of INSTALL_MODE
|
||||
|
@ -1029,13 +1046,13 @@ Zebra database. Koha's CGI scripts and templates will
|
|||
be run from the current directory.
|
||||
|
||||
Configuration directory:);
|
||||
|
||||
# FIXME - home directory portability consideration apply
|
||||
$install_base_default =
|
||||
$ENV{DESTDIR}
|
||||
|| ( exists $ENV{HOME} ? "$ENV{HOME}/koha-dev" : "$defaults->{'INSTALL_BASE'}-dev" )
|
||||
;
|
||||
$install_base_default = $ENV{DESTDIR}
|
||||
|| ( exists $ENV{HOME} ? "$ENV{HOME}/koha-dev" : "$defaults->{'INSTALL_BASE'}-dev" );
|
||||
} elsif ( $config{'INSTALL_MODE'} eq 'single' ) {
|
||||
$msg = "\nPlease specify the directory in which to install Koha";
|
||||
|
||||
# FIXME -- we're assuming under a 'single' mode install
|
||||
# that user will likely want to install under the home
|
||||
# directory. This is OK in and of itself, but we should
|
||||
|
@ -1045,6 +1062,7 @@ Configuration directory:);
|
|||
# --we must also keep this portable to the major OS's -fbcit
|
||||
$install_base_default = ( exists $ENV{'HOME'} ) ? "$ENV{'HOME'}/koha" : $defaults->{'INSTALL_BASE'};
|
||||
} else {
|
||||
|
||||
# must be standard
|
||||
$msg = q(
|
||||
Please specify the directory under which most Koha files
|
||||
|
@ -1057,7 +1075,8 @@ as the package name in the FHS layout.
|
|||
|
||||
Base installation directory);
|
||||
}
|
||||
$config{'INSTALL_BASE'} = _get_value('INSTALL_BASE', $msg, $install_base_default, $valid_values, $install_log_values);
|
||||
$config{'INSTALL_BASE'} =
|
||||
_get_value( 'INSTALL_BASE', $msg, $install_base_default, $valid_values, $install_log_values );
|
||||
|
||||
$config{'INSTALL_BASE'} = File::Spec->rel2abs( $config{'INSTALL_BASE'} );
|
||||
print "INSTALL_BASE=$config{'INSTALL_BASE'}\r\n" if $DEBUG;
|
||||
|
@ -1079,7 +1098,8 @@ user should not be the same as the user
|
|||
account Apache runs under.
|
||||
|
||||
User account);
|
||||
$config{'KOHA_USER'} = _get_value('KOHA_USER', $msg, $defaults->{'KOHA_USER'}, $valid_values, $install_log_values);
|
||||
$config{'KOHA_USER'} =
|
||||
_get_value( 'KOHA_USER', $msg, $defaults->{'KOHA_USER'}, $valid_values, $install_log_values );
|
||||
|
||||
$msg = q(
|
||||
Please specify the group that should own
|
||||
|
@ -1088,7 +1108,8 @@ not exist right now, but should be created
|
|||
before you run 'make install'.
|
||||
|
||||
Group);
|
||||
$config{'KOHA_GROUP'} = _get_value('KOHA_GROUP', $msg, $defaults->{'KOHA_GROUP'}, $valid_values, $install_log_values);
|
||||
$config{'KOHA_GROUP'} =
|
||||
_get_value( 'KOHA_GROUP', $msg, $defaults->{'KOHA_GROUP'}, $valid_values, $install_log_values );
|
||||
}
|
||||
|
||||
$msg = q(
|
||||
|
@ -1125,22 +1146,32 @@ used by Koha);
|
|||
$msg = q(
|
||||
Please specify whether the connection to MySQL will use TLS
|
||||
);
|
||||
$config{'DB_USE_TLS'} = _get_value('DB_USE_TLS', $msg, $defaults->{'DB_USE_TLS'}, $valid_values, $install_log_values);
|
||||
$config{'DB_USE_TLS'} =
|
||||
_get_value( 'DB_USE_TLS', $msg, $defaults->{'DB_USE_TLS'}, $valid_values, $install_log_values );
|
||||
}
|
||||
if ( $config{'DB_USE_TLS'} eq 'yes' ) {
|
||||
$msg = q(
|
||||
Please enter the path to the CA certificate for TLS
|
||||
);
|
||||
$config{'DB_TLS_CA_CERTIFICATE'} = _get_value('DB_TLS_CA_CERTIFICATE', $msg, $defaults->{'DB_TLS_CA_CERTIFICATE'}, $valid_values, $install_log_values);
|
||||
$config{'DB_TLS_CA_CERTIFICATE'} = _get_value(
|
||||
'DB_TLS_CA_CERTIFICATE', $msg, $defaults->{'DB_TLS_CA_CERTIFICATE'}, $valid_values,
|
||||
$install_log_values
|
||||
);
|
||||
|
||||
$msg = q(
|
||||
Please enter the path to the client certificate for TLS
|
||||
);
|
||||
$config{'DB_TLS_CLIENT_CERTIFICATE'} = _get_value('DB_TLS_CLIENT_CERTIFICATE', $msg, $defaults->{'DB_TLS_CLIENT_CERTIFICATE'}, $valid_values, $install_log_values);
|
||||
$config{'DB_TLS_CLIENT_CERTIFICATE'} = _get_value(
|
||||
'DB_TLS_CLIENT_CERTIFICATE', $msg, $defaults->{'DB_TLS_CLIENT_CERTIFICATE'}, $valid_values,
|
||||
$install_log_values
|
||||
);
|
||||
$msg = q(
|
||||
Please enter the path to the client key for TLS
|
||||
);
|
||||
$config{'DB_TLS_CLIENT_KEY'} = _get_value('DB_TLS_CLIENT_KEY', $msg, $defaults->{'DB_TLS_CLIENT_KEY'}, $valid_values, $install_log_values);
|
||||
$config{'DB_TLS_CLIENT_KEY'} = _get_value(
|
||||
'DB_TLS_CLIENT_KEY', $msg, $defaults->{'DB_TLS_CLIENT_KEY'}, $valid_values,
|
||||
$install_log_values
|
||||
);
|
||||
}
|
||||
|
||||
$msg = q(
|
||||
|
@ -1182,7 +1213,8 @@ and UNIMARC.
|
|||
|
||||
MARC format for Zebra indexing);
|
||||
$msg .= _add_valid_values_disp( 'ZEBRA_MARC_FORMAT', $valid_values );
|
||||
$config{'ZEBRA_MARC_FORMAT'} = _get_value('ZEBRA_MARC_FORMAT', $msg, $defaults->{'ZEBRA_MARC_FORMAT'}, $valid_values, $install_log_values);
|
||||
$config{'ZEBRA_MARC_FORMAT'} =
|
||||
_get_value( 'ZEBRA_MARC_FORMAT', $msg, $defaults->{'ZEBRA_MARC_FORMAT'}, $valid_values, $install_log_values );
|
||||
$msg = q(
|
||||
Koha supplies Zebra configuration files tuned for
|
||||
searching either English (en) or French (fr) MARC
|
||||
|
@ -1190,7 +1222,8 @@ records.
|
|||
|
||||
Primary language for Zebra indexing);
|
||||
$msg .= _add_valid_values_disp( 'ZEBRA_LANGUAGE', $valid_values );
|
||||
$config{'ZEBRA_LANGUAGE'} = _get_value('ZEBRA_LANGUAGE', $msg, $defaults->{'ZEBRA_LANGUAGE'}, $valid_values, $install_log_values);
|
||||
$config{'ZEBRA_LANGUAGE'} =
|
||||
_get_value( 'ZEBRA_LANGUAGE', $msg, $defaults->{'ZEBRA_LANGUAGE'}, $valid_values, $install_log_values );
|
||||
|
||||
$msg = q(
|
||||
Zebra has two methods to perform records tokenization
|
||||
|
@ -1199,15 +1232,18 @@ recommended for catalogs containing non-Latin
|
|||
characters.);
|
||||
|
||||
$msg .= _add_valid_values_disp( 'ZEBRA_TOKENIZER', $valid_values );
|
||||
$config{'ZEBRA_TOKENIZER'} = _get_value('ZEBRA_TOKENIZER', $msg, $defaults->{'ZEBRA_TOKENIZER'}, $valid_values, $install_log_values);
|
||||
$config{'ZEBRA_TOKENIZER'} =
|
||||
_get_value( 'ZEBRA_TOKENIZER', $msg, $defaults->{'ZEBRA_TOKENIZER'}, $valid_values, $install_log_values );
|
||||
|
||||
$msg = q(
|
||||
Please specify Zebra database user);
|
||||
$config{'ZEBRA_USER'} = _get_value('ZEBRA_USER', $msg, $defaults->{'ZEBRA_USER'}, $valid_values, $install_log_values);
|
||||
$config{'ZEBRA_USER'} =
|
||||
_get_value( 'ZEBRA_USER', $msg, $defaults->{'ZEBRA_USER'}, $valid_values, $install_log_values );
|
||||
|
||||
$msg = q(
|
||||
Please specify the Zebra database password);
|
||||
$config{'ZEBRA_PASS'} = _get_value('ZEBRA_PASS', $msg, $defaults->{'ZEBRA_PASS'}, $valid_values, $install_log_values);
|
||||
$config{'ZEBRA_PASS'} =
|
||||
_get_value( 'ZEBRA_PASS', $msg, $defaults->{'ZEBRA_PASS'}, $valid_values, $install_log_values );
|
||||
|
||||
$msg = q(
|
||||
Since you've chosen to use Zebra, you can enable the SRU/
|
||||
|
@ -1220,7 +1256,8 @@ settings. Those references will be ignored by Koha.
|
|||
|
||||
Install the SRU configuration files?);
|
||||
$msg .= _add_valid_values_disp( 'INSTALL_SRU', $valid_values );
|
||||
$config{'INSTALL_SRU'} = _get_value('INSTALL_SRU', $msg, $defaults->{'INSTALL_SRU'}, $valid_values, $install_log_values);
|
||||
$config{'INSTALL_SRU'} =
|
||||
_get_value( 'INSTALL_SRU', $msg, $defaults->{'INSTALL_SRU'}, $valid_values, $install_log_values );
|
||||
|
||||
if ( $config{'INSTALL_SRU'} eq 'yes' ) {
|
||||
$msg = q(
|
||||
|
@ -1230,15 +1267,22 @@ Servers (bibliographic and authority) should run on.
|
|||
);
|
||||
$msg = q(
|
||||
SRU Database host?);
|
||||
$config{'ZEBRA_SRU_HOST'} = _get_value('ZEBRA_SRU_HOST', $msg, $defaults->{'ZEBRA_SRU_HOST'}, $valid_values, $install_log_values);
|
||||
$config{'ZEBRA_SRU_HOST'} =
|
||||
_get_value( 'ZEBRA_SRU_HOST', $msg, $defaults->{'ZEBRA_SRU_HOST'}, $valid_values, $install_log_values );
|
||||
|
||||
$msg = q(
|
||||
SRU port for bibliographic data?);
|
||||
$config{'ZEBRA_SRU_BIBLIOS_PORT'} = _get_value('ZEBRA_SRU_BIBLIOS_PORT', $msg, $defaults->{'ZEBRA_SRU_BIBLIOS_PORT'}, $valid_values, $install_log_values);
|
||||
$config{'ZEBRA_SRU_BIBLIOS_PORT'} = _get_value(
|
||||
'ZEBRA_SRU_BIBLIOS_PORT', $msg, $defaults->{'ZEBRA_SRU_BIBLIOS_PORT'}, $valid_values,
|
||||
$install_log_values
|
||||
);
|
||||
|
||||
$msg = q(
|
||||
SRU port for authority data?);
|
||||
$config{'ZEBRA_SRU_AUTHORITIES_PORT'} = _get_value('ZEBRA_SRU_AUTHORITIES_PORT', $msg, $defaults->{'ZEBRA_SRU_AUTHORITIES_PORT'}, $valid_values, $install_log_values);
|
||||
$config{'ZEBRA_SRU_AUTHORITIES_PORT'} = _get_value(
|
||||
'ZEBRA_SRU_AUTHORITIES_PORT', $msg, $defaults->{'ZEBRA_SRU_AUTHORITIES_PORT'}, $valid_values,
|
||||
$install_log_values
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1247,26 +1291,33 @@ Use memcached to cache the results of some function calls?
|
|||
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);
|
||||
$config{'USE_MEMCACHED'} =
|
||||
_get_value( 'USE_MEMCACHED', $msg, $defaults->{'USE_MEMCACHED'}, $valid_values, $install_log_values );
|
||||
if ( $config{'USE_MEMCACHED'} eq 'yes' ) {
|
||||
$msg = q(
|
||||
Since you've chosen to use caching, you must specify the memcached servers and the namespace to use:
|
||||
);
|
||||
$msg = q(
|
||||
Memcached server address?);
|
||||
$config{'MEMCACHED_SERVERS'} = _get_value('MEMCACHED_SERVERS', $msg, $defaults->{'MEMCACHED_SERVERS'}, $valid_values, $install_log_values);
|
||||
$config{'MEMCACHED_SERVERS'} = _get_value(
|
||||
'MEMCACHED_SERVERS', $msg, $defaults->{'MEMCACHED_SERVERS'}, $valid_values,
|
||||
$install_log_values
|
||||
);
|
||||
|
||||
$msg = q(
|
||||
Memcached namespace?);
|
||||
$config{'MEMCACHED_NAMESPACE'} = _get_value('MEMCACHED_NAMESPACE', $msg, $defaults->{'MEMCACHED_NAMESPACE'}, $valid_values, $install_log_values);
|
||||
$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);
|
||||
$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
|
||||
|
@ -1274,19 +1325,26 @@ 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);
|
||||
$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);
|
||||
$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);
|
||||
$config{'TEMPLATE_CACHE_DIR'} =
|
||||
_get_value( 'TEMPLATE_CACHE_DIR', $msg, $defaults->{'TEMPLATE_CACHE_DIR'}, $valid_values, $install_log_values );
|
||||
|
||||
$msg = q(
|
||||
Path to DejaVu fonts?);
|
||||
|
@ -1297,40 +1355,48 @@ SMTP settings
|
|||
You will be able to set your default SMTP configuration.);
|
||||
$msg .= q{
|
||||
SMTP host name?};
|
||||
$config{'SMTP_HOST'} = _get_value('SMTP_HOST', $msg, $defaults->{'SMTP_HOST'}, $valid_values, $install_log_values);
|
||||
$config{'SMTP_HOST'} =
|
||||
_get_value( 'SMTP_HOST', $msg, $defaults->{'SMTP_HOST'}, $valid_values, $install_log_values );
|
||||
|
||||
$msg = q{
|
||||
SMTP port?};
|
||||
$config{'SMTP_PORT'} = _get_value('SMTP_PORT', $msg, $defaults->{'SMTP_PORT'}, $valid_values, $install_log_values);
|
||||
$config{'SMTP_PORT'} =
|
||||
_get_value( 'SMTP_PORT', $msg, $defaults->{'SMTP_PORT'}, $valid_values, $install_log_values );
|
||||
|
||||
$msg = q{
|
||||
SMTP timeout (in seconds)?};
|
||||
$config{'SMTP_TIMEOUT'} = _get_value('SMTP_TIMEOUT', $msg, $defaults->{'SMTP_TIMEOUT'}, $valid_values, $install_log_values);
|
||||
$config{'SMTP_TIMEOUT'} =
|
||||
_get_value( 'SMTP_TIMEOUT', $msg, $defaults->{'SMTP_TIMEOUT'}, $valid_values, $install_log_values );
|
||||
|
||||
$msg = q{
|
||||
SMTP SSL mode?};
|
||||
$msg .= _add_valid_values_disp( 'SMTP_SSL_MODE', $valid_values );
|
||||
$config{'SMTP_SSL_MODE'} = _get_value('SMTP_SSL_MODE', $msg, $defaults->{'SMTP_SSL_MODE'}, $valid_values, $install_log_values);
|
||||
$config{'SMTP_SSL_MODE'} =
|
||||
_get_value( 'SMTP_SSL_MODE', $msg, $defaults->{'SMTP_SSL_MODE'}, $valid_values, $install_log_values );
|
||||
|
||||
$msg = q{
|
||||
SMTP user name?};
|
||||
$config{'SMTP_USER_NAME'} = _get_value('SMTP_USER_NAME', $msg, $defaults->{'SMTP_USER_NAME'}, $valid_values, $install_log_values);
|
||||
$config{'SMTP_USER_NAME'} =
|
||||
_get_value( 'SMTP_USER_NAME', $msg, $defaults->{'SMTP_USER_NAME'}, $valid_values, $install_log_values );
|
||||
|
||||
$msg = q{
|
||||
SMTP password?};
|
||||
$config{'SMTP_PASSWORD'} = _get_value('SMTP_PASSWORD', $msg, $defaults->{'SMTP_PASSWORD'}, $valid_values, $install_log_values);
|
||||
$config{'SMTP_PASSWORD'} =
|
||||
_get_value( 'SMTP_PASSWORD', $msg, $defaults->{'SMTP_PASSWORD'}, $valid_values, $install_log_values );
|
||||
|
||||
$msg = q{
|
||||
SMTP debug mode?};
|
||||
$msg .= _add_valid_values_disp( 'SMTP_DEBUG', $valid_values );
|
||||
$config{'SMTP_DEBUG'} = _get_value('SMTP_DEBUG', $msg, $defaults->{'SMTP_DEBUG'}, $valid_values, $install_log_values);
|
||||
$config{'SMTP_DEBUG'} =
|
||||
_get_value( 'SMTP_DEBUG', $msg, $defaults->{'SMTP_DEBUG'}, $valid_values, $install_log_values );
|
||||
|
||||
$config{'SMTP_DEBUG'} = ( $config{'SMTP_DEBUG'} eq 'yes' ) ? 1 : 0;
|
||||
|
||||
$msg = q(
|
||||
Would you like to run the database-dependent test suite?);
|
||||
$msg .= _add_valid_values_disp( 'RUN_DATABASE_TESTS', $valid_values );
|
||||
$config{'RUN_DATABASE_TESTS'} = _get_value( 'RUN_DATABASE_TESTS', $msg, $defaults->{'RUN_DATABASE_TESTS'}, $valid_values, $install_log_values );
|
||||
$config{'RUN_DATABASE_TESTS'} =
|
||||
_get_value( 'RUN_DATABASE_TESTS', $msg, $defaults->{'RUN_DATABASE_TESTS'}, $valid_values, $install_log_values );
|
||||
|
||||
if ( $config{'RUN_DATABASE_TESTS'} eq 'yes' ) {
|
||||
$config{'TEST_DB_TYPE'} = $config{'DB_TYPE'};
|
||||
|
@ -1348,21 +1414,26 @@ doing it in a database that you don't want to lose.
|
|||
Please specify the name of the test database to be
|
||||
used by Koha);
|
||||
|
||||
$config{'TEST_DB_NAME'} = _get_value('TEST_DB_NAME', $msg, $defaults->{'TEST_DB_NAME'}, $valid_values, $install_log_values);
|
||||
$config{'TEST_DB_NAME'} =
|
||||
_get_value( 'TEST_DB_NAME', $msg, $defaults->{'TEST_DB_NAME'}, $valid_values, $install_log_values );
|
||||
while ( $config{'TEST_DB_NAME'} eq $config{'DB_NAME'} ) {
|
||||
$msg = q(Please do not use the same database for testing as you do for production. You run the severe risk of data loss.);
|
||||
$config{'TEST_DB_NAME'} = _get_value('TEST_DB_NAME', $msg, $defaults->{'TEST_DB_NAME'}, $valid_values, $install_log_values);
|
||||
$msg =
|
||||
q(Please do not use the same database for testing as you do for production. You run the severe risk of data loss.);
|
||||
$config{'TEST_DB_NAME'} =
|
||||
_get_value( 'TEST_DB_NAME', $msg, $defaults->{'TEST_DB_NAME'}, $valid_values, $install_log_values );
|
||||
}
|
||||
|
||||
$msg = q(
|
||||
Please specify the user that owns the database to be
|
||||
used by Koha);
|
||||
$config{'TEST_DB_USER'} = _get_value('TEST_DB_USER', $msg, $defaults->{'TEST_DB_USER'}, $valid_values, $install_log_values);
|
||||
$config{'TEST_DB_USER'} =
|
||||
_get_value( 'TEST_DB_USER', $msg, $defaults->{'TEST_DB_USER'}, $valid_values, $install_log_values );
|
||||
|
||||
$msg = q(
|
||||
Please specify the password of the user that owns the
|
||||
database to be used by Koha);
|
||||
$config{'TEST_DB_PASS'} = _get_value('TEST_DB_PASS', $msg, $defaults->{'TEST_DB_PASS'}, $valid_values, $install_log_values);
|
||||
$config{'TEST_DB_PASS'} =
|
||||
_get_value( 'TEST_DB_PASS', $msg, $defaults->{'TEST_DB_PASS'}, $valid_values, $install_log_values );
|
||||
}
|
||||
|
||||
print "\n\n";
|
||||
|
@ -1410,9 +1481,10 @@ sub _get_value {
|
|||
|
||||
my $val = prompt( $msg, $default );
|
||||
|
||||
while (exists $valid_values->{$key} and
|
||||
$val ne $default and
|
||||
not exists $valid_values->{$key}->{$val}) {
|
||||
while ( exists $valid_values->{$key}
|
||||
and $val ne $default
|
||||
and not exists $valid_values->{$key}->{$val} )
|
||||
{
|
||||
my $retry_msg = "Value '$val' is not a valid option.\n";
|
||||
$retry_msg .= "Please enter a value";
|
||||
$retry_msg .= _add_valid_values_disp( $key, $valid_values );
|
||||
|
@ -1445,11 +1517,13 @@ sub get_target_directories {
|
|||
|
||||
my @basedir = File::Spec->splitdir($directories);
|
||||
|
||||
if ( $^O eq 'cygwin' ) { shift @basedir; unshift @basedir, 'c:'; } # in a cygwin environment, $volume is returned empty
|
||||
if ( $^O eq 'cygwin' ) {
|
||||
shift @basedir;
|
||||
unshift @basedir, 'c:';
|
||||
} # in a cygwin environment, $volume is returned empty
|
||||
|
||||
my $package = pop @basedir;
|
||||
|
||||
|
||||
my %dirmap = ();
|
||||
my %skipdirs = ();
|
||||
if ( $mode eq 'single' ) {
|
||||
|
@ -1493,6 +1567,7 @@ sub get_target_directories {
|
|||
$skipdirs{'OPAC_TMPL_DIR'} = 1;
|
||||
$dirmap{'OPAC_WWW_DIR'} = File::Spec->catdir( $curdir, 'koha-tmpl' );
|
||||
$skipdirs{'OPAC_WWW_DIR'} = 1;
|
||||
|
||||
#NOTE: We're hacking the dirmap here, so that PERL_MODULE_DIR tokens get rewritten correctly for git installs
|
||||
$dirmap{'PERL_MODULE_DIR'} = File::Spec->catdir($curdir);
|
||||
$skipdirs{'PERL_MODULE_DIR'} = 1;
|
||||
|
@ -1503,6 +1578,7 @@ sub get_target_directories {
|
|||
$dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir( @basedir, $package, 'etc', 'z3950' );
|
||||
$dirmap{'MISC_DIR'} = File::Spec->catdir( @basedir, $package, 'misc' );
|
||||
$dirmap{'SCRIPT_DIR'} = File::Spec->catdir( @basedir, $package, 'bin' );
|
||||
|
||||
#For dev install, point NONDEV_DIR to misc in current dir (not base)
|
||||
#Used by supportdir in koha-conf.xml (BZ 12031)
|
||||
$dirmap{'SCRIPT_NONDEV_DIR'} = File::Spec->catdir( $curdir, 'misc' );
|
||||
|
@ -1517,6 +1593,7 @@ sub get_target_directories {
|
|||
$dirmap{'ZEBRA_DATA_DIR'} = File::Spec->catdir( @basedir, $package, 'var', 'lib', 'zebradb' );
|
||||
$dirmap{'ZEBRA_RUN_DIR'} = File::Spec->catdir( @basedir, $package, 'var', 'run', 'zebradb' );
|
||||
} else {
|
||||
|
||||
# mode is standard, i.e., 'fhs'
|
||||
$dirmap{'API_CGI_DIR'} = File::Spec->catdir( @basedir, $package, 'api' );
|
||||
$dirmap{'INTRANET_CGI_DIR'} = File::Spec->catdir( @basedir, $package, 'intranet', 'cgi-bin' );
|
||||
|
@ -1653,6 +1730,7 @@ sub find_zebra {
|
|||
push @search_dirs, qw(/usr/local/bin /opt/local/bin /usr/bin);
|
||||
my @zebrasrv_dirs = grep { -x File::Spec->catpath( '', $_, 'zebrasrv' ) } @search_dirs;
|
||||
return unless @zebrasrv_dirs;
|
||||
|
||||
# verify that directory that contains zebrasrv also contains zebraidx
|
||||
foreach my $dir (@zebrasrv_dirs) {
|
||||
return $dir if -x File::Spec->catpath( '', $dir, 'zebraidx' );
|
||||
|
@ -1675,6 +1753,7 @@ sub test {
|
|||
sub install {
|
||||
my $self = shift;
|
||||
my $install = "";
|
||||
|
||||
# NOTE: we're *not* doing this: my $install = $self->SUPER::install(@_);
|
||||
# This means that we're completely overriding EU::MM's default
|
||||
# installation and uninstallation targets.
|
||||
|
@ -1682,7 +1761,8 @@ sub install {
|
|||
my $perl5lib_dirs = _build_perl5lib_string( { target_dirs => $target_directories } );
|
||||
|
||||
# If installation is on Win32, we need to do permissions different from *nix
|
||||
if ( $^O =~ /darwin|linux|cygwin|freebsd|solaris/ ) { # this value needs to be verified for each platform and modified accordingly
|
||||
if ( $^O =~ /darwin|linux|cygwin|freebsd|solaris/ )
|
||||
{ # this value needs to be verified for each platform and modified accordingly
|
||||
foreach my $key ( sort keys %$target_directories ) {
|
||||
$install .= qq(
|
||||
KOHA_INST_$key = blib/$key
|
||||
|
@ -1704,10 +1784,12 @@ install :: all install_koha set_koha_ownership set_koha_permissions warn_koha_en
|
|||
|
||||
$install .= "\n";
|
||||
$install .= "set_koha_ownership ::\n";
|
||||
|
||||
# Do not try to change ownership if DESTDIR is set
|
||||
if ( $config{'INSTALL_MODE'} eq 'standard' and $config{'KOHA_USER'} ne "root" ) {
|
||||
foreach my $key ( sort keys %$target_directories ) {
|
||||
$install .= "\t\$(NOECHO) if test -z \"\$(DESTDIR)\"; then chown -R $config{'KOHA_USER'}:$config{'KOHA_GROUP'} \$(KOHA_DEST_$key); fi\n"
|
||||
$install .=
|
||||
"\t\$(NOECHO) if test -z \"\$(DESTDIR)\"; then chown -R $config{'KOHA_USER'}:$config{'KOHA_GROUP'} \$(KOHA_DEST_$key); fi\n"
|
||||
unless exists $skip_directories->{$key};
|
||||
}
|
||||
} else {
|
||||
|
@ -1716,6 +1798,7 @@ install :: all install_koha set_koha_ownership set_koha_permissions warn_koha_en
|
|||
|
||||
$install .= "\n";
|
||||
$install .= "set_koha_permissions ::\n";
|
||||
|
||||
# This is necessary because EU::MM installs files
|
||||
# as either 0444 or 0555, and we want the owner
|
||||
# of Koha's files to have write permission by default.
|
||||
|
@ -1785,17 +1868,22 @@ upgrade :: make_upgrade_backup install
|
|||
make_upgrade_backup ::
|
||||
\t\$(NOECHO) umask 022; \$(MOD_BACKUP) \\
|
||||
/;
|
||||
foreach my $key (qw/KOHA_CONF_DIR INTRANET_TMPL_DIR INTRANET_WWW_DIR OPAC_TMPL_DIR OPAC_WWW_DIR
|
||||
ZEBRA_CONF_DIR PLUGINS_DIR/) {
|
||||
foreach my $key (
|
||||
qw/KOHA_CONF_DIR INTRANET_TMPL_DIR INTRANET_WWW_DIR OPAC_TMPL_DIR OPAC_WWW_DIR
|
||||
ZEBRA_CONF_DIR PLUGINS_DIR/
|
||||
)
|
||||
{
|
||||
$upgrade .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n"
|
||||
unless exists $skip_directories->{$key} or
|
||||
not exists $target_directories->{$key};
|
||||
unless exists $skip_directories->{$key}
|
||||
or not exists $target_directories->{$key};
|
||||
}
|
||||
$upgrade =~ s/\\\n$/\n/;
|
||||
|
||||
return $upgrade;
|
||||
}
|
||||
|
||||
sub postamble {
|
||||
|
||||
# put directory mappings into Makefile
|
||||
# so that Make will export as environment
|
||||
# variables -- this is for the use of
|
||||
|
@ -1806,7 +1894,7 @@ sub postamble {
|
|||
#NOTE: Build __PERL5LIB_DIRS__ for rewrite-config.PL
|
||||
my $perl5lib_dirs = _build_perl5lib_string( { target_dirs => $target_directories } );
|
||||
if ($perl5lib_dirs) {
|
||||
$env .= "export __PERL5LIB_DIRS__ := $perl5lib_dirs\n"
|
||||
$env .= "export __PERL5LIB_DIRS__ := $perl5lib_dirs\n";
|
||||
}
|
||||
|
||||
# Hereagain, we must alter syntax per platform...
|
||||
|
|
|
@ -64,6 +64,7 @@ sub fixshebang{
|
|||
opendir my $dh, $dir or die $!;
|
||||
warn "Reading $dir contents.\n" if $DEBUG;
|
||||
while ( my $file = readdir($dh) ) {
|
||||
|
||||
# this may be used to exclude any desired files from the scan
|
||||
# if ( $file =~ /foo/ ) { next; }
|
||||
# handle files... other extensions could be substituted/added if needed
|
||||
|
@ -93,16 +94,15 @@ sub fixshebang{
|
|||
warn "\tOriginal shebang line: $filearray[0]\n" if $DEBUG;
|
||||
$filearray[0] =~ /-w$/ ? $filearray[0] = "$shebang -w" : $filearray[0] = $shebang;
|
||||
warn "\tNew shebang line is: $filearray[0]\n\n" if $DEBUG;
|
||||
}
|
||||
elsif ( $filearray[0] =~ /$shebang|"$shebang -w"/ ) {
|
||||
} elsif ( $filearray[0] =~ /$shebang|"$shebang -w"/ ) {
|
||||
warn "\n\tShebang line is correct.\n\n" if $DEBUG;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
warn "\n\tNo shebang line found in $pathfile\n\n" if $DEBUG;
|
||||
}
|
||||
untie @filearray;
|
||||
chmod $old_perm, $pathfile;
|
||||
}
|
||||
|
||||
# handle directories
|
||||
elsif ( -d ( $dir . '/' . $file ) && $file !~ /^\.{1,2}/ ) {
|
||||
my $dirpath = $dir . '/' . $file;
|
||||
|
|
|
@ -77,7 +77,6 @@ unless ( $myip = $ENV{WEBSERVER_IP} ) {
|
|||
or die "can't inet_ntoa ($!)";
|
||||
}
|
||||
|
||||
|
||||
my $prefix = $ENV{'INSTALL_BASE'} || "/usr";
|
||||
|
||||
# These are our configuration guesses
|
||||
|
@ -118,7 +117,8 @@ my %configuration = (
|
|||
'__OPAC_CGI_DIR__' => "$prefix/opac/cgi-bin",
|
||||
'__OPAC_TMPL_DIR__' => "$prefix/opac/templates",
|
||||
'__OPAC_WWW_DIR__' => "$prefix/opac/www",
|
||||
'__PERL_MODULE_DIR__' => ($ENV{'INSTALLSITELIB'} || sprintf($prefix."/lib/perl5/site_perl/%vd",$^V))."/koha",
|
||||
'__PERL_MODULE_DIR__' => ( $ENV{'INSTALLSITELIB'} || sprintf( $prefix . "/lib/perl5/site_perl/%vd", $^V ) )
|
||||
. "/koha",
|
||||
'__KOHA_CONF_DIR__' => "$prefix/etc/koha",
|
||||
'__ZEBRA_CONF_DIR__' => "$prefix/etc/koha/zebradb",
|
||||
'__MISC_DIR__' => "$prefix/misc",
|
||||
|
|
Loading…
Reference in a new issue