<arg choice="req"><option>--create-db</option>|<option>--request-db</option>|<option>--populate-db</option>|<option>--use-db</option></arg>
<arg><option>--marcflavor</option> marc21|normarc|unimarc</arg>
<arg><option>--zebralang</option> en|es|fr|nb|ru|uk</arg>
+ <arg><option>--auth-idx</option> dom|grs1</arg>
+ <arg><option>--biblio-idx</option> dom|grs1</arg>
<arg><option>--defaultsql</option> /path/to/some.sql</arg>
<arg><option>--configfile</option> /path/to/config</arg>
<arg><option>--passwdfile</option> /path/to/passwd</arg>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--auth-idx</option></term>
+ <listitem>
+ <para>Specified the desired indexing mode for authority records. Valid options are <option>dom</option> (default) and <option>grs1</option>.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>--biblio-idx</option></term>
+ <listitem>
+ <para>Specified the desired indexing mode for bibliographic records. Valid options are <option>dom</option> (default) and <option>grs1</option>.</para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</refsect1>
-#!/bin/sh
+#!/bin/bash
#
# koha-create -- Create a new Koha instance.
# Copyright 2010 Catalyst IT, Ltd
usage="Usage: $0 [--create-db|--request-db|--populate-db|--use-db] \
[--marcflavor marc21|normarc|unimarc] \
[--zebralang en|es|fr|nb|ru|uk] \
+ [--auth-idx dom|grs1] [--biblio-idx dom|grs1] \
[--defaultsql /path/to/some.sql] \
[--configfile /path/to/config] [--passwdfile /path/to/passwd] \
[--database database] [--adminuser n] instancename"
-e "s/__ZEBRA_PASS__/$zebrapwd/g" \
-e "s/__ZEBRA_MARC_FORMAT__/$ZEBRA_MARC_FORMAT/g" \
-e "s/__ZEBRA_LANGUAGE__/$ZEBRA_LANGUAGE/g" \
+ -e "s/__BIBLIOS_INDEXING_MODE__/$BIBLIOS_INDEXING_MODE/g" \
+ -e "s/__AUTHORITIES_INDEXING_MODE__/$AUTHORITIES_INDEXING_MODE/g" \
+ -e "s/__ZEBRA_BIBLIOS_CFG__/$ZEBRA_BIBLIOS_CFG/g" \
+ -e "s/__ZEBRA_AUTHORITIES_CFG__/$ZEBRA_AUTHORITIES_CFG/g" \
+ -e "s/__START_BIBLIOS_RETRIEVAL_INFO__/`echo $START_BIBLIOS_RETRIEVAL_INFO`/g" \
+ -e "s/__END_BIBLIOS_RETRIEVAL_INFO__/`echo $END_BIBLIOS_RETRIEVAL_INFO`/g" \
+ -e "s/__START_AUTHORITIES_RETRIEVAL_INFO__/`echo $START_AUTHORITIES_RETRIEVAL_INFO`/g" \
+ -e "s/__END_AUTHORITIES_RETRIEVAL_INFO__/`echo $END_AUTHORITIES_RETRIEVAL_INFO`/g" \
-e "s/__DB_NAME__/$mysqldb/g" \
-e "s/__DB_HOST__/$mysqlhost/g" \
-e "s/__DB_USER__/$mysqluser/g" \
-e "s/__UNIXGROUP__/$username/g" \
-e "s/__PLUGINS_DIR__/\/var\/lib\/koha\/$name\/plugins/g" \
"/etc/koha/$1" > "$2"
+
}
getmysqlhost() {
xmlstarlet sel -t -v 'yazgfs/config/database' "/etc/koha/sites/$1/koha-conf.xml"
}
+set_biblios_indexing_mode()
+{
+ local indexing_mode=$1
+ local marc_format=$2
+
+ case $indexing_mode in
+ "dom")
+ START_BIBLIOS_RETRIEVAL_INFO=`cat <<EOF
+ <xi:include href="\/etc\/koha\/$marc_format-retrieval-info-bib-dom.xml"\n
+ xmlns:xi="http:\/\/www.w3.org\/2001\/XInclude">\n
+ <xi:fallback>\n
+ <retrievalinfo>
+EOF`
+
+ END_BIBLIOS_RETRIEVAL_INFO=`cat <<EOF
+ <\/retrievalinfo>\n
+ <\/xi:fallback>\n
+ <\/xi:include>
+EOF`
+ BIBLIOS_INDEXING_MODE="dom"
+ ZEBRA_BIBLIOS_CFG="zebra-biblios-dom.cfg"
+ ;;
+ "grs1")
+ START_BIBLIOS_RETRIEVAL_INFO=" <retrievalinfo>"
+ END_BIBLIOS_RETRIEVAL_INFO=" <\/retrievalinfo>"
+ BIBLIOS_INDEXING_MODE="grs1"
+ ZEBRA_BIBLIOS_CFG="zebra-biblios.cfg"
+ ;;
+ *)
+ die "Error: '$indexing_mode' is not a valid indexing mode for bibliographic records."
+ ;;
+ esac
+}
+
+
+set_authorities_indexing_mode()
+{
+ local indexing_mode=$1
+ local marc_format=$2
+
+ case $indexing_mode in
+ "dom")
+ START_AUTHORITIES_RETRIEVAL_INFO=`cat <<EOF
+ <xi:include href="\/etc\/koha\/$marc_format-retrieval-info-auth-dom.xml"\n
+ xmlns:xi="http:\/\/www.w3.org\/2001\/XInclude">\n
+ <xi:fallback>\n
+ <retrievalinfo>
+EOF`
+
+ END_AUTHORITIES_RETRIEVAL_INFO=`cat <<EOF
+ <\/retrievalinfo>\n
+ <\/xi:fallback>\n
+ <\/xi:include>\n
+EOF`
+ AUTHORITIES_INDEXING_MODE="dom"
+ ZEBRA_AUTHORITIES_CFG="zebra-authorities-dom.cfg"
+ ;;
+ "grs1")
+ START_AUTHORITIES_RETRIEVAL_INFO=" <retrievalinfo>"
+ END_AUTHORITIES_RETRIEVAL_INFO=" <\/retrievalinfo>"
+ AUTHORITIES_INDEXING_MODE="grs1"
+ ZEBRA_AUTHORITIES_CFG="zebra-authorities.cfg"
+ ;;
+ *)
+ die "Error: '$indexing_mode' is not a valid indexing mode for authority records."
+ ;;
+ esac
+}
+
# Set defaults and read config file, if it exists.
DOMAIN=""
OPACPORT="80"
ZEBRA_LANGUAGE="en"
ADMINUSER="1"
PASSWDFILE="/etc/koha/passwd"
+
+# Indexing mode variables (default is DOM)
+BIBLIOS_INDEXING_MODE="dom"
+AUTHORITIES_INDEXING_MODE="dom"
+
+START_BIBLIOS_RETRIEVAL_INFO=""
+END_BIBLIOS_RETRIEVAL_INFO=""
+START_AUTHORITIES_RETRIEVAL_INFO=""
+END_AUTHORITIES_RETRIEVAL_INFO=""
+
if [ -e /etc/koha/koha-sites.conf ]
then
. /etc/koha/koha-sites.conf
[ $# -ge 2 ] && [ $# -le 16 ] || die $usage
-TEMP=`getopt -o crpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,marcflavor:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser: \
+TEMP=`getopt -o crpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser: \
-n "$0" -- "$@"`
# Note the quotes around `$TEMP': they are essential!
CLO_ZEBRA_LANGUAGE=""
CLO_DEFAULTSQL=""
CLO_ADMINUSER=""
+CLO_BIBLIOS_INDEXING_MODE=""
+CLO_AUTHORITIES_INDEXING_MODE=""
+
while true ; do
case "$1" in
-u|--use-db) op=use ; shift ;;
-m|--marcflavor) CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;;
-l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
+ --auth-idx) CLO_AUTHORITIES_INDEXING_MODE="$2" ; shift 2 ;;
+ --biblio-idx) CLO_BIBLIOS_INDEXING_MODE="$2" ; shift 2 ;;
-d|--defaultsql) CLO_DEFAULTSQL="$2" ; shift 2 ;;
-f|--configfile) configfile="$2" ; shift 2 ;;
-s|--passwdfile) CLO_PASSWDFILE="$2" ; shift 2 ;;
PASSWDFILE="$CLO_PASSWDFILE"
fi
+if [ "$CLO_BIBLIOS_INDEXING_MODE" != "" ]; then
+ BIBLIOS_INDEXING_MODE=$CLO_BIBLIOS_INDEXING_MODE
+fi
+
+set_biblios_indexing_mode $BIBLIOS_INDEXING_MODE $ZEBRA_MARC_FORMAT
+
+
+if [ "$CLO_AUTHORITIES_INDEXING_MODE" != "" ]; then
+ AUTHORITIES_INDEXING_MODE=$CLO_AUTHORITIES_INDEXING_MODE
+fi
+
+set_authorities_indexing_mode $AUTHORITIES_INDEXING_MODE $ZEBRA_MARC_FORMAT
+
name="$1"
opacdomain="$OPACPREFIX$name$OPACSUFFIX$DOMAIN"
# Generate and install Zebra config files.
generate_config_file zebra-biblios-site.cfg.in \
"/etc/koha/sites/$name/zebra-biblios.cfg"
+ generate_config_file zebra-biblios-dom-site.cfg.in \
+ "/etc/koha/sites/$name/zebra-biblios-dom.cfg"
generate_config_file zebra-authorities-site.cfg.in \
"/etc/koha/sites/$name/zebra-authorities.cfg"
generate_config_file zebra-authorities-dom-site.cfg.in \
rm "/etc/koha/sites/$name/koha-conf.xml"
[ -f "/etc/koha/sites/$name/zebra-biblios.cfg" ] && \
rm "/etc/koha/sites/$name/zebra-biblios.cfg"
+ [ -f "/etc/koha/sites/$name/zebra-biblios-dom.cfg" ] && \
+ rm "/etc/koha/sites/$name/zebra-biblios-dom.cfg"
[ -f "/etc/koha/sites/$name/zebra-authorities.cfg" ] && \
rm "/etc/koha/sites/$name/zebra-authorities.cfg"
[ -f "/etc/koha/sites/$name/zebra-authorities-dom.cfg" ] && \
<listen id="mergeserver">tcp:@:__MERGE_SERVER_PORT__</listen>
<server id="mergeserver" listenref="mergeserver">
<directory>/var/lib/koha/__KOHASITE__/biblios</directory>
- <config>/var/lib/koha/__KOHASITE__/zebra-biblios.cfg</config>
+ <config>/var/lib/koha/__KOHASITE__/__ZEBRA_BIBLIOS_CFG__</config>
<cql2rpn>/var/lib/koha/__KOHASITE__/pqf.properties</cql2rpn>
</server>
-->
<!-- BIBLIOGRAPHIC RECORDS -->
<server id="biblioserver" listenref="biblioserver">
<directory>/var/lib/koha/__KOHASITE__/biblios</directory>
- <config>/etc/koha/sites/__KOHASITE__/zebra-biblios.cfg</config>
+ <config>/etc/koha/sites/__KOHASITE__/__ZEBRA_BIBLIOS_CFG__</config>
<cql2rpn>/etc/koha/zebradb/pqf.properties</cql2rpn>
- <retrievalinfo>
+
+ __START_BIBLIOS_RETRIEVAL_INFO__
<retrieval syntax="__ZEBRA_MARC_FORMAT__" name="F"/>
<retrieval syntax="__ZEBRA_MARC_FORMAT__" name="B"/>
<retrieval syntax="xml" name="F"/>
<xslt stylesheet="/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl"/>
</backend>
</retrieval>
- </retrievalinfo>
+ __END_BIBLIOS_RETRIEVAL_INFO__
+
<!-- The stuff below is used to enable SRU. It's currently disabled
until we come up with a good way to make it get magically set up by
the packaging system. If you need it, uncomment and set it up
<!-- AUTHORITY RECORDS -->
<server id="authorityserver" listenref="authorityserver" >
<directory>/var/lib/koha/__KOHASITE__/authorities</directory>
- <config>/etc/koha/sites/__KOHASITE__/zebra-authorities-dom.cfg</config>
+ <config>/etc/koha/sites/__KOHASITE__/__ZEBRA_AUTHORITIES_CFG__</config>
<cql2rpn>/etc/koha/zebradb/pqf.properties</cql2rpn>
- <xi:include href="/etc/koha/__ZEBRA_MARC_FORMAT__-retrieval-info-auth-dom.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude">
- <xi:fallback>
- <retrievalinfo>
+
+ __START_AUTHORITIES_RETRIEVAL_INFO__
<retrieval syntax="__ZEBRA_MARC_FORMAT__" name="F"/>
<retrieval syntax="__ZEBRA_MARC_FORMAT__" name="B"/>
<retrieval syntax="xml" name="marcxml"
<xslt stylesheet="/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl"/>
</backend>
</retrieval>
- </retrievalinfo>
- </xi:fallback>
- </xi:include>
+ __END_AUTHORITIES_RETRIEVAL_INFO__
+
<!-- The stuff below is used to enable SRU. It's currently disabled
until we come up with a good way to make it get magically set up by
the packaging system. If you need it, uncomment and set it up
<server id="publicserver" listenref="publicserver">
<directory>/var/lib/koha/__KOHASITE__/biblios</directory>
- <config>/etc/koha/sites/__KOHASITE__/zebra-biblios.cfg</config>
+ <config>/etc/koha/sites/__KOHASITE__/__ZEBRA_BIBLIOS_CFG__</config>
<cql2rpn>/etc/koha/zebradb/pqf.properties</cql2rpn>
- <retrievalinfo>
+
+ __START_BIBLIOS_RETRIEVAL_INFO__
<retrieval syntax="__ZEBRA_MARC_FORMAT__" name="F"/>
<retrieval syntax="__ZEBRA_MARC_FORMAT__" name="B"/>
<retrieval syntax="xml" name="F"/>
<xslt stylesheet="/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl"/>
</backend>
</retrieval>
- </retrievalinfo>
+ __END_BIBLIOS_RETRIEVAL_INFO__
+
<xi:include href="__KOHA_CONF_DIR__/zebradb/explain-biblios.xml"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:fallback>
<useldapserver>0</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on -->
<memcached_servers></memcached_servers>
<memcached_namespace></memcached_namespace>
+ <zebra_bib_index_mode>__BIBLIOS_INDEXING_MODE__</zebra_bib_index_mode>
+ <zebra_auth_index_mode>__AUTHORITIES_INDEXING_MODE__</zebra_auth_index_mode>
<queryparser_config>/etc/koha/searchengine/queryparser.yaml</queryparser_config>
</config>
# $Id: zebra.cfg,v 1.1.2.2 2006/05/09 12:03:16 rangi Exp $
#
# Where are the config files located?
-profilePath:__ZEBRA_CONF_DIR__/biblios/etc:__ZEBRA_CONF_DIR__/etc:__ZEBRA_CONF_DIR__/marc_defs/__ZEBRA_MARC_FORMAT__/biblios:__ZEBRA_CONF_DIR__/lang_defs/__ZEBRA_LANGUAGE__:__ZEBRA_CONF_DIR__/xsl
+profilePath:/etc/koha/zebradb/biblios/etc:/etc/koha/zebradb/etc:/etc/koha/zebradb/marc_defs/__ZEBRA_MARC_FORMAT__/biblios:/etc/koha/zebradb/lang_defs/__ZEBRA_LANGUAGE__:/etc/koha/zebradb/xsl
# modulePath - where to look for loadable zebra modules
modulePath: /usr/lib/idzebra-2.0/modules
# http://www.indexdata.dk/zebra/doc/zebra-cfg.tkl
# http://www.indexdata.dk/zebra/doc/grs.tkl
-recordtype: dom.__ZEBRA_CONF_DIR__/biblios/etc/dom-config.xml
-marcxml.recordtype: dom.__ZEBRA_CONF_DIR__/biblios/etc/dom-config.xml
-iso2709.recordtype: dom.__ZEBRA_CONF_DIR__/biblios/etc/dom-config-marc.xml
+recordtype: dom./etc/koha/zebradb/biblios/etc/dom-config.xml
+marcxml.recordtype: dom./etc/koha/zebradb/biblios/etc/dom-config.xml
+iso2709.recordtype: dom./etc/koha/zebradb/biblios/etc/dom-config-marc.xml
recordId: (bib1,Local-number)
storeKeys:1
# Lock File Area
-lockDir: __ZEBRA_LOCK_DIR__/biblios
+lockDir: /var/lock/koha/__KOHASITE__/biblios
perm.anonymous:ar
-perm.__ZEBRA_USER__:rw
-passwd: __ZEBRA_CONF_DIR__/etc/passwd
-register: __ZEBRA_DATA_DIR__/biblios/register:20G
-shadow: __ZEBRA_DATA_DIR__/biblios/shadow:20G
+perm.kohauser:rw
+passwd: /etc/koha/sites/__KOHASITE__/zebra.passwd
+register: /var/lib/koha/__KOHASITE__/biblios/register:20G
+shadow: /var/lib/koha/__KOHASITE__/biblios/shadow:20G
# Temp File area for result sets
-setTmpDir: __ZEBRA_DATA_DIR__/biblios/tmp
+setTmpDir: /var/lib/koha/__KOHASITE__/biblios/tmp
# Temp File area for index program
-keyTmpDir: __ZEBRA_DATA_DIR__/biblios/key
+keyTmpDir: /var/lib/koha/__KOHASITE__/biblios/key
# Approx. Memory usage during indexing
memMax: 50M