diff options
Diffstat (limited to 'net-www/zope')
-rw-r--r-- | net-www/zope/files/digest-zope-2.4.0 | 1 | ||||
-rw-r--r-- | net-www/zope/files/zope | 167 | ||||
-rw-r--r-- | net-www/zope/zope-2.4.0.ebuild | 97 |
3 files changed, 265 insertions, 0 deletions
diff --git a/net-www/zope/files/digest-zope-2.4.0 b/net-www/zope/files/digest-zope-2.4.0 new file mode 100644 index 000000000000..88acd9059751 --- /dev/null +++ b/net-www/zope/files/digest-zope-2.4.0 @@ -0,0 +1 @@ +MD5 1a41e096a80411bccf61cd862bc3cc20 Zope-2.4.0-src.tgz diff --git a/net-www/zope/files/zope b/net-www/zope/files/zope new file mode 100644 index 000000000000..b84f1eae3eea --- /dev/null +++ b/net-www/zope/files/zope @@ -0,0 +1,167 @@ +#!/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 + +SERVICE=zope +opts="start stop restart status" + +export INSTANCE_HOME=/var/lib/zope +export INSTANCE_NAME=`basename ${INSTANCE_HOME}` + +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 root \ + -z /usr/share/zope \ + -Z /var/run/zwatchdog.pid \ + -w '' \ + -f 8021 \ + -m '' \ + -l /var/log/zope \ + 2>&1 >> /var/log/zope \ + & + else + /usr/bin/env python z2.py \ + -u root \ + -z /usr/share/zope \ + -Z /var/run/zwatchdog.pid \ + -w 8080 \ + -f 8021 \ + -W 8023 \ + -m '' \ + -l /var/log/zope \ + -D \ + 2>&1 >> /var/log/zope \ + & + 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 + eend $? "Error stopping $SERVICE" + } + +restart(){ + stop + start + } + +status(){ + echo "Checking for zope: " + chkstatus zwatchdog + chkstatus zserver + } + +doservice ${@} diff --git a/net-www/zope/zope-2.4.0.ebuild b/net-www/zope/zope-2.4.0.ebuild new file mode 100644 index 000000000000..d634fd75cdda --- /dev/null +++ b/net-www/zope/zope-2.4.0.ebuild @@ -0,0 +1,97 @@ +# Copyright 1999-2000 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Holger Brueckner <darks@gentoo.org> +# $Header: /var/cvsroot/gentoo-x86/net-www/zope/zope-2.4.0.ebuild,v 1.1 2001/08/05 21:23:11 darks Exp $ + +A="Zope-${PV}-src.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" +HOMEPAGE="http://www.zope.org" + +DEPEND="virtual/glibc + >=dev-lang/python-2.1" +RDEPEND=">=dev-lang/python-2.1" + +src_unpack() { + + unpack Zope-${PV}-src.tgz +} + +src_compile() { + + try python w_pcgi.py +} + +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}/var + doins z2.py + insopts -m644 + doins var/Data.fs.in + dodir ${ZVAR}/Extensions + dodir ${ZVAR}/import + dodir ${ZVAR}/Products + + exeinto ${ZDIR} + doexe zpasswd.py start stop 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/rc.d/init.d + exeinto /etc/rc.d/init.d + doexe ${FILESDIR}/zope +} + +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 + echo + echo before you can start zope + fi +} |