pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/zope/files Add common files for zope29, zope210 an...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4f8db95105ae
branches:  trunk
changeset: 537321:4f8db95105ae
user:      taca <taca%pkgsrc.org@localhost>
date:      Sun Jan 06 15:51:39 2008 +0000

description:
Add common files for zope29, zope210 and possibly zope211 in feature.

diffstat:

 www/zope/files/sitecustomize.py |  15 ++++++
 www/zope/files/zeo.sh           |  88 +++++++++++++++++++++++++++++++++++++++++
 www/zope/files/zope.sh          |  83 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 186 insertions(+), 0 deletions(-)

diffs (198 lines):

diff -r 09b5c87f6726 -r 4f8db95105ae www/zope/files/sitecustomize.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/zope/files/sitecustomize.py   Sun Jan 06 15:51:39 2008 +0000
@@ -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 -r 09b5c87f6726 -r 4f8db95105ae www/zope/files/zeo.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/zope/files/zeo.sh     Sun Jan 06 15:51:39 2008 +0000
@@ -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 -r 09b5c87f6726 -r 4f8db95105ae www/zope/files/zope.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/zope/files/zope.sh    Sun Jan 06 15:51:39 2008 +0000
@@ -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}"



Home | Main Index | Thread Index | Old Index