diff options
author | Jason Shoemaker <kutsuya@gentoo.org> | 2003-03-03 23:43:22 +0000 |
---|---|---|
committer | Jason Shoemaker <kutsuya@gentoo.org> | 2003-03-03 23:43:22 +0000 |
commit | 92ecfe183ffac3ef2b396408d54cb7e20c1cb50c (patch) | |
tree | eab71122665f4f9a1d10192b129c9354bb9d9501 /net-zope | |
parent | new package (diff) | |
download | gentoo-2-92ecfe183ffac3ef2b396408d54cb7e20c1cb50c.tar.gz gentoo-2-92ecfe183ffac3ef2b396408d54cb7e20c1cb50c.tar.bz2 gentoo-2-92ecfe183ffac3ef2b396408d54cb7e20c1cb50c.zip |
Moving from net-www to net-zope.
Diffstat (limited to 'net-zope')
26 files changed, 2402 insertions, 0 deletions
diff --git a/net-zope/zope/ChangeLog b/net-zope/zope/ChangeLog new file mode 100644 index 000000000000..904226cf3b1f --- /dev/null +++ b/net-zope/zope/ChangeLog @@ -0,0 +1,60 @@ +# ChangeLog for net-zope/zope +# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 +# $Header: + +06 Dec 2002; Rodney Rees <manson@gentoo.org> : changed sparc ~sparc keywords + +*zope-2.6.1 (26 Feb 2003) + + 03 Mar 2003; Jason Shoemaker <kutsuya@gentoo.org> : Moving from net-www to net-zope. + + 26 Feb 2003; Jason Shoemaker <kutsuya@gentoo.org> : Version bump. + +*zope-2.6.0-r3 (25 Feb 2003) + + 25 Feb 2003; Jason Shoemaker <kutsuya@gentoo.org> zope-r2.initd : A bug fix + revision mostly. Fixed dependencies. Changed SLOT back to 0, hopefully this + won't cause too much trouble. Changed 'zope' user abit in pkg_seup().Added + RCNAME as a global varibale to ease revising the rcscripts. Fixed 'example + zope applications,' which was mention by Macros73 to be missing. Also added + the option, for developers, of using virtual/python with + PYTHON_SLOT_VERSION=VIRTUAL. + +*zope-2.6.0-r2 (16 Feb 2003) + + 16 Feb 2003; Jason Shoemaker <kutsuya@gentoo.org> : A major revision. + New rcscript (along with zope-config) makes it possible to have several zope + instances runing at the same time. Also has better PID management fixing + #14173. /etc/env.d/zope and /etc/conf.d/zope are now placed in + /etc/conf.d/zope-2_6_0. Also added a DateTime patch. Improved security. + +*zope-2.6.0-r1 (23 Nov 2002) + + 23 Nov 2002; Grant Goodyear <g2boojum@gentoo.org> zope-2.6.0-r1.ebuild : + Added ebuild from Bug #10758 (thanks to Maurizio Disimino!) which should + ensure that python 2.1.3* is used, the init script is now properly + located in /etc/init.d, and probably one or two other fixes. + +*zope-2.6.0 (24 Oct 2002) + + 24 Oct 2002; Daniel Ahlberg <aliz@gentoo.org> zope-2.6.0.ebuild : + Security update. Ebuild contributed by Jason S <kutsuya1@yahoo.com> in #9474. + +*zope-2.5.1 (2 Jul 2002) + + 2 Jul 2002; Jon Nelson <jnelson@gentoo.org> zope-2.5.1.ebuild: + Use python 2.1.3 ebuild explicitly + Thanks for Matt Behrens <matt@zigg.com> + Hopefully closes #468 + +*unreleased-as-yet-still-using-masked-zope-2.4.0-r6 + + 1 Jul 2002; Jon Nelson <jnelson@gentoo.org> zope-2.4.0-r6: + Use new python2.1 ebuild explicitly + Will probably update to zope 2.5.0 when I get some time, but + 2.4.0-r6 will build. + +*zope-2.4.0-r6 (1 Feb 2002) + + 1 Feb 2002; G.Bevin <gbevin@gentoo.org> ChangeLog : Initial import. + diff --git a/net-zope/zope/files/2.6.0/DateTime.py.bz2 b/net-zope/zope/files/2.6.0/DateTime.py.bz2 Binary files differnew file mode 100644 index 000000000000..e6f8331421d1 --- /dev/null +++ b/net-zope/zope/files/2.6.0/DateTime.py.bz2 diff --git a/net-zope/zope/files/2.6.0/zope-r1.initd b/net-zope/zope/files/2.6.0/zope-r1.initd new file mode 100644 index 000000000000..b04abd120a03 --- /dev/null +++ b/net-zope/zope/files/2.6.0/zope-r1.initd @@ -0,0 +1,174 @@ +#!/sbin/runscript +# Zope rc-script for Gentoo Linux +# Copyright 2002-2003 by Jason Shoemaker +# Distributed under the terms of the GNU General Public License, v2 or later. +# $Header: /var/cvsroot/gentoo-x86/net-zope/zope/files/2.6.0/zope-r1.initd,v 1.1 2003/03/03 23:43:22 kutsuya Exp $ + +depend() +{ + need net +} + +# Since zope doesn't delete its .pid file when done, we have to determine its +# status. Zope can be shutdown from a browser...this bypasses init.d. + +# Need to export these conf.d variables so that (env) can use them + +setup_exports() +{ +local EXPORT_LST="INSTANCE_HOME SOFTWARE_HOME ZOPE_HOME FORCE_PRODUCT_LOAD \ +PROFILE_PUBLISHER SUPPRESS_ACCESSRULE SUPPRESS_SITEROOT CLIENT_HOME \ +ZEO_CLIENT EVENT_LOG_FORMAT EVENT_LOG_FILE EVENT_LOG_SEVERITY ZSYSLOG \ +ZSYSLOG_FACILITY ZSYSLOG_SERVER ZSYSLOG_ACCESS ZSYSLOG_ACCESS_FACILITY \ +ZSYSLOG_ACCESS_SERVER Z_DEBUG_MODE Z_REALM NO_SECURITY ZOPE_SECURITY_POLICY \ +ZSP_OWNEROUS_SKIP ZSP_AUTHENTICATED_SKIP DISALLOW_LOCAL_PRODUCTS \ +ZOPE_DATABASE_QUOTA ZOPE_READ_ONLY ZSESSION_ADD_NOTIFY ZSESSION_DEL_NOTIFY \ +ZSESSION_TIMEOUT_MINS ZSESSION_OBJECT_LIMIT WEBDAV_SOURCE_PORT_CLIENTS \ +STX_DEFAULT_LEVEL ZOPE_DTML_REQUEST_AUTOQUOTE Z_MAX_STACK_SIZE \ +FORCE_PRODUCT_RELOAD" + +for N in $EXPORT_LST ; do + if [ -n "${N}" ] ; then export ${N} ; fi +done +} + +# Check if the file exist. then send file to stdout. +# Parameters: +# $1 = /path/to/pid.file +# Outputs: + +read_pid() +{ + if [ -f "${1}" ] ; then + cat ${1} + fi +} + +# Check if we have a living PID, if not delete the PID FILE +# Parameters: +# $1 = /path/to/pid.file +# Returns: +# 0 if alive pid file remains +# 1 if dead pid file removed +# 2 if no pid file found + + +check_pid_status() +{ + local RESULT=2 # assume no pid file will be found + local PID=$(read_pid ${1}) + + if [ -n "${PID}" ] ; then + ps --no-headers ${PID} > /dev/null 2>&1 + if [ "${?}" -eq 0 ] ; then + RESULT=0 + else + rm -f ${1} + RESULT=1 + fi + fi + + return ${RESULT} +} + +# Parameters: +# None +# Returns: +# 0 true +# 1 false and echos /pathname/to/pid/file + +is_zope_dead() +{ + local RESULT= + + if [ -n "${INSTANCE_HOME}" ] ; then + loc=${INSTANCE_HOME} + else + loc=${ZOPE_HOME} + fi + + check_pid_status ${loc}/var/Z2.pid + RESULT=${?} + if [ "${RESULT}" -eq 0 ] ; then + echo "${loc}" + RESULT=10 + break # found a live pid + fi + + if [ "${RESULT}" -eq 10 ] ; then + RESULT=1 + else + RESULT=0 + fi + + return ${RESULT} +} + +status() +{ + + if is_zope_dead ; then + eerror "--> Zope is dead." + else + einfo "--> Zope is alive." + fi + + return ! is_zope_dead +} + +# If Zope is dead, remove PID file and start zope. +# The idea with 'env' is that a environment snapshot +# (current vars + /etc/conf.d/zope?) is created for zope to use. + +start_zope() +{ + local RESULT= + + is_zope_dead >/dev/null + RESULT=${?} + if [ "${RESULT}" -eq 0 ] ; then + setup_exports + umask 077 # Recommended by Zope + env /usr/bin/python2.1 ${ZOPE_HOME}z2.py ${ZOPE_OPTS} & + RESULT=${?} + else + echo 'Zope is running independant of RC management.' + echo 'We are going to try and kill it.' + stop_zope + if [ "${?}" -eq 0 ] ; then + echo 'Successfully killed zope. Try to start zope again' + fi + fi + + return ${RESULT} +} + +# If Zope is alive, kill it. + +stop_zope() +{ + local PID=$(is_zope_dead) + + if [ -n "${PID}" ] ; then + kill $(cat ${PID}/var/Z2.pid) # Not sure if kill always succeeds, so not removeing .pid file. + fi + return $? +} + +# + +start() +{ + ebegin "Starting zope" + start_zope + eend $? "Failed to start zope" +} + +# + +stop() +{ + ebegin "Stopping zope" + stop_zope + eend $? "Failed to stop zope" +} diff --git a/net-zope/zope/files/2.6.0/zope-r2.initd b/net-zope/zope/files/2.6.0/zope-r2.initd new file mode 100644 index 000000000000..d35ed1a4b300 --- /dev/null +++ b/net-zope/zope/files/2.6.0/zope-r2.initd @@ -0,0 +1,175 @@ +#!/sbin/runscript +# Zope rc-script for Gentoo Linux +# Copyright 2002-2003 by Jason Shoemaker +# Distributed under the terms of the GNU General Public License, v2 or later. +# $Header: /var/cvsroot/gentoo-x86/net-zope/zope/files/2.6.0/zope-r2.initd,v 1.1 2003/03/03 23:43:22 kutsuya Exp $ + +python= + +depend() +{ + need net +} + +# Since zope doesn't delete its .pid file when done, we have to determine its +# status. Zope can be shutdown from a browser...this bypasses init.d. + +# Need to export these conf.d variables so that (env) can use them + +setup_exports() +{ +local EXPORT_LST="INSTANCE_HOME SOFTWARE_HOME ZOPE_HOME FORCE_PRODUCT_LOAD \ +PROFILE_PUBLISHER SUPPRESS_ACCESSRULE SUPPRESS_SITEROOT CLIENT_HOME \ +ZEO_CLIENT EVENT_LOG_FORMAT EVENT_LOG_FILE EVENT_LOG_SEVERITY ZSYSLOG \ +ZSYSLOG_FACILITY ZSYSLOG_SERVER ZSYSLOG_ACCESS ZSYSLOG_ACCESS_FACILITY \ +ZSYSLOG_ACCESS_SERVER Z_DEBUG_MODE Z_REALM NO_SECURITY ZOPE_SECURITY_POLICY \ +ZSP_OWNEROUS_SKIP ZSP_AUTHENTICATED_SKIP DISALLOW_LOCAL_PRODUCTS \ +ZOPE_DATABASE_QUOTA ZOPE_READ_ONLY ZSESSION_ADD_NOTIFY ZSESSION_DEL_NOTIFY \ +ZSESSION_TIMEOUT_MINS ZSESSION_OBJECT_LIMIT WEBDAV_SOURCE_PORT_CLIENTS \ +STX_DEFAULT_LEVEL ZOPE_DTML_REQUEST_AUTOQUOTE Z_MAX_STACK_SIZE \ +FORCE_PRODUCT_RELOAD" + +for N in $EXPORT_LST ; do + if [ -n "${N}" ] ; then export ${N} ; fi +done +} + +# Check if the file exist. then send file to stdout. +# Parameters: +# $1 = /path/to/pid.file +# Outputs: + +read_pid() +{ + if [ -f "${1}" ] ; then + cat ${1} + fi +} + +# Check if we have a living PID, if not delete the PID FILE +# Parameters: +# $1 = /path/to/pid.file +# Returns: +# 0 if alive pid file remains +# 1 if dead pid file removed +# 2 if no pid file found + +check_pid_status() +{ + local RESULT=2 # assume no pid file will be found + local PID=$(read_pid ${1}) + + if [ -n "${PID}" ] ; then + ps --no-headers ${PID} > /dev/null 2>&1 + if [ "${?}" -eq 0 ] ; then + RESULT=0 + else + rm -f ${1} + RESULT=1 + fi + fi + + return ${RESULT} +} + +# Parameters: +# None +# Returns: +# 0 true +# 1 false and echos /pathname/to/pid/file + +is_zope_dead() +{ + local RESULT= + + if [ -n "${INSTANCE_HOME}" ] ; then + loc=${INSTANCE_HOME} + else + loc=${ZOPE_HOME} + fi + + check_pid_status ${loc}/var/Z2.pid + RESULT=${?} + if [ "${RESULT}" -eq 0 ] ; then + echo "${loc}" + RESULT=10 + break # found a live pid + fi + + if [ "${RESULT}" -eq 10 ] ; then + RESULT=1 + else + RESULT=0 + fi + + return ${RESULT} +} + +status() +{ + + if is_zope_dead ; then + eerror "--> Zope is dead." + else + einfo "--> Zope is alive." + fi + + return ! is_zope_dead +} + +# If Zope is dead, remove PID file and start zope. +# The idea with 'env' is that a environment snapshot +# (current vars + /etc/conf.d/zope?) is created for zope to use. + +start_zope() +{ + local RESULT= + + is_zope_dead >/dev/null + RESULT=${?} + if [ "${RESULT}" -eq 0 ] ; then + setup_exports + umask 077 # Recommended by Zope + env /usr/bin/${python} ${ZOPE_HOME}z2.py ${ZOPE_OPTS} & + RESULT=${?} + else + echo 'Zope is running independant of RC management.' + echo 'We are going to try and kill it.' + stop_zope + if [ "${?}" -eq 0 ] ; then + echo 'Successfully killed zope. Try to start zope again' + fi + fi + + return ${RESULT} +} + +# If Zope is alive, kill it. + +stop_zope() +{ + local PID=$(is_zope_dead) + + if [ -n "${PID}" ] ; then + kill $(cat ${PID}/var/Z2.pid) # Not sure if kill always succeeds, so not removeing .pid file. + fi + return $? +} + +# + +start() +{ + ebegin "Starting zope" + start_zope + eend $? "Failed to start zope" +} + +# + +stop() +{ + ebegin "Stopping zope" + stop_zope + eend $? "Failed to stop zope" +} diff --git a/net-zope/zope/files/2.6.0/zope.envd b/net-zope/zope/files/2.6.0/zope.envd new file mode 100644 index 000000000000..0ab9e3fb0df0 --- /dev/null +++ b/net-zope/zope/files/2.6.0/zope.envd @@ -0,0 +1,79 @@ +#-- Zope installation + +#INSTANCE_HOME= +#SOFTWARE_HOME= +#ZOPE_HOME= +#FORCE_PRODUCT_LOAD= + +#-- Profiling + +#PROFILE_PUBLISHER= + +#-- SiteAccess + +#SUPPRESS_ACCESSRULE= +#SUPPRESS_SITEROOT= + +#-- ZEO + +#CLIENT_HOME= +#ZEO_CLIENT= + +#-- Debugging and Logging + +#EVENT_LOG_FORMAT= +#EVENT_LOG_FILE= +#EVENT_LOG_SEVERITY= +#ZSYSLOG= +#ZSYSLOG_FACILITY= +#ZSYSLOG_SERVER= +#ZSYSLOG_ACCESS= +#ZSYSLOG_ACCESS_FACILITY= +#ZSYSLOG_ACCESS_SERVER= +#Z_DEBUG_MODE= + +#-- Misc. + +#Z_REALM + +#-- Security related + +#NO_SECURITY= +#ZOPE_SECURITY_POLICY= +#ZSP_OWNEROUS_SKIP= +#ZSP_AUTHENTICATED_SKIP= +#DISALLOW_LOCAL_PRODUCTS= + +#-- ZODB related + +#ZOPE_DATABASE_QUOTA= +#ZOPE_READ_ONLY= + +#-- Session related + +#ZSESSION_ADD_NOTIFY= +#ZSESSION_DEL_NOTIFY= +#ZSESSION_TIMEOUT_MINS= +#ZSESSION_OBJECT_LIMIT= + +#-- WebDAV + +#WEBDAV_SOURCE_PORT_CLIENTS= + +#-- Structured Text + +#STX_DEFAULT_LEVEL= + +#-- DTML + +#ZOPE_DTML_REQUEST_AUTOQUOTE= + +#-- Esoteric + +#Z_MAX_STACK_SIZE= +#FORCE_PRODUCT_RELOAD= + + + + + diff --git a/net-zope/zope/files/2.6.0/zope.initd b/net-zope/zope/files/2.6.0/zope.initd new file mode 100644 index 000000000000..f08a15e5a823 --- /dev/null +++ b/net-zope/zope/files/2.6.0/zope.initd @@ -0,0 +1,30 @@ +#!/sbin/runscript +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-zope/zope/files/2.6.0/zope.initd,v 1.1 2003/03/03 23:43:22 kutsuya Exp $ + +depend() { + need net +} + +start() { + ebegin "Starting zope" + start-stop-daemon -S -q --pidfile ${ZOPE_HOME}var/Z2.pid \ + --startas /usr/bin/python2.1 -- ${ZOPE_HOME}z2.py ${ZOPE_OPTS} + eend $? "Failed to start zope" +} + +stop() { + ebegin "Stopping zope" + start-stop-daemon -o -q -K --pidfile ${ZOPE_HOME}var/Z2.pid + RESULT=${?} + + # In case we have to kill zope by hand. + mv ${ZOPE_HOME}var/Z2.pid ${ZOPE_HOME}var/Z2.pid.old + eend $RESULT "Failed to stop zope" +} + + + + + diff --git a/net-zope/zope/files/2.6.1/zope.envd b/net-zope/zope/files/2.6.1/zope.envd new file mode 100644 index 000000000000..6caea5172fcf --- /dev/null +++ b/net-zope/zope/files/2.6.1/zope.envd @@ -0,0 +1,79 @@ +#-- Zope installation + +#INSTANCE_HOME= +#SOFTWARE_HOME= +#ZOPE_HOME= +#FORCE_PRODUCT_LOAD= + +#-- Profiling + +#PROFILE_PUBLISHER= + +#-- SiteAccess + +#SUPPRESS_ACCESSRULE= +#SUPPRESS_SITEROOT= + +#-- ZEO + +#CLIENT_HOME= +#ZEO_CLIENT= + +#-- Debugging and Logging + +#EVENT_LOG_FORMAT= +#EVENT_LOG_FILE= +#EVENT_LOG_SEVERITY= +#ZSYSLOG= +#ZSYSLOG_FACILITY= +#ZSYSLOG_SERVER= +#ZSYSLOG_ACCESS= +#ZSYSLOG_ACCESS_FACILITY= +#ZSYSLOG_ACCESS_SERVER= +#Z_DEBUG_MODE= + +#-- Misc. + +#Z_REALM + +#-- Security related + +#NO_SECURITY= +#ZOPE_SECURITY_POLICY= +#ZSP_OWNEROUS_SKIP= +#ZSP_AUTHENTICATED_SKIP= +#DISALLOW_LOCAL_PRODUCTS= + +#-- ZODB related + +#ZOPE_DATABASE_QUOTA= +#ZOPE_READ_ONLY= + +#-- Session related + +#ZSESSION_ADD_NOTIFY= +#ZSESSION_DEL_NOTIFY= +#ZSESSION_TIMEOUT_MINS= +#ZSESSION_OBJECT_LIMIT= + +#-- WebDAV + +#WEBDAV_SOURCE_PORT_CLIENTS= + +#-- Structured Text + +#STX_DEFAULT_LEVEL= + +#-- DTML + +#ZOPE_DTML_REQUEST_AUTOQUOTE= + +#-- Esoteric + +#Z_MAX_STACK_SIZE= + + + + + + diff --git a/net-zope/zope/files/2.6.1/zope.initd b/net-zope/zope/files/2.6.1/zope.initd new file mode 100644 index 000000000000..cdbde5c807a7 --- /dev/null +++ b/net-zope/zope/files/2.6.1/zope.initd @@ -0,0 +1,175 @@ +#!/sbin/runscript +# Zope rc-script for Gentoo Linux +# Copyright 2002-2003 by Jason Shoemaker +# Distributed under the terms of the GNU General Public License, v2 or later. +# $Header: /var/cvsroot/gentoo-x86/net-zope/zope/files/2.6.1/zope.initd,v 1.1 2003/03/03 23:43:22 kutsuya Exp $ + +python= + +depend() +{ + need net +} + +# Since zope doesn't delete its .pid file when done, we have to determine its +# status. Zope can be shutdown from a browser...this bypasses init.d. + +# Need to export these conf.d variables so that (env) can use them + +setup_exports() +{ +local EXPORT_LST="INSTANCE_HOME SOFTWARE_HOME ZOPE_HOME FORCE_PRODUCT_LOAD \ +PROFILE_PUBLISHER SUPPRESS_ACCESSRULE SUPPRESS_SITEROOT CLIENT_HOME \ +ZEO_CLIENT EVENT_LOG_FORMAT EVENT_LOG_FILE EVENT_LOG_SEVERITY ZSYSLOG \ +ZSYSLOG_FACILITY ZSYSLOG_SERVER ZSYSLOG_ACCESS ZSYSLOG_ACCESS_FACILITY \ +ZSYSLOG_ACCESS_SERVER Z_DEBUG_MODE Z_REALM NO_SECURITY ZOPE_SECURITY_POLICY \ +ZSP_OWNEROUS_SKIP ZSP_AUTHENTICATED_SKIP DISALLOW_LOCAL_PRODUCTS \ +ZOPE_DATABASE_QUOTA ZOPE_READ_ONLY ZSESSION_ADD_NOTIFY ZSESSION_DEL_NOTIFY \ +ZSESSION_TIMEOUT_MINS ZSESSION_OBJECT_LIMIT WEBDAV_SOURCE_PORT_CLIENTS \ +STX_DEFAULT_LEVEL ZOPE_DTML_REQUEST_AUTOQUOTE Z_MAX_STACK_SIZE \ +FORCE_PRODUCT_RELOAD" + +for N in $EXPORT_LST ; do + if [ -n "${N}" ] ; then export ${N} ; fi +done +} + +# Check if the file exist. then send file to stdout. +# Parameters: +# $1 = /path/to/pid.file +# Outputs: + +read_pid() +{ + if [ -f "${1}" ] ; then + cat ${1} + fi +} + +# Check if we have a living PID, if not delete the PID FILE +# Parameters: +# $1 = /path/to/pid.file +# Returns: +# 0 if alive pid file remains +# 1 if dead pid file removed +# 2 if no pid file found + +check_pid_status() +{ + local RESULT=2 # assume no pid file will be found + local PID=$(read_pid ${1}) + + if [ -n "${PID}" ] ; then + ps --no-headers ${PID} > /dev/null 2>&1 + if [ "${?}" -eq 0 ] ; then + RESULT=0 + else + rm -f ${1} + RESULT=1 + fi + fi + + return ${RESULT} +} + +# Parameters: +# None +# Returns: +# 0 true +# 1 false and echos /pathname/to/pid/file + +is_zope_dead() +{ + local RESULT= + + if [ -n "${INSTANCE_HOME}" ] ; then + loc=${INSTANCE_HOME} + else + loc=${ZOPE_HOME} + fi + + check_pid_status ${loc}/var/Z2.pid + RESULT=${?} + if [ "${RESULT}" -eq 0 ] ; then + echo "${loc}" + RESULT=10 + break # found a live pid + fi + + if [ "${RESULT}" -eq 10 ] ; then + RESULT=1 + else + RESULT=0 + fi + + return ${RESULT} +} + +status() +{ + + if is_zope_dead ; then + eerror "--> Zope is dead." + else + einfo "--> Zope is alive." + fi + + return ! is_zope_dead +} + +# If Zope is dead, remove PID file and start zope. +# The idea with 'env' is that a environment snapshot +# (current vars + /etc/conf.d/zope?) is created for zope to use. + +start_zope() +{ + local RESULT= + + is_zope_dead >/dev/null + RESULT=${?} + if [ "${RESULT}" -eq 0 ] ; then + setup_exports + umask 077 # Recommended by Zope + env /usr/bin/${python} ${ZOPE_HOME}z2.py ${ZOPE_OPTS} & + RESULT=${?} + else + echo 'Zope is running independant of RC management.' + echo 'We are going to try and kill it.' + stop_zope + if [ "${?}" -eq 0 ] ; then + echo 'Successfully killed zope. Try to start zope again' + fi + fi + + return ${RESULT} +} + +# If Zope is alive, kill it. + +stop_zope() +{ + local PID=$(is_zope_dead) + + if [ -n "${PID}" ] ; then + kill $(cat ${PID}/var/Z2.pid) # Not sure if kill always succeeds, so not removeing .pid file. + fi + return $? +} + +# + +start() +{ + ebegin "Starting zope" + start_zope + eend $? "Failed to start zope" +} + +# + +stop() +{ + ebegin "Stopping zope" + stop_zope + eend $? "Failed to stop zope" +} diff --git a/net-zope/zope/files/digest-zope-2.4.0-r6 b/net-zope/zope/files/digest-zope-2.4.0-r6 new file mode 100644 index 000000000000..176552c69287 --- /dev/null +++ b/net-zope/zope/files/digest-zope-2.4.0-r6 @@ -0,0 +1,2 @@ +MD5 1a41e096a80411bccf61cd862bc3cc20 Zope-2.4.0-src.tgz 1968422 +MD5 f9477321903f2127abf897d74c3a1457 ZEO-1.0b3.tgz 38077 diff --git a/net-zope/zope/files/digest-zope-2.5.1 b/net-zope/zope/files/digest-zope-2.5.1 new file mode 100644 index 000000000000..96e862d6ce6c --- /dev/null +++ b/net-zope/zope/files/digest-zope-2.5.1 @@ -0,0 +1,2 @@ +MD5 65d502b2acf986693576decad6b837cf Zope-2.5.1-src.tgz 2165141 +MD5 ba57ebf203f77b7d92510bc06f9d0c0d ZEO-1.0.tgz 44203 diff --git a/net-zope/zope/files/digest-zope-2.6.0 b/net-zope/zope/files/digest-zope-2.6.0 new file mode 100644 index 000000000000..c2e2d34bcace --- /dev/null +++ b/net-zope/zope/files/digest-zope-2.6.0 @@ -0,0 +1 @@ +MD5 a0bb91ca1df775aebfc8ff8c46afa3a9 Zope-2.6.0-src.tgz 2291282 diff --git a/net-zope/zope/files/digest-zope-2.6.0-r1 b/net-zope/zope/files/digest-zope-2.6.0-r1 new file mode 100644 index 000000000000..c2e2d34bcace --- /dev/null +++ b/net-zope/zope/files/digest-zope-2.6.0-r1 @@ -0,0 +1 @@ +MD5 a0bb91ca1df775aebfc8ff8c46afa3a9 Zope-2.6.0-src.tgz 2291282 diff --git a/net-zope/zope/files/digest-zope-2.6.0-r2 b/net-zope/zope/files/digest-zope-2.6.0-r2 new file mode 100644 index 000000000000..c2e2d34bcace --- /dev/null +++ b/net-zope/zope/files/digest-zope-2.6.0-r2 @@ -0,0 +1 @@ +MD5 a0bb91ca1df775aebfc8ff8c46afa3a9 Zope-2.6.0-src.tgz 2291282 diff --git a/net-zope/zope/files/digest-zope-2.6.0-r3 b/net-zope/zope/files/digest-zope-2.6.0-r3 new file mode 100644 index 000000000000..c2e2d34bcace --- /dev/null +++ b/net-zope/zope/files/digest-zope-2.6.0-r3 @@ -0,0 +1 @@ +MD5 a0bb91ca1df775aebfc8ff8c46afa3a9 Zope-2.6.0-src.tgz 2291282 diff --git a/net-zope/zope/files/digest-zope-2.6.1 b/net-zope/zope/files/digest-zope-2.6.1 new file mode 100644 index 000000000000..2f3b61877e76 --- /dev/null +++ b/net-zope/zope/files/digest-zope-2.6.1 @@ -0,0 +1 @@ +MD5 a17f36b86b6e489797d8e52f1ba48efe Zope-2.6.1-src.tgz 2318685 diff --git a/net-zope/zope/files/zctl.py b/net-zope/zope/files/zctl.py new file mode 100644 index 000000000000..adc971c93673 --- /dev/null +++ b/net-zope/zope/files/zctl.py @@ -0,0 +1,331 @@ +#!/usr/bin/env python +# -*- python -*- + +"""Control Zope and ZEO server if it's configured + +Usage: + + zctl.py start [confname ...] [--zeo -arg ... [--zope]] -arg ... + + zctl.py stop [confname ...] + + zctl.py stop_all + + zctl.py start_zeo + + zctl.py stop_zeo + + zctl.py status [confname ...] + + zctl.py make_cgi [filename] + + zctl.py debug + + zctl.py test filename + + zctl.py do [-i] [-f filename]* commands + + zctl.py script filename + +The file 'zope.conf' must exist in the INSTANCE_HOME where 'zctl.py' lives. +It contains configuration information for Zope, and optionally for ZEO. +Additional Zope configurations may be defined by creating subdirectories +of the INSTANCE_HOME containing 'conf.py'. If you specify the name of +one or more of these subdirectories in a 'zctl.py start' or 'zctl.py stop', +that configuration will be started or stopped instead of the default. + +'zctl.py make_cgi' will write PCGI settings to the file you specify, or to +'Zope.cgi' if the name is omitted. + +'zctl.py debug' will launch an interactive Python session with the Zope +application object loaded as 'app'. + +'zctl.py script filename' will run the Python file in the same type of +context as provided by 'zctl.py debug'. + + +""" + +import sys, os, socket, time, string +from os.path import isfile, isdir, abspath +pjoin = os.path.join +psplit = os.path.split +env = os.environ +run = os.system + +# Find out where we are, and where Python is. +if not sys.argv[0]: HERE = '.' +else: HERE = psplit(sys.argv[0])[0] +HERE = abspath(HERE) +PYTHON = '"%s"' % sys.executable +ZOPE_ENV = {} +ZEO = {} # ZEO is off by default + +# Set INSTANCE_HOME +INSTANCE_HOME = env['INSTANCE_HOME'] = HERE + +# Load configuration data into global variables +ZOPE_CONFIG = pjoin(HERE, 'zope.conf') +if not isfile(ZOPE_CONFIG): + print 'Zope configuration file "zope.conf" not found.' + sys.exit(1) +execfile(ZOPE_CONFIG, globals()) + +# set PYTHONHOME +env['PYTHONHOME'] = ZOPE_HOME = abspath(ZOPE_HOME) + +# add ZEO stuff to environment +for k, v in ZEO.items(): + env[k] = str(v) + +# Commands + +def test(args): + print PYTHON + print HERE + print ZOPE_HOME + print ZEO + +def start(args): + """Start Zope when ZEO is reachable, starting ZEO first if necessary.""" + clients = [] + zeo_args = [] + zope_args = [] + while args and args[0][:1] != '-': + clients.append(args.pop(0)) + while args: + if args[0] == '--zeo': + args.pop(0) + while args and args[0][:2] != '--': + zeo_args.append(args.pop(0)) + else: + if args[0] == '--zope': + args.pop(0) + while args and args[0][:2] != '--': + zope_args.append(args.pop(0)) + if not clients: + clients.append('default') + + cmd = '%s "%s/z2.py" %%s' % (PYTHON, ZOPE_HOME) + global ZOPE_PORT, ZOPE_LOG, ZOPE_OPTS, ZOPE_ENV, CLIENT_HOME + for client in clients: + args = list(zope_args) + if client != 'default': + ZOPE_PORT = ZOPE_LOG = ZOPE_OPTS = '' + CLIENT_HOME = pjoin(HERE, client) + conf = pjoin(CLIENT_HOME, 'conf.py') + if not (isdir(CLIENT_HOME) and isfile(conf)): + print 'Client configuration file "%s" was not found.' % conf + continue + execfile(conf, globals()) + args.append('"CLIENT_HOME=%s"' % CLIENT_HOME) + if ZOPE_OPTS: + args.insert(0, ZOPE_OPTS) + if ZOPE_PORT: + args.insert(0, '-P %s' % ZOPE_PORT) + if ZOPE_LOG: + args.append('"STUPID_LOG_FILE=%s"' % ZOPE_LOG) + for k,v in ZOPE_ENV.items(): + env[k] = str(v) + if ZEO: + start_zeo(zeo_args) + print 'Starting %s Zope...' % client + run(cmd % string.join(args)) + +def start_zeo(args): + """Try to start ZEO.""" + host = ZEO.get('ZEO_SERVER_NAME', 'localhost') + port = ZEO['ZEO_SERVER_PORT'] + storagearg = '' + storages = ZEO.get('ZEO_STORAGES', None) + if storages: + for id in ZEO['ZEO_STORAGES'].keys(): + storagearg = storagearg + "-S%s=%s " % (id, storages[id]) + if host == 'localhost' and not _check_for_service(host, port): + stop_zeo(None) + print "Starting ZEO server on", port + cmd = '%s %s/lib/python/ZEO/start.py -p %s %s %s &' % ( + PYTHON, ZOPE_HOME, port, storagearg, string.join(args) + ) + print cmd + run(cmd) + count = 0 + while not _check_for_service(host, port): + count = count + 1 + if count > ZEO_WAIT_BAILOUT: + print ("ZEO connect failure, on port %s after %d seconds" + % (port, ZEO_WAIT_BAILOUT)) + sys.exit(1) + print "waiting for ZEO server to start %d/%d" % (count, + ZEO_WAIT_BAILOUT) + time.sleep(1) + #print "ZEO server ready." + +def stop_zeo(args): + """Stop the ZEO server.""" + try: + pids = open('%s/var/ZEO_SERVER.pid' % HERE, 'r').read() + except: + return + print "Stopping ZEO pid: %s" % pids + run('kill %s' % pids) + +def stop(args): + """Stop client(s).""" + if not args: + args = ['var'] + for client in args: + pidf = pjoin(HERE, client, 'Z2.pid') + if not isfile(pidf): + print '"%s" was not found' % pidf + continue + pids=open(pidf).read() + print 'Stopping Zope process %s' % pids + run('kill %s' % open(pidf, 'r').read()) + return + +def stop_all(args): + "Stop clients and ZEO server" + stop(args) + stop_zeo(args) + return + +def status(args): + """Print status.""" + print "NAME\tPORT\tPIDS" + if ZEO: + host = ZEO.get('ZEO_SERVER_NAME', 'localhost') + port = ZEO['ZEO_SERVER_PORT'] + pids = '' + if _check_for_service(host, port): + if host == 'localhost': + pids = open('%s/var/ZEO_SERVER.pid' % HERE, 'r').read() + else: + pids = 'unknown' + print "ZEO\t%s\t%s" % (port, pids) + if not args: + import glob + for client in glob.glob('%s/*/conf.py' % HERE): + args.append(psplit(psplit(client)[0])[1]) + for client in args: + pidf = pjoin(HERE, client, 'Z2.pid') + if isfile(pidf): + pids = open(pidf, 'r').read() + else: + pids = 'not found' + print '%s\t%s\t%s' % (client, '', pids) + +def make_cgi(args): + """Create a PCGI parameter file.""" + if args: + fname = args.pop(0) + else: + fname = 'Zope.cgi' + write = open(fname, 'w').write + write('''\ +#!%(ZOPE_HOME)s/pcgi/pcgi-wrapper +PCGI_NAME=Zope +PCGI_MODULE_PATH=%(ZOPE_HOME)s/lib/python/Zope +PCGI_PUBLISHER=%(ZOPE_HOME)s/pcgi/pcgi_publisher.py +PCGI_EXE=%(PYTHON)s +PCGI_SOCKET_FILE=%(HERE)s/var/pcgi.soc +PCGI_PID_FILE=%(HERE)s/var/pcgi.pid +PCGI_ERROR_LOG=%(HERE)s/var/pcgi.log +PCGI_DISPLAY_ERRORS=1 +BOBO_REALM=Zope +BOBO_DEBUG_MODE=1 +INSTANCE_HOME=%(HERE)s +''' % globals()) + +def script(args): + """Execute a Python script""" + if ZEO: + start_zeo([]) + for k,v in ZOPE_ENV.items(): + env[k] = str(v) + os.chdir(pjoin(ZOPE_HOME, 'lib', 'python')) + options = "-c" + script_name = os.path.join(HERE, args[0]) + cmd = ("%s %s 'import Zope; HERE=\"%s\"; app=Zope.app(); execfile(\"%s\")'" + % (PYTHON, options, HERE, script_name)) + #print cmd + run(cmd) + + +def do(args): + """Execute python commands""" + if ZEO: + start_zeo([]) + for k,v in ZOPE_ENV.items(): + env[k] = str(v) + os.chdir(pjoin(ZOPE_HOME, 'lib', 'python')) + msg = """ + Zope debugging session for %s + The root application object is bound to name 'app'. + To let other people see your changes, you must: + get_transaction().commit() + To see other people's changes, you must: + app._p_jar.sync()""" % HERE + options = "-c" + if not args or '-i' in args: + options = '-i ' + options + if args: + args.remove('-i') + print msg + while '-f' in args: + fpos = args.index('-f') + args.pop(fpos) + args[fpos] = 'execfile("%s");' % args[fpos] + cmd = ("%s %s 'import Zope; app=Zope.app(); %s'" + % (PYTHON, options, string.join(args, " "))) + run(cmd) + +def debug(args): + """Start an interactive debugging session""" + args.insert(0, '-i') + do(args) + +def test(args): + """Run tests""" + args[0] = os.path.abspath(args[0]) + args.insert(0, '-f') + do(args) + +# Internal helper functions + +def _check_for_service(host, port): + """Return 1 if server is found at (host, port), 0 otherwise.""" + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + try: + s.connect((host, int(port))) + return 1 + except socket.error: + return 0 + +def _dispatch(): + """Dispatch command line invocation.""" + if len(sys.argv) == 1: + print """\ + start [confname ...] [--zeo -arg ... [--zope]] -arg ... + stop [confname ...] + stop_all + start_zeo + stop_zeo + status [confname ...] + make_cgi [filename] + debug + test filename + do [-i] [-f filename]* commands + script filename +""" + args = string.split(raw_input('command: ')) + else: + args = sys.argv[1:] + action = string.lower(args.pop(0)) + if action[:1] == '_': + print 'Invalid action "%s"' % action + sys.exit(1) + globals()[action](args) + +if __name__ == "__main__": + _dispatch() diff --git a/net-zope/zope/files/zope b/net-zope/zope/files/zope new file mode 100644 index 000000000000..54231fbed206 --- /dev/null +++ b/net-zope/zope/files/zope @@ -0,0 +1,200 @@ +#!/bin/sh +# Copyright (c) 1995-1998 SuSE GmbH Nuernberg, Germany. +# +# Author: Vojtech Bubnik <bubnikv@suse.cz> +# Based on script from: Jeff Rush <jrush@taupro.com> +# modified for gentoo linux by Holger Brueckner <darks@gentoo.org> +#RCUPDATE:3 4:99 + +. /etc/rc.d/config/functions + +USEZEO="`/usr/lib/portage/bin/use zeo`" + +SERVICE=zope +opts="start stop restart status" + +export INSTANCE_HOME=/var/lib/zope +export INSTANCE_NAME=`basename ${INSTANCE_HOME}` +export ZOPE_HOME=/usr/share/zope +export ZOPE_PORT=80 +export ZOPE_LOG="/var/log/zope" +export ZEO_SERVER_PORT=5800 +export ZEO_SERVER_NAME="localhost" + +ZOPE_PCGI="no" + +# Logging to a remote server using syslogd can +# be done by using ZSYSLOG_SERVER instead if ZYSLOG. If you do not define +# either of the ZSYSLOG* env vars, logging goes to the file specified by +# the -l <file> command argument instead. + +# Note: For syslog logging to work from the ZServer/medusa subsystem, the +# ZSYSLOG variable must now contain the name of the socket to log to, +# usually /dev/log on Unix machines. + +#export ZSYSLOG="/dev/log" +#export ZSYSLOG_SERVER="localhost:514" + +start_zope() { + + cd ${INSTANCE_HOME} + if [ $ZOPE_PCGI = "yes" ] ; then + /usr/bin/env python z2.py \ + -p $INSTANCE_HOME/Zope.cgi \ + -u nobody \ + -z $ZOPE_HOME \ + -Z /var/run/zwatchdog.pid \ + -w '' \ + -f 8021 \ + -m '' \ + -l $ZOPE_LOG \ + 2>&1 >> /var/log/zope \ + & + else + if [ $USEZEO ]; then + export PYTHONPATH=/usr/lib/python2.1/:/usr/lib/python2.1/lib-dynload/ + /usr/bin/env python zctl.py start_zeo + unset PYTHONPATH + /usr/bin/env python z2.py \ + -u nobody \ + -p - \ + -z $ZOPE_HOME \ + -Z /var/run/zwatchdog.pid \ + -w $ZOPE_PORT \ + -f 8021 \ + -W 8023 \ + -m '' \ + -l $ZOPE_LOG \ + -D \ + 2>&1 >> /var/log/zope \ + & + else + /usr/bin/env python z2.py \ + -u nobody \ + -p - \ + -z $ZOPE_HOME \ + -Z /var/run/zwatchdog.pid \ + -w $ZOPE_PORT \ + -f 8021 \ + -W 8023 \ + -m '' \ + -l $ZOPE_LOG \ + -D \ + 2>&1 >> /var/log/zope \ + & + fi + fi + +} + +# A function to find the pid of a program. We cannot use checkproc, +# because we are handling scripts. +pidofproc() { + # First try the "$INSTANCE_HOME/var/Z2.pid" file + if [ -f ${INSTANCE_HOME}/var/Z2.pid ] ; then + if [ "$1" = "zwatchdog" ] ; then + pid=`sed -e 's/^\([0-9]\+\) [0-9]\+/\1/' ${INSTANCE_HOME}/var/Z2.pid` + else + if [ "$1" = "zserver" ] ; then + pid=`sed -e 's/^[0-9]\+ \([0-9]\+\)/\1/' ${INSTANCE_HOME}/var/Z2.pid` + fi + fi + + if [ "$pid" != "" ] ; then + echo $pid + return 0 + fi + fi + + # Next try "/var/run/*.pid" files + if [ -f /var/run/$1.pid ] ; then + pid=`head -1 /var/run/$1.pid` + if [ "$pid" != "" ] ; then + echo $pid + return 0 + fi + fi + + # Next try "pidof" + pid=`pidof -o $$ -o $PPID -o %PPID -x $1` + if [ "$pid" != "" ] ; then + echo $pid + return 0 + fi +} + +# Extracted from 'functions' to fix a tiny bug where it uses 'pidof' +# but should be using 'pidofproc'. +chkstatus() { + # First try "pidofproc" + pid=`pidofproc $1` + if [ "$pid" != "" ] && ps h $pid >/dev/null 2>&1 ; then + echo "$1 (pid $pid) is running..." + return 0 + else + pid=`pidof -o $$ -o $PPID -o %PPID -x $1` + if [ "$pid" != "" ] ; then + echo "$1 (pid $pid) is running..." + return 0 + fi + fi + + # Next try "/var/run/*.pid" files + if [ -f /var/run/$1.pid ] ; then + pid=`head -1 /var/run/$1.pid` + if [ "$pid" != "" ] ; then + echo "$1 dead but pid file exists" + return 1 + fi + fi + + # See if /var/lock/subsys/$1 exists + if [ -f /var/lock/subsys/$1 ]; then + echo "$1 dead but subsys locked" + return 2 + fi + echo "$1 is stopped" + return 3 +} + +start() { + ebegin "Starting zope" + # See if it's already running. + zw_pid=`pidofproc zwatchdog` + zs_pid=`pidofproc zserver` + if ( [ -z "$zw_pid" ] || ! ps h $zw_pid >/dev/null 2>&1 ) && \ + ( [ -z "$zs_pid" ] || ! ps h $zs_pid >/dev/null 2>&1 ) ; then + rm -f ${INSTANCE_HOME}/var/Z2.pid + start_zope + ret=$? + fi + eend $ret "Error starting $SERVICE" + } +stop(){ + ebegin "Shutting down zope" + pid=`pidofproc zwatchdog` + [ -n "$pid" ] && (kill $pid 2>&1 >/dev/null) + pid=`pidofproc zserver` + [ -n "$pid" ] && (kill $pid 2>&1 >/dev/null) + rm -f ${INSTANCE_HOME}/var/Z2.pid /var/run/zwatchdog.pid + if [ $USEZEO ]; then + /usr/bin/env python ${INSTANCE_HOME}/zctl.py stop_zeo + fi + eend $? "Error stopping $SERVICE" + } + +restart(){ + stop + start + } + +status(){ + echo "Checking for zope: " + chkstatus zwatchdog + chkstatus zserver + if [ $USEZEO ]; then + /usr/bin/env python ${INSTANCE_HOME}/zctl.py status + fi + } + +doservice ${@} diff --git a/net-zope/zope/files/zope.conf b/net-zope/zope/files/zope.conf new file mode 100644 index 000000000000..52a967c4a6ec --- /dev/null +++ b/net-zope/zope/files/zope.conf @@ -0,0 +1,21 @@ +"""zope.conf - zctl.py Zope/ZEO startup settings +This is execfile'd in the context of the zctl.py script. +Here are a few handy python var settings (see 'zctl.py for more): +HERE - the absoluted path of zctl.py's working directory +pjoin - os.path.join +""" +## Zope ## +ZOPE_HOME = env['ZOPE_HOME'] +ZOPE_OPTS = '-p - -f -' +ZOPE_PORT = env['ZOPE_PORT'] +ZOPE_LOG = env['ZOPE_LOG'] +ZOPE_ENV['PRODUCTS_PATH'] = ("%(SOFTWARE_PRODUCTS)s:" + + pjoin(HERE, '..', 'OtherProducts') + + ":%(INSTANCE_PRODUCTS)s") +## ZEO ## +# 'localhost' will be used if ZEO_SERVER_NAME has no setting. +ZEO['ZEO_SERVER_NAME'] = env['ZEO_SERVER_NAME'] +# You must specify a ZEO_SERVER_PORT. +ZEO['ZEO_SERVER_PORT'] = env['ZEO_SERVER_PORT'] +ZEO['STUPID_LOG_FILE'] = pjoin(HERE, 'var', 'ZEO_Server.log') +ZEO_WAIT_BAILOUT = 200 # Don't try for more than num seconds diff --git a/net-zope/zope/files/zope.rc6 b/net-zope/zope/files/zope.rc6 new file mode 100644 index 000000000000..57facfca47d1 --- /dev/null +++ b/net-zope/zope/files/zope.rc6 @@ -0,0 +1,202 @@ +#!/bin/sh +# Copyright (c) 1995-1998 SuSE GmbH Nuernberg, Germany. +# +# Author: Vojtech Bubnik <bubnikv@suse.cz> +# Based on script from: Jeff Rush <jrush@taupro.com> +# modified for gentoo linux by Holger Brueckner <darks@gentoo.org> +#RCUPDATE:3 4:99 + +depend() { + need net +} + +USEZEO="`/usr/lib/portage/bin/use zeo`" + +SERVICE=zope +opts="start stop restart status" + +export INSTANCE_HOME=/var/lib/zope +export INSTANCE_NAME=`basename ${INSTANCE_HOME}` +export ZOPE_HOME=/usr/share/zope +export ZOPE_PORT=80 +export ZOPE_LOG="/var/log/zope" +export ZEO_SERVER_PORT=5800 +export ZEO_SERVER_NAME="localhost" + +ZOPE_PCGI="no" + +# Logging to a remote server using syslogd can +# be done by using ZSYSLOG_SERVER instead if ZYSLOG. If you do not define +# either of the ZSYSLOG* env vars, logging goes to the file specified by +# the -l <file> command argument instead. + +# Note: For syslog logging to work from the ZServer/medusa subsystem, the +# ZSYSLOG variable must now contain the name of the socket to log to, +# usually /dev/log on Unix machines. + +#export ZSYSLOG="/dev/log" +#export ZSYSLOG_SERVER="localhost:514" + +start_zope() { + + cd ${INSTANCE_HOME} + if [ $ZOPE_PCGI = "yes" ] ; then + /usr/bin/env python z2.py \ + -p $INSTANCE_HOME/Zope.cgi \ + -u nobody \ + -z $ZOPE_HOME \ + -Z /var/run/zwatchdog.pid \ + -w '' \ + -f 8021 \ + -m '' \ + -l $ZOPE_LOG \ + 2>&1 >> /var/log/zope \ + & + else + if [ $USEZEO ]; then + export PYTHONPATH=/usr/lib/python2.1/:/usr/lib/python2.1/lib-dynload/ + /usr/bin/env python zctl.py start_zeo + unset PYTHONPATH + /usr/bin/env python z2.py \ + -u nobody \ + -p - \ + -z $ZOPE_HOME \ + -Z /var/run/zwatchdog.pid \ + -w $ZOPE_PORT \ + -f 8021 \ + -W 8023 \ + -m '' \ + -l $ZOPE_LOG \ + -D \ + 2>&1 >> /var/log/zope \ + & + else + /usr/bin/env python z2.py \ + -u nobody \ + -p - \ + -z $ZOPE_HOME \ + -Z /var/run/zwatchdog.pid \ + -w $ZOPE_PORT \ + -f 8021 \ + -W 8023 \ + -m '' \ + -l $ZOPE_LOG \ + -D \ + 2>&1 >> /var/log/zope \ + & + fi + fi + +} + +# A function to find the pid of a program. We cannot use checkproc, +# because we are handling scripts. +pidofproc() { + # First try the "$INSTANCE_HOME/var/Z2.pid" file + if [ -f ${INSTANCE_HOME}/var/Z2.pid ] ; then + if [ "$1" = "zwatchdog" ] ; then + pid=`sed -e 's/^\([0-9]\+\) [0-9]\+/\1/' ${INSTANCE_HOME}/var/Z2.pid` + else + if [ "$1" = "zserver" ] ; then + pid=`sed -e 's/^[0-9]\+ \([0-9]\+\)/\1/' ${INSTANCE_HOME}/var/Z2.pid` + fi + fi + + if [ "$pid" != "" ] ; then + echo $pid + return 0 + fi + fi + + # Next try "/var/run/*.pid" files + if [ -f /var/run/$1.pid ] ; then + pid=`head -1 /var/run/$1.pid` + if [ "$pid" != "" ] ; then + echo $pid + return 0 + fi + fi + + # Next try "pidof" + pid=`pidof -o $$ -o $PPID -o %PPID -x $1` + if [ "$pid" != "" ] ; then + echo $pid + return 0 + fi +} + +# Extracted from 'functions' to fix a tiny bug where it uses 'pidof' +# but should be using 'pidofproc'. +chkstatus() { + # First try "pidofproc" + pid=`pidofproc $1` + if [ "$pid" != "" ] && ps h $pid >/dev/null 2>&1 ; then + echo "$1 (pid $pid) is running..." + return 0 + else + pid=`pidof -o $$ -o $PPID -o %PPID -x $1` + if [ "$pid" != "" ] ; then + echo "$1 (pid $pid) is running..." + return 0 + fi + fi + + # Next try "/var/run/*.pid" files + if [ -f /var/run/$1.pid ] ; then + pid=`head -1 /var/run/$1.pid` + if [ "$pid" != "" ] ; then + echo "$1 dead but pid file exists" + return 1 + fi + fi + + # See if /var/lock/subsys/$1 exists + if [ -f /var/lock/subsys/$1 ]; then + echo "$1 dead but subsys locked" + return 2 + fi + echo "$1 is stopped" + return 3 +} + +start() { + ebegin "Starting zope" + # See if it's already running. + zw_pid=`pidofproc zwatchdog` + zs_pid=`pidofproc zserver` + if ( [ -z "$zw_pid" ] || ! ps h $zw_pid >/dev/null 2>&1 ) && \ + ( [ -z "$zs_pid" ] || ! ps h $zs_pid >/dev/null 2>&1 ) ; then + rm -f ${INSTANCE_HOME}/var/Z2.pid + start_zope + ret=$? + fi + eend $ret "Error starting $SERVICE" + } +stop(){ + ebegin "Shutting down zope" + pid=`pidofproc zwatchdog` + [ -n "$pid" ] && (kill $pid 2>&1 >/dev/null) + pid=`pidofproc zserver` + [ -n "$pid" ] && (kill $pid 2>&1 >/dev/null) + rm -f ${INSTANCE_HOME}/var/Z2.pid /var/run/zwatchdog.pid + if [ $USEZEO ]; then + /usr/bin/env python ${INSTANCE_HOME}/zctl.py stop_zeo + fi + eend $? "Error stopping $SERVICE" + } + +restart(){ + stop + start + } + +status(){ + echo "Checking for zope: " + chkstatus zwatchdog + chkstatus zserver + if [ $USEZEO ]; then + /usr/bin/env python ${INSTANCE_HOME}/zctl.py status + fi + } + + diff --git a/net-zope/zope/zope-2.4.0-r6.ebuild b/net-zope/zope/zope-2.4.0-r6.ebuild new file mode 100644 index 000000000000..32c9b877d92e --- /dev/null +++ b/net-zope/zope/zope-2.4.0-r6.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-zope/zope/zope-2.4.0-r6.ebuild,v 1.1 2003/03/03 23:43:22 kutsuya Exp $ + +A="Zope-${PV}-src.tgz ZEO-1.0b3.tgz" +S=${WORKDIR}/Zope-${PV}-src +DESCRIPTION="Zope is web application platform used for building high-performance, dynamic web sites." +SRC_URI="http://www.zope.org/Products/Zope/${PV}/Zope-${PV}-src.tgz + http://www.zope.org/Products/ZEO/ZEO-1.0b3.tgz" +HOMEPAGE="http://www.zope.org" + +DEPEND="virtual/glibc + =dev-lang/python-2.1*" +RDEPEND="=dev-lang/python-2.1*" +KEYWORDS="x86 ppc sparc " +SLOT="0" +LICENSE="as-is" + +src_unpack() { + + unpack Zope-${PV}-src.tgz + + if [ "`use zeo`" ]; then + cd ${S}/lib/python + unpack ZEO-1.0b3.tgz + mv ZEO-1.0b3/ZEO ${S}/lib/python + rm -rf ZEO-1.0b3 + fi +} + +src_compile() { + python2.1 w_pcgi.py || die +} + +src_install () { + + ZDIR=/usr/share/zope + ZVAR=/var/lib/zope + + + dodir ${ZDIR}/var + insinto ${ZDIR} + doins w_pcgi.py wo_pcgi.py + + dodir ${ZDIR}/lib + cp -a lib/* ${D}${ZDIR}/lib/ + cp -a ZServer utilities ${D}${ZDIR} + rm ${D}${ZDIR}/ZServer/*.txt + exeinto ${ZDIR}/pcgi + doexe pcgi/pcgi-wrapper pcgi/pcgi_publisher.py + + dodir ${ZDIR}/inst + cp -a inst/* ${D}${ZDIR}/inst + + dodir ${ZDIR}/pcgi + cp -a pcgi/* ${D}${ZDIR}/pcgi + + cd ${S} + fperms a+x ${ZDIR}/lib/python/zdaemon.py + fperms a+x ${ZDIR}/lib/python/StructuredText/StructuredText.py + fperms a+x ${ZDIR}/lib/python/ZPublisher/Client.py + + dodir ${ZVAR} + insinto ${ZVAR} + doins z2.py + insinto ${ZVAR}/var + insopts -m644 + doins var/Data.fs.in + dodir ${ZVAR}/Extensions + dodir ${ZVAR}/import + dodir ${ZVAR}/Products + + if [ "`use zeo`" ]; then + insinto ${ZVAR} + doins ${FILESDIR}/zctl.py ${FILESDIR}/zope ${FILESDIR}/zope.conf ${FILESDIR}/custom_zodb.py + fi + + exeinto ${ZDIR} + doexe zpasswd.py Zope.cgi + + cd ${D}${ZDIR} + sed -e "s:${WORKDIR}:${ZDIR}:g" Zope.cgi > Zope.cgi.tmp + mv Zope.cgi.tmp Zope.cgi + sed -e "s:${WORKDIR}:${ZVAR}:g" stop > stop.tmp + mv stop.tmp stop + + dodir /etc/init.d + exeinto /etc/init.d + newexe ${FILESDIR}/zope.rc6 zope + chown nobody.users ${ZVAR}/var/* +} + +pkg_postinst() { + if [ ! -f ${ROOT}/var/lib/zope/var/Data.fs ] + then + echo "Installing Data.fs from template..." + cd ${ROOT}/var/lib/zope/var + cp Data.fs.in Data.fs + echo + echo "Fixing permissions..." + chown nobody.nogroup -R ${ROOT}/var/lib/zope/var + chmod 600 ${ROOT}/var/lib/zope/var/Data.fs + echo + fi + if [ ! -f ${ROOT}/var/lib/zope/access ] + then + echo "You must run" + echo + echo /usr/share/zope/zpasswd.py /var/lib/zope/inituser + if [ "`use zeo`" ]; then + echo and edit /var/lib/zope/zope.conf + fi + + echo + echo before you can start zope + fi +} diff --git a/net-zope/zope/zope-2.5.1.ebuild b/net-zope/zope/zope-2.5.1.ebuild new file mode 100644 index 000000000000..fdaf04d9ee23 --- /dev/null +++ b/net-zope/zope/zope-2.5.1.ebuild @@ -0,0 +1,116 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-zope/zope/zope-2.5.1.ebuild,v 1.1 2003/03/03 23:43:22 kutsuya Exp $ + +A="Zope-${PV}-src.tgz ZEO-1.0.tgz" +S=${WORKDIR}/Zope-${PV}-src +DESCRIPTION="Zope is web application platform used for building high-performance, dynamic web sites." +SRC_URI="http://www.zope.org/Products/Zope/${PV}/Zope-${PV}-src.tgz + http://www.zope.org/Products/ZEO/ZEO-1.0.tgz" +HOMEPAGE="http://www.zope.org" + +DEPEND="virtual/glibc + =dev-lang/python-2.1.3*" +SLOT="0" +LICENSE="as-is" +KEYWORDS="x86 ppc sparc " + +src_unpack() { + + unpack Zope-${PV}-src.tgz + + if [ "`use zeo`" ]; then + cd ${S}/lib/python + unpack ZEO-1.0.tgz + mv ZEO-1.0/ZEO ${S}/lib/python + rm -rf ZEO-1.0 + fi +} + +src_compile() { + python2.1 w_pcgi.py || die +} + +src_install () { + + ZDIR=/usr/share/zope + ZVAR=/var/lib/zope + + + dodir ${ZDIR}/var + insinto ${ZDIR} + doins w_pcgi.py wo_pcgi.py + + dodir ${ZDIR}/lib + cp -a lib/* ${D}${ZDIR}/lib/ + cp -a ZServer utilities ${D}${ZDIR} + rm ${D}${ZDIR}/ZServer/*.txt + exeinto ${ZDIR}/pcgi + doexe pcgi/pcgi-wrapper pcgi/pcgi_publisher.py + + dodir ${ZDIR}/inst + cp -a inst/* ${D}${ZDIR}/inst + + dodir ${ZDIR}/pcgi + cp -a pcgi/* ${D}${ZDIR}/pcgi + + cd ${S} + fperms a+x ${ZDIR}/lib/python/zdaemon.py + fperms a+x ${ZDIR}/lib/python/StructuredText/StructuredText.py + fperms a+x ${ZDIR}/lib/python/ZPublisher/Client.py + + dodir ${ZVAR} + insinto ${ZVAR} + doins z2.py + insinto ${ZVAR}/var + insopts -m644 + doins var/Data.fs.in + dodir ${ZVAR}/Extensions + dodir ${ZVAR}/import + dodir ${ZVAR}/Products + + if [ "`use zeo`" ]; then + insinto ${ZVAR} + doins ${FILESDIR}/zctl.py ${FILESDIR}/zope ${FILESDIR}/zope.conf ${FILESDIR}/custom_zodb.py + fi + + exeinto ${ZDIR} + doexe zpasswd.py Zope.cgi + + cd ${D}${ZDIR} + sed -e "s:${WORKDIR}:${ZDIR}:g" Zope.cgi > Zope.cgi.tmp + mv Zope.cgi.tmp Zope.cgi + sed -e "s:${WORKDIR}:${ZVAR}:g" stop > stop.tmp + mv stop.tmp stop + + dodir /etc/init.d + exeinto /etc/init.d + newexe ${FILESDIR}/zope.rc6 zope + chown nobody.users ${D}/${ZVAR}/var/* +} + +pkg_postinst() { + if [ ! -f ${ROOT}/var/lib/zope/var/Data.fs ] + then + echo "Installing Data.fs from template..." + cd ${ROOT}/var/lib/zope/var + cp Data.fs.in Data.fs + echo + echo "Fixing permissions..." + chown nobody.nogroup -R ${ROOT}/var/lib/zope/var + chmod 600 ${ROOT}/var/lib/zope/var/Data.fs + echo + fi + if [ ! -f ${ROOT}/var/lib/zope/access ] + then + echo "You must run" + echo + echo /usr/share/zope/zpasswd.py /var/lib/zope/inituser + if [ "`use zeo`" ]; then + echo and edit /var/lib/zope/zope.conf + fi + + echo + echo before you can start zope + fi +} diff --git a/net-zope/zope/zope-2.6.0-r1.ebuild b/net-zope/zope/zope-2.6.0-r1.ebuild new file mode 100644 index 000000000000..7fb78db15271 --- /dev/null +++ b/net-zope/zope/zope-2.6.0-r1.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-zope/zope/zope-2.6.0-r1.ebuild,v 1.1 2003/03/03 23:43:22 kutsuya Exp $ + +S="${WORKDIR}/Zope-${PV}-src" + +DESCRIPTION="Zope is a web application platform used for building high-performance, dynamic web sites." +HOMEPAGE="http://www.zope.org" +SRC_URI="http://www.zope.org/Products/Zope/${PV}/Zope-${PV}-src.tgz" +LICENSE="ZPL" +SLOT="0" + +KEYWORDS="x86" + +DEPEND="virtual/glibc + =dev-lang/python-2.1.3*" + +ZOPEDIR="${DESTTREE}/share/zope/${PV}/" + +src_compile() { + python2.1 wo_pcgi.py || die "Failed to compile." +} + +src_install() { + + dodoc LICENSE.txt README.txt + docinto doc ; dodoc doc/*.txt + docinto doc/PLATFORMS ; dodoc doc/PLATFORMS/* + docinto doc/changenotes ; dodoc doc/changenotes/* + + # using '/etc/init.d/zope' + rm -Rf start stop LICENCE.txt doc/ + + # copy the remaining contents of ${S} into the ${D}. + dodir ${ZOPEDIR} + cp -a . ${D}${ZOPEDIR} + + # Add a rc-script. + exeinto /etc/init.d ; newexe ${FILESDIR}/${PV}/zope.initd zope + + # Add a env.d script. + insinto /etc/env.d ; doins ${FILESDIR}/${PV}/zope.envd + + # Fill in an env.d variable. + sed -i -e "/ZOPE_HOME/ c\\ZOPE_HOME=${ZOPEDIR}\\" ${D}/etc/env.d/zope.envd + + # Add a conf.d script. + dodir /etc/conf.d + echo -e "ZOPE_OPTS='-u root'\nZOPE_HOME=${ZOPEDIR}" > ${D}/etc/conf.d/zope + + # Keep others from overwritting PID files + fperms o+t ${ZOPEDIR}var/ + + # Useful link + dosym /usr/share/doc/${P}/doc/ ${ZOPEDIR}doc +} + +pkg_postinst() { + einfo "To get zope running you must execure the following:" + einfo "\tebuild /var/db/pkg/net-www/${PF}/${PF}.ebuild config" +} + +pkg_config() { + einfo ">>> Create inital user..." + python2.1 ${ROOT}${ZOPEDIR}zpasswd.py ${ROOT}${ZOPEDIR}inituser +} diff --git a/net-zope/zope/zope-2.6.0-r2.ebuild b/net-zope/zope/zope-2.6.0-r2.ebuild new file mode 100644 index 000000000000..1139665d082c --- /dev/null +++ b/net-zope/zope/zope-2.6.0-r2.ebuild @@ -0,0 +1,124 @@ +# Copyright 2002-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-zope/zope/zope-2.6.0-r2.ebuild,v 1.1 2003/03/03 23:43:22 kutsuya Exp $ + +S="${WORKDIR}/Zope-${PV}-src" + +DESCRIPTION="Zope is a web application platform used for building high-performance, dynamic web sites." +HOMEPAGE="http://www.zope.org" +SRC_URI="http://www.zope.org/Products/Zope/${PV}/Zope-${PV}-src.tgz" +LICENSE="ZPL" +SLOT="0" + +KEYWORDS="~x86 ~sparc" + +RDEPEND="=dev-lang/python-2.1.3*" +DEPEND="virtual/glibc + >=sys-apps/sed-4.0.5 + app-admin/zope-config + ${RDEPEND}" + +ZUID=zope +ZGID=$(echo ${P} |sed -e "s:\.:_:g") +ZSERVDIR="${DESTTREE}/share/zope/${PF}/" +ZINSTDIR=$"/var/lib/zope/${ZGID}" +CONFDIR="/etc/conf.d/" + +# Narrow the scope of ownership/permissions. +# Security plan: +# * ZUID is the superuser for all zope instances. +# * ZGID is for a single instance's administration. +# * Other's should not have any access to ${ZSERVDIR}, +# because they can work through the Zope web interface. +# This should protect our code/data better. + +#Parameters: +# $1 = instance directory +# $2 = group + +setup_security() +{ + chown -R ${ZUID}:${2} ${1} + chmod -R g+u ${1} + chmod -R o-rwx ${1} +} + +install_help() +{ + einfo "Need to setup an inituser (admin) before executing zope:" + einfo "\tzope-config --zpasswd" + einfo "To execute default Zope instance:" + einfo "\t/etc/init.d/${ZGID} start" +} + +pkg_setup() { + if ! groupmod ${ZGID} > /dev/null 2>&1 ; then + groupadd ${ZGID} || die "Can not add ${ZGID} group!" + fi + if ! id ${ZUID} > /dev/null 2>&1 ; then + useradd -d ${ZSERVDIR} -c "Zope dedicatedr-user" ${ZUID} \ + || die "Can not add ${ZUID} user!" + fi +} + +src_unpack() +{ + unpack ${A} + # DateTime 2.6.0(only) rfc822 fix + einfo "Applying patches..." + bzcat ${FILESDIR}/${PV}/DateTime.py.bz2 \ + > ${S}/lib/python/DateTime/DateTime.py || die "Patch failed" +} + +src_compile() { + python2.1 wo_pcgi.py || die "Failed to compile." +} + +src_install() { + dodoc LICENSE.txt README.txt + docinto doc ; dodoc doc/*.txt + docinto doc/PLATFORMS ; dodoc doc/PLATFORMS/* + docinto doc/changenotes ; dodoc doc/changenotes/* + + # using '/etc/init.d/zope' + rm -Rf start stop LICENSE.txt README.txt doc/ + + # Need to rip out the zinstance stuff out + # but save as templates + mkdir .templates + mv -f Extensions/ .templates/ + mv -f import/ .templates/ + mv -f var/ .templates/ + + # Add conf.d script. + dodir /etc/conf.d + echo "ZOPE_OPTS=\"-u zope\"" | \ + cat - ${FILESDIR}/${PV}/zope.envd > .templates/zope.confd + + # Fill in environmental variables + sed -i -e "/ZOPE_HOME=/ c\\ZOPE_HOME=${ZSERVDIR}\\ " \ + -e "/SOFTWARE_HOME=/ c\\SOFTWARE_HOME=${ZSERVDIR}/lib/python\\ " \ + .templates/zope.confd + + # Add rc-script. + cp ${FILESDIR}/${PV}/zope-r1.initd .templates/zope.initd + + # Copy the remaining contents of ${S} into the ${D}. + dodir ${ZSERVDIR} + cp -a . ${D}${ZSERVDIR} + + setup_security ${D}${ZSERVDIR} ${ZGID} +} + +pkg_postinst() +{ + # Here we add our default zope instance. + /usr/sbin/zope-config --zserv=${ZSERVDIR} --zinst=${ZINSTDIR} \ + --zgid=${ZGID} + install_help +} + +pkg_config() +{ + install_help +} diff --git a/net-zope/zope/zope-2.6.0-r3.ebuild b/net-zope/zope/zope-2.6.0-r3.ebuild new file mode 100644 index 000000000000..7d88ed385de5 --- /dev/null +++ b/net-zope/zope/zope-2.6.0-r3.ebuild @@ -0,0 +1,186 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-zope/zope/zope-2.6.0-r3.ebuild,v 1.1 2003/03/03 23:43:22 kutsuya Exp $ + +S="${WORKDIR}/Zope-${PV}-src" + +DESCRIPTION="Zope is a web application platform used for building high-performance, dynamic web sites." +HOMEPAGE="http://www.zope.org" +SRC_URI="http://www.zope.org/Products/Zope/${PV}/Zope-${PV}-src.tgz" +LICENSE="ZPL" +SLOT="0" + +KEYWORDS="~x86 ~sparc" + +# This is for developers that wish to test Zope with virtual/python. +# If this is a problem, let me know right away. --kutsuya@gentoo.org +# I wondering if we need a USE flag for this. But I'm planning to have +# a private environmental variable called PYTHON_SLOT_VERSION set in +# ebuilds to build extensions for python2.1. + +if [ "${PYTHON_SLOT_VERSION}" = 'VIRTUAL' ] ; then + RDEPEND="virtual/python" + python='python' +else + RDEPEND="=dev-lang/python-2.1.3*" + python='python2.1' +fi + +DEPEND="virtual/glibc + >=sys-apps/sed-4.0.5 + ${RDEPEND}" + +RDEPEND="app-admin/zope-config + ${RDEPEND}" + +ZUID=zope +ZGID=$(echo ${P} |sed -e "s:\.:_:g") +ZS_DIR=${ROOT}/usr/share/zope/ +ZI_DIR=${ROOT}/var/lib/zope/ +ZSERVDIR=${ZS_DIR}/${PF}/ +ZINSTDIR=${ZI_DIR}/${ZGID} +CONFDIR=${ROOT}/etc/conf.d/ +RCNAME=zope-r2.initd + +# Narrow the scope of ownership/permissions. +# Security plan: +# * ZUID is the superuser for all zope instances. +# * ZGID is for a single instance's administration. +# * Other's should not have any access to ${ZSERVDIR}, +# because they can work through the Zope web interface. +# This should protect our code/data better. + +#Parameters: +# $1 = instance directory +# $2 = group + +setup_security() +{ + chown -R ${ZUID}:${2} ${1} + chmod -R g+u ${1} + chmod -R o-rwx ${1} +} + +# + +install_help() +{ + einfo "Need to setup an inituser \(admin\) before executing zope:" + einfo "\tzope-config --zpasswd" + einfo "To execute default Zope instance:" + einfo "\t/etc/conf.d/${ZGID} start" +} + +# + +pkg_setup() +{ + if [ "${PYTHON_SLOT_VERSION}" = 'VIRTUAL' ] ; then + ewarn "WARNING: You set PYTHON_SLOT_VERSION=VIRTUAL. So this ebuild will" + ewarn "use python-2.2*. Zope Corp. only recommends using python-2.1.3 " + ewarn "with this version of zope. Emerge at your own risk." + sleep 12 + fi + if ! groupmod ${ZGID} > /dev/null 2>&1 ; then + groupadd ${ZGID} || die "Can not add ${ZGID} group!" + fi + if ! id ${ZUID} > /dev/null 2>&1 ; then + useradd -d ${ZS_DIR} -c "Zope root user" -u 261 ${ZUID} \ + || die "Can not add ${ZUID} user!" + fi +} + +# + +src_unpack() +{ + unpack ${A} + # DateTime 2.6.0(only) rfc822 fix + einfo "Applying patch..." + bzcat ${FILESDIR}/${PV}/DateTime.py.bz2 \ + > ${S}/lib/python/DateTime/DateTime.py || die "Patch failed" +} + +# + +src_compile() { + $python wo_pcgi.py || die "Failed to compile." +} + +# + +src_install() { + dodoc LICENSE.txt README.txt + docinto doc ; dodoc doc/*.txt + docinto doc/PLATFORMS ; dodoc doc/PLATFORMS/* + docinto doc/changenotes ; dodoc doc/changenotes/* + + # using '/etc/init.d/zope' + rm -Rf start stop LICENSE.txt README.txt doc/ + + # Need to rip out the zinstance stuff out + # but save as templates + mkdir -p .templates/import + cp import/README.txt .templates/import/ + mv -f Extensions/ .templates/ + mv -f var/ .templates/ + + # Add conf.d script. + dodir /etc/conf.d + echo "ZOPE_OPTS=\"-u zope\"" | \ + cat - ${FILESDIR}/${PV}/zope.envd > .templates/zope.confd + + # Fill in environmental variables + sed -i -e "/ZOPE_HOME=/ c\\ZOPE_HOME=${ZSERVDIR}\\ " \ + -e "/SOFTWARE_HOME=/ c\\SOFTWARE_HOME=${ZSERVDIR}/lib/python\\ " \ + .templates/zope.confd + + # Add rc-script. + #!! TODO: fill in $python in zope-r2.initd + sed -e "/python=/ c\\python=\"${python}\"\\ " ${FILESDIR}/${PV}/${RCNAME} \ + > .templates/zope.initd + + # Copy the remaining contents of ${S} into the ${D}. + dodir ${ZSERVDIR} + cp -a . ${D}${ZSERVDIR} + + setup_security ${D}${ZSERVDIR} ${ZGID} +} + + +# + +pkg_postinst() +{ + # Here we add our default zope instance. + /usr/sbin/zope-config --zserv=${ZSERVDIR} --zinst=${ZINSTDIR} \ + --zgid=${ZGID} + install_help +} + +# + +pkg_postrm() +{ + # Remove the rcscript and confd file. Emerge won't do it because it + # didn't add them. zope-config did added them. This will change when + # zope-config can remove instances. + + rm -f ${CONFDIR}/${ZGID} /etc/init.d/${ZGID} + + + # Delete .default if this ebuild is the default. zprod-manager will + # have to handle a missing default; + local VERSION_DEF="$(zope-config --zidef-get)" + if [ "${ZGID}" = "$VERSION_DEF" ] ; then + rm -f ${ZI_DIR}/.default + fi +} + + +# + +pkg_config() +{ + install_help +} diff --git a/net-zope/zope/zope-2.6.0.ebuild b/net-zope/zope/zope-2.6.0.ebuild new file mode 100644 index 000000000000..eaab32b367d0 --- /dev/null +++ b/net-zope/zope/zope-2.6.0.ebuild @@ -0,0 +1,85 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-zope/zope/zope-2.6.0.ebuild,v 1.1 2003/03/03 23:43:22 kutsuya Exp $ + +S="${WORKDIR}/Zope-${PV}-src" + +DESCRIPTION="Zope is a web application platform used for building high-performance, dynamic web sites." +HOMEPAGE="http://www.zope.org" +SRC_URI="http://www.zope.org/Products/Zope/${PV}/Zope-${PV}-src.tgz" +LICENSE="ZPL" +SLOT="0" + +# TODO: needs to be confirmed on other platforms. +KEYWORDS="x86" + +DEPEND="virtual/glibc + dev-lang/python" + +ZOPEDIR="${DESTTREE}/share/zope/${PV}/" + +src_compile() { + python w_pcgi.py || die +} + +src_install() { + ENVD_DIR=etc/env.d/ + CONFD_DIR=etc/conf.d/ + + # move the main docs and compress them. + dodoc LICENSE.txt README.txt + + docinto doc + dodoc doc/*.txt + + docinto doc/PLATFORMS + dodoc doc/PLATFORMS/* + + docinto doc/changenotes + dodoc doc/changenotes/* + + #rm -fr LICENSE.txt README.txt doc/ + + # patch some paths. + sed -e "s:${S}:${ZOPEDIR}:" Zope.cgi > Zope.cgi.tmp + mv Zope.cgi.tmp Zope.cgi + chmod 755 Zope.cgi # restoring permissions + + # using '/etc/init.d/zope' instead + rm -f start stop + + # Keep others from overwritting PID files + chmod o+t var/ + + # copy the remaining contents of ${S} into the ${D}. + dodir ${ZOPEDIR} + cp -a . ${D}${ZOPEDIR} + + # Add a rc-script. + insinto /etc/init.d + newins ${FILESDIR}/${PV}/zope.initd zope + + # Add a env.d script. + insinto /etc/env.d + doins ${FILESDIR}/${PV}/zope.envd + + # Fill in an env.d variable. + sed -e "/ZOPE_HOME/ c\\ZOPE_HOME=${ZOPEDIR}\\" ${D}${ENVD_DIR}zope.envd \ + > ${D}${ENVD_DIR}zope.tmp + mv ${D}${ENVD_DIR}zope.tmp ${D}${ENVD_DIR}50zope + + # Add a conf.d script. + dodir ${CONFD_DIR} + echo -e "ZOPE_OPTS='-u root'\nZOPE_HOME=${ZOPEDIR}" > ${D}${CONFD_DIR}zope +} + +pkg_postinst() { + einfo "To get zope running you must execure the following:" + einfo "\tebuild /var/db/pkg/net-www/${PF}/${P}.ebuild config" +} + +pkg_config() { + einfo ">>> Create inital user...${ROOT}\n" + python ${ROOT}${ZOPEDIR}zpasswd.py ${ROOT}${ZOPEDIR}inituser +} + diff --git a/net-zope/zope/zope-2.6.1.ebuild b/net-zope/zope/zope-2.6.1.ebuild new file mode 100644 index 000000000000..0f519327d6c3 --- /dev/null +++ b/net-zope/zope/zope-2.6.1.ebuild @@ -0,0 +1,173 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-zope/zope/zope-2.6.1.ebuild,v 1.1 2003/03/03 23:43:22 kutsuya Exp $ + +S="${WORKDIR}/Zope-${PV}-src" + +DESCRIPTION="Zope is a web application platform used for building high-performance, dynamic web sites." +HOMEPAGE="http://www.zope.org" +SRC_URI="http://www.zope.org/Products/Zope/${PV}/Zope-${PV}-src.tgz" +LICENSE="ZPL" +SLOT="0" + +KEYWORDS="~x86 ~sparc" + +# This is for developers that wish to test Zope with virtual/python. +# If this is a problem, let me know right away. --kutsuya@gentoo.org +# I wondering if we need a USE flag for this. But I'm planning to have +# a private environmental variable called PYTHON_SLOT_VERSION set in +# ebuilds to build extensions for python2.1. + +if [ "${PYTHON_SLOT_VERSION}" = 'VIRTUAL' ] ; then + RDEPEND="virtual/python" + python='python' +else + RDEPEND="=dev-lang/python-2.1.3*" + python='python2.1' +fi + +DEPEND="virtual/glibc + >=sys-apps/sed-4.0.5 + ${RDEPEND}" + +RDEPEND="app-admin/zope-config + ${RDEPEND}" + +ZUID=zope +ZGID=$(echo ${P} |sed -e "s:\.:_:g") +ZS_DIR=${ROOT}/usr/share/zope/ +ZI_DIR=${ROOT}/var/lib/zope/ +ZSERVDIR=${ZS_DIR}/${PF}/ +ZINSTDIR=${ZI_DIR}/${ZGID} +CONFDIR=${ROOT}/etc/conf.d/ +RCNAME=zope.initd + +# Narrow the scope of ownership/permissions. +# Security plan: +# * ZUID is the superuser for all zope instances. +# * ZGID is for a single instance's administration. +# * Other's should not have any access to ${ZSERVDIR}, +# because they can work through the Zope web interface. +# This should protect our code/data better. + +#Parameters: +# $1 = instance directory +# $2 = group + +setup_security() +{ + chown -R ${ZUID}:${2} ${1} + chmod -R g+u ${1} + chmod -R o-rwx ${1} +} + +# + +install_help() +{ + einfo "Need to setup an inituser \(admin\) before executing zope:" + einfo "\tzope-config --zpasswd" + einfo "To execute default Zope instance:" + einfo "\t/etc/conf.d/${ZGID} start" +} + +# + +pkg_setup() +{ + if [ "${PYTHON_SLOT_VERSION}" = 'VIRTUAL' ] ; then + ewarn "WARNING: You set PYTHON_SLOT_VERSION=VIRTUAL. So this ebuild will" + ewarn "use python-2.2*. Zope Corp. only recommends using python-2.1.3 " + ewarn "with this version of zope. Emerge at your own risk." + sleep 12 + fi + if ! groupmod ${ZGID} > /dev/null 2>&1 ; then + groupadd ${ZGID} || die "Can not add ${ZGID} group!" + fi + if ! id ${ZUID} > /dev/null 2>&1 ; then + useradd -d ${ZS_DIR} -c "Zope root user" -u 261 ${ZUID} \ + || die "Can not add ${ZUID} user!" + fi +} + +# + +src_compile() { + $python wo_pcgi.py || die "Failed to compile." +} + +# + +src_install() { + dodoc LICENSE.txt README.txt + docinto doc ; dodoc doc/*.txt + docinto doc/PLATFORMS ; dodoc doc/PLATFORMS/* + docinto doc/changenotes ; dodoc doc/changenotes/* + + # using '/etc/init.d/zope' + rm -Rf start stop LICENSE.txt README.txt doc/ + + # Need to rip out the zinstance stuff out + # but save as templates + mkdir -p .templates/import + cp import/README.txt .templates/import/ + mv -f Extensions/ .templates/ + mv -f var/ .templates/ + + # Add conf.d script. + dodir /etc/conf.d + echo "ZOPE_OPTS=\"-u zope\"" | \ + cat - ${FILESDIR}/${PV}/zope.envd > .templates/zope.confd + + # Fill in environmental variables + sed -i -e "/ZOPE_HOME=/ c\\ZOPE_HOME=${ZSERVDIR}\\ " \ + -e "/SOFTWARE_HOME=/ c\\SOFTWARE_HOME=${ZSERVDIR}/lib/python\\ " \ + .templates/zope.confd + + # Add rc-script. + #!! TODO: fill in $python in zope-r2.initd + sed -e "/python=/ c\\python=\"${python}\"\\ " ${FILESDIR}/${PV}/${RCNAME} \ + > .templates/zope.initd + + # Copy the remaining contents of ${S} into the ${D}. + dodir ${ZSERVDIR} + cp -a . ${D}${ZSERVDIR} + + setup_security ${D}${ZSERVDIR} ${ZGID} +} + +# + +pkg_postinst() +{ + # Here we add our default zope instance. + /usr/sbin/zope-config --zserv=${ZSERVDIR} --zinst=${ZINSTDIR} \ + --zgid=${ZGID} + install_help +} + +# + +pkg_postrm() +{ + # Remove the rcscript and confd file. Emerge won't do it because it + # didn't add them. zope-config did added them. This will change when + # zope-config can remove instances. + + rm -f ${CONFDIR}/${ZGID} /etc/init.d/${ZGID} + + + # Delete .default if this ebuild is the default. zprod-manager will + # have to handle a missing default; + local VERSION_DEF="$(zope-config --zidef-get)" + if [ "${ZGID}" = "$VERSION_DEF" ] ; then + rm -f ${ZI_DIR}/.default + fi +} + +# + +pkg_config() +{ + install_help +} |