summaryrefslogtreecommitdiff
path: root/www/zope25/files
diff options
context:
space:
mode:
authordrochner <drochner@pkgsrc.org>2003-07-28 09:27:29 +0000
committerdrochner <drochner@pkgsrc.org>2003-07-28 09:27:29 +0000
commit64325cd1bcfb94c6da8b30f7dbbc52c1324868b1 (patch)
treea2f82e6e86cb84416bac4130df9238bbadeeef20 /www/zope25/files
parenta33b0d84c5b94e097bc7637dca2f4d276dac48b5 (diff)
downloadpkgsrc-64325cd1bcfb94c6da8b30f7dbbc52c1324868b1.tar.gz
install a little shell script which eases the creation of a zope
instance in response to PR: pkg/18191 by Kent Polk
Diffstat (limited to 'www/zope25/files')
-rw-r--r--www/zope25/files/zope25-create47
1 files changed, 47 insertions, 0 deletions
diff --git a/www/zope25/files/zope25-create b/www/zope25/files/zope25-create
new file mode 100644
index 00000000000..690ab469449
--- /dev/null
+++ b/www/zope25/files/zope25-create
@@ -0,0 +1,47 @@
+#!/bin/sh
+ID='$NetBSD: zope25-create,v 1.1 2003/07/28 09:27:31 drochner Exp $'
+
+PYTHONBIN=@@PYTHONBIN@@
+ZOPE_HOME=@@ZOPE_HOME@@
+
+INSTANCE_HOME=/var/zope
+if [ $# -gt 0 ]; then
+ INSTANCE_HOME=$1
+fi
+
+STARTSCRIPT=${INSTANCE_HOME}/zope-start
+
+echo "Creating Zope instance in ${INSTANCE_HOME}"
+
+mkdir -p ${INSTANCE_HOME}
+mkdir -p ${INSTANCE_HOME}/var
+
+if [ ! -d ${INSTANCE_HOME} -o ! -w ${INSTANCE_HOME} ]; then
+ echo "Fatal error: cannot access instance home directory"
+ exit 1
+fi
+
+echo "Initial user authentication"
+(cd ${INSTANCE_HOME} && ${PYTHONBIN} ${ZOPE_HOME}/zpasswd.py inituser)
+
+SCRIPT_FIX=""
+for i in PYTHONBIN ZOPE_HOME INSTANCE_HOME;do
+ eval v=\${$i}
+ SCRIPT_FIX="${SCRIPT_FIX} -e s|@$i@|$v|"
+done
+
+sed ${SCRIPT_FIX} >${STARTSCRIPT} <<SCRIPT_END
+#!/bin/sh
+# created automatically by ${ID}
+
+PYTHONBIN=@PYTHONBIN@
+ZOPE_HOME=@ZOPE_HOME@
+INSTANCE_HOME=@INSTANCE_HOME@
+export INSTANCE_HOME
+
+exec ${PYTHONBIN} ${ZOPE_HOME}/z2.py \$*
+SCRIPT_END
+
+chmod +x ${STARTSCRIPT}
+
+echo "To start ZServer for this instance, run ${STARTSCRIPT}"