summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaca <taca@pkgsrc.org>2008-01-06 15:51:39 +0000
committertaca <taca@pkgsrc.org>2008-01-06 15:51:39 +0000
commitdf8393ac2480f7822d0b5057141ab02dfbee5484 (patch)
tree1ab19d3282f4eac95a51640deb1b51db82bca5c7
parent71d57f29725e71539017423e9c557f6efc5e18b9 (diff)
downloadpkgsrc-df8393ac2480f7822d0b5057141ab02dfbee5484.tar.gz
Add common files for zope29, zope210 and possibly zope211 in feature.
-rw-r--r--www/zope/files/sitecustomize.py15
-rw-r--r--www/zope/files/zeo.sh88
-rw-r--r--www/zope/files/zope.sh83
3 files changed, 186 insertions, 0 deletions
diff --git a/www/zope/files/sitecustomize.py b/www/zope/files/sitecustomize.py
new file mode 100644
index 00000000000..c9e2228e4aa
--- /dev/null
+++ b/www/zope/files/sitecustomize.py
@@ -0,0 +1,15 @@
+#
+# $NetBSD: sitecustomize.py,v 1.1 2008/01/06 15:51:39 taca Exp $
+#
+# Set default character encoding for Zope.
+#
+
+import os, sys
+
+env = os.environ
+
+try :
+ encoding = env['ZOPE@ZOPE_VERSION@_DEFAULT_ENCODING']
+ sys.setdefaultencoding(encoding)
+except:
+ pass
diff --git a/www/zope/files/zeo.sh b/www/zope/files/zeo.sh
new file mode 100644
index 00000000000..a775fda46ad
--- /dev/null
+++ b/www/zope/files/zeo.sh
@@ -0,0 +1,88 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# Startup script for Zeo @ZOPE_VERSION@ server.
+#
+# $NetBSD: zeo.sh,v 1.1 2008/01/06 15:51:40 taca Exp $
+#
+
+# PROVIDE: zeo@ZOPE_VERSION@
+# REQUIRE: DAEMON
+# BEFORE: @ZOPE_PKG@
+#
+# You will need to set some variables in /etc/rc.conf to start one
+# or more instances.
+#
+# zeo@ZOPE_VERSION@@RCVAR_SUFFIX@ : bool
+# Enable Zeo ("YES") or not ("NO", the default).
+#
+# zeo@ZOPE_VERSION@_encoding : list
+# Default character encoding for zeo@ZOPE_VERSION@ (default is "utf-8").
+#
+# zeo@ZOPE_VERSION@_instances : list
+# List of dirs with Zeo's instances ("" by default).
+#
+
+if [ -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="zeo@ZOPE_VERSION@"
+rcvar="$name@RCVAR_SUFFIX@"
+version="@ZOPE_FULL_VERSION@"
+zeo_name="Zope ${version}"
+
+zeo@ZOPE_VERSION@ctl () {
+ cmd = $1
+
+ set ${zeo@ZOPE_VERSION@_encoding}
+ for instance in $zeo@ZOPE_VERSION@_instances; do
+ if [ "$1" ]; then
+ ZOPE@ZOPE_VERSION@_DEFAULT_ENCODING="$1"
+ export ZOPE@ZOPE_VERSION@_DEFAULT_ENCODING
+ else
+ unset ZOPE@ZOPE_VERSION@_DEFAULT_ENCODING
+ fi
+ if [ -d ${instance} ]; then
+ echo -n " Zeo instance ${instance} -> "
+ ${instance}/bin/zeoctl ${cmd}
+ fi
+ shift
+ done
+}
+
+zeo@ZOPE_VERSION@_start () {
+ echo "Starting ${zeo_name}:"
+ zeo@ZOPE_VERSION@ctl "start"
+}
+
+zeo@ZOPE_VERSION@_stop () {
+ echo "Stopping ${zeo_name}:"
+ zeo@ZOPE_VERSION@ctl "stop"
+}
+
+zeo@ZOPE_VERSION@_restart () {
+ echo "Restarting ${zeo_name}:"
+ zeo@ZOPE_VERSION@ctl "restart"
+}
+
+ start_cmd="zeo@ZOPE_VERSION@_start"
+ stop_cmd="zeo@ZOPE_VERSION@_stop"
+restart_cmd="zeo@ZOPE_VERSION@_restart"
+
+load_rc_config $name
+
+: ${zeo@ZOPE_VERSION@_@RCVAR_SUFFIX@="NO"}
+: ${zeo@ZOPE_VERSION@_encoding="utf-8"}
+: ${zeo@ZOPE_VERSION@_instances=""}
+
+cmd="$1"
+[ $# -gt 0 ] && shift
+[ -n "$*" ] && zeo@ZOPE_VERSION@_instances="$*"
+
+if [ "${zeo@ZOPE_VERSION@_encoding}" ]; then
+ ZOPE@ZOPE_VERSION@_DEFAULT_ENCODING=${@ZOPE_PKG@_encoding}
+ export ZOPE@ZOPE_VERSION@_DEFAULT_ENCODING
+fi
+
+run_rc_command "${cmd}"
diff --git a/www/zope/files/zope.sh b/www/zope/files/zope.sh
new file mode 100644
index 00000000000..635446734c7
--- /dev/null
+++ b/www/zope/files/zope.sh
@@ -0,0 +1,83 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# Startup script for Zope @ZOPE_VERSION@ server.
+#
+# $NetBSD: zope.sh,v 1.1 2008/01/06 15:51:40 taca Exp $
+#
+
+# PROVIDE: @ZOPE_PKG@
+# REQUIRE: DAEMON
+
+# You will need to set some variables in /etc/rc.conf to start Zope
+#
+# @ZOPE_PKG@@RCVAR_SUFFIX@ : bool
+# Enable Zope ("YES") or not ("NO", the default).
+#
+# @ZOPE_PKG@_encoding : list
+# Default character encoding for @ZOPE_PKG@ (default is "utf-8").
+# You can specify single character encoding for all Zope instances
+# or specify a list for each Zope instance. "none" means specify
+# nothing.
+#
+# @ZOPE_PKG@_instances : list
+# List of dirs with Zope's instances ("" by default).
+#
+
+if [ -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="@ZOPE_PKG@"
+rcvar="$name@RCVAR_SUFFIX@"
+version="@ZOPE_FULL_VERSION@"
+zope_name="Zope ${version}"
+start_cmd="@ZOPE_PKG@_start"
+stop_cmd="@ZOPE_PKG@_stop"
+restart_cmd="@ZOPE_PKG@_restart"
+
+@ZOPE_PKG@ctl () {
+ cmd=$1
+
+ for encoding in ${@ZOPE_PKG@_encoding}; do
+ if [ "$encoding" ]; then
+ ZOPE@ZOPE_VERSION@_DEFAULT_ENCODING="$encoding"
+ export ZOPE@ZOPE_VERSION@_DEFAULT_ENCODING
+ else
+ unset ZOPE@ZOPE_VERSION@_DEFAULT_ENCODING
+ fi
+ for instance in ${@ZOPE_PKG@_instances}; do
+ if [ -d ${instance} ]; then
+ echo -n " Zope instance ${instance} -> "
+ ${instance}/bin/zopectl ${cmd}
+ fi
+ done
+ done
+}
+
+@ZOPE_PKG@_start () {
+ echo "Starting ${zope_name}:"
+ @ZOPE_PKG@ctl "start"
+}
+
+@ZOPE_PKG@_stop () {
+ echo "Stopping ${zope_name}:"
+ @ZOPE_PKG@ctl "stop"
+}
+
+@ZOPE_PKG@_restart () {
+ echo "Restarting ${zope_name}:"
+ @ZOPE_PKG@ctl "restart"
+}
+
+load_rc_config $name
+
+: ${@ZOPE_PKG@@RCVAR_SUFFIX@="NO"}
+: ${@ZOPE_PKG@_encoding="utf-8"}
+: ${@ZOPE_PKG@_instances=""}
+
+cmd="$1"
+[ $# -gt 0 ] && shift
+[ -n "$*" ] && @ZOPE_PKG@_instances="$*"
+
+run_rc_command "${cmd}"