diff options
author | Alfredo Tupone <tupone@gentoo.org> | 2008-11-16 15:11:23 +0000 |
---|---|---|
committer | Alfredo Tupone <tupone@gentoo.org> | 2008-11-16 15:11:23 +0000 |
commit | afa38e66852dffadd9e7d87ed3cf8689a484f55c (patch) | |
tree | 760f0d3d30d59258e7198d17ee332de90970924e /app-admin/zope-config | |
parent | Fixed library soname, added possibility to build with bluetooth support (drop... (diff) | |
download | historical-afa38e66852dffadd9e7d87ed3cf8689a484f55c.tar.gz historical-afa38e66852dffadd9e7d87ed3cf8689a484f55c.tar.bz2 historical-afa38e66852dffadd9e7d87ed3cf8689a484f55c.zip |
Fix dialog not finding tty. Bug #120471
Package-Manager: portage-2.1.4.5
Diffstat (limited to 'app-admin/zope-config')
-rw-r--r-- | app-admin/zope-config/ChangeLog | 18 | ||||
-rw-r--r-- | app-admin/zope-config/Manifest | 28 | ||||
-rw-r--r-- | app-admin/zope-config/files/0.1/zope-config | 305 | ||||
-rw-r--r-- | app-admin/zope-config/files/0.3/zope-config | 340 | ||||
-rwxr-xr-x | app-admin/zope-config/files/0.6/zope-config | 531 | ||||
-rw-r--r-- | app-admin/zope-config/files/0.6/zope-config.conf (renamed from app-admin/zope-config/files/0.3/zope-config.conf) | 5 | ||||
-rw-r--r-- | app-admin/zope-config/zope-config-0.1-r1.ebuild | 23 | ||||
-rw-r--r-- | app-admin/zope-config/zope-config-0.3.ebuild | 36 | ||||
-rw-r--r-- | app-admin/zope-config/zope-config-0.4-r2.ebuild | 36 | ||||
-rw-r--r-- | app-admin/zope-config/zope-config-0.4-r3.ebuild | 36 | ||||
-rw-r--r-- | app-admin/zope-config/zope-config-0.4.ebuild | 36 | ||||
-rw-r--r-- | app-admin/zope-config/zope-config-0.5-r1.ebuild | 10 | ||||
-rw-r--r-- | app-admin/zope-config/zope-config-0.5.ebuild | 12 | ||||
-rw-r--r-- | app-admin/zope-config/zope-config-0.6.ebuild (renamed from app-admin/zope-config/zope-config-0.4-r1.ebuild) | 18 |
14 files changed, 587 insertions, 847 deletions
diff --git a/app-admin/zope-config/ChangeLog b/app-admin/zope-config/ChangeLog index c55331e0ca66..0bee565fc96f 100644 --- a/app-admin/zope-config/ChangeLog +++ b/app-admin/zope-config/ChangeLog @@ -1,6 +1,20 @@ # ChangeLog for app-admin/zope-config -# Copyright 2003-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/ChangeLog,v 1.39 2007/01/24 15:11:32 genone Exp $ +# Copyright 2003-2008 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/ChangeLog,v 1.40 2008/11/16 15:11:23 tupone Exp $ + +*zope-config-0.6 (16 Nov 2008) + + 16 Nov 2008; Tupone Alfredo <tupone@gentoo.org> -files/0.1/zope-config, + -files/0.3/zope-config, -files/0.3/zope-config.conf, + +files/0.6/zope-config, +files/0.6/zope-config.conf, + -zope-config-0.1-r1.ebuild, -zope-config-0.3.ebuild, + -zope-config-0.4.ebuild, -zope-config-0.4-r1.ebuild, + -zope-config-0.4-r2.ebuild, -zope-config-0.4-r3.ebuild, + zope-config-0.5.ebuild, zope-config-0.5-r1.ebuild, + +zope-config-0.6.ebuild: + Fix dialog not finding tty. Bug #120471 by Francesco R. <vivo@gentoo.org> + Clean old ebuild. + Make repoman happy. 24 Jan 2007; Marius Mauch <genone@gentoo.org> zope-config-0.3.ebuild, zope-config-0.4.ebuild, zope-config-0.4-r1.ebuild, diff --git a/app-admin/zope-config/Manifest b/app-admin/zope-config/Manifest index e8074c68e0fe..8e76ab6192a5 100644 --- a/app-admin/zope-config/Manifest +++ b/app-admin/zope-config/Manifest @@ -1,18 +1,22 @@ -AUX 0.1/zope-config 6878 RMD160 d79da5dcb914ce2cd5fd6c1f4ac460937acb3113 SHA1 039f23a1b5ba6236b070b534532f93a33faec271 SHA256 a8950a39ac275dd3386a687b56f9b55bded7416e5caa491e8daa1c3e01bb679f -AUX 0.3/zope-config 7714 RMD160 2cbde2fb04bb6b0f1e2bcbc868c61f5ce6f045ee SHA1 4c62390fc35375fc6ae50ec3f998657110ba3653 SHA256 18b867d91cfea423bf2c7dedb17a06f516e1ecae62e02b3f3d4e04118dda8724 -AUX 0.3/zope-config.conf 1040 RMD160 a50e194f101e3f36fffe0e91b40cd2f90bea9ebf SHA1 3a3ba7b50ab62ca3c93d410ce62eff19ef556370 SHA256 2d66c0099fe09aac6bc50f687dbcffdafd7194edcdb034f2ac1197ef709f772c +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + AUX 0.4/zope-config 14204 RMD160 8886e352ee0a4f7f5e6a8a00c7b5cf087096ed2f SHA1 9fc7c1f7bbbf27ad71107abd4144b4d482767c1e SHA256 31486268140870533ad14bde7a55206641a7ab25be5bcc958675ad4dec9c7014 AUX 0.4/zope-config.conf 1079 RMD160 63d182362b0ffa6d62dde9efeb500f2efe2eee83 SHA1 dd943a4f894465bf3e9707cd93cf8b511d4ff84d SHA256 a6c73b7e5e4ca68247d264c80a1189e5577354ad7e5cd60f9fbc9ddac659de9d AUX 0.5/zope-config 14373 RMD160 5a731d4ca53707c76d596e0815975a6f71d6299f SHA1 a13a4baaa5ce6fa1331bf1c2292033467ab6c5a6 SHA256 508cccf31375fbe80a0af6376c21c32ac9a2c17018937050bb60f5f8e5964fa3 AUX 0.5/zope-config-0.5.patch 894 RMD160 689e9b74db4fc6bc7f046976f972e41cbf399369 SHA1 910dc751c3686b53f4c71a9361a7c9909abb3e31 SHA256 40c62bf7d161db87648f8e3fca646487e28eb5c382695b4df41ee10066073894 AUX 0.5/zope-config.conf 1079 RMD160 4ff9408ea5688bd57ad07b951c110f857dc7f76a SHA1 89347390c80fb57335d9974784e00ccd86408be4 SHA256 116dba0046fb567aeb440670c2e21acb0422bbf6635627a229de5aebf2f899e9 -EBUILD zope-config-0.1-r1.ebuild 561 RMD160 519ec245e3aa5d2fb700f632ddfac7c34b167ded SHA1 54a61b64c89d5f7fce8487dc01231260dfd1981e SHA256 b4f0416ff1b7f7c21e707a48a37903e70bb4367e234b7a647cbaa9ff12086291 -EBUILD zope-config-0.3.ebuild 953 RMD160 93ad595056dca541f3ccdaf023896e9896e7589d SHA1 48908d7e954b37ea8b94de609829bc923c46375d SHA256 e71653b35cd1217b519e69a41625eaf05dfc1ea585bc4f7657e3c8a6a3ad1c9a -EBUILD zope-config-0.4-r1.ebuild 962 RMD160 6bff9b4b19ae8ec97126ce1a828d9d633ff6f6b6 SHA1 c758a2602e65523638db87d3aa7949368e48a6df SHA256 9efd4575fce9620eb2352be03720361d2db41bbe76173906ba8bfd31a3f4b27b -EBUILD zope-config-0.4-r2.ebuild 962 RMD160 023be82d37bb73d74dc0093cbb6d58c30cfeb159 SHA1 8a4eff308869f8b8bc3ed7edb9475deef3120b45 SHA256 c555cf758ae2d3a92bc446f14ca61387739b4931009ae9e4240394f7d2b6aa30 -EBUILD zope-config-0.4-r3.ebuild 962 RMD160 94ca960069cb63476ff14746c0c9b1f62161fc34 SHA1 b8edd823820c5fc4cf3ee60d6df4c1adadcfdd6d SHA256 280a649831726f69334828e33976be4a52e0df03702f643ed043363b3e9a8f28 -EBUILD zope-config-0.4.ebuild 952 RMD160 8f6581bf7fb84c171d58a1121ec334faddf7cff5 SHA1 5141bb02019aeac68a7311288ba589bca796929c SHA256 a02b2568a01c2f57ccadf516f651b199c68ba4b1020e86b97a4229dd944c94ed -EBUILD zope-config-0.5-r1.ebuild 966 RMD160 ccdaa83127af464cd766ca97f6059cfa5db8aa48 SHA1 c7e5c16f79d04ad60bcaec8fbda496f18b3b2890 SHA256 1547b79769e2363c7569cbc65a9c859edb32a20064788ed56dd3b2d794f86c2b -EBUILD zope-config-0.5.ebuild 1014 RMD160 95c97a303101bba0f02390a4cdac91670e507201 SHA1 3c4a4295bd2798a84dd25b64dfd5c7a345472257 SHA256 15731e1786182edd447ac52c1e10aaf854930608bfe89b8fefc559ff1d98e386 -MISC ChangeLog 5975 RMD160 4607f84b5f34a0218d507b2a5da40ffbbb9b1ed4 SHA1 513d56ef512c979bbba1d2e3bd753d65c601fae6 SHA256 a8ace6c7bbc0ee256fc8b4ccec2088a4ec9e356272f981546e220b78984e98df +AUX 0.6/zope-config 14670 RMD160 1a6fad53bd48a8781058547327943c96e038e55e SHA1 a9431e32e0c02e508634ab1fb6e0b1e498eecc03 SHA256 a15d8a72436f90e9581cdc8a5a5260804eb47b09575d8e948133ee4701fc1aea +AUX 0.6/zope-config.conf 1078 RMD160 f4b0ac46bea7b8305efc1e9f37e53662ae556ad8 SHA1 411ed2f35673056076dec8dc58e41d358e1862ae SHA256 b18576b6f6b0ead8c29f08cf04a288e23ff7e3467326d5de66b7667c30b10b52 +EBUILD zope-config-0.5-r1.ebuild 972 RMD160 b1a7b8f932c7a3324c3021a58ed3c8fe481b6a52 SHA1 d9a8cac5af6107aa89c2e86ab4d63a37be35e259 SHA256 d455b8abcfd683ece0cbd8554b2b9088ca56471c4107c9900e2bb6296d450283 +EBUILD zope-config-0.5.ebuild 1024 RMD160 23a821ae802053ec821f71a719db90713e6d5e6a SHA1 148b5c60a6733bb5e4416bb75e66799703296dbb SHA256 00b8aee5cdee5edbaaa48efb7ec981910cd54c56027cd7b313c80757bc4b94e1 +EBUILD zope-config-0.6.ebuild 975 RMD160 af5f917720f51f7d67fc3535ec0c9ad5ae6dfdf6 SHA1 bc1b49b8d27804c8d6c663514e849bca6f0d8fe8 SHA256 ae321638bf688800039557480b2aa6cb4166c45049d2ac8015443be0644875e1 +MISC ChangeLog 6558 RMD160 46ddad6e3599415be37b6e7e6e10c4f561db2367 SHA1 3dcc874f17c30a4e6ebb75b29c0ae8a774e257bb SHA256 f86352e97433396a75d9639f4f973d6691ab1ac82829697d1f04679bcdad2a05 MISC metadata.xml 161 RMD160 5e136d45f811478292bd2ee1798a9b0229ffe468 SHA1 9755179a2dee0511818b1f6738ded28e335e1b9a SHA256 e69ac7205cbc2e42a297e20d8f08922003390a345bbf50ccf00d1158a1c97cc5 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.9 (GNU/Linux) + +iEYEARECAAYFAkkgOCgACgkQSYz9rjec82YjLQCgs1I0qE3bOLxy7yOjKTbodLib +DRYAni0uRuOkXRdUfEr8RgX8CEDjWqG9 +=g223 +-----END PGP SIGNATURE----- diff --git a/app-admin/zope-config/files/0.1/zope-config b/app-admin/zope-config/files/0.1/zope-config deleted file mode 100644 index 5253dc87d256..000000000000 --- a/app-admin/zope-config/files/0.1/zope-config +++ /dev/null @@ -1,305 +0,0 @@ -#!/bin/bash -# Gentoo Zope Instance configure tool. -# Copyright 2003 Jason Shoemaker <kutsuya@gentoo.org> -# Distributed under GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/files/0.1/zope-config,v 1.5 2004/07/18 02:26:33 dragonheart Exp $ - -VERSION="0.1" -ZUID=zope -ZS_DIR="/usr/share/zope/" -ZI_DIR="/var/lib/zope/" -INITD="/etc/init.d/" - -# Return codes used in this program: -E_SUCCESS=0 -E_FAILURE=1 - -#E_ZPLIST=20 -E_ZILIST=22 -#E_COMMAND=24 -E_PARAM=26 -E_ZSLIST=28 -E_ZIDEFAULT=30 - -#Parameters: -# $1 = instance directory -# $2 = group - -zinst_security_setup() -{ - chown -R ${ZUID}:${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/ -} - -#Params: -# $1 = zserv dir -# $2 = zinst dir - -zinst_fs_setup() -{ - local RESULT=${E_FAILURE} - - if [ "${#}" -lt 2 ] ; then - # need a param - RESULT=${E_PARAM} - else - 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 - cp -R $1/.templates/Extensions $2 - cp -R $1/.templates/import $2 - cp -R $1/.templates/var $2 - mkdir $2/Products - RESULT=$? - 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} - else - install $1/.templates/zope.confd /etc/conf.d/${3} - install $1/.templates/zope.initd /etc/init.d/${3} - sed -i -e "/INSTANCE_HOME=/ c\\INSTANCE_HOME=${2}\\ " \ - -e "/CLIENT_HOME=/ c\\CLIENT_HOME=${2}/var\\ " \ - /etc/conf.d/${3} - RESULT=$? - fi - return ${RESULT} -} - -# - -zserv_dir_get() -{ - local RESULT=${E_FAILURE} - local LIST=$(ls ${ZS_DIR}) - 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 0 ${LIST_CNT} ${DLIST}) - RESULT=$? - else - RESULT=${E_ZSLIST} # There are no zservers - fi - ZSERV_DIR="${ZS_DIR}${ZSERV_DIR}" - return ${RESULT} -} - -# - -zinst_dir_set() -{ - local RESULT= - - if [ ! -d ${ZI_DIR} ] ; then - mkdir -p ${ZI_DIR} - fi - - while : ; do - ZINST_DIR=$(dialog --stdout \ - --backtitle "Need a uniqe name for zinstance directory.(Also the name of the rcscript.)" \ - --inputbox "Enter a new zinstance name:" 0 0 zope- ) - 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." 0 0 - continue - fi - ZINST_DIR=${ZI_DIR}${ZINST_DIR} - break - done - return ${RESULT} -} - -# - -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} -} - -# - -zinst_default_set() -{ - local RESULT= - - zinst_dir_get - RESULT=$? - if [ ${RESULT} -eq 0 ] ; then - echo $(basename ${ZINST_DIR}) >${ZI_DIR}/.default - chown zope ${ZI_DIR}/.default - fi - - return ${RESULT} -} - -# - -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} -} - -# - -zinst_zgid_set() -{ - local RESULT= - while : ; do - ZGID_NAME=$(dialog --stdout \ - --backtitle "Need to create/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 "${ZGID_NAME} already exists, use it?" 0 0 - RESULT=$? - [ ${RESULT} -ne 0 ] && continue - fi - break - done - return ${RESULT} -} - -zinst_zpasswd_set() -{ - if [ -z ${ZSERV_DIR} ] ; then - zserv_dir_get || { exit $? ; } - fi - if [ -z ${ZINST_DIR} ] ; then - zinst_dir_get || exit $? - fi - - echo ">>> Create 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 -} - -usage() -{ - echo "$(basename $0) version ${VERSION}" - echo "A Gentoo Zope Instance configure 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=[dir] & zgid=[name]]" - exit ${E_SUCCESS} -} - -##### 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} ;; - --zinst=*) ZINST_DIR=${OPTARG} ;; - --zgid=*) ZGID_NAME=${OPTARG} ;; - --zidef-set) zinst_default_set ; exit $? ;; - --zidef-get) zinst_default_get ; exit $? ;; - --zpasswd) zinst_zpasswd_set ; exit $? ;; - --version) echo ${VERSION} ; exit 0 ;; - -*) usage ;; - *) usage ;; - esac - shift -done - -if [ -z ${ZSERV_DIR} ] ; then - zserv_dir_get || { echo 'Canceled: zserv_dir_get' ; exit 1 ; } -fi - -if [ -z ${ZINST_DIR} ] ; then - zinst_dir_set || { echo 'Canceled: zinst_dir_set' ; exit 1 ; } -fi - -[ -z ${ZIRC_NAME} ] && ZIRC_NAME=$(basename ${ZINST_DIR}) - -if [ -z ${ZGID_NAME} ] ; then - zinst_zgid_set || { echo 'Canceled: zinst_zgid_set' ; exit 1 ; } -fi - -zinst_fs_setup ${ZSERV_DIR} ${ZINST_DIR} -zinst_rc_setup ${ZSERV_DIR} ${ZINST_DIR} ${ZIRC_NAME} -groupadd ${ZGID_NAME} -zinst_security_setup ${ZINST_DIR} ${ZGID_NAME} - -# TODO: see about adding interactive configuration of ZOPE_OPTS -echo "Note: Don't forget to edit ZOPE_OPTS in /etc/conf.d/${ZIRC_NAME}" - diff --git a/app-admin/zope-config/files/0.3/zope-config b/app-admin/zope-config/files/0.3/zope-config deleted file mode 100644 index df32d8e5d282..000000000000 --- a/app-admin/zope-config/files/0.3/zope-config +++ /dev/null @@ -1,340 +0,0 @@ -#!/bin/bash -# vim: set noexpandtab ts=4: -# Gentoo Zope Instance configure tool. -# -# Originally written by Jason Shoemaker <kutsuya@gentoo.org> -# Portions by solution2u.net gmbh (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.3/zope-config,v 1.3 2004/07/14 21:22:44 agriffis Exp $ - -VERSION="0.2" - -CONFIGFILE=/etc/zope-config.conf -if [ -e ${CONFIGFILE} ]; then - source ${CONFIGFILE} -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_ZPLIST=20 -E_ZILIST=22 -#E_COMMAND=24 -E_PARAM=26 -E_ZSLIST=28 -E_ZIDEFAULT=30 - -#Parameters: -# $1 = instance directory -# $2 = group - -zinst_security_setup() -{ - chown -R ${ZUID}:${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/ -} - -#Params: -# $1 = zserv dir -# $2 = zinst dir - -zinst_fs_setup() -{ - local RESULT=${E_FAILURE} - - if [ "${#}" -lt 2 ] ; then - # need a param - RESULT=${E_PARAM} - else - 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 - - 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} - 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=$? - # make sure the directory exists - mkdir -p ${EVENTLOGDIR} >/dev/null 2>&1 - fi - return ${RESULT} -} - -# - -zserv_dir_get() -{ - local RESULT=${E_FAILURE} - local LIST=$(ls ${ZS_DIR}) - 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 0 ${LIST_CNT} ${DLIST}) - RESULT=$? - else - RESULT=${E_ZSLIST} # There are no zservers - fi - ZSERV_DIR="${ZS_DIR}${ZSERV_DIR}" - return ${RESULT} -} - -# - -zinst_dir_set() -{ - local RESULT= - - if [ ! -d ${ZI_DIR} ] ; then - mkdir -p ${ZI_DIR} - fi - - while : ; do - ZINST_DIR=$(dialog --stdout \ - --backtitle "Need a uniqe name for zinstance directory.(Also 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." 0 0 - continue - fi - ZINST_DIR=${ZI_DIR}${ZINST_DIR} - break - done - return ${RESULT} -} - -# - -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} -} - -# - -zinst_default_set() -{ - local RESULT= - - zinst_dir_get - 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 "Need to create/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 "${ZGID_NAME} already exists, 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 - - echo ">>> Create 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 -} - -# help! - -usage() -{ - echo "$(basename $0) version ${VERSION}" - echo "A Gentoo Zope Instance configure 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=[dir] & zgid=[name]]" - exit ${E_SUCCESS} -} - -##### 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} ;; - --zinst=*) ZINST_DIR=${OPTARG} ;; - --zgid=*) ZGID_NAME=${OPTARG} ;; - --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 [ -z ${ZSERV_DIR} ] ; then - zserv_dir_get || { echo 'Canceled: zserv_dir_get' ; exit 1 ; } -fi - -if [ -z ${ZINST_DIR} ] ; then - zinst_dir_set || { echo 'Canceled: zinst_dir_set' ; exit 1 ; } -fi - -[ -z ${ZIRC_NAME} ] && ZIRC_NAME=$(basename ${ZINST_DIR}) - -if [ -z ${ZGID_NAME} ] ; then - zinst_zgid_set || { echo 'Canceled: zinst_zgid_set' ; exit 1 ; } -fi - -zinst_fs_setup ${ZSERV_DIR} ${ZINST_DIR} -zinst_rc_setup ${ZSERV_DIR} ${ZINST_DIR} ${ZIRC_NAME} - -groupadd ${ZGID_NAME} -# add existing user zope to the new group -gpasswd -a zope ${ZGID_NAME} - -zinst_security_setup ${ZINST_DIR} ${ZGID_NAME} - -# TODO: see about adding interactive configuration of ZOPE_OPTS -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)" - diff --git a/app-admin/zope-config/files/0.6/zope-config b/app-admin/zope-config/files/0.6/zope-config new file mode 100755 index 000000000000..e72605f693dc --- /dev/null +++ b/app-admin/zope-config/files/0.6/zope-config @@ -0,0 +1,531 @@ +#!/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.3/zope-config.conf b/app-admin/zope-config/files/0.6/zope-config.conf index cebd982790ba..1a7ff04d3848 100644 --- a/app-admin/zope-config/files/0.3/zope-config.conf +++ b/app-admin/zope-config/files/0.6/zope-config.conf @@ -2,12 +2,12 @@ # Gentoo Zope Instance configure tool config file. # # Originally written by Jason Shoemaker <kutsuya@gentoo.org> -# Portions by solution2u.net gmbh (Logging and some cleanups) +# 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.3/zope-config.conf,v 1.2 2004/07/14 21:22:44 agriffis Exp $ +# $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-" @@ -21,6 +21,7 @@ EVENTLOGDIR="/var/log/zope/" 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 diff --git a/app-admin/zope-config/zope-config-0.1-r1.ebuild b/app-admin/zope-config/zope-config-0.1-r1.ebuild deleted file mode 100644 index 4d0b903a9c59..000000000000 --- a/app-admin/zope-config/zope-config-0.1-r1.ebuild +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/zope-config-0.1-r1.ebuild,v 1.14 2005/09/11 15:06:34 agriffis Exp $ - -DESCRIPTION="A Gentoo Zope multi-Instance configure tool" -SRC_URI="" -HOMEPAGE="http://www.gentoo.org/" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="x86 ppc ~sparc" -IUSE="" - -DEPEND="" -RDEPEND=">=dev-util/dialog-0.7 - sys-apps/grep - sys-apps/sed" - -PDEPEND=">=net-zope/zope-2.6.0-r2" - -src_install() { - dosbin ${FILESDIR}/${PV}/zope-config -} diff --git a/app-admin/zope-config/zope-config-0.3.ebuild b/app-admin/zope-config/zope-config-0.3.ebuild deleted file mode 100644 index a6d691b4d474..000000000000 --- a/app-admin/zope-config/zope-config-0.3.ebuild +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/zope-config-0.3.ebuild,v 1.14 2007/01/24 15:11:32 genone Exp $ - -DESCRIPTION="A Gentoo Zope multi-Instance configure tool" -SRC_URI="" -HOMEPAGE="http://www.gentoo.org/" -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="x86 sparc ppc ~alpha" -IUSE="" -DEPEND="" -RDEPEND=">=dev-util/dialog-0.7 - sys-apps/grep - sys-apps/sed - sys-apps/shadow - dev-lang/python - sys-apps/coreutils" - -PDEPEND=">=net-zope/zope-2.6.0-r2" - -src_install() { - # the script - dosbin ${FILESDIR}/${PV}/zope-config - # config file - insinto /etc - doins ${FILESDIR}/${PV}/zope-config.conf - # ensure this directory exists - keepdir /var/log/zope -} - -pkg_postinst() { - source ${FILESDIR}/${PV}/zope-config.conf - elog "Please note that new instances now log into ${EVENTLOGDIR}" - elog "Please see the configuration file /etc/zope-config.conf" -} diff --git a/app-admin/zope-config/zope-config-0.4-r2.ebuild b/app-admin/zope-config/zope-config-0.4-r2.ebuild deleted file mode 100644 index 19bc27377e3c..000000000000 --- a/app-admin/zope-config/zope-config-0.4-r2.ebuild +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/zope-config-0.4-r2.ebuild,v 1.3 2007/01/24 15:11:32 genone Exp $ - -DESCRIPTION="A Gentoo Zope multi-Instance configure tool" -SRC_URI="" -HOMEPAGE="http://www.gentoo.org/" -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~sparc ~ppc ~alpha ~amd64" -IUSE="" -DEPEND="" -RDEPEND=">=dev-util/dialog-0.7 - sys-apps/grep - sys-apps/sed - sys-apps/shadow - dev-lang/python - sys-apps/coreutils" - -PDEPEND=">=net-zope/zope-2.7.1" - -src_install() { - # the script - dosbin ${FILESDIR}/${PV}/zope-config - # config file - insinto /etc - doins ${FILESDIR}/${PV}/zope-config.conf - # ensure this directory exists - keepdir /var/log/zope -} - -pkg_postinst() { - source ${FILESDIR}/${PV}/zope-config.conf - elog "Please note that new instances now log into ${EVENTLOGDIR}" - elog "Please see the configuration file /etc/zope-config.conf" -} diff --git a/app-admin/zope-config/zope-config-0.4-r3.ebuild b/app-admin/zope-config/zope-config-0.4-r3.ebuild deleted file mode 100644 index 21a29646b977..000000000000 --- a/app-admin/zope-config/zope-config-0.4-r3.ebuild +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/zope-config-0.4-r3.ebuild,v 1.6 2007/01/24 15:11:32 genone Exp $ - -DESCRIPTION="A Gentoo Zope multi-Instance configure tool" -SRC_URI="" -HOMEPAGE="http://www.gentoo.org/" -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="x86 sparc ppc ~alpha ~amd64" -IUSE="" -DEPEND="" -RDEPEND=">=dev-util/dialog-0.7 - sys-apps/grep - sys-apps/sed - sys-apps/shadow - dev-lang/python - sys-apps/coreutils" - -PDEPEND=">=net-zope/zope-2.7.2-r2" - -src_install() { - # the script - dosbin ${FILESDIR}/${PV}/zope-config - # config file - insinto /etc - doins ${FILESDIR}/${PV}/zope-config.conf - # ensure this directory exists - keepdir /var/log/zope -} - -pkg_postinst() { - source ${FILESDIR}/${PV}/zope-config.conf - elog "Please note that new instances now log into ${EVENTLOGDIR}" - elog "Please see the configuration file /etc/zope-config.conf" -} diff --git a/app-admin/zope-config/zope-config-0.4.ebuild b/app-admin/zope-config/zope-config-0.4.ebuild deleted file mode 100644 index 3c21d267a7f4..000000000000 --- a/app-admin/zope-config/zope-config-0.4.ebuild +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/zope-config-0.4.ebuild,v 1.3 2007/01/24 15:11:32 genone Exp $ - -DESCRIPTION="A Gentoo Zope multi-Instance configure tool" -SRC_URI="" -HOMEPAGE="http://www.gentoo.org/" -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~sparc ~ppc ~alpha" -IUSE="" -DEPEND="" -RDEPEND=">=dev-util/dialog-0.7 - sys-apps/grep - sys-apps/sed - sys-apps/shadow - dev-lang/python - sys-apps/coreutils" - -PDEPEND=">=net-zope/zope-2.7.1" - -src_install() { - # the script - dosbin ${FILESDIR}/${PV}/zope-config - # config file - insinto /etc - doins ${FILESDIR}/${PV}/zope-config.conf - # ensure this directory exists - keepdir /var/log/zope -} - -pkg_postinst() { - source ${FILESDIR}/${PV}/zope-config.conf - elog "Please note that new instances now log into ${EVENTLOGDIR}" - elog "Please see the configuration file /etc/zope-config.conf" -} diff --git a/app-admin/zope-config/zope-config-0.5-r1.ebuild b/app-admin/zope-config/zope-config-0.5-r1.ebuild index becdf2daa8ca..d297c2236ee5 100644 --- a/app-admin/zope-config/zope-config-0.5-r1.ebuild +++ b/app-admin/zope-config/zope-config-0.5-r1.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2007 Gentoo Foundation +# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/zope-config-0.5-r1.ebuild,v 1.2 2007/01/24 15:11:32 genone Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/zope-config-0.5-r1.ebuild,v 1.3 2008/11/16 15:11:23 tupone Exp $ DESCRIPTION="A Gentoo Zope multi-Instance configure tool" SRC_URI="" @@ -21,17 +21,17 @@ PDEPEND=">=net-zope/zope-2.7.2-r2" src_install() { # the script - dosbin ${FILESDIR}/${PV}/zope-config + dosbin "${FILESDIR}"/${PV}/zope-config # config file insinto /etc - doins ${FILESDIR}/${PV}/zope-config.conf + doins "${FILESDIR}"/${PV}/zope-config.conf # ensure this directory exists keepdir /var/log/zope } pkg_postinst() { - source ${FILESDIR}/${PV}/zope-config.conf + source "${FILESDIR}"/${PV}/zope-config.conf elog "Please note that new instances now log into ${EVENTLOGDIR}" elog "Please see the configuration file /etc/zope-config.conf" } diff --git a/app-admin/zope-config/zope-config-0.5.ebuild b/app-admin/zope-config/zope-config-0.5.ebuild index c65c1f007680..2a9ccc884972 100644 --- a/app-admin/zope-config/zope-config-0.5.ebuild +++ b/app-admin/zope-config/zope-config-0.5.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2007 Gentoo Foundation +# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/zope-config-0.5.ebuild,v 1.8 2007/01/24 15:11:32 genone Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/zope-config-0.5.ebuild,v 1.9 2008/11/16 15:11:23 tupone Exp $ DESCRIPTION="A Gentoo Zope multi-Instance configure tool" SRC_URI="" @@ -21,18 +21,18 @@ PDEPEND=">=net-zope/zope-2.7.2-r2" src_install() { # the script - dosbin ${FILESDIR}/0.4/zope-config - patch ${D}/usr/sbin/zope-config ${FILESDIR}/${PV}/${P}.patch + dosbin "${FILESDIR}"/0.4/zope-config + patch "${D}"/usr/sbin/zope-config "${FILESDIR}"/${PV}/${P}.patch # config file insinto /etc - doins ${FILESDIR}/0.4/zope-config.conf + doins "${FILESDIR}"/0.4/zope-config.conf # ensure this directory exists keepdir /var/log/zope } pkg_postinst() { - source ${FILESDIR}/0.4/zope-config.conf + source "${FILESDIR}"/0.4/zope-config.conf elog "Please note that new instances now log into ${EVENTLOGDIR}" elog "Please see the configuration file /etc/zope-config.conf" } diff --git a/app-admin/zope-config/zope-config-0.4-r1.ebuild b/app-admin/zope-config/zope-config-0.6.ebuild index 1f5424d8ed8a..61a3525d0e80 100644 --- a/app-admin/zope-config/zope-config-0.4-r1.ebuild +++ b/app-admin/zope-config/zope-config-0.6.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2007 Gentoo Foundation +# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/zope-config-0.4-r1.ebuild,v 1.4 2007/01/24 15:11:32 genone Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/zope-config/zope-config-0.6.ebuild,v 1.1 2008/11/16 15:11:23 tupone Exp $ DESCRIPTION="A Gentoo Zope multi-Instance configure tool" SRC_URI="" @@ -10,27 +10,29 @@ SLOT="0" KEYWORDS="~x86 ~sparc ~ppc ~alpha ~amd64" IUSE="" DEPEND="" -RDEPEND=">=dev-util/dialog-0.7 +RDEPEND="dev-util/dialog sys-apps/grep sys-apps/sed sys-apps/shadow dev-lang/python - sys-apps/coreutils" + sys-apps/coreutils + sys-apps/debianutils" -PDEPEND=">=net-zope/zope-2.7.1" +PDEPEND="net-zope/zope" src_install() { # the script - dosbin ${FILESDIR}/${PV}/zope-config + dosbin "${FILESDIR}"/${PV}/zope-config + # config file insinto /etc - doins ${FILESDIR}/${PV}/zope-config.conf + doins "${FILESDIR}"/${PV}/zope-config.conf # ensure this directory exists keepdir /var/log/zope } pkg_postinst() { - source ${FILESDIR}/${PV}/zope-config.conf + source "${FILESDIR}"/${PV}/zope-config.conf elog "Please note that new instances now log into ${EVENTLOGDIR}" elog "Please see the configuration file /etc/zope-config.conf" } |