fixing a bug where the query cgi was loaded twice for re-sort forms
[koha_gimpoz] / Makefile.PL
index 98b000b..bf08ff4 100644 (file)
@@ -370,6 +370,7 @@ my %config_defaults = (
   'DB_PASS'           => 'katikoan',
   'INSTALL_ZEBRA'     => 'yes',
   'INSTALL_SRU'       => 'yes',
+  'AUTH_INDEX_MODE'   => 'grs1',
   'ZEBRA_MARC_FORMAT' => 'marc21',
   'ZEBRA_LANGUAGE'    => 'en',
   'ZEBRA_USER'        => 'kohauser',
@@ -411,6 +412,7 @@ my %valid_config_values = (
   'DB_TYPE' => { 'mysql' => 1, 'Pg' => 1 },
   'INSTALL_ZEBRA' => { 'yes' => 1, 'no' => 1 },
   'INSTALL_SRU' => { 'yes' => 1, 'no' => 1 },
+  'AUTH_INDEX_MODE' => { 'grs1' => 1, 'dom' => 1 },
   'ZEBRA_MARC_FORMAT' => { 'marc21' => 1, 'unimarc' => 1 }, # FIXME should generate from contents of distributation
   'ZEBRA_LANGUAGE'    => { 'en' => 1, 'fr' => 1 }, # FIXME should generate from contents of distribution
 );
@@ -436,8 +438,11 @@ if ($config{'INSTALL_ZEBRA'} eq "yes") {
         'blib/ZEBRA_CONF_DIR/etc/passwd',
         'blib/ZEBRA_CONF_DIR/zebra-biblios.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/explain-biblios.xml',
+        'blib/ZEBRA_CONF_DIR/retrieval-info-auth-grs1.xml',
+        'blib/ZEBRA_CONF_DIR/retrieval-info-auth-dom.xml',
     );
     if ($config{'INSTALL_MODE'} ne 'dev') {
         push @{ $pl_files->{'rewrite-config.PL'} }, (
@@ -445,6 +450,9 @@ if ($config{'INSTALL_ZEBRA'} eq "yes") {
             'blib/SCRIPT_DIR/koha-zebraqueue-ctl.sh',
         );
     }
+    $config{'ZEBRA_AUTH_CFG'} = $config{'AUTH_INDEX_MODE'} eq 'dom' ? 'zebra-authorities-dom.cfg' : 'zebra-authorities.cfg';
+    $config{'AUTH_RETRIEVAL_CFG'} = 
+        $config{'AUTH_INDEX_MODE'} eq 'dom' ? 'retrieval-info-auth-dom.xml' : 'retrieval-info-auth-grs1.xml';
 }
 
 if ($config{'INSTALL_MODE'} ne "dev") {
@@ -516,6 +524,7 @@ WriteMakefile(
 'Test::More' => 0.62,
 'Text::CSV' => 0.01,
 'Text::CSV_XS' => 0.32,
+'Text::Iconv' => 1.7,
 'Text::Wrap' => 2005.082401,
 'Time::HiRes' => 1.86,
 'Time::localtime' => 1.02,
@@ -682,7 +691,7 @@ sub _add_to_file_map {
     }
 }
 
-=head2 get_configuration_options
+=head2 get_configuration
 
 This prompts the user for various configuration options.
 
@@ -863,7 +872,20 @@ 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);
-
+   
+        $msg = q(
+Koha can use one of  two different indexing modes 
+for the MARC authorities records:
+
+grs1 - uses the Zebra GRS-1 filter, available 
+       for legacy support
+dom  - uses the DOM XML filter; offers improved
+       functionality.
+
+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);
+       
         $msg = q(
 Please specify Zebra database user);
         $config{'ZEBRA_USER'} = _get_value('ZEBRA_USER', $msg, $defaults->{'ZEBRA_USER'}, $valid_values);
@@ -1108,6 +1130,9 @@ sub test {
     my $self = shift;
     my $test = $self->SUPER::test(@_);
     $test =~ s!\$\(INST_LIB\)!blib/PERL_MODULE_DIR!g;
+
+    # set KOHA_CONF 
+    $test =~ s!\$\(FULLPERLRUN\)!KOHA_CONF=blib/KOHA_CONF_DIR/koha-conf.xml \$(FULLPERLRUN)!g;
     return $test;
 }
 
@@ -1119,7 +1144,7 @@ sub install {
     # installation and uninstallation targets.
 
 # If installation is on Win32, we need to do permissions different from *nix
-    if ( $^O =~ /darwin|linux|cygwin/ ) { # this value needs to be verified for each platform and modified accordingly
+    if ( $^O =~ /darwin|linux|cygwin|freebsd/ ) { # 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
@@ -1198,9 +1223,29 @@ install :: all install_koha warn_koha_env_vars
     $install .= "\t\$(NOECHO) \$(ECHO) For other post-installation tasks, please consult the README.\n";
     $install .= "\t\$(NOECHO) \$(ECHO)\n";
 
+    if ($config{'INSTALL_ZEBRA'} eq "yes") {
+        $install .= _update_zebra_conf_target();
+    }
+
     return $install;
 }
 
+=head 2 _update_zebra_conf_target
+
+Add an installation target for updating
+Zebra's configuration files.
+
+=cut
+
+sub _update_zebra_conf_target {
+
+    my $target = "\nupdate_zebra_conf ::\n";
+    $target   .= "\tumask 022; \$(MOD_INSTALL) \\\n";
+    $target .= "\t\t\$(KOHA_INST_ZEBRA_CONF_DIR) \$(KOHA_DEST_ZEBRA_CONF_DIR) \n";
+
+    return $target;
+}
+
 sub postamble {
     # put directory mappings into Makefile
     # so that Make will export as environment