summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2012-03-01 15:07:21 +0000
committerPatrick Lauer <patrick@gentoo.org>2012-03-01 15:07:21 +0000
commit3b6efd4019e731fcfe80d527b4f46cc6b9a41b58 (patch)
tree8b9739ef72b17060424125795b862ae23de8041b /app-admin/zope-config/files
parentFold standard_configure_options() into qt4-build_src_configure(). (diff)
downloadhistorical-3b6efd4019e731fcfe80d527b4f46cc6b9a41b58.tar.gz
historical-3b6efd4019e731fcfe80d527b4f46cc6b9a41b58.tar.bz2
historical-3b6efd4019e731fcfe80d527b4f46cc6b9a41b58.zip
Removing p.masked net-zope deps
Diffstat (limited to 'app-admin/zope-config/files')
-rw-r--r--app-admin/zope-config/files/0.4/zope-config515
-rw-r--r--app-admin/zope-config/files/0.4/zope-config.conf30
-rw-r--r--app-admin/zope-config/files/0.5/zope-config520
-rw-r--r--app-admin/zope-config/files/0.5/zope-config-0.5.patch26
-rw-r--r--app-admin/zope-config/files/0.5/zope-config.conf30
-rwxr-xr-xapp-admin/zope-config/files/0.6/zope-config531
-rw-r--r--app-admin/zope-config/files/0.6/zope-config.conf30
7 files changed, 0 insertions, 1682 deletions
diff --git a/app-admin/zope-config/files/0.4/zope-config b/app-admin/zope-config/files/0.4/zope-config
deleted file mode 100644
index 5dfcbb3c4572..000000000000
--- a/app-admin/zope-config/files/0.4/zope-config
+++ /dev/null
@@ -1,515 +0,0 @@
-#!/bin/bash
-# vim: set noexpandtab ts=4:
-# Gentoo Zope Instance configure tool.
-#
-# Originally written by Jason Shoemaker <kutsuya@gentoo.org>
-# Portions by Jodok Batlogg <batlogg@gentoo.org> (Logging and some cleanups)
-# Portions by Robin Johnson <robbat2@gentoo.org> (Documentation and further cleanup)
-# Portions by Carter Smithhart <derheld42@derheld.net> (2.7.0 stuff)
-#
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/files/0.4/zope-config,v 1.6 2004/09/18 15:58:05 batlogg Exp $
-#
-#
-# Notes:
-# $ZI_DIR/.default holds name of default zope instance
-# $NEWZOPE is set to 1 if the zope server is 2.7.0 or newer
-#
-VERSION="0.4"
-
-CONFIGFILE=/etc/zope-config.conf
-if [ -e ${CONFIGFILE} ]; then
- source ${CONFIGFILE}
- EVENTLOGDIR=`dirname ${EVENTLOGDIR}`/`basename ${EVENTLOGDIR}`
-else
- echo "Unable to find config file: ${CONFIGFILE}" 1>&2
- exit 1
-fi
-
-
-
-# Return codes used in this program:
-E_SUCCESS=0
-E_FAILURE=1
-
-E_ZILIST=22
-E_PARAM=26
-E_ZSLIST=28
-E_ZIDEFAULT=30
-ZUID=''
-#Parameters:
-# $1 = instance directory
-# $2 = group
-# $3 = user
-zinst_security_setup()
-{
- if [ ${ZOPE27} ] ; then
- chown -R ${3}:${2} ${1}
- chmod -R o-rwx ${1}
- chmod -R g-w ${1}
- #chmod g+ws ${1}/{var,log}
- chmod g+rX -R ${1}
- #set owner and group on log dir
- chown -R ${ZUID}:${ZGID_NAME} ${EVENTLOGDIR}/${ZIRC_NAME}
- # permissions on log dir
- chmod -R 750 ${EVENTLOGDIR}/${ZIRC_NAME}
- else
- chown -R ${3}:${2} ${1}
- chmod -R g+u ${1}
- chmod -R o-rwx ${1}
- chown root ${1}/var/ # needed if $ZOPE_OPTS='-u root'
- chmod +t ${1}/var/
- fi
-}
-
-# params: $ZSERV_DIR
-# returns 1 if $ZSERV_DIR is a 2.7 or newer Zope. Also sets NEWZOPE to 1.
-zserv_is_2.7_or_newer()
-{
- TEXT=$(echo $1 | grep ${ZS_DIR2})
- if [ "$TEXT" = "" ] ; then
- NEWZOPE=0
- return 0;
- fi
- NEWZOPE=1
- return 1;
-}
-
-#Params:
-# $1 = zserv dir
-# $2 = zinst dir
-zinst_fs_setup()
-{
- local RESULT=${E_FAILURE}
- local USER=
- local PASS=
- local PASS2=
-
- if [ "${#}" -lt 2 ] ; then
- # need a param
- RESULT=${E_PARAM}
- elif [ ${ZOPE27} ] ; then
- if [ "x$3" == "xinituser" ] ; then
- ${BIN}/mkzopeinstance.py --user admin:admin --dir $2
- else
- ${BIN}/mkzopeinstance.py --dir $2
- fi
- # create the log directory
- mkdir ${EVENTLOGDIR}/${ZIRC_NAME}
- # remove log directory in skeltarget
- rm -r $2/log
- # symlink log directory
- ln -s ${EVENTLOGDIR}/${ZIRC_NAME} $2/log
- RESULT=$?
- else
- if [ $NEWZOPE = 1 ] ; then
- while : ; do
- USER=$(dialog --stdout \
- --backtitle "Please choose a username and password for the initial user." \
- --inputbox "Username:" 0 0 "admin")
- RESULT=$?
- if [ "$USER" != "" ] ; then
- break
- fi
- done
- while : ; do
- PASS=$(dialog --stdout \
- --backtitle "Please choose a username and password for the initial user." \
- --passwordbox "Password:" 0 0 "")
- RESULT=$?
- if [ "$PASS" = "" ] ; then
- continue
- fi
- PASS2=$(dialog --stdout \
- --backtitle "Please choose a username and password for the initial user." \
- --passwordbox "Reenter Password:" 0 0 "")
- RESULT=$?
- if [ "$PASS2" = "" ] ; then
- continue
- fi
- if [ $PASS = $PASS2 ] ; then
- break
- else
- dialog --msgbox "Passwords must be equal!" 0 0
- fi
- done
- su zope -c "$1/bin/mkzopeinstance.py --dir $2 --user $USER:$PASS"
- RESULT=${E_SUCCESS}
- else
- # prior to 2.7
- mkdir -p $2 || exit 1
- if [ $(zinst_default_get >/dev/null)$? -ne 0 ] ; then
- echo $(basename ${ZINST_DIR}) >${ZI_DIR}/.default
- chown zope:root ${ZI_DIR}/.default
- fi
-
- if [ -f $2/var/Data.fs ]; then
- mv $2/var/Data.fs $2/var/Data.fs.org
- fi
-
- cp -R $1/.templates/Extensions $2
- cp -R $1/.templates/import $2
- cp -R $1/.templates/var $2
- mkdir $2/Products
-
- if [ -f $2/var/Data.fs.org ]; then
- mv $2/var/Data.fs $2/var/Data.fs.dist
- mv $2/var/Data.fs.org $2/var/Data.fs
- fi
-
- RESULT=$?
- fi
- fi
-
- return ${RESULT}
-}
-
-#Params:
-# $1 = zserv dir
-# $2 = zinst dir
-# $3 = zinst name
-zinst_rc_setup()
-{
- local RESULT=${E_FAILURE}
-
- if [ "${#}" -lt 3 ] ; then
- # need a param
- RESULT=${E_PARAM}
- elif [ ${ZOPE27} ] ; then
- install $1/skel/zope.initd ${INITD}/${3}
- #echo "INSTANCE_HOME=${2}" >${CONFD}/$3
- #echo "EVENT_LOG_FILE=${EVENTLOGDIR}/${3}" >>${CONFD}/$3
- sed -i \
- -e "/^# *effective-user/ a\\effective-user ${ZUID}\\ " \
- ${2}/etc/zope.conf
- sed -i \
- -e "s|INSTANCE_HOME|${2}|" \
- ${INITD}/${3}
- RESULT=$?
- else
- if [ $NEWZOPE = 1 ] ; then
- install $1/.templates/zope.initd ${INITD}/${3}
- sed -i \
- -e "s|ZINST_DIR=|ZINST_DIR=${2}|" \
- -e "s|EVENT_LOG_FILE=|EVENT_LOG_FILE=${EVENTLOGDIR}\/${3}|" \
- ${INITD}/${3}
- RESULT=${E_SUCCESS}
- else
- install $1/.templates/zope.confd ${CONFD}/${3}
- install $1/.templates/zope.initd ${INITD}/${3}
- sed -i \
- -e "/INSTANCE_HOME=/ c\\INSTANCE_HOME=${2}\\ " \
- -e "/CLIENT_HOME=/ c\\CLIENT_HOME=${2}/var\\ " \
- -e "/EVENT_LOG_FILE=/ c\\EVENT_LOG_FILE=${EVENTLOGDIR}\/${3}\\ " \
- ${CONFD}/${3}
- RESULT=$?
- fi
- # make sure the directory exists
- mkdir -p ${EVENTLOGDIR} >/dev/null 2>&1
- fi
- return ${RESULT}
-}
-
-# Sets the variable: ZSERV_DIR and returns 0
-# or returns a non-zero error code
-zserv_dir_get()
-{
- local RESULT=${E_FAILURE}
- local LIST=$(ls -d ${ZS_DIR}* ; ls -d ${ZS_DIR2}*)
- local LIST_CNT=$(echo ${LIST} | wc -w)
- local DLIST=
-
- # Assume that LIST_TMP contains valid zserver dirs.
- if [ ${LIST_CNT} -eq 1 ] ; then
- ZSERV_DIR=${LIST}
- RESULT=${E_SUCCESS}
- elif [ ${LIST_CNT} -ne 0 ] ; then
- for N in ${LIST} ; do
- DLIST="${DLIST} $N -"
- done
- ZSERV_DIR=$(dialog --stdout \
- --title "Zope Server List" \
- --menu "Select desired zserver: " 0 40 ${LIST_CNT} ${DLIST})
- RESULT=$?
- else
- RESULT=${E_ZSLIST} # There are no zservers
- fi
-
- # set NEWZOPE to 1 if we are dealing with a "newer" zope version
- zserv_is_2.7_or_newer ${ZERV_DIR}
-
- return ${RESULT}
-}
-
-# Sets the variable: ZINST_DIR and returns 0
-# or returns a non-zero error code
-zinst_dir_set()
-{
- local RESULT=
-
- if [ ! -d ${ZI_DIR} ] ; then
- mkdir -p ${ZI_DIR}
- fi
-
- while : ; do
- ZINST_DIR=$(dialog --stdout \
- --backtitle "We need a unique name for the zinstance directory. (This will be the name of the rcscript.)" \
- --inputbox "Enter a new zinstance name:" 0 0 ${DEFAULT_ZINSTANCENAME} )
- RESULT=$?
- if [ ${RESULT} -ne 0 ] ; then
- break
- elif [ -z ${ZINST_DIR} ] ; then
- dialog --msgbox "Error: need a name." 0 0
- continue
- elif echo ${ZINST_DIR} |grep "/" ; then
- dialog --msgbox "Error: ${ZINST_DIR} is a path, not a name." 0 0
- continue
- elif [[ -d "${ZI_DIR}${ZINST_DIR}" && \
- -f "${INITD}/${ZINST_DIR}" ]] ; then
- dialog --msgbox "Error: ${ZINST_DIR} zinstance already exists. Delete ${INITD}/${ZINST_DIR} to replace instance." 0 0
- continue
- fi
- ZINST_DIR=${ZI_DIR}${ZINST_DIR}
- break
- done
- return ${RESULT}
-}
-
-# sets the variable $ZINST_DIR and returns 0
-# or returns non-null error code
-zinst_dir_get()
-{
- local RESULT=1
- local LIST=$(ls ${ZI_DIR})
- local LIST_CNT=$(echo ${LIST} | wc -w)
- local DLIST=
-
- # Assume that LIST_TMP contains valid zinstance dirs.
- if [ ${LIST_CNT} -eq 1 ] ; then
- ZINST_DIR=${LIST}
- RESULT=${E_SUCCESS}
- elif [ ${LIST_CNT} -ne 0 ] ; then
- for N in ${LIST} ; do
- DLIST="${DLIST} $N -"
- done
- ZINST_DIR=$(dialog --stdout \
- --title "Zope Instance List" \
- --menu "Select desired zinstance:" 0 0 ${LIST_CNT} ${DLIST})
- RESULT=$?
- else
- RESULT=${E_ZILIST} # There are no zinstances
- fi
- ZINST_DIR="${ZI_DIR}${ZINST_DIR}"
- return ${RESULT}
-}
-
-# makes ZSERV_DIR the default zope version. if ZSERV_DIR
-zinst_default_set()
-{
- local RESULT=
-
- if [ -z ${ZINST_DIR} ] ; then
- zinst_dir_get || { echo 'Cancelled: zinst_dir_get' ; exit 1 ; }
- fi
- RESULT=$?
- if [ ${RESULT} -eq 0 ] ; then
- echo $(basename ${ZINST_DIR}) >${ZI_DIR}/.default
- chown zope ${ZI_DIR}/.default
- fi
-
- return ${RESULT}
-}
-
-# Echos the default directory that this instance was created in
-zinst_default_get()
-{
- local RESULT=${E_ZIDEFAULT}
-
- if [ -s ${ZI_DIR}/.default ] ; then
- cat ${ZI_DIR}/.default
- RESULT=$? # use to be 0
- fi
- return ${RESULT}
-}
-
-# Gets a name for the group that owns the new zinstance and also creates the
-# group if nessicary
-zinst_zgid_set()
-{
- local RESULT=
- while : ; do
- ZGID_NAME=$(dialog --stdout \
- --backtitle "We need to create and/or assign a zinstance group name." \
- --inputbox "Enter a group name:" \
- 0 0 $(basename ${ZIRC_NAME}))
- RESULT=$?
- if [ ${RESULT} -ne 0 ] ; then
- break
- elif [ -z ${ZGID_NAME} ] ; then
- dialog --msgbox "Error: empty string." 0 0
- continue
- elif groupmod ${ZGID_NAME} >/dev/null 2>&1 ; then
- dialog --yesno "The group ${ZGID_NAME} already exists. Do you want to use it?" 0 0
- RESULT=$?
- [ ${RESULT} -ne 0 ] && continue
- fi
- break
- done
- return ${RESULT}
-}
-
-# Gets a name for the user that owns the new zinstance and also creates the
-# group if nessicary, this is the user zope runs as
-zinst_zuid_set()
-{
- local RESULT=
- while : ; do
- ZUID=$(dialog --stdout \
- --backtitle "We need to create and/or assign a zinstance user name." \
- --inputbox "Enter a user name:" \
- 0 0 $(basename ${ZIRC_NAME}))
- RESULT=$?
- if [ ${RESULT} -ne 0 ] ; then
- break
- elif [ -z ${ZUID} ] ; then
- dialog --msgbox "Error: empty string." 0 0
- continue
- elif egrep "^${ZUID}:" /etc/passwd >/dev/null 2>&1 ; then
- dialog --yesno "The user ${ZUID} already exists. Do you want to use it?" 0 0
- RESULT=$?
- [ ${RESULT} -ne 0 ] && continue
- fi
- break
- done
- return ${RESULT}
-}
-
-# Sets the inituser password for a given zinstance
-zinst_zpasswd_set()
-{
- if [ -z ${ZSERV_DIR} ] ; then
- zserv_dir_get || { exit $? ; }
- fi
- if [ -z ${ZINST_DIR} ] ; then
- zinst_dir_get || exit $?
- fi
-
- zserv_is_2.7_or_newer ${ZSERV_DIR}
- if [ $NEWZOPE = 1 ] ; then
- echo ">>> Creating a Zope inituser for \"$(basename ${ZINST_DIR})\"..."
- /usr/bin/python ${BIN}/zpasswd.py ${ZINST_DIR}/inituser
- # If zpasswd is aborted it creates a blank inituser
- chown ${ZUID} ${ZINST_DIR}/inituser
- else
- echo ">>> Creating a Zope inituser for \"$(basename ${ZINST_DIR})\"..."
- /usr/bin/python ${ZSERV_DIR}/zpasswd.py ${ZINST_DIR}/inituser
- # If zpasswd is aborted it creates a blank inituser
- chown ${ZUID} ${ZINST_DIR}/inituser
- fi
-}
-
-# help!
-
-usage()
-{
- echo "$(basename $0) version ${VERSION}"
- echo "A Gentoo Zope instance configuration tool."
- echo
- echo "Interactive usage:"
- echo -e "\t$(basename $0)"
- echo "Partial interactive usage:"
- echo -e "\t$(basename $0) --[zserv=[dir] &| zinst=[dir] &| zgid=[name]]"
- echo "Non-interactive usage:"
- echo -e "\t$(basename $0) --[zidef-get | zidef-set | zpasswd | version | help]"
- echo -e "\t$(basename $0) --[zserv=[dir] & zinst=[di] & zgid=[name]]"
- exit ${E_SUCCESS}
-}
-
-zserv_version_detect()
-{
- if [ -d "${ZSERV_DIR}/bin" ] ; then
- ZOPE27=1
- BIN=${ZSERV_DIR}/bin
- else
- ZOPE27=0
- BIN=${ZSERV_DIR}
- fi
-}
-
-##### Process the commandline
-
-while [ "$#" -gt 0 ] ; do
- case "$1" in
- -*=*) OPTARG=$(echo "$1" | sed 's/[-_a-zA-Z0-9:]*=//') ;;
- *) OPTARG= ;;
- esac
-
- case "$1" in
- --zserv=*) ZSERV_DIR=${OPTARG} ; zserv_version_detect ;;
- --zinst=*) ZINST_DIR=${OPTARG} ;;
- --zgid=*) ZGID_NAME=${OPTARG} ;;
- --zuid=*) ZUID=${OPTARG} ;;
- --zinituser) ZINIT_USER=inituser ;;
- --zidef-set) zinst_default_set ; exit $? ;;
- --zidef-get) zinst_default_get ; exit $? ;;
- --zpasswd) zinst_zpasswd_set ; exit $? ;;
- --version) echo ${VERSION} ; exit 0 ;;
- -*) usage ; exit 0 ;;
- *) usage ; exit 0 ;;
- esac
- shift
-done
-
-# if ZSERV_DIR isn't set by command line, call zserv_dir_get to set it
-if [ -z ${ZSERV_DIR} ] ; then
- zserv_dir_get || { echo 'Cancelled: zserv_dir_get' ; exit 1 ; }
- zserv_version_detect
-else
- ZSERV_DIR=`dirname ${ZSERV_DIR}`/`basename ${ZSERV_DIR}`
-fi
-
-# if ZINST_DIR passed by command line, call zinst_dir_set to set it
-if [ -z ${ZINST_DIR} ] ; then
- zinst_dir_set || { echo 'Cancelled: zinst_dir_set' ; exit 1 ; }
-else
- ZINST_DIR=`dirname ${ZINST_DIR}`/`basename ${ZINST_DIR}`
-fi
-
-# if ZIRC_NAME isn't set then use the base of the ZINST_DIR for ZIRC_NAME
-[ -z ${ZIRC_NAME} ] && ZIRC_NAME=$(basename ${ZINST_DIR})
-
-if [ -z ${ZUID} ] ; then
- zinst_zuid_set || { echo 'Cancelled: zinst_zuid_set' ; exit 1 ; }
-fi
-
-if [ -z ${ZGID_NAME} ] ; then
- zinst_zgid_set || { echo 'Cancelled: zinst_zgid_set' ; exit 1 ; }
-fi
-
-
-
-zserv_is_2.7_or_newer ${ZSERV_DIR}
-
-! groupmod ${ZGID_NAME} >/dev/null 2>&1 && groupadd ${ZGID_NAME}
-zinst_fs_setup ${ZSERV_DIR} ${ZINST_DIR} ${ZINIT_USER}
-zinst_rc_setup ${ZSERV_DIR} ${ZINST_DIR} ${ZIRC_NAME}
-
-# create user if needed
-useradd -g ${ZGID_NAME} ${ZUID}
-
-
-# add existing user to the new group
-gpasswd -a ${ZUID} ${ZGID_NAME}
-
-zinst_security_setup ${ZINST_DIR} ${ZGID_NAME} ${ZUID}
-# TODO: see about adding interactive configuration of ZOPE_OPTS
-if [ ${ZOPE27} ] ; then
- echo "Note: Review settings in ${ZINST_DIR}/etc/zope.conf."
- echo "Then you can start your new instance with:"
- echo " /etc/init.d/${ZIRC_NAME} start"
-else
- echo "Note: Don\'t forget to edit ZOPE_OPTS in ${CONFD}${ZIRC_NAME}"
- echo " (you might want to add -P 8{1,2,3,..}00 to set the zope ports offset)"
-fi
-
diff --git a/app-admin/zope-config/files/0.4/zope-config.conf b/app-admin/zope-config/files/0.4/zope-config.conf
deleted file mode 100644
index 312e5bdbbd22..000000000000
--- a/app-admin/zope-config/files/0.4/zope-config.conf
+++ /dev/null
@@ -1,30 +0,0 @@
-# vim: set noexpandtab ts=4 ft=sh:
-# Gentoo Zope Instance configure tool config file.
-#
-# Originally written by Jason Shoemaker <kutsuya@gentoo.org>
-# Portions by Jodok Batlogg <batlogg@gentoo.org> (Logging and some cleanups)
-# Portions by Robin Johnson <robbat2@gentoo.org> (Documentation and further cleanup)
-#
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/files/0.4/zope-config.conf,v 1.3 2004/07/24 22:19:46 batlogg Exp $
-
-# default name for new instances
-DEFAULT_ZINSTANCENAME="zope-"
-
-# Logging directory
-EVENTLOGDIR="/var/log/zope/"
-
-# you probably shouldn't change anything below this
-# -------------------------------------------------
-# Name of zope user on your system
-ZUID=zope
-# This is where the real zope lives
-ZS_DIR="/usr/share/zope/"
-ZS_DIR2="/usr/lib/zope-"
-# This is where we will put our new instance of zope
-ZI_DIR="/var/lib/zope/"
-# place for init script
-# and it's associated configuration file
-INITD="/etc/init.d/"
-CONFD="/etc/conf.d/"
diff --git a/app-admin/zope-config/files/0.5/zope-config b/app-admin/zope-config/files/0.5/zope-config
deleted file mode 100644
index 48a722313f82..000000000000
--- a/app-admin/zope-config/files/0.5/zope-config
+++ /dev/null
@@ -1,520 +0,0 @@
-#!/bin/bash
-# vim: set noexpandtab ts=4:
-# Gentoo Zope Instance configure tool.
-#
-# Originally written by Jason Shoemaker <kutsuya@gentoo.org>
-# Portions by Jodok Batlogg <batlogg@gentoo.org> (Logging and some cleanups)
-# Portions by Robin Johnson <robbat2@gentoo.org> (Documentation and further cleanup)
-# Portions by Carter Smithhart <derheld42@derheld.net> (2.7.0 stuff)
-#
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/files/0.5/zope-config,v 1.2 2005/12/24 13:12:42 radek Exp $
-#
-#
-# Notes:
-# $ZI_DIR/.default holds name of default zope instance
-# $NEWZOPE is set to 1 if the zope server is 2.7.0 or newer
-#
-VERSION="0.5"
-
-CONFIGFILE=/etc/zope-config.conf
-if [ -e ${CONFIGFILE} ]; then
- source ${CONFIGFILE}
- EVENTLOGDIR=`dirname ${EVENTLOGDIR}`/`basename ${EVENTLOGDIR}`
-else
- echo "Unable to find config file: ${CONFIGFILE}" 1>&2
- exit 1
-fi
-
-
-
-# Return codes used in this program:
-E_SUCCESS=0
-E_FAILURE=1
-
-E_ZILIST=22
-E_PARAM=26
-E_ZSLIST=28
-E_ZIDEFAULT=30
-ZUID=''
-#Parameters:
-# $1 = instance directory
-# $2 = group
-# $3 = user
-zinst_security_setup()
-{
- if [ ${ZOPE27} ] ; then
- chown -R ${3}:${2} ${1}
- chmod -R o-rwx ${1}
- chmod -R g-w ${1}
- #chmod g+ws ${1}/{var,log}
- chmod g+rX -R ${1}
- #set owner and group on log dir
- chown -R ${ZUID}:${ZGID_NAME} ${EVENTLOGDIR}/${ZIRC_NAME}
- # permissions on log dir
- chmod -R 750 ${EVENTLOGDIR}/${ZIRC_NAME}
- else
- chown -R ${3}:${2} ${1}
- chmod -R g+u ${1}
- chmod -R o-rwx ${1}
- chown root ${1}/var/ # needed if $ZOPE_OPTS='-u root'
- chmod +t ${1}/var/
- fi
-}
-
-# params: $ZSERV_DIR
-# returns 1 if $ZSERV_DIR is a 2.7 or newer Zope. Also sets NEWZOPE to 1.
-zserv_is_2.7_or_newer()
-{
- TEXT=$(echo $1 | grep ${ZS_DIR2})
- if [ "$TEXT" = "" ] ; then
- NEWZOPE=0
- return 0;
- fi
- NEWZOPE=1
- return 1;
-}
-
-#Params:
-# $1 = zserv dir
-# $2 = zinst dir
-zinst_fs_setup()
-{
- local RESULT=${E_FAILURE}
- local USER=
- local PASS=
- local PASS2=
-
- if [ "${#}" -lt 2 ] ; then
- # need a param
- RESULT=${E_PARAM}
- elif [ ${ZOPE27} ] ; then
- if [ "x$3" == "xinituser" ] ; then
- ${BIN}/mkzopeinstance.py --user admin:admin --dir $2
- else
- ${BIN}/mkzopeinstance.py --dir $2
- fi
- # sets default instance if just created is first one
- if [ $(zinst_default_get >/dev/null)$? -ne 0 ] ; then
- echo $(basename ${ZINST_DIR}) >${ZI_DIR}/.default
- chown zope:root ${ZI_DIR}/.default
- fi
- # create the log directory
- mkdir ${EVENTLOGDIR}/${ZIRC_NAME}
- # remove log directory in skeltarget
- rm -r $2/log
- # symlink log directory
- ln -s ${EVENTLOGDIR}/${ZIRC_NAME} $2/log
- RESULT=$?
- else
- if [ $NEWZOPE = 1 ] ; then
- while : ; do
- USER=$(dialog --stdout \
- --backtitle "Please choose a username and password for the initial user." \
- --inputbox "Username:" 0 0 "admin")
- RESULT=$?
- if [ "$USER" != "" ] ; then
- break
- fi
- done
- while : ; do
- PASS=$(dialog --stdout \
- --backtitle "Please choose a username and password for the initial user." \
- --passwordbox "Password:" 0 0 "")
- RESULT=$?
- if [ "$PASS" = "" ] ; then
- continue
- fi
- PASS2=$(dialog --stdout \
- --backtitle "Please choose a username and password for the initial user." \
- --passwordbox "Reenter Password:" 0 0 "")
- RESULT=$?
- if [ "$PASS2" = "" ] ; then
- continue
- fi
- if [ $PASS = $PASS2 ] ; then
- break
- else
- dialog --msgbox "Passwords must be equal!" 0 0
- fi
- done
- su zope -c "$1/bin/mkzopeinstance.py --dir $2 --user $USER:$PASS"
- RESULT=${E_SUCCESS}
- else
- # prior to 2.7
- mkdir -p $2 || exit 1
- if [ $(zinst_default_get >/dev/null)$? -ne 0 ] ; then
- echo $(basename ${ZINST_DIR}) >${ZI_DIR}/.default
- chown zope:root ${ZI_DIR}/.default
- fi
-
- if [ -f $2/var/Data.fs ]; then
- mv $2/var/Data.fs $2/var/Data.fs.org
- fi
-
- cp -R $1/.templates/Extensions $2
- cp -R $1/.templates/import $2
- cp -R $1/.templates/var $2
- mkdir $2/Products
-
- if [ -f $2/var/Data.fs.org ]; then
- mv $2/var/Data.fs $2/var/Data.fs.dist
- mv $2/var/Data.fs.org $2/var/Data.fs
- fi
-
- RESULT=$?
- fi
- fi
-
- return ${RESULT}
-}
-
-#Params:
-# $1 = zserv dir
-# $2 = zinst dir
-# $3 = zinst name
-zinst_rc_setup()
-{
- local RESULT=${E_FAILURE}
-
- if [ "${#}" -lt 3 ] ; then
- # need a param
- RESULT=${E_PARAM}
- elif [ ${ZOPE27} ] ; then
- install $1/skel/zope.initd ${INITD}/${3}
- #echo "INSTANCE_HOME=${2}" >${CONFD}/$3
- #echo "EVENT_LOG_FILE=${EVENTLOGDIR}/${3}" >>${CONFD}/$3
- sed -i \
- -e "/^# *effective-user/ a\\effective-user ${ZUID}\\ " \
- ${2}/etc/zope.conf
- sed -i \
- -e "s|INSTANCE_HOME|${2}|" \
- ${INITD}/${3}
- RESULT=$?
- else
- if [ $NEWZOPE = 1 ] ; then
- install $1/.templates/zope.initd ${INITD}/${3}
- sed -i \
- -e "s|ZINST_DIR=|ZINST_DIR=${2}|" \
- -e "s|EVENT_LOG_FILE=|EVENT_LOG_FILE=${EVENTLOGDIR}\/${3}|" \
- ${INITD}/${3}
- RESULT=${E_SUCCESS}
- else
- install $1/.templates/zope.confd ${CONFD}/${3}
- install $1/.templates/zope.initd ${INITD}/${3}
- sed -i \
- -e "/INSTANCE_HOME=/ c\\INSTANCE_HOME=${2}\\ " \
- -e "/CLIENT_HOME=/ c\\CLIENT_HOME=${2}/var\\ " \
- -e "/EVENT_LOG_FILE=/ c\\EVENT_LOG_FILE=${EVENTLOGDIR}\/${3}\\ " \
- ${CONFD}/${3}
- RESULT=$?
- fi
- # make sure the directory exists
- mkdir -p ${EVENTLOGDIR} >/dev/null 2>&1
- fi
- return ${RESULT}
-}
-
-# Sets the variable: ZSERV_DIR and returns 0
-# or returns a non-zero error code
-zserv_dir_get()
-{
- local RESULT=${E_FAILURE}
- local LIST=$(ls -d ${ZS_DIR}* ; ls -d ${ZS_DIR2}*)
- local LIST_CNT=$(echo ${LIST} | wc -w)
- local DLIST=
-
- # Assume that LIST_TMP contains valid zserver dirs.
- if [ ${LIST_CNT} -eq 1 ] ; then
- ZSERV_DIR=${LIST}
- RESULT=${E_SUCCESS}
- elif [ ${LIST_CNT} -ne 0 ] ; then
- for N in ${LIST} ; do
- DLIST="${DLIST} $N -"
- done
- ZSERV_DIR=$(dialog --stdout \
- --title "Zope Server List" \
- --menu "Select desired zserver: " 0 40 ${LIST_CNT} ${DLIST})
- RESULT=$?
- else
- RESULT=${E_ZSLIST} # There are no zservers
- fi
-
- # set NEWZOPE to 1 if we are dealing with a "newer" zope version
- zserv_is_2.7_or_newer ${ZERV_DIR}
-
- return ${RESULT}
-}
-
-# Sets the variable: ZINST_DIR and returns 0
-# or returns a non-zero error code
-zinst_dir_set()
-{
- local RESULT=
-
- if [ ! -d ${ZI_DIR} ] ; then
- mkdir -p ${ZI_DIR}
- fi
-
- while : ; do
- ZINST_DIR=$(dialog --stdout \
- --backtitle "We need a unique name for the zinstance directory. (This will be the name of the rcscript.)" \
- --inputbox "Enter a new zinstance name:" 0 0 ${DEFAULT_ZINSTANCENAME} )
- RESULT=$?
- if [ ${RESULT} -ne 0 ] ; then
- break
- elif [ -z ${ZINST_DIR} ] ; then
- dialog --msgbox "Error: need a name." 0 0
- continue
- elif echo ${ZINST_DIR} |grep "/" ; then
- dialog --msgbox "Error: ${ZINST_DIR} is a path, not a name." 0 0
- continue
- elif [[ -d "${ZI_DIR}${ZINST_DIR}" && \
- -f "${INITD}/${ZINST_DIR}" ]] ; then
- dialog --msgbox "Error: ${ZINST_DIR} zinstance already exists. Delete ${INITD}/${ZINST_DIR} to replace instance." 0 0
- continue
- fi
- ZINST_DIR=${ZI_DIR}${ZINST_DIR}
- break
- done
- return ${RESULT}
-}
-
-# sets the variable $ZINST_DIR and returns 0
-# or returns non-null error code
-zinst_dir_get()
-{
- local RESULT=1
- local LIST=$(ls ${ZI_DIR})
- local LIST_CNT=$(echo ${LIST} | wc -w)
- local DLIST=
-
- # Assume that LIST_TMP contains valid zinstance dirs.
- if [ ${LIST_CNT} -eq 1 ] ; then
- ZINST_DIR=${LIST}
- RESULT=${E_SUCCESS}
- elif [ ${LIST_CNT} -ne 0 ] ; then
- for N in ${LIST} ; do
- DLIST="${DLIST} $N -"
- done
- ZINST_DIR=$(dialog --stdout \
- --title "Zope Instance List" \
- --menu "Select desired zinstance:" 0 0 ${LIST_CNT} ${DLIST})
- RESULT=$?
- else
- RESULT=${E_ZILIST} # There are no zinstances
- fi
- ZINST_DIR="${ZI_DIR}${ZINST_DIR}"
- return ${RESULT}
-}
-
-# makes ZSERV_DIR the default zope version. if ZSERV_DIR
-zinst_default_set()
-{
- local RESULT=
-
- if [ -z ${ZINST_DIR} ] ; then
- zinst_dir_get || { echo 'Cancelled: zinst_dir_get' ; exit 1 ; }
- fi
- RESULT=$?
- if [ ${RESULT} -eq 0 ] ; then
- echo $(basename ${ZINST_DIR}) >${ZI_DIR}/.default
- chown zope ${ZI_DIR}/.default
- fi
-
- return ${RESULT}
-}
-
-# Echos the default directory that this instance was created in
-zinst_default_get()
-{
- local RESULT=${E_ZIDEFAULT}
-
- if [ -s ${ZI_DIR}/.default ] ; then
- cat ${ZI_DIR}/.default
- RESULT=$? # use to be 0
- fi
- return ${RESULT}
-}
-
-# Gets a name for the group that owns the new zinstance and also creates the
-# group if nessicary
-zinst_zgid_set()
-{
- local RESULT=
- while : ; do
- ZGID_NAME=$(dialog --stdout \
- --backtitle "We need to create and/or assign a zinstance group name." \
- --inputbox "Enter a group name:" \
- 0 0 $(basename ${ZIRC_NAME}))
- RESULT=$?
- if [ ${RESULT} -ne 0 ] ; then
- break
- elif [ -z ${ZGID_NAME} ] ; then
- dialog --msgbox "Error: empty string." 0 0
- continue
- elif groupmod ${ZGID_NAME} >/dev/null 2>&1 ; then
- dialog --yesno "The group ${ZGID_NAME} already exists. Do you want to use it?" 0 0
- RESULT=$?
- [ ${RESULT} -ne 0 ] && continue
- fi
- break
- done
- return ${RESULT}
-}
-
-# Gets a name for the user that owns the new zinstance and also creates the
-# group if nessicary, this is the user zope runs as
-zinst_zuid_set()
-{
- local RESULT=
- while : ; do
- ZUID=$(dialog --stdout \
- --backtitle "We need to create and/or assign a zinstance user name." \
- --inputbox "Enter a user name:" \
- 0 0 $(basename ${ZIRC_NAME}))
- RESULT=$?
- if [ ${RESULT} -ne 0 ] ; then
- break
- elif [ -z ${ZUID} ] ; then
- dialog --msgbox "Error: empty string." 0 0
- continue
- elif egrep "^${ZUID}:" /etc/passwd >/dev/null 2>&1 ; then
- dialog --yesno "The user ${ZUID} already exists. Do you want to use it?" 0 0
- RESULT=$?
- [ ${RESULT} -ne 0 ] && continue
- fi
- break
- done
- return ${RESULT}
-}
-
-# Sets the inituser password for a given zinstance
-zinst_zpasswd_set()
-{
- if [ -z ${ZSERV_DIR} ] ; then
- zserv_dir_get || { exit $? ; }
- fi
- if [ -z ${ZINST_DIR} ] ; then
- zinst_dir_get || exit $?
- fi
-
- zserv_is_2.7_or_newer ${ZSERV_DIR}
- if [ $NEWZOPE = 1 ] ; then
- echo ">>> Creating a Zope inituser for \"$(basename ${ZINST_DIR})\"..."
- /usr/bin/python ${BIN}/zpasswd.py ${ZINST_DIR}/inituser
- # If zpasswd is aborted it creates a blank inituser
- chown ${ZUID} ${ZINST_DIR}/inituser
- else
- echo ">>> Creating a Zope inituser for \"$(basename ${ZINST_DIR})\"..."
- /usr/bin/python ${ZSERV_DIR}/zpasswd.py ${ZINST_DIR}/inituser
- # If zpasswd is aborted it creates a blank inituser
- chown ${ZUID} ${ZINST_DIR}/inituser
- fi
-}
-
-# help!
-
-usage()
-{
- echo "$(basename $0) version ${VERSION}"
- echo "A Gentoo Zope instance configuration tool."
- echo
- echo "Interactive usage:"
- echo -e "\t$(basename $0)"
- echo "Partial interactive usage:"
- echo -e "\t$(basename $0) --[zserv=[dir] &| zinst=[dir] &| zgid=[name]]"
- echo "Non-interactive usage:"
- echo -e "\t$(basename $0) --[zidef-get | zidef-set | zpasswd | version | help]"
- echo -e "\t$(basename $0) --[zserv=[dir] & zinst=[di] & zgid=[name]]"
- exit ${E_SUCCESS}
-}
-
-zserv_version_detect()
-{
- if [ -d "${ZSERV_DIR}/bin" ] ; then
- ZOPE27=1
- BIN=${ZSERV_DIR}/bin
- else
- ZOPE27=0
- BIN=${ZSERV_DIR}
- fi
-}
-
-##### Process the commandline
-
-while [ "$#" -gt 0 ] ; do
- case "$1" in
- -*=*) OPTARG=$(echo "$1" | sed 's/[-_a-zA-Z0-9:]*=//') ;;
- *) OPTARG= ;;
- esac
-
- case "$1" in
- --zserv=*) ZSERV_DIR=${OPTARG} ; zserv_version_detect ;;
- --zinst=*) ZINST_DIR=${OPTARG} ;;
- --zgid=*) ZGID_NAME=${OPTARG} ;;
- --zuid=*) ZUID=${OPTARG} ;;
- --zinituser) ZINIT_USER=inituser ;;
- --zidef-set) zinst_default_set ; exit $? ;;
- --zidef-get) zinst_default_get ; exit $? ;;
- --zpasswd) zinst_zpasswd_set ; exit $? ;;
- --version) echo ${VERSION} ; exit 0 ;;
- -*) usage ; exit 0 ;;
- *) usage ; exit 0 ;;
- esac
- shift
-done
-
-# if ZSERV_DIR isn't set by command line, call zserv_dir_get to set it
-if [ -z ${ZSERV_DIR} ] ; then
- zserv_dir_get || { echo 'Cancelled: zserv_dir_get' ; exit 1 ; }
- zserv_version_detect
-else
- ZSERV_DIR=`dirname ${ZSERV_DIR}`/`basename ${ZSERV_DIR}`
-fi
-
-# if ZINST_DIR passed by command line, call zinst_dir_set to set it
-if [ -z ${ZINST_DIR} ] ; then
- zinst_dir_set || { echo 'Cancelled: zinst_dir_set' ; exit 1 ; }
-else
- ZINST_DIR=`dirname ${ZINST_DIR}`/`basename ${ZINST_DIR}`
-fi
-
-# if ZIRC_NAME isn't set then use the base of the ZINST_DIR for ZIRC_NAME
-[ -z ${ZIRC_NAME} ] && ZIRC_NAME=$(basename ${ZINST_DIR})
-
-if [ -z ${ZUID} ] ; then
- zinst_zuid_set || { echo 'Cancelled: zinst_zuid_set' ; exit 1 ; }
-fi
-
-if [ -z ${ZGID_NAME} ] ; then
- zinst_zgid_set || { echo 'Cancelled: zinst_zgid_set' ; exit 1 ; }
-fi
-
-
-
-zserv_is_2.7_or_newer ${ZSERV_DIR}
-
-! groupmod ${ZGID_NAME} >/dev/null 2>&1 && groupadd ${ZGID_NAME}
-zinst_fs_setup ${ZSERV_DIR} ${ZINST_DIR} ${ZINIT_USER}
-zinst_rc_setup ${ZSERV_DIR} ${ZINST_DIR} ${ZIRC_NAME}
-
-# create user if needed
-useradd -g ${ZGID_NAME} ${ZUID}
-
-
-# add existing user to the new group
-gpasswd -a ${ZUID} ${ZGID_NAME}
-
-zinst_security_setup ${ZINST_DIR} ${ZGID_NAME} ${ZUID}
-# TODO: see about adding interactive configuration of ZOPE_OPTS
-if [ ${ZOPE27} ] ; then
- echo "Note: Review settings in ${ZINST_DIR}/etc/zope.conf."
- echo "Then you can start your new instance with:"
- echo " /etc/init.d/${ZIRC_NAME} start"
-else
- echo "Note: Don\'t forget to edit ZOPE_OPTS in ${CONFD}${ZIRC_NAME}"
- echo " (you might want to add -P 8{1,2,3,..}00 to set the zope ports offset)"
-fi
-
diff --git a/app-admin/zope-config/files/0.5/zope-config-0.5.patch b/app-admin/zope-config/files/0.5/zope-config-0.5.patch
deleted file mode 100644
index 7d265e4cf1fa..000000000000
--- a/app-admin/zope-config/files/0.5/zope-config-0.5.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/zope-config 2004-10-07 22:50:21.213319592 +0200
-+++ b/zope-config 2004-10-07 22:45:46.249120504 +0200
-@@ -95,12 +95,17 @@
- else
- ${BIN}/mkzopeinstance.py --dir $2
- fi
-- # create the log directory
-- mkdir ${EVENTLOGDIR}/${ZIRC_NAME}
-- # remove log directory in skeltarget
-- rm -r $2/log
-- # symlink log directory
-- ln -s ${EVENTLOGDIR}/${ZIRC_NAME} $2/log
-+ # sets default instance if just created is first one
-+ if [ $(zinst_default_get >/dev/null)$? -ne 0 ] ; then
-+ echo $(basename ${ZINST_DIR}) >${ZI_DIR}/.default
-+ chown zope:root ${ZI_DIR}/.default
-+ fi
-+ # create the log directory
-+ mkdir ${EVENTLOGDIR}/${ZIRC_NAME}
-+ # remove log directory in skeltarget
-+ rm -r $2/log
-+ # symlink log directory
-+ ln -s ${EVENTLOGDIR}/${ZIRC_NAME} $2/log
- RESULT=$?
- else
- if [ $NEWZOPE = 1 ] ; then
diff --git a/app-admin/zope-config/files/0.5/zope-config.conf b/app-admin/zope-config/files/0.5/zope-config.conf
deleted file mode 100644
index 753bd36b2b37..000000000000
--- a/app-admin/zope-config/files/0.5/zope-config.conf
+++ /dev/null
@@ -1,30 +0,0 @@
-# vim: set noexpandtab ts=4 ft=sh:
-# Gentoo Zope Instance configure tool config file.
-#
-# Originally written by Jason Shoemaker <kutsuya@gentoo.org>
-# Portions by Jodok Batlogg <batlogg@gentoo.org> (Logging and some cleanups)
-# Portions by Robin Johnson <robbat2@gentoo.org> (Documentation and further cleanup)
-#
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/files/0.5/zope-config.conf,v 1.1 2005/01/02 14:05:24 batlogg Exp $
-
-# default name for new instances
-DEFAULT_ZINSTANCENAME="zope-"
-
-# Logging directory
-EVENTLOGDIR="/var/log/zope/"
-
-# you probably shouldn't change anything below this
-# -------------------------------------------------
-# Name of zope user on your system
-ZUID=zope
-# This is where the real zope lives
-ZS_DIR="/usr/share/zope/"
-ZS_DIR2="/usr/lib/zope-"
-# This is where we will put our new instance of zope
-ZI_DIR="/var/lib/zope/"
-# place for init script
-# and it's associated configuration file
-INITD="/etc/init.d/"
-CONFD="/etc/conf.d/"
diff --git a/app-admin/zope-config/files/0.6/zope-config b/app-admin/zope-config/files/0.6/zope-config
deleted file mode 100755
index e72605f693dc..000000000000
--- a/app-admin/zope-config/files/0.6/zope-config
+++ /dev/null
@@ -1,531 +0,0 @@
-#!/bin/bash
-# vim: set noexpandtab ts=4:
-# Gentoo Zope Instance configure tool.
-#
-# Originally written by Jason Shoemaker <kutsuya@gentoo.org>
-# Portions by Jodok Batlogg <batlogg@gentoo.org> (Logging and some cleanups)
-# Portions by Robin Johnson <robbat2@gentoo.org> (Documentation and further cleanup)
-# Portions by Carter Smithhart <derheld42@derheld.net> (2.7.0 stuff)
-#
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/files/0.6/zope-config,v 1.1 2008/11/16 15:11:23 tupone Exp $
-#
-#
-# Notes:
-# $ZI_DIR/.default holds name of default zope instance
-# $NEWZOPE is set to 1 if the zope server is 2.7.0 or newer
-#
-VERSION="0.6"
-
-CONFIGFILE=/etc/zope-config.conf
-if [ -e ${CONFIGFILE} ]; then
- source ${CONFIGFILE}
- EVENTLOGDIR=`dirname ${EVENTLOGDIR}`/`basename ${EVENTLOGDIR}`
-else
- echo "Unable to find config file: ${CONFIGFILE}" 1>&2
- exit 1
-fi
-
-
-
-# Return codes used in this program:
-E_SUCCESS=0
-E_FAILURE=1
-
-E_ZILIST=22
-E_PARAM=26
-E_ZSLIST=28
-E_ZIDEFAULT=30
-ZUID=''
-#Parameters:
-# $1 = instance directory
-# $2 = group
-# $3 = user
-zinst_security_setup()
-{
- if [ ${ZOPE27} ] ; then
- chown -R ${3}:${2} ${1}
- chmod -R o-rwx ${1}
- chmod -R g-w ${1}
- #chmod g+ws ${1}/{var,log}
- chmod g+rX -R ${1}
- #set owner and group on log dir
- chown -R ${ZUID}:${ZGID_NAME} ${EVENTLOGDIR}/${ZIRC_NAME}
- # permissions on log dir
- chmod -R 750 ${EVENTLOGDIR}/${ZIRC_NAME}
- else
- chown -R ${3}:${2} ${1}
- chmod -R g+u ${1}
- chmod -R o-rwx ${1}
- chown root ${1}/var/ # needed if $ZOPE_OPTS='-u root'
- chmod +t ${1}/var/
- fi
-}
-
-# params: $ZSERV_DIR
-# returns 1 if $ZSERV_DIR is a 2.7 or newer Zope. Also sets NEWZOPE to 1.
-zserv_is_2.7_or_newer()
-{
- TEXT=$(echo $1 | grep ${ZS_DIR2})
- if [ "$TEXT" = "" ] ; then
- NEWZOPE=0
- return 0;
- fi
- NEWZOPE=1
- return 1;
-}
-
-#Params:
-# $1 = zserv dir
-# $2 = zinst dir
-zinst_fs_setup()
-{
- local RESULT=${E_FAILURE}
- local USER=
- local PASS=
- local PASS2=
-
- if [ "${#}" -lt 2 ] ; then
- # need a param
- RESULT=${E_PARAM}
- elif [ ${ZOPE27} ] ; then
- if [ "x$3" == "xinituser" ] ; then
- ${BIN}/mkzopeinstance.py --user admin:admin --dir $2
- else
- ${BIN}/mkzopeinstance.py --dir $2
- fi
- # sets default instance if just created is first one
- if [ $(zinst_default_get >/dev/null)$? -ne 0 ] ; then
- echo $(basename ${ZINST_DIR}) >${ZI_DIR}/.default
- chown zope:root ${ZI_DIR}/.default
- fi
- # create the log directory
- mkdir ${EVENTLOGDIR}/${ZIRC_NAME}
- # remove log directory in skeltarget
- rm -r $2/log
- # symlink log directory
- ln -s ${EVENTLOGDIR}/${ZIRC_NAME} $2/log
- RESULT=$?
- else
- if [ $NEWZOPE = 1 ] ; then
- while : ; do
- dialog \
- --backtitle "Please choose a username and password for the initial user." \
- --inputbox "Username:" 0 0 "admin" 2> $tempfile
- RESULT=$?
- USER=$(cat $tempfile)
- if [ "$USER" != "" ] ; then
- break
- fi
- done
- while : ; do
- dialog \
- --backtitle "Please choose a username and password for the initial user." \
- --passwordbox "Password:" 0 0 "" 2> $tempfile
- RESULT=$?
- PASS=$(cat $tempfile)
- if [ "$PASS" = "" ] ; then
- continue
- fi
- dialog \
- --backtitle "Please choose a username and password for the initial user." \
- --passwordbox "Reenter Password:" 0 0 "" 2> $tempfile
- RESULT=$?
- PASS2=$(cat $tempfile)
- if [ "$PASS2" = "" ] ; then
- continue
- fi
- if [ $PASS = $PASS2 ] ; then
- break
- else
- dialog --msgbox "Passwords must be equal!" 0 0
- fi
- done
- su zope -c "$1/bin/mkzopeinstance.py --dir $2 --user $USER:$PASS"
- RESULT=${E_SUCCESS}
- else
- # prior to 2.7
- mkdir -p $2 || exit 1
- if [ $(zinst_default_get >/dev/null)$? -ne 0 ] ; then
- echo $(basename ${ZINST_DIR}) >${ZI_DIR}/.default
- chown zope:root ${ZI_DIR}/.default
- fi
-
- if [ -f $2/var/Data.fs ]; then
- mv $2/var/Data.fs $2/var/Data.fs.org
- fi
-
- cp -R $1/.templates/Extensions $2
- cp -R $1/.templates/import $2
- cp -R $1/.templates/var $2
- mkdir $2/Products
-
- if [ -f $2/var/Data.fs.org ]; then
- mv $2/var/Data.fs $2/var/Data.fs.dist
- mv $2/var/Data.fs.org $2/var/Data.fs
- fi
-
- RESULT=$?
- fi
- fi
-
- return ${RESULT}
-}
-
-#Params:
-# $1 = zserv dir
-# $2 = zinst dir
-# $3 = zinst name
-zinst_rc_setup()
-{
- local RESULT=${E_FAILURE}
-
- if [ "${#}" -lt 3 ] ; then
- # need a param
- RESULT=${E_PARAM}
- elif [ ${ZOPE27} ] ; then
- install $1/skel/zope.initd ${INITD}/${3}
- #echo "INSTANCE_HOME=${2}" >${CONFD}/$3
- #echo "EVENT_LOG_FILE=${EVENTLOGDIR}/${3}" >>${CONFD}/$3
- sed -i \
- -e "/^# *effective-user/ a\\effective-user ${ZUID}\\ " \
- ${2}/etc/zope.conf
- sed -i \
- -e "s|INSTANCE_HOME|${2}|" \
- ${INITD}/${3}
- RESULT=$?
- else
- if [ $NEWZOPE = 1 ] ; then
- install $1/.templates/zope.initd ${INITD}/${3}
- sed -i \
- -e "s|ZINST_DIR=|ZINST_DIR=${2}|" \
- -e "s|EVENT_LOG_FILE=|EVENT_LOG_FILE=${EVENTLOGDIR}\/${3}|" \
- ${INITD}/${3}
- RESULT=${E_SUCCESS}
- else
- install $1/.templates/zope.confd ${CONFD}/${3}
- install $1/.templates/zope.initd ${INITD}/${3}
- sed -i \
- -e "/INSTANCE_HOME=/ c\\INSTANCE_HOME=${2}\\ " \
- -e "/CLIENT_HOME=/ c\\CLIENT_HOME=${2}/var\\ " \
- -e "/EVENT_LOG_FILE=/ c\\EVENT_LOG_FILE=${EVENTLOGDIR}\/${3}\\ " \
- ${CONFD}/${3}
- RESULT=$?
- fi
- # make sure the directory exists
- mkdir -p ${EVENTLOGDIR} >/dev/null 2>&1
- fi
- return ${RESULT}
-}
-
-# Sets the variable: ZSERV_DIR and returns 0
-# or returns a non-zero error code
-zserv_dir_get()
-{
- local RESULT=${E_FAILURE}
- local LIST=$(ls -d ${ZS_DIR}* ; ls -d ${ZS_DIR2}*)
- local LIST_CNT=$(echo ${LIST} | wc -w)
- local DLIST=
-
- # Assume that LIST_TMP contains valid zserver dirs.
- if [ ${LIST_CNT} -eq 1 ] ; then
- ZSERV_DIR=${LIST}
- RESULT=${E_SUCCESS}
- elif [ ${LIST_CNT} -ne 0 ] ; then
- for N in ${LIST} ; do
- DLIST="${DLIST} $N -"
- done
- dialog \
- --title "Zope Server List" \
- --menu "Select desired zserver: " 0 40 ${LIST_CNT} ${DLIST} 2> $tempfile
- RESULT=$?
- ZSERV_DIR=$(cat $tempfile)
- else
- RESULT=${E_ZSLIST} # There are no zservers
- fi
-
- # set NEWZOPE to 1 if we are dealing with a "newer" zope version
- zserv_is_2.7_or_newer ${ZERV_DIR}
-
- return ${RESULT}
-}
-
-# Sets the variable: ZINST_DIR and returns 0
-# or returns a non-zero error code
-zinst_dir_set()
-{
- local RESULT=
-
- if [ ! -d ${ZI_DIR} ] ; then
- mkdir -p ${ZI_DIR}
- fi
-
- while : ; do
- dialog \
- --backtitle "We need a unique name for the zinstance directory. (This will be the name of the rcscript.)" \
- --inputbox "Enter a new zinstance name:" 0 0 ${DEFAULT_ZINSTANCENAME} 2> $tempfile
- RESULT=$?
- ZINST_DIR=$(cat $tempfile)
- if [ ${RESULT} -ne 0 ] ; then
- break
- elif [ -z ${ZINST_DIR} ] ; then
- dialog --msgbox "Error: need a name." 0 0
- continue
- elif echo ${ZINST_DIR} |grep "/" ; then
- dialog --msgbox "Error: ${ZINST_DIR} is a path, not a name." 0 0
- continue
- elif [[ -d "${ZI_DIR}${ZINST_DIR}" && \
- -f "${INITD}/${ZINST_DIR}" ]] ; then
- dialog --msgbox "Error: ${ZINST_DIR} zinstance already exists. Delete ${INITD}/${ZINST_DIR} to replace instance." 0 0
- continue
- fi
- ZINST_DIR=${ZI_DIR}${ZINST_DIR}
- break
- done
- return ${RESULT}
-}
-
-# sets the variable $ZINST_DIR and returns 0
-# or returns non-null error code
-zinst_dir_get()
-{
- local RESULT=1
- local LIST=$(ls ${ZI_DIR})
- local LIST_CNT=$(echo ${LIST} | wc -w)
- local DLIST=
-
- # Assume that LIST_TMP contains valid zinstance dirs.
- if [ ${LIST_CNT} -eq 1 ] ; then
- ZINST_DIR=${LIST}
- RESULT=${E_SUCCESS}
- elif [ ${LIST_CNT} -ne 0 ] ; then
- for N in ${LIST} ; do
- DLIST="${DLIST} $N -"
- done
- dialog \
- --title "Zope Instance List" \
- --menu "Select desired zinstance:" 0 0 ${LIST_CNT} ${DLIST} 2> $tempfile
- RESULT=$?
- ZINST_DIR=$(cat $tempfile)
- else
- RESULT=${E_ZILIST} # There are no zinstances
- fi
- ZINST_DIR="${ZI_DIR}${ZINST_DIR}"
- return ${RESULT}
-}
-
-# makes ZSERV_DIR the default zope version. if ZSERV_DIR
-zinst_default_set()
-{
- local RESULT=
-
- if [ -z ${ZINST_DIR} ] ; then
- zinst_dir_get || { echo 'Cancelled: zinst_dir_get' ; exit 1 ; }
- fi
- RESULT=$?
- if [ ${RESULT} -eq 0 ] ; then
- echo $(basename ${ZINST_DIR}) >${ZI_DIR}/.default
- chown zope ${ZI_DIR}/.default
- fi
-
- return ${RESULT}
-}
-
-# Echos the default directory that this instance was created in
-zinst_default_get()
-{
- local RESULT=${E_ZIDEFAULT}
-
- if [ -s ${ZI_DIR}/.default ] ; then
- cat ${ZI_DIR}/.default
- RESULT=$? # use to be 0
- fi
- return ${RESULT}
-}
-
-# Gets a name for the group that owns the new zinstance and also creates the
-# group if nessicary
-zinst_zgid_set()
-{
- local RESULT=
- while : ; do
- dialog \
- --backtitle "We need to create and/or assign a zinstance group name." \
- --inputbox "Enter a group name:" \
- 0 0 $(basename ${ZIRC_NAME}) 2> $tempfile
- RESULT=$?
- ZGID_NAME=$(cat $tempfile)
- if [ ${RESULT} -ne 0 ] ; then
- break
- elif [ -z ${ZGID_NAME} ] ; then
- dialog --msgbox "Error: empty string." 0 0
- continue
- elif groupmod ${ZGID_NAME} >/dev/null 2>&1 ; then
- dialog --yesno "The group ${ZGID_NAME} already exists. Do you want to use it?" 0 0
- RESULT=$?
- [ ${RESULT} -ne 0 ] && continue
- fi
- break
- done
- return ${RESULT}
-}
-
-# Gets a name for the user that owns the new zinstance and also creates the
-# group if nessicary, this is the user zope runs as
-zinst_zuid_set()
-{
- local RESULT=
- while : ; do
- dialog \
- --backtitle "We need to create and/or assign a zinstance user name." \
- --inputbox "Enter a user name:" \
- 0 0 $(basename ${ZIRC_NAME}) 2> $tempfile
- RESULT=$?
- ZUID=$(cat $tempfile)
- if [ ${RESULT} -ne 0 ] ; then
- break
- elif [ -z ${ZUID} ] ; then
- dialog --msgbox "Error: empty string." 0 0
- continue
- elif egrep "^${ZUID}:" /etc/passwd >/dev/null 2>&1 ; then
- dialog --yesno "The user ${ZUID} already exists. Do you want to use it?" 0 0
- RESULT=$?
- [ ${RESULT} -ne 0 ] && continue
- fi
- break
- done
- return ${RESULT}
-}
-
-# Sets the inituser password for a given zinstance
-zinst_zpasswd_set()
-{
- if [ -z ${ZSERV_DIR} ] ; then
- zserv_dir_get || { exit $? ; }
- fi
- if [ -z ${ZINST_DIR} ] ; then
- zinst_dir_get || exit $?
- fi
-
- zserv_is_2.7_or_newer ${ZSERV_DIR}
- if [ $NEWZOPE = 1 ] ; then
- echo ">>> Creating a Zope inituser for \"$(basename ${ZINST_DIR})\"..."
- /usr/bin/python ${BIN}/zpasswd.py ${ZINST_DIR}/inituser
- # If zpasswd is aborted it creates a blank inituser
- chown ${ZUID} ${ZINST_DIR}/inituser
- else
- echo ">>> Creating a Zope inituser for \"$(basename ${ZINST_DIR})\"..."
- /usr/bin/python ${ZSERV_DIR}/zpasswd.py ${ZINST_DIR}/inituser
- # If zpasswd is aborted it creates a blank inituser
- chown ${ZUID} ${ZINST_DIR}/inituser
- fi
-}
-
-# help!
-
-usage()
-{
- echo "$(basename $0) version ${VERSION}"
- echo "A Gentoo Zope instance configuration tool."
- echo
- echo "Interactive usage:"
- echo -e "\t$(basename $0)"
- echo "Partial interactive usage:"
- echo -e "\t$(basename $0) --[zserv=[dir] &| zinst=[dir] &| zgid=[name]]"
- echo "Non-interactive usage:"
- echo -e "\t$(basename $0) --[zidef-get | zidef-set | zpasswd | version | help]"
- echo -e "\t$(basename $0) --[zserv=[dir] & zinst=[di] & zgid=[name]]"
- exit ${E_SUCCESS}
-}
-
-zserv_version_detect()
-{
- if [ -d "${ZSERV_DIR}/bin" ] ; then
- ZOPE27=1
- BIN=${ZSERV_DIR}/bin
- else
- ZOPE27=0
- BIN=${ZSERV_DIR}
- fi
-}
-
-##### Process the commandline
-
-while [ "$#" -gt 0 ] ; do
- case "$1" in
- -*=*) OPTARG=$(echo "$1" | sed 's/[-_a-zA-Z0-9:]*=//') ;;
- *) OPTARG= ;;
- esac
-
- case "$1" in
- --zserv=*) ZSERV_DIR=${OPTARG} ; zserv_version_detect ;;
- --zinst=*) ZINST_DIR=${OPTARG} ;;
- --zgid=*) ZGID_NAME=${OPTARG} ;;
- --zuid=*) ZUID=${OPTARG} ;;
- --zinituser) ZINIT_USER=inituser ;;
- --zidef-set) zinst_default_set ; exit $? ;;
- --zidef-get) zinst_default_get ; exit $? ;;
- --zpasswd) zinst_zpasswd_set ; exit $? ;;
- --version) echo ${VERSION} ; exit 0 ;;
- -*) usage ; exit 0 ;;
- *) usage ; exit 0 ;;
- esac
- shift
-done
-
-tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
-trap "rm -f $tempfile" 0 1 2 15
-
-# if ZSERV_DIR isn't set by command line, call zserv_dir_get to set it
-if [ -z ${ZSERV_DIR} ] ; then
- zserv_dir_get || { echo 'Cancelled: zserv_dir_get' ; exit 1 ; }
- zserv_version_detect
-else
- ZSERV_DIR=`dirname ${ZSERV_DIR}`/`basename ${ZSERV_DIR}`
-fi
-
-# if ZINST_DIR passed by command line, call zinst_dir_set to set it
-if [ -z ${ZINST_DIR} ] ; then
- zinst_dir_set || { echo 'Cancelled: zinst_dir_set' ; exit 1 ; }
-else
- ZINST_DIR=`dirname ${ZINST_DIR}`/`basename ${ZINST_DIR}`
-fi
-
-# if ZIRC_NAME isn't set then use the base of the ZINST_DIR for ZIRC_NAME
-[ -z ${ZIRC_NAME} ] && ZIRC_NAME=$(basename ${ZINST_DIR})
-
-if [ -z ${ZUID} ] ; then
- zinst_zuid_set || { echo 'Cancelled: zinst_zuid_set' ; exit 1 ; }
-fi
-
-if [ -z ${ZGID_NAME} ] ; then
- zinst_zgid_set || { echo 'Cancelled: zinst_zgid_set' ; exit 1 ; }
-fi
-
-
-
-zserv_is_2.7_or_newer ${ZSERV_DIR}
-
-! groupmod ${ZGID_NAME} >/dev/null 2>&1 && groupadd ${ZGID_NAME}
-zinst_fs_setup ${ZSERV_DIR} ${ZINST_DIR} ${ZINIT_USER}
-zinst_rc_setup ${ZSERV_DIR} ${ZINST_DIR} ${ZIRC_NAME}
-
-# create user if needed
-useradd -g ${ZGID_NAME} ${ZUID}
-
-
-# add existing user to the new group
-gpasswd -a ${ZUID} ${ZGID_NAME}
-
-zinst_security_setup ${ZINST_DIR} ${ZGID_NAME} ${ZUID}
-# TODO: see about adding interactive configuration of ZOPE_OPTS
-if [ ${ZOPE27} ] ; then
- echo "Note: Review settings in ${ZINST_DIR}/etc/zope.conf."
- echo "Then you can start your new instance with:"
- echo " /etc/init.d/${ZIRC_NAME} start"
-else
- echo "Note: Don\'t forget to edit ZOPE_OPTS in ${CONFD}${ZIRC_NAME}"
- echo " (you might want to add -P 8{1,2,3,..}00 to set the zope ports offset)"
-fi
-
diff --git a/app-admin/zope-config/files/0.6/zope-config.conf b/app-admin/zope-config/files/0.6/zope-config.conf
deleted file mode 100644
index 1a7ff04d3848..000000000000
--- a/app-admin/zope-config/files/0.6/zope-config.conf
+++ /dev/null
@@ -1,30 +0,0 @@
-# vim: set noexpandtab ts=4 ft=sh:
-# Gentoo Zope Instance configure tool config file.
-#
-# Originally written by Jason Shoemaker <kutsuya@gentoo.org>
-# Portions by Jodok Batlogg <batlogg@gentoo.org> (Logging and some cleanups)
-# Portions by Robin Johnson <robbat2@gentoo.org> (Documentation and further cleanup)
-#
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/files/0.6/zope-config.conf,v 1.1 2008/11/16 15:11:23 tupone Exp $
-
-# default name for new instances
-DEFAULT_ZINSTANCENAME="zope-"
-
-# Logging directory
-EVENTLOGDIR="/var/log/zope/"
-
-# you probably shouldn't change anything below this
-# -------------------------------------------------
-# Name of zope user on your system
-ZUID=zope
-# This is where the real zope lives
-ZS_DIR="/usr/share/zope/"
-ZS_DIR2="/usr/lib/zope-"
-# This is where we will put our new instance of zope
-ZI_DIR="/var/lib/zope/"
-# place for init script
-# and it's associated configuration file
-INITD="/etc/init.d/"
-CONFD="/etc/conf.d/"