summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Shoemaker <kutsuya@gentoo.org>2003-02-26 07:29:22 +0000
committerJason Shoemaker <kutsuya@gentoo.org>2003-02-26 07:29:22 +0000
commit0e46db125065dfa92249efe4253e82d2d5ce0e81 (patch)
tree2c7261abe82df5fa32c7b2d8c432fa325fc658da /net-www
parentFixed dependencies. Added functions to preserve certain .txt files from (diff)
downloadhistorical-0e46db125065dfa92249efe4253e82d2d5ce0e81.tar.gz
historical-0e46db125065dfa92249efe4253e82d2d5ce0e81.tar.bz2
historical-0e46db125065dfa92249efe4253e82d2d5ce0e81.zip
Fixed dependencies, changed slot to '0'. Added ability to change python versions. Change zope user details. Added RCNAME to make my job easier.
Diffstat (limited to 'net-www')
-rw-r--r--net-www/zope/ChangeLog14
-rw-r--r--net-www/zope/files/2.6.0/zope-r2.initd175
-rw-r--r--net-www/zope/files/digest-zope-2.6.0-r31
-rw-r--r--net-www/zope/zope-2.6.0-r2.ebuild7
-rw-r--r--net-www/zope/zope-2.6.0-r3.ebuild186
5 files changed, 377 insertions, 6 deletions
diff --git a/net-www/zope/ChangeLog b/net-www/zope/ChangeLog
index c9e90cd7371b..56ec75604a1d 100644
--- a/net-www/zope/ChangeLog
+++ b/net-www/zope/ChangeLog
@@ -1,12 +1,22 @@
# ChangeLog for net-www/zope
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-www/zope/ChangeLog,v 1.10 2003/02/17 04:54:38 kutsuya Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-www/zope/ChangeLog,v 1.11 2003/02/26 07:29:22 kutsuya Exp $
06 Dec 2002; Rodney Rees <manson@gentoo.org> : changed sparc ~sparc keywords
+*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 revison.
+ 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
diff --git a/net-www/zope/files/2.6.0/zope-r2.initd b/net-www/zope/files/2.6.0/zope-r2.initd
new file mode 100644
index 000000000000..80a1a14a2f7f
--- /dev/null
+++ b/net-www/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-www/zope/files/2.6.0/zope-r2.initd,v 1.1 2003/02/26 07:29: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-www/zope/files/digest-zope-2.6.0-r3 b/net-www/zope/files/digest-zope-2.6.0-r3
new file mode 100644
index 000000000000..c2e2d34bcace
--- /dev/null
+++ b/net-www/zope/files/digest-zope-2.6.0-r3
@@ -0,0 +1 @@
+MD5 a0bb91ca1df775aebfc8ff8c46afa3a9 Zope-2.6.0-src.tgz 2291282
diff --git a/net-www/zope/zope-2.6.0-r2.ebuild b/net-www/zope/zope-2.6.0-r2.ebuild
index ea39952fc6a9..3c75d48f8430 100644
--- a/net-www/zope/zope-2.6.0-r2.ebuild
+++ b/net-www/zope/zope-2.6.0-r2.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Copyright 2002-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-www/zope/zope-2.6.0-r2.ebuild,v 1.2 2003/02/17 04:54:38 kutsuya Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-www/zope/zope-2.6.0-r2.ebuild,v 1.3 2003/02/26 07:29:22 kutsuya Exp $
S="${WORKDIR}/Zope-${PV}-src"
@@ -8,7 +8,7 @@ DESCRIPTION="Zope is a web application platform used for building high-performan
HOMEPAGE="http://www.zope.org"
SRC_URI="http://www.zope.org/Products/Zope/${PV}/Zope-${PV}-src.tgz"
LICENSE="ZPL"
-SLOT="2.6"
+SLOT="0"
KEYWORDS="~x86 ~sparc"
@@ -16,7 +16,6 @@ RDEPEND="=dev-lang/python-2.1.3*"
DEPEND="virtual/glibc
>=sys-apps/sed-4.0.5
app-admin/zope-config
- app-admin/zprod-update
${RDEPEND}"
ZUID=zope
diff --git a/net-www/zope/zope-2.6.0-r3.ebuild b/net-www/zope/zope-2.6.0-r3.ebuild
new file mode 100644
index 000000000000..c7cc95a17650
--- /dev/null
+++ b/net-www/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-www/zope/zope-2.6.0-r3.ebuild,v 1.1 2003/02/26 07:29: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/init.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
+}