@@ -, +, @@
- Apply the patch, have a packages setup (either by grabbing the relevant files [1]
or by creating your own package).
- Run koha-create --create-db instance
- Create a new instance using the --upload-path making it point to whatever you want
- Sign off :-D
---
debian/docs/koha-create.xml | 9 +++++++++
debian/scripts/koha-create | 25 ++++++++++++++++++++++++-
debian/scripts/koha-create-dirs | 1 +
debian/templates/koha-conf-site.xml.in | 2 +-
4 files changed, 35 insertions(+), 2 deletions(-)
--- a/debian/docs/koha-create.xml
+++ a/debian/docs/koha-create.xml
@@ -39,6 +39,7 @@
n
port
+ directory
|
instancename
@@ -168,6 +169,14 @@
+
+
+ Specifiy a for storing the instance's uploaded files.
+ It defaults to /var/lib/koha/instance/uploads.
+
+
+
+
,
Print usage information.
--- a/debian/scripts/koha-create
+++ a/debian/scripts/koha-create
@@ -69,6 +69,8 @@ Options:
--database dbname Enforce the use of the specified DB name (64 char limit)
--adminuser n Explicit the admin user ID in the DB. Relevant in
conjunction with --defaultsql and --populate-db.
+ --upload-path dir Set a user defined upload_path. It defaults to
+ /var/lib/koha//uploads
--help,-h Show this help.
Note: the instance name cannot be longer that 11 chars.
@@ -107,6 +109,7 @@ generate_config_file() {
-e "s/__DB_PASS__/$mysqlpwd/g" \
-e "s/__UNIXUSER__/$username/g" \
-e "s/__UNIXGROUP__/$username/g" \
+ -e "s/__UPLOAD_PATH__/$UPLOAD_PATH/g" \
-e "s/__PLUGINS_DIR__/\/var\/lib\/koha\/$name\/plugins/g" \
-e "s/__MEMCACHED_NAMESPACE__/$MEMCACHED_NAMESPACE/g" \
-e "s/__MEMCACHED_SERVERS__/$MEMCACHED_SERVERS/g" \
@@ -286,6 +289,17 @@ set_memcached()
}
+set_upload_path()
+{
+ local $instance="$1"
+
+ if [ "$CLO_UPLOAD_PATH" != "" ]; then
+ UPLOAD_PATH=$CLO_UPLOAD_PATH
+ else
+ UPLOAD_PATH="$UPLOAD_PATH_BASE/$instance/$UPLOAD_DIR"
+ fi
+}
+
enable_sru_server()
{
# remove the commenting symbols
@@ -318,6 +332,10 @@ MEMCACHED_PREFIX=""
# hardcoded memcached defaults
DEFAULT_MEMCACHED_SERVERS="127.0.0.1:11211"
DEFAULT_MEMCACHED_PREFIX="koha_"
+# hardcoded upload_path
+UPLOAD_PATH_BASE="/var/lib/koha"
+UPLOAD_DIR="uploads"
+UPLOAD_PATH=""
# SRU server variables
ENABLE_SRU="no"
@@ -343,7 +361,7 @@ fi
[ $# -ge 1 ] && [ $# -le 16 ] || ( usage ; die "Error: wrong parameters" )
-TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,use-memcached,enable-sru,sru-port:,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser:,memcached-servers:,memcached-prefix:, \
+TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,use-memcached,enable-sru,sru-port:,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser:,memcached-servers:,memcached-prefix:,upload-path:, \
-n "$0" -- "$@"`
# Note the quotes around `$TEMP': they are essential!
@@ -358,6 +376,7 @@ CLO_BIBLIOS_INDEXING_MODE=""
CLO_AUTHORITIES_INDEXING_MODE=""
CLO_MEMCACHED_SERVERS=""
CLO_MEMCACHED_PREFIX=""
+CLO_UPLOAD_PATH=""
while true ; do
@@ -398,6 +417,8 @@ while true ; do
ENABLE_SRU="yes" ; shift ;;
--sru-port)
SRU_SERVER_PORT="$2" ; shift 2 ;;
+ --upload-path)
+ CLO_UPLOAD_PATH="$2" ; shift 2 ;;
-h|--help)
usage ; exit 0 ;;
--)
@@ -458,6 +479,8 @@ set_authorities_indexing_mode $AUTHORITIES_INDEXING_MODE $ZEBRA_MARC_FORMAT
name="$1"
+set_upload_path $name
+
if [ "$USE_MEMCACHED" = "yes" ]; then
set_memcached $name
elif [ "$CLO_MEMCACHED_SERVERS" != "" ] || \
--- a/debian/scripts/koha-create-dirs
+++ a/debian/scripts/koha-create-dirs
@@ -52,6 +52,7 @@ do
userdir "$name" "/var/lib/koha/$name/biblios/shadow"
userdir "$name" "/var/lib/koha/$name/biblios/tmp"
userdir "$name" "/var/lib/koha/$name/plugins"
+ userdir "$name" "/var/lib/koha/$name/uploads"
userdir "$name" "/var/lock/koha/$name"
userdir "$name" "/var/lock/koha/$name/authorities"
userdir "$name" "/var/lock/koha/$name/biblios"
--- a/debian/templates/koha-conf-site.xml.in
+++ a/debian/templates/koha-conf-site.xml.in
@@ -260,7 +260,7 @@ __END_SRU_PUBLICSERVER__
1
__PLUGINS_DIR__
0
-
+ __UPLOAD_PATH__
/usr/share/koha/intranet/cgi-bin
/usr/share/koha/opac/cgi-bin/opac
/usr/share/koha/opac/htdocs/opac-tmpl
--