parent
0674c2c9fc
commit
78c323054b
@ -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
|
||||
|
@ -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/"
|
@ -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
|
||||
|
@ -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
|
@ -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/"
|
@ -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
|
||||
|
@ -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/"
|
@ -1,37 +0,0 @@
|
||||
# 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.3 2008/11/16 15:11:23 tupone 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"
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
# 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.9 2008/11/16 15:11:23 tupone Exp $
|
||||
|
||||
DESCRIPTION="A Gentoo Zope multi-Instance configure tool"
|
||||
SRC_URI=""
|
||||
HOMEPAGE="http://www.gentoo.org/"
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="alpha amd64 ppc sparc x86"
|
||||
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}"/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
|
||||
# ensure this directory exists
|
||||
keepdir /var/log/zope
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
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"
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
# 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.6.ebuild,v 1.1 2008/11/16 15:11:23 tupone 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
|
||||
sys-apps/grep
|
||||
sys-apps/sed
|
||||
sys-apps/shadow
|
||||
dev-lang/python
|
||||
sys-apps/coreutils
|
||||
sys-apps/debianutils"
|
||||
|
||||
PDEPEND="net-zope/zope"
|
||||
|
||||
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"
|
||||
}
|
@ -1,349 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Gentoo Zope Product selection tool.
|
||||
# Copyright 2003 Jason Shoemaker <kutsuya@gentoo.org>
|
||||
# Distributed under GPL v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-admin/zprod-manager/files/0.3.1/zprod-manager,v 1.1 2006/11/06 05:28:09 aross Exp $
|
||||
|
||||
VERSION="0.3.1"
|
||||
COMMAND_LIST="add del"
|
||||
ZS_DIR="/usr/share/zope/"
|
||||
ZI_DIR="/var/lib/zope/"
|
||||
ZPROD_DIR="/usr/share/zproduct/"
|
||||
|
||||
ZINST_DEFAULT=".default"
|
||||
ZPROD_FLIST_FNAME=".zfolder.lst"
|
||||
ZPROD_PLIST_FNAME=".zproduct.lst"
|
||||
|
||||
# Assume the standard dialog return codes
|
||||
#DIALOG_CANCEL=1
|
||||
#DIALOG_ERROR=-1
|
||||
#DIALOG_ESC=-255
|
||||
#DIALOG_OK=0
|
||||
#DIALOG_ERROR may equal #DIALOG_ESC
|
||||
|
||||
# Return codes used in this program:
|
||||
E_SUCCESS=0
|
||||
E_FAILURE=1
|
||||
|
||||
E_ZPLIST=20
|
||||
E_ZILIST=22
|
||||
E_COMMAND=24
|
||||
E_OVERWRITE=26
|
||||
|
||||
## copied from zope-config
|
||||
|
||||
zinst_dir_get()
|
||||
{
|
||||
local RESULT=${E_FAILURE}
|
||||
local LIST=$(ls ${ZI_DIR})
|
||||
local LIST_CNT=$(echo ${LIST} | wc -w)
|
||||
local DLIST=
|
||||
|
||||
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}
|
||||
}
|
||||
|
||||
# params: none
|
||||
# TODO: Maybe try to break this function down some more.
|
||||
# TODO: verify items in ZP_PLIST and ZI_PLIST
|
||||
|
||||
mode_interactive()
|
||||
{
|
||||
local RESULT=
|
||||
if [ $(is_command "${COMMAND_LIST}" ${1})${?} -ne 0 ] ; then
|
||||
RESULT=${?}
|
||||
return ${RESULT}
|
||||
fi
|
||||
ZP_PLIST=$(ls ${ZPROD_DIR})
|
||||
if [ "${ZP_PLIST}" ] ; then
|
||||
zinst_dir_get
|
||||
RESULT=$?
|
||||
if [ ${RESULT} -eq 0 ] ; then
|
||||
ZI_PLIST=$(cat ${ZINST_DIR}/${ZPROD_PLIST_FNAME})
|
||||
# Create CLIST for --menu
|
||||
if [ "${ZI_PLIST}" ] ; then
|
||||
for N in ${ZP_PLIST} ; do
|
||||
echo ${ZI_PLIST} |grep ${N} >/dev/null
|
||||
if [ $? -eq 0 ] ; then
|
||||
STATUS=ON
|
||||
else
|
||||
STATUS=OFF
|
||||
fi
|
||||
CLIST="${CLIST} ${N} - ${STATUS}"
|
||||
done
|
||||
CTAGS=$(dialog --stdout \
|
||||
--backtitle "Select the zproducts you want installed for zinstance(${ZINST_DIR})." \
|
||||
--checklist "Select:" 0 0 0 ${CLIST})
|
||||
RESULT=$?
|
||||
CTAGS=$(echo ${CTAGS} | sed -e "s:\"::g")
|
||||
# Prepare to add and delete zproducts installed in zinstance
|
||||
if [[ ${RESULT} -eq 0 && "${CTAGS}" ]] ; then
|
||||
for N in ${ZI_PLIST} ; do
|
||||
echo "$CTAGS" |grep ${N} >/dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
prod_del ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
fi
|
||||
done
|
||||
for N in ${CTAGS} ; do
|
||||
echo ${ZI_PLIST} |grep ${N} >/dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
prod_add ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
fi
|
||||
done
|
||||
RESULT=$?
|
||||
elif [ ${RESULT} -eq 0 ] ; then # $CTAGS is empty
|
||||
for N in ${ZI_PLIST} ; do
|
||||
prod_del ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
done
|
||||
RESULT=$?
|
||||
fi
|
||||
else # ZI_PLIST is empty
|
||||
for N in ${ZP_PLIST} ; do
|
||||
CLIST="${CLIST} ${N} - 0"
|
||||
done
|
||||
CTAGS=$(dialog --stdout \
|
||||
--backtitle "Select the zproducts you want installed for zinstance(${ZINST_DIR})." \
|
||||
--checklist "Select:" 0 0 0 ${CLIST})
|
||||
RESULT=$?
|
||||
CTAGS=$(echo "${CTAGS}" | sed -e "s:\"::g")
|
||||
if [[ ${RESULT} -eq 0 && "${CTAGS}" ]] ; then
|
||||
for N in ${CTAGS} ; do
|
||||
# as this is empty Products directory in instance if-case, we can safely ignore
|
||||
# RESULT returned from prod_add in case of overwrite error. It can not happen
|
||||
# when ZI_PLIST is empty, right? ;) <radek@gentoo.org>
|
||||
prod_add ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else # ZP_PLIST is empty
|
||||
RESULT=${E_ZPLIST}
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
|
||||
# Parameters:
|
||||
# $1 = command list
|
||||
# $2 = command received
|
||||
# Returns:
|
||||
# true or false
|
||||
|
||||
is_command()
|
||||
{
|
||||
local RESULT=${E_COMMAND}
|
||||
local N=
|
||||
|
||||
echo ${1} |grep ${2} >/dev/null
|
||||
if [ $? -eq 0 ] ; then
|
||||
RESULT=0
|
||||
fi
|
||||
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zinstance
|
||||
# Returns:
|
||||
# true or false
|
||||
|
||||
is_zinstanceDir()
|
||||
{
|
||||
local RESULT=${E_ZILIST}
|
||||
# If can't find these, probably not a zinstance.
|
||||
if [[ -d "${1}/Products" && -d "${1}/var" && -d "${1}/import" && -d "${1}/Extensions" ]] ; then
|
||||
RESULT=0
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zproduct
|
||||
# Returns:
|
||||
# true or false
|
||||
|
||||
is_zproductDir()
|
||||
{
|
||||
local RESULT=${E_ZPLIST}
|
||||
# look for something in .zproduct.lst in $1, if we can't find that...
|
||||
if [ -s "${1}/${ZPROD_FLIST_FNAME}" ] ; then
|
||||
RESULT=0
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zinst_dir
|
||||
# Returns:
|
||||
# stdout = name of defautl zinstance, if any.
|
||||
|
||||
zinst_default_get()
|
||||
{
|
||||
if [ -s ${1}/${ZINST_DEFAULT} ] ; then
|
||||
cat ${1}/${ZINST_DEFAULT}
|
||||
fi
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zproduct
|
||||
# $2 = /path/to/zinstance
|
||||
|
||||
# be warned, using this function you have to immediately fail if functionss returns error.
|
||||
|
||||
prod_add()
|
||||
{
|
||||
local RESULT=
|
||||
local N=
|
||||
|
||||
# checks if some products components are already installed,
|
||||
# if yes, we have to break with error, as overwrites are DANGEROUS!
|
||||
for N in $(cat "${1}/${ZPROD_FLIST_FNAME}")
|
||||
do
|
||||
if [ -d ${2}/Products/${N} ]
|
||||
then
|
||||
echo "ZPROD-MANAGER WARNING: Overwrite possiblity detected at ${N}"
|
||||
return ${E_OVERWRITE}
|
||||
fi
|
||||
done
|
||||
|
||||
for N in $(cat "${1}/${ZPROD_FLIST_FNAME}") ; do
|
||||
# we do copy instead of link, because its much safer, and zope-development-way compliant
|
||||
cp -Ra ${1}/${N} ${2}/Products
|
||||
done
|
||||
RESULT=$?
|
||||
if [ ${RESULT} -eq 0 ] ; then
|
||||
# basically adding ${PF} to .zproduct.lst
|
||||
echo $(basename $1) >> ${2}/${ZPROD_PLIST_FNAME}
|
||||
sort -u ${2}/${ZPROD_PLIST_FNAME} > ${2}/.tmp
|
||||
mv -f ${2}/.tmp ${2}/${ZPROD_PLIST_FNAME}
|
||||
RESULT=$?
|
||||
|
||||
for N in $(cat "${1}/${ZPROD_FLIST_FNAME}") ; do
|
||||
# setting owner and group as in Products folder, so we can compile
|
||||
# python scripts with the zope user
|
||||
|
||||
chown -R `stat -c %U:%G ${2}/Products` ${2}/Products/${N}
|
||||
|
||||
# gives group writing perms (very often need in development teams)
|
||||
# takes all perms from others to comply with 770 instance policy
|
||||
chmod -R g+rwX,o-rwx ${2}/Products/${N}
|
||||
done
|
||||
fi
|
||||
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zproduct
|
||||
# $2 = /path/to/zinstance
|
||||
|
||||
prod_del()
|
||||
{
|
||||
local RESULT=
|
||||
local N=
|
||||
local PF=$(basename $1)
|
||||
|
||||
grep "${PF}" "${2}/${ZPROD_PLIST_FNAME}" >/dev/null
|
||||
RESULT=$?
|
||||
if [ ${RESULT} -eq 0 ] ; then
|
||||
for N in $(cat ${1}/${ZPROD_FLIST_FNAME}) ; do
|
||||
rm -rf ${2}/Products/${N}
|
||||
done
|
||||
# remove zproduct from .zproduct.lst
|
||||
sed -i -e "s/${PF}$//" -e "/^$/d" ${2}/${ZPROD_PLIST_FNAME}
|
||||
RESULT=$?
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = (optional) error message
|
||||
|
||||
mode_help()
|
||||
{
|
||||
echo "$(basename $0) version ${VERSION}"
|
||||
echo "A Gentoo Zope Product selection tool."
|
||||
echo
|
||||
echo "Interactive usage:"
|
||||
echo -e "\t$(basename $0) [add | del]"
|
||||
echo "Default zinstance usage:"
|
||||
echo -e "\t$(basename $0) [add |del] /path/of/zproduct"
|
||||
echo "Non-interactive usage:"
|
||||
echo -e "\t$(basename $0) [add | del] /path/of/zproduct /path/of/zinstance/"
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = command
|
||||
# $2 = /path/to/zproductDir
|
||||
|
||||
mode_defaultZinst()
|
||||
{
|
||||
local DEFAULT_ZINST=$(zinst_default_get ${ZI_DIR})
|
||||
local RESULT=$?
|
||||
if [ -n "${DEFAULT_ZINST}" ] ; then
|
||||
mode_explicit ${1} ${2} ${ZI_DIR}/${DEFAULT_ZINST}
|
||||
RESULT=${?}
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = command
|
||||
# $2 = /path/to/zproduct
|
||||
# $3 = /path/to/zinstance
|
||||
|
||||
mode_explicit()
|
||||
{
|
||||
local RESULT=
|
||||
if [[ $(is_command "${COMMAND_LIST}" ${1})${?} -eq 0 && \
|
||||
$(is_zproductDir ${2})${?} -eq 0 && \
|
||||
$(is_zinstanceDir ${3})${?} -eq 0 ]] ; then
|
||||
if [ ${1} = "add" ] ; then
|
||||
prod_add ${2} ${3}
|
||||
RESULT=$?
|
||||
elif [ ${1} = "del" ] ; then
|
||||
prod_del ${2} ${3}
|
||||
RESULT=$?
|
||||
else
|
||||
RESULT=${E_COMMAND}
|
||||
fi
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
### MAIN
|
||||
|
||||
if [ ${!#} = "--help" ] ; then
|
||||
mode_help
|
||||
else
|
||||
case "${#}" in
|
||||
0) mode_help ;;
|
||||
1) mode_interactive ${1} ;;
|
||||
2) mode_defaultZinst ${1} ${2} ;;
|
||||
3) mode_explicit ${1} ${2} ${3} ;;
|
||||
*) mode_help "Error: Too many parameters" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
RESULT=$?
|
||||
|
||||
if [ ${RESULT} -ne 0 ] ; then
|
||||
echo "ERROR ${?}"
|
||||
fi
|
||||
|
||||
|
||||
# vim:ts=8
|
@ -1,379 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Gentoo Zope Product selection tool.
|
||||
# Copyright 2003 Jason Shoemaker <kutsuya@gentoo.org>
|
||||
# Distributed under GPL v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-admin/zprod-manager/files/0.3.2/zprod-manager,v 1.2 2008/05/24 20:46:27 tupone Exp $
|
||||
|
||||
VERSION="0.3.1"
|
||||
COMMAND_LIST="add del"
|
||||
ZS_DIR="/usr/share/zope/"
|
||||
ZI_DIR="/var/lib/zope/"
|
||||
ZPROD_DIR="/usr/share/zproduct/"
|
||||
|
||||
ZINST_DEFAULT=".default"
|
||||
ZPROD_FLIST_FNAME=".zfolder.lst"
|
||||
ZPROD_LLIST_FNAME=".zlfolder.lst"
|
||||
ZPROD_PLIST_FNAME=".zproduct.lst"
|
||||
|
||||
# Assume the standard dialog return codes
|
||||
#DIALOG_CANCEL=1
|
||||
#DIALOG_ERROR=-1
|
||||
#DIALOG_ESC=-255
|
||||
#DIALOG_OK=0
|
||||
#DIALOG_ERROR may equal #DIALOG_ESC
|
||||
|
||||
# Return codes used in this program:
|
||||
E_SUCCESS=0
|
||||
E_FAILURE=1
|
||||
|
||||
E_ZPLIST=20
|
||||
E_ZILIST=22
|
||||
E_COMMAND=24
|
||||
E_OVERWRITE=26
|
||||
|
||||
## copied from zope-config
|
||||
|
||||
zinst_dir_get()
|
||||
{
|
||||
local RESULT=${E_FAILURE}
|
||||
local LIST=$(ls ${ZI_DIR})
|
||||
local LIST_CNT=$(echo ${LIST} | wc -w)
|
||||
local DLIST=
|
||||
|
||||
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}
|
||||
}
|
||||
|
||||
# params: none
|
||||
# TODO: Maybe try to break this function down some more.
|
||||
# TODO: verify items in ZP_PLIST and ZI_PLIST
|
||||
|
||||
mode_interactive()
|
||||
{
|
||||
local RESULT=
|
||||
if [ $(is_command "${COMMAND_LIST}" ${1})${?} -ne 0 ] ; then
|
||||
RESULT=${?}
|
||||
return ${RESULT}
|
||||
fi
|
||||
ZP_PLIST=$(ls ${ZPROD_DIR})
|
||||
if [ "${ZP_PLIST}" ] ; then
|
||||
zinst_dir_get
|
||||
RESULT=$?
|
||||
if [ ${RESULT} -eq 0 ] ; then
|
||||
ZI_PLIST=$(cat ${ZINST_DIR}/${ZPROD_PLIST_FNAME})
|
||||
# Create CLIST for --menu
|
||||
if [ "${ZI_PLIST}" ] ; then
|
||||
for N in ${ZP_PLIST} ; do
|
||||
echo ${ZI_PLIST} |grep ${N} >/dev/null
|
||||
if [ $? -eq 0 ] ; then
|
||||
STATUS=ON
|
||||
else
|
||||
STATUS=OFF
|
||||
fi
|
||||
CLIST="${CLIST} ${N} - ${STATUS}"
|
||||
done
|
||||
CTAGS=$(dialog --stdout \
|
||||
--backtitle "Select the zproducts you want installed for zinstance(${ZINST_DIR})." \
|
||||
--checklist "Select:" 0 0 0 ${CLIST})
|
||||
RESULT=$?
|
||||
CTAGS=$(echo ${CTAGS} | sed -e "s:\"::g")
|
||||
# Prepare to add and delete zproducts installed in zinstance
|
||||
if [[ ${RESULT} -eq 0 && "${CTAGS}" ]] ; then
|
||||
for N in ${ZI_PLIST} ; do
|
||||
echo "$CTAGS" |grep ${N} >/dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
prod_del ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
fi
|
||||
done
|
||||
for N in ${CTAGS} ; do
|
||||
echo ${ZI_PLIST} |grep ${N} >/dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
prod_add ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
fi
|
||||
done
|
||||
RESULT=$?
|
||||
elif [ ${RESULT} -eq 0 ] ; then # $CTAGS is empty
|
||||
for N in ${ZI_PLIST} ; do
|
||||
prod_del ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
done
|
||||
RESULT=$?
|
||||
fi
|
||||
else # ZI_PLIST is empty
|
||||
for N in ${ZP_PLIST} ; do
|
||||
CLIST="${CLIST} ${N} - 0"
|
||||
done
|
||||
CTAGS=$(dialog --stdout \
|
||||
--backtitle "Select the zproducts you want installed for zinstance(${ZINST_DIR})." \
|
||||
--checklist "Select:" 0 0 0 ${CLIST})
|
||||
RESULT=$?
|
||||
CTAGS=$(echo "${CTAGS}" | sed -e "s:\"::g")
|
||||
if [[ ${RESULT} -eq 0 && "${CTAGS}" ]] ; then
|
||||
for N in ${CTAGS} ; do
|
||||
# as this is empty Products directory in instance if-case, we can safely ignore
|
||||
# RESULT returned from prod_add in case of overwrite error. It can not happen
|
||||
# when ZI_PLIST is empty, right? ;) <radek@gentoo.org>
|
||||
prod_add ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else # ZP_PLIST is empty
|
||||
RESULT=${E_ZPLIST}
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
|
||||
# Parameters:
|
||||
# $1 = command list
|
||||
# $2 = command received
|
||||
# Returns:
|
||||
# true or false
|
||||
|
||||
is_command()
|
||||
{
|
||||
local RESULT=${E_COMMAND}
|
||||
local N=
|
||||
|
||||
echo ${1} |grep ${2} >/dev/null
|
||||
if [ $? -eq 0 ] ; then
|
||||
RESULT=0
|
||||
fi
|
||||
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zinstance
|
||||
# Returns:
|
||||
# true or false
|
||||
|
||||
is_zinstanceDir()
|
||||
{
|
||||
local RESULT=${E_ZILIST}
|
||||
# If can't find these, probably not a zinstance.
|
||||
if [[ -d "${1}/Products" && -d "${1}/var" && -d "${1}/import" && -d "${1}/Extensions" ]] ; then
|
||||
RESULT=0
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zproduct
|
||||
# Returns:
|
||||
# true or false
|
||||
|
||||
is_zproductDir()
|
||||
{
|
||||
local RESULT=${E_ZPLIST}
|
||||
# look for something in .zproduct.lst in $1, if we can't find that...
|
||||
if [ -s "${1}/${ZPROD_FLIST_FNAME}" ] ; then
|
||||
RESULT=0
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zinst_dir
|
||||
# Returns:
|
||||
# stdout = name of defautl zinstance, if any.
|
||||
|
||||
zinst_default_get()
|
||||
{
|
||||
if [ -s ${1}/${ZINST_DEFAULT} ] ; then
|
||||
cat ${1}/${ZINST_DEFAULT}
|
||||
fi
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zproduct
|
||||
# $2 = /path/to/zinstance
|
||||
|
||||
# be warned, using this function you have to immediately fail if functionss returns error.
|
||||
|
||||
prod_add()
|
||||
{
|
||||
local RESULT=
|
||||
local N=
|
||||
|
||||
# checks if some products components are already installed,
|
||||
# if yes, we have to break with error, as overwrites are DANGEROUS!
|
||||
for N in $(cat "${1}/${ZPROD_FLIST_FNAME}")
|
||||
do
|
||||
if [ -d ${2}/Products/${N} ]
|
||||
then
|
||||
echo "ZPROD-MANAGER WARNING: Overwrite possiblity detected at ${N}"
|
||||
return ${E_OVERWRITE}
|
||||
fi
|
||||
done
|
||||
if [ -f "${1}/${ZPROD_LLIST_FNAME}" ]; then
|
||||
for N in $(cat "${1}/${ZPROD_LLIST_FNAME}"); do
|
||||
if [ -d ${2}/lib/python/${N} ]; then
|
||||
echo "ZPROD-MANAGER WARNING: Overwrite detected at ${N}"
|
||||
return ${E_OVERWRITE}
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# we do copy instead of link, because its much safer,
|
||||
# and zope-development-way compliant
|
||||
if [ -e ${1}/Products ] ; then
|
||||
for N in $(cat "${1}/${ZPROD_FLIST_FNAME}") ; do
|
||||
cp -Ra ${1}/Products/${N} ${2}/Products
|
||||
done
|
||||
else
|
||||
for N in $(cat "${1}/${ZPROD_FLIST_FNAME}") ; do
|
||||
cp -Ra ${1}/${N} ${2}/Products
|
||||
done
|
||||
fi
|
||||
if [ -f "${1}/${ZPROD_LLIST_FNAME}" ]; then
|
||||
for N in $(cat "${1}/${ZPROD_LLIST_FNAME}") ; do
|
||||
cp -Ra ${1}/lib/python/${N} ${2}/lib/python
|
||||
done
|
||||
fi
|
||||
RESULT=$?
|
||||
if [ ${RESULT} -eq 0 ] ; then
|
||||
# basically adding ${PF} to .zproduct.lst
|
||||
echo $(basename $1) >> ${2}/${ZPROD_PLIST_FNAME}
|
||||
sort -u ${2}/${ZPROD_PLIST_FNAME} > ${2}/.tmp
|
||||
mv -f ${2}/.tmp ${2}/${ZPROD_PLIST_FNAME}
|
||||
RESULT=$?
|
||||
|
||||
# setting owner and group as in Products folder, so we can compile
|
||||
# python scripts with the zope user
|
||||
# gives group writing perms (very often need in development teams)
|
||||
# takes all perms from others to comply with 770 instance policy
|
||||
for N in $(cat "${1}/${ZPROD_FLIST_FNAME}") ; do
|
||||
chown -R `stat -c %U:%G ${2}/Products` ${2}/Products/${N}
|
||||
chmod -R g+rwX,o-rwx ${2}/Products/${N}
|
||||
done
|
||||
if [ -f "${1}/${ZPROD_LLIST_FNAME}" ]; then
|
||||
for N in $(cat "${1}/${ZPROD_LLIST_FNAME}") ; do
|
||||
chown -R `stat -c %U:%G ${2}/Products` ${2}/lib/python/${N}
|
||||
chmod -R g+rwX,o-rwx ${2}/lib/python/${N}
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zproduct
|
||||
# $2 = /path/to/zinstance
|
||||
|
||||
prod_del()
|
||||
{
|
||||
local RESULT=
|
||||
local N=
|
||||
local PF=$(basename $1)
|
||||
|
||||
grep "${PF}" "${2}/${ZPROD_PLIST_FNAME}" >/dev/null
|
||||
RESULT=$?
|
||||
if [ ${RESULT} -eq 0 ] ; then
|
||||
for N in $(cat ${1}/${ZPROD_FLIST_FNAME}) ; do
|
||||
rm -rf ${2}/Products/${N}
|
||||
done
|
||||
if [ -f "${1}/${ZPROD_LLIST_FNAME}" ]; then
|
||||
for N in $(cat ${1}/${ZPROD_LLIST_FNAME}) ; do
|
||||
rm -rf ${2}/lib/python/${N}
|
||||
done
|
||||
fi
|
||||
# remove zproduct from .zproduct.lst
|
||||
sed -i -e "s/${PF}$//" -e "/^$/d" ${2}/${ZPROD_PLIST_FNAME}
|
||||
RESULT=$?
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = (optional) error message
|
||||
|
||||
mode_help()
|
||||
{
|
||||
echo "$(basename $0) version ${VERSION}"
|
||||
echo "A Gentoo Zope Product selection tool."
|
||||
echo
|
||||
echo "Interactive usage:"
|
||||
echo -e "\t$(basename $0) [add | del]"
|
||||
echo "Default zinstance usage:"
|
||||
echo -e "\t$(basename $0) [add |del] /path/of/zproduct"
|
||||
echo "Non-interactive usage:"
|
||||
echo -e "\t$(basename $0) [add | del] /path/of/zproduct /path/of/zinstance/"
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = command
|
||||
# $2 = /path/to/zproductDir
|
||||
|
||||
mode_defaultZinst()
|
||||
{
|
||||
local DEFAULT_ZINST=$(zinst_default_get ${ZI_DIR})
|
||||
local RESULT=$?
|
||||
if [ -n "${DEFAULT_ZINST}" ] ; then
|
||||
mode_explicit ${1} ${2} ${ZI_DIR}/${DEFAULT_ZINST}
|
||||
RESULT=${?}
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = command
|
||||
# $2 = /path/to/zproduct
|
||||
# $3 = /path/to/zinstance
|
||||
|
||||
mode_explicit()
|
||||
{
|
||||
local RESULT=
|
||||
if [[ $(is_command "${COMMAND_LIST}" ${1})${?} -eq 0 && \
|
||||
$(is_zproductDir ${2})${?} -eq 0 && \
|
||||
$(is_zinstanceDir ${3})${?} -eq 0 ]] ; then
|
||||
if [ ${1} = "add" ] ; then
|
||||
prod_add ${2} ${3}
|
||||
RESULT=$?
|
||||
elif [ ${1} = "del" ] ; then
|
||||
prod_del ${2} ${3}
|
||||
RESULT=$?
|
||||
else
|
||||
RESULT=${E_COMMAND}
|
||||
fi
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
### MAIN
|
||||
|
||||
if [ ${!#} = "--help" ] ; then
|
||||
mode_help
|
||||
else
|
||||
case "${#}" in
|
||||
0) mode_help ;;
|
||||
1) mode_interactive ${1} ;;
|
||||
2) mode_defaultZinst ${1} ${2} ;;
|
||||
3) mode_explicit ${1} ${2} ${3} ;;
|
||||
*) mode_help "Error: Too many parameters" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
RESULT=$?
|
||||
|
||||
if [ ${RESULT} -ne 0 ] ; then
|
||||
echo "ERROR ${?}"
|
||||
fi
|
||||
|
||||
|
||||
# vim:ts=8
|
@ -1,385 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Gentoo Zope Product selection tool.
|
||||
# Copyright 2003 Jason Shoemaker <kutsuya@gentoo.org>
|
||||
# Distributed under GPL v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-admin/zprod-manager/files/0.3.3/zprod-manager,v 1.1 2008/11/16 16:00:40 tupone Exp $
|
||||
|
||||
VERSION="0.3.3"
|
||||
COMMAND_LIST="add del"
|
||||
ZS_DIR="/usr/share/zope/"
|
||||
ZI_DIR="/var/lib/zope/"
|
||||
ZPROD_DIR="/usr/share/zproduct/"
|
||||
|
||||
ZINST_DEFAULT=".default"
|
||||
ZPROD_FLIST_FNAME=".zfolder.lst"
|
||||
ZPROD_LLIST_FNAME=".zlfolder.lst"
|
||||
ZPROD_PLIST_FNAME=".zproduct.lst"
|
||||
|
||||
# Assume the standard dialog return codes
|
||||
#DIALOG_CANCEL=1
|
||||
#DIALOG_ERROR=-1
|
||||
#DIALOG_ESC=-255
|
||||
#DIALOG_OK=0
|
||||
#DIALOG_ERROR may equal #DIALOG_ESC
|
||||
|
||||
# Return codes used in this program:
|
||||
E_SUCCESS=0
|
||||
E_FAILURE=1
|
||||
|
||||
E_ZPLIST=20
|
||||
E_ZILIST=22
|
||||
E_COMMAND=24
|
||||
E_OVERWRITE=26
|
||||
|
||||
## copied from zope-config
|
||||
|
||||
zinst_dir_get()
|
||||
{
|
||||
local RESULT=${E_FAILURE}
|
||||
local LIST=$(ls ${ZI_DIR})
|
||||
local LIST_CNT=$(echo ${LIST} | wc -w)
|
||||
local DLIST=
|
||||
|
||||
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}
|
||||
}
|
||||
|
||||
# params: none
|
||||
# TODO: Maybe try to break this function down some more.
|
||||
# TODO: verify items in ZP_PLIST and ZI_PLIST
|
||||
|
||||
mode_interactive()
|
||||
{
|
||||
local RESULT=
|
||||
if [ $(is_command "${COMMAND_LIST}" ${1})${?} -ne 0 ] ; then
|
||||
RESULT=${?}
|
||||
return ${RESULT}
|
||||
fi
|
||||
ZP_PLIST=$(ls ${ZPROD_DIR})
|
||||
if [ "${ZP_PLIST}" ] ; then
|
||||
zinst_dir_get
|
||||
RESULT=$?
|
||||
if [ ${RESULT} -eq 0 ] ; then
|
||||
ZI_PLIST=$(cat ${ZINST_DIR}/${ZPROD_PLIST_FNAME})
|
||||
# Create CLIST for --menu
|
||||
if [ "${ZI_PLIST}" ] ; then
|
||||
for N in ${ZP_PLIST} ; do
|
||||
echo ${ZI_PLIST} |grep ${N} >/dev/null
|
||||
if [ $? -eq 0 ] ; then
|
||||
STATUS=ON
|
||||
else
|
||||
STATUS=OFF
|
||||
fi
|
||||
CLIST="${CLIST} ${N} - ${STATUS}"
|
||||
done
|
||||
dialog \
|
||||
--backtitle "Select the zproducts you want installed for zinstance(${ZINST_DIR})." \
|
||||
--checklist "Select:" 0 0 0 ${CLIST} 2> $tempfile
|
||||
RESULT=$?
|
||||
CTAGS=$(cat $tempfile)
|
||||
CTAGS=$(echo ${CTAGS} | sed -e "s:\"::g")
|
||||
# Prepare to add and delete zproducts installed in zinstance
|
||||
if [[ ${RESULT} -eq 0 && "${CTAGS}" ]] ; then
|
||||
for N in ${ZI_PLIST} ; do
|
||||
echo "$CTAGS" |grep ${N} >/dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
prod_del ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
fi
|
||||
done
|
||||
for N in ${CTAGS} ; do
|
||||
echo ${ZI_PLIST} |grep ${N} >/dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
prod_add ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
fi
|
||||
done
|
||||
RESULT=$?
|
||||
elif [ ${RESULT} -eq 0 ] ; then # $CTAGS is empty
|
||||
for N in ${ZI_PLIST} ; do
|
||||
prod_del ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
done
|
||||
RESULT=$?
|
||||
fi
|
||||
else # ZI_PLIST is empty
|
||||
for N in ${ZP_PLIST} ; do
|
||||
CLIST="${CLIST} ${N} - 0"
|
||||
done
|
||||
dialog \
|
||||
--backtitle "Select the zproducts you want installed for zinstance(${ZINST_DIR})." \
|
||||
--checklist "Select:" 0 0 0 ${CLIST} 2> $tempfile
|
||||
RESULT=$?
|
||||
CTAGS=$(cat $tempfile)
|
||||
CTAGS=$(echo "${CTAGS}" | sed -e "s:\"::g")
|
||||
if [[ ${RESULT} -eq 0 && "${CTAGS}" ]] ; then
|
||||
for N in ${CTAGS} ; do
|
||||
# as this is empty Products directory in instance if-case, we can safely ignore
|
||||
# RESULT returned from prod_add in case of overwrite error. It can not happen
|
||||
# when ZI_PLIST is empty, right? ;) <radek@gentoo.org>
|
||||
prod_add ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else # ZP_PLIST is empty
|
||||
RESULT=${E_ZPLIST}
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
|
||||
# Parameters:
|
||||
# $1 = command list
|
||||
# $2 = command received
|
||||
# Returns:
|
||||
# true or false
|
||||
|
||||
is_command()
|
||||
{
|
||||
local RESULT=${E_COMMAND}
|
||||
local N=
|
||||
|
||||
echo ${1} |grep ${2} >/dev/null
|
||||
if [ $? -eq 0 ] ; then
|
||||
RESULT=0
|
||||
fi
|
||||
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zinstance
|
||||
# Returns:
|
||||
# true or false
|
||||
|
||||
is_zinstanceDir()
|
||||
{
|
||||
local RESULT=${E_ZILIST}
|
||||
# If can't find these, probably not a zinstance.
|
||||
if [[ -d "${1}/Products" && -d "${1}/var" && -d "${1}/import" && -d "${1}/Extensions" ]] ; then
|
||||
RESULT=0
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zproduct
|
||||
# Returns:
|
||||
# true or false
|
||||
|
||||
is_zproductDir()
|
||||
{
|
||||
local RESULT=${E_ZPLIST}
|
||||
# look for something in .zproduct.lst in $1, if we can't find that...
|
||||
if [ -s "${1}/${ZPROD_FLIST_FNAME}" ] ; then
|
||||
RESULT=0
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zinst_dir
|
||||
# Returns:
|
||||
# stdout = name of defautl zinstance, if any.
|
||||
|
||||
zinst_default_get()
|
||||
{
|
||||
if [ -s ${1}/${ZINST_DEFAULT} ] ; then
|
||||
cat ${1}/${ZINST_DEFAULT}
|
||||
fi
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zproduct
|
||||
# $2 = /path/to/zinstance
|
||||
|
||||
# be warned, using this function you have to immediately fail if functionss returns error.
|
||||
|
||||
prod_add()
|
||||
{
|
||||
local RESULT=
|
||||
local N=
|
||||
|
||||
# checks if some products components are already installed,
|
||||
# if yes, we have to break with error, as overwrites are DANGEROUS!
|
||||
for N in $(cat "${1}/${ZPROD_FLIST_FNAME}")
|
||||
do
|
||||
if [ -d ${2}/Products/${N} ]
|
||||
then
|
||||
echo "ZPROD-MANAGER WARNING: Overwrite possiblity detected at ${N}"
|
||||
return ${E_OVERWRITE}
|
||||
fi
|
||||
done
|
||||
if [ -f "${1}/${ZPROD_LLIST_FNAME}" ]; then
|
||||
for N in $(cat "${1}/${ZPROD_LLIST_FNAME}"); do
|
||||
if [ -d ${2}/lib/python/${N} ]; then
|
||||
echo "ZPROD-MANAGER WARNING: Overwrite detected at ${N}"
|
||||
return ${E_OVERWRITE}
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# we do copy instead of link, because its much safer,
|
||||
# and zope-development-way compliant
|
||||
if [ -e ${1}/Products ] ; then
|
||||
for N in $(cat "${1}/${ZPROD_FLIST_FNAME}") ; do
|
||||
cp -Ra ${1}/Products/${N} ${2}/Products
|
||||
done
|
||||
else
|
||||
for N in $(cat "${1}/${ZPROD_FLIST_FNAME}") ; do
|
||||
cp -Ra ${1}/${N} ${2}/Products
|
||||
done
|
||||
fi
|
||||
if [ -f "${1}/${ZPROD_LLIST_FNAME}" ]; then
|
||||
for N in $(cat "${1}/${ZPROD_LLIST_FNAME}") ; do
|
||||
cp -Ra ${1}/lib/python/${N} ${2}/lib/python
|
||||
done
|
||||
fi
|
||||
RESULT=$?
|
||||
if [ ${RESULT} -eq 0 ] ; then
|
||||
# basically adding ${PF} to .zproduct.lst
|
||||
echo $(basename $1) >> ${2}/${ZPROD_PLIST_FNAME}
|
||||
sort -u ${2}/${ZPROD_PLIST_FNAME} > ${2}/.tmp
|
||||
mv -f ${2}/.tmp ${2}/${ZPROD_PLIST_FNAME}
|
||||
RESULT=$?
|
||||
|
||||
# setting owner and group as in Products folder, so we can compile
|
||||
# python scripts with the zope user
|
||||
# gives group writing perms (very often need in development teams)
|
||||
# takes all perms from others to comply with 770 instance policy
|
||||
for N in $(cat "${1}/${ZPROD_FLIST_FNAME}") ; do
|
||||
chown -R `stat -c %U:%G ${2}/Products` ${2}/Products/${N}
|
||||
chmod -R g+rwX,o-rwx ${2}/Products/${N}
|
||||
done
|
||||
if [ -f "${1}/${ZPROD_LLIST_FNAME}" ]; then
|
||||
for N in $(cat "${1}/${ZPROD_LLIST_FNAME}") ; do
|
||||
chown -R `stat -c %U:%G ${2}/Products` ${2}/lib/python/${N}
|
||||
chmod -R g+rwX,o-rwx ${2}/lib/python/${N}
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zproduct
|
||||
# $2 = /path/to/zinstance
|
||||
|
||||
prod_del()
|
||||
{
|
||||
local RESULT=
|
||||
local N=
|
||||
local PF=$(basename $1)
|
||||
|
||||
grep "${PF}" "${2}/${ZPROD_PLIST_FNAME}" >/dev/null
|
||||
RESULT=$?
|
||||
if [ ${RESULT} -eq 0 ] ; then
|
||||
for N in $(cat ${1}/${ZPROD_FLIST_FNAME}) ; do
|
||||
rm -rf ${2}/Products/${N}
|
||||
done
|
||||
if [ -f "${1}/${ZPROD_LLIST_FNAME}" ]; then
|
||||
for N in $(cat ${1}/${ZPROD_LLIST_FNAME}) ; do
|
||||
rm -rf ${2}/lib/python/${N}
|
||||
done
|
||||
fi
|
||||
# remove zproduct from .zproduct.lst
|
||||
sed -i -e "s/${PF}$//" -e "/^$/d" ${2}/${ZPROD_PLIST_FNAME}
|
||||
RESULT=$?
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = (optional) error message
|
||||
|
||||
mode_help()
|
||||
{
|
||||
echo "$(basename $0) version ${VERSION}"
|
||||
echo "A Gentoo Zope Product selection tool."
|
||||
echo
|
||||
echo "Interactive usage:"
|
||||
echo -e "\t$(basename $0) [add | del]"
|
||||
echo "Default zinstance usage:"
|
||||
echo -e "\t$(basename $0) [add |del] /path/of/zproduct"
|
||||
echo "Non-interactive usage:"
|
||||
echo -e "\t$(basename $0) [add | del] /path/of/zproduct /path/of/zinstance/"
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = command
|
||||
# $2 = /path/to/zproductDir
|
||||
|
||||
mode_defaultZinst()
|
||||
{
|
||||
local DEFAULT_ZINST=$(zinst_default_get ${ZI_DIR})
|
||||
local RESULT=$?
|
||||
if [ -n "${DEFAULT_ZINST}" ] ; then
|
||||
mode_explicit ${1} ${2} ${ZI_DIR}/${DEFAULT_ZINST}
|
||||
RESULT=${?}
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = command
|
||||
# $2 = /path/to/zproduct
|
||||
# $3 = /path/to/zinstance
|
||||
|
||||
mode_explicit()
|
||||
{
|
||||
local RESULT=
|
||||
if [[ $(is_command "${COMMAND_LIST}" ${1})${?} -eq 0 && \
|
||||
$(is_zproductDir ${2})${?} -eq 0 && \
|
||||
$(is_zinstanceDir ${3})${?} -eq 0 ]] ; then
|
||||
if [ ${1} = "add" ] ; then
|
||||
prod_add ${2} ${3}
|
||||
RESULT=$?
|
||||
elif [ ${1} = "del" ] ; then
|
||||
prod_del ${2} ${3}
|
||||
RESULT=$?
|
||||
else
|
||||
RESULT=${E_COMMAND}
|
||||
fi
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
### MAIN
|
||||
|
||||
tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
|
||||
trap "rm -f $tempfile" 0 1 2 15
|
||||
|
||||
if [ ${!#} = "--help" ] ; then
|
||||
mode_help
|
||||
else
|
||||
case "${#}" in
|
||||
0) mode_help ;;
|
||||
1) mode_interactive ${1} ;;
|
||||
2) mode_defaultZinst ${1} ${2} ;;
|
||||
3) mode_explicit ${1} ${2} ${3} ;;
|
||||
*) mode_help "Error: Too many parameters" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
RESULT=$?
|
||||
|
||||
if [ ${RESULT} -ne 0 ] ; then
|
||||
echo "ERROR ${?}"
|
||||
fi
|
||||
|
||||
|
||||
# vim:ts=8
|
@ -1,345 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Gentoo Zope Product selection tool.
|
||||
# Copyright 2003 Jason Shoemaker <kutsuya@gentoo.org>
|
||||
# Distributed under GPL v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-admin/zprod-manager/files/0.3/zprod-manager,v 1.2 2006/11/06 05:28:09 aross Exp $
|
||||
|
||||
VERSION="0.3"
|
||||
COMMAND_LIST="add del"
|
||||
ZS_DIR="/usr/share/zope/"
|
||||
ZI_DIR="/var/lib/zope/"
|
||||
ZPROD_DIR="/usr/share/zproduct/"
|
||||
|
||||
ZINST_DEFAULT=".default"
|
||||
ZPROD_FLIST_FNAME=".zfolder.lst"
|
||||
ZPROD_PLIST_FNAME=".zproduct.lst"
|
||||
|
||||
# Assume the standard dialog return codes
|
||||
#DIALOG_CANCEL=1
|
||||
#DIALOG_ERROR=-1
|
||||
#DIALOG_ESC=-255
|
||||
#DIALOG_OK=0
|
||||
#DIALOG_ERROR may equal #DIALOG_ESC
|
||||
|
||||
# Return codes used in this program:
|
||||
E_SUCCESS=0
|
||||
E_FAILURE=1
|
||||
|
||||
E_ZPLIST=20
|
||||
E_ZILIST=22
|
||||
E_COMMAND=24
|
||||
E_OVERWRITE=26
|
||||
|
||||
## copied from zope-config
|
||||
|
||||
zinst_dir_get()
|
||||
{
|
||||
local RESULT=${E_FAILURE}
|
||||
local LIST=$(ls ${ZI_DIR})
|
||||
local LIST_CNT=$(echo ${LIST} | wc -w)
|
||||
local DLIST=
|
||||
|
||||
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}
|
||||
}
|
||||
|
||||
# params: none
|
||||
# TODO: Maybe try to break this function down some more.
|
||||
# TODO: verify items in ZP_PLIST and ZI_PLIST
|
||||
|
||||
mode_interactive()
|
||||
{
|
||||
local RESULT=
|
||||
if [ $(is_command "${COMMAND_LIST}" ${1})${?} -ne 0 ] ; then
|
||||
RESULT=${?}
|
||||
return ${RESULT}
|
||||
fi
|
||||
ZP_PLIST=$(ls ${ZPROD_DIR})
|
||||
if [ "${ZP_PLIST}" ] ; then
|
||||
zinst_dir_get
|
||||
RESULT=$?
|
||||
if [ ${RESULT} -eq 0 ] ; then
|
||||
ZI_PLIST=$(cat ${ZINST_DIR}/${ZPROD_PLIST_FNAME})
|
||||
# Create CLIST for --menu
|
||||
if [ "${ZI_PLIST}" ] ; then
|
||||
for N in ${ZP_PLIST} ; do
|
||||
echo ${ZI_PLIST} |grep ${N} >/dev/null
|
||||
if [ $? -eq 0 ] ; then
|
||||
STATUS=ON
|
||||
else
|
||||
STATUS=OFF
|
||||
fi
|
||||
CLIST="${CLIST} ${N} - ${STATUS}"
|
||||
done
|
||||
CTAGS=$(dialog --stdout \
|
||||
--backtitle "Select the zproducts you want installed for zinstance(${ZINST_DIR})." \
|
||||
--checklist "Select:" 0 0 0 ${CLIST})
|
||||
RESULT=$?
|
||||
CTAGS=$(echo ${CTAGS} | sed -e "s:\"::g")
|
||||
# Prepare to add and delete zproducts installed in zinstance
|
||||
if [[ ${RESULT} -eq 0 && "${CTAGS}" ]] ; then
|
||||
for N in ${ZI_PLIST} ; do
|
||||
echo "$CTAGS" |grep ${N} >/dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
prod_del ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
fi
|
||||
done
|
||||
for N in ${CTAGS} ; do
|
||||
echo ${ZI_PLIST} |grep ${N} >/dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
prod_add ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
fi
|
||||
done
|
||||
RESULT=$?
|
||||
elif [ ${RESULT} -eq 0 ] ; then # $CTAGS is empty
|
||||
for N in ${ZI_PLIST} ; do
|
||||
prod_del ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
done
|
||||
RESULT=$?
|
||||
fi
|
||||
else # ZI_PLIST is empty
|
||||
for N in ${ZP_PLIST} ; do
|
||||
CLIST="${CLIST} ${N} - 0"
|
||||
done
|
||||
CTAGS=$(dialog --stdout \
|
||||
--backtitle "Select the zproducts you want installed for zinstance(${ZINST_DIR})." \
|
||||
--checklist "Select:" 0 0 0 ${CLIST})
|
||||
RESULT=$?
|
||||
CTAGS=$(echo "${CTAGS}" | sed -e "s:\"::g")
|
||||
if [[ ${RESULT} -eq 0 && "${CTAGS}" ]] ; then
|
||||
for N in ${CTAGS} ; do
|
||||
# as this is empty Products directory in instance if-case, we can safely ignore
|
||||
# RESULT returned from prod_add in case of overwrite error. It can not happen
|
||||
# when ZI_PLIST is empty, right? ;) <radek@gentoo.org>
|
||||
prod_add ${ZPROD_DIR}/${N} ${ZINST_DIR}
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else # ZP_PLIST is empty
|
||||
RESULT=${E_ZPLIST}
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
|
||||
# Parameters:
|
||||
# $1 = command list
|
||||
# $2 = command received
|
||||
# Returns:
|
||||
# true or false
|
||||
|
||||
is_command()
|
||||
{
|
||||
local RESULT=${E_COMMAND}
|
||||
local N=
|
||||
|
||||
echo ${1} |grep ${2} >/dev/null
|
||||
if [ $? -eq 0 ] ; then
|
||||
RESULT=0
|
||||
fi
|
||||
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zinstance
|
||||
# Returns:
|
||||
# true or false
|
||||
|
||||
is_zinstanceDir()
|
||||
{
|
||||
local RESULT=${E_ZILIST}
|
||||
# If can't find these, probably not a zinstance.
|
||||
if [[ -d "${1}/Products" && -d "${1}/var" && -d "${1}/import" && -d "${1}/Extensions" ]] ; then
|
||||
RESULT=0
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zproduct
|
||||
# Returns:
|
||||
# true or false
|
||||
|
||||
is_zproductDir()
|
||||
{
|
||||
local RESULT=${E_ZPLIST}
|
||||
# look for something in .zproduct.lst in $1, if we can't find that...
|
||||
if [ -s "${1}/${ZPROD_FLIST_FNAME}" ] ; then
|
||||
RESULT=0
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zinst_dir
|
||||
# Returns:
|
||||
# stdout = name of defautl zinstance, if any.
|
||||
|
||||
zinst_default_get()
|
||||
{
|
||||
if [ -s ${1}/${ZINST_DEFAULT} ] ; then
|
||||
cat ${1}/${ZINST_DEFAULT}
|
||||
fi
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zproduct
|
||||
# $2 = /path/to/zinstance
|
||||
|
||||
# be warned, using this function you have to immediately fail if functionss returns error.
|
||||
|
||||
prod_add()
|
||||
{
|
||||
local RESULT=
|
||||
local N=
|
||||
|
||||
# checks if some products components are already installed,
|
||||
# if yes, we have to break with error, as overwrites are DANGEROUS!
|
||||
for N in $(cat "${1}/${ZPROD_FLIST_FNAME}")
|
||||
do
|
||||
if [ -d ${2}/Products/${N} ]
|
||||
then
|
||||
echo "ZPROD-MANAGER WARNING: Overwrite possiblity detected at ${N}"
|
||||
return ${E_OVERWRITE}
|
||||
fi
|
||||
done
|
||||
|
||||
for N in $(cat "${1}/${ZPROD_FLIST_FNAME}") ; do
|
||||
# we do copy instead of link, because its much safer, and zope-development-way compliant
|
||||
cp -Ra ${1}/${N} ${2}/Products
|
||||
done
|
||||
RESULT=$?
|
||||
if [ ${RESULT} -eq 0 ] ; then
|
||||
# basically adding ${PF} to .zproduct.lst
|
||||
echo $(basename $1) >> ${2}/${ZPROD_PLIST_FNAME}
|
||||
sort -u ${2}/${ZPROD_PLIST_FNAME} > ${2}/.tmp
|
||||
mv -f ${2}/.tmp ${2}/${ZPROD_PLIST_FNAME}
|
||||
RESULT=$?
|
||||
|
||||
for N in $(cat "${1}/${ZPROD_FLIST_FNAME}") ; do
|
||||
# setting owner and group as in Products folder, so we can compile
|
||||
# python scripts with the zope user
|
||||
|
||||
chown -R `stat -c %U:%G ${2}/Products` ${2}/Products/${N}
|
||||
|
||||
# gives group writing perms (very often need in development teams)
|
||||
# takes all perms from others to comply with 770 instance policy
|
||||
chmod -R g+rwX,o-rwx ${2}/Products/${N}
|
||||
done
|
||||
fi
|
||||
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = /path/to/zproduct
|
||||
# $2 = /path/to/zinstance
|
||||
|
||||
prod_del()
|
||||
{
|
||||
local RESULT=
|
||||
local N=
|
||||
local PF=$(basename $1)
|
||||
|
||||
grep "${PF}" "${2}/${ZPROD_PLIST_FNAME}" >/dev/null
|
||||
RESULT=$?
|
||||
if [ ${RESULT} -eq 0 ] ; then
|
||||
for N in $(cat ${1}/${ZPROD_FLIST_FNAME}) ; do
|
||||
rm -rf ${2}/Products/${N}
|
||||
done
|
||||
# remove zproduct from .zproduct.lst
|
||||
sed -i -e "s/${PF}$//" -e "/^$/d" ${2}/${ZPROD_PLIST_FNAME}
|
||||
RESULT=$?
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = (optional) error message
|
||||
|
||||
mode_help()
|
||||
{
|
||||
echo "$(basename $0) version ${VERSION}"
|
||||
echo "A Gentoo Zope Product selection tool."
|
||||
echo
|
||||
echo "Interactive usage:"
|
||||
echo -e "\t$(basename $0) [add | del]"
|
||||
echo "Default zinstance usage:"
|
||||
echo -e "\t$(basename $0) [add |del] /path/of/zproduct"
|
||||
echo "Non-interactive usage:"
|
||||
echo -e "\t$(basename $0) [add | del] /path/of/zproduct /path/of/zinstance/"
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = command
|
||||
# $2 = /path/to/zproductDir
|
||||
|
||||
mode_defaultZinst()
|
||||
{
|
||||
local DEFAULT_ZINST=$(zinst_default_get ${ZI_DIR})
|
||||
local RESULT=$?
|
||||
if [ -n "${DEFAULT_ZINST}" ] ; then
|
||||
mode_explicit ${1} ${2} ${ZI_DIR}/${DEFAULT_ZINST}
|
||||
RESULT=${?}
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
# Parameters:
|
||||
# $1 = command
|
||||
# $2 = /path/to/zproduct
|
||||
# $3 = /path/to/zinstance
|
||||
|
||||
mode_explicit()
|
||||
{
|
||||
local RESULT=
|
||||
if [[ $(is_command "${COMMAND_LIST}" ${1})${?} -eq 0 && \
|
||||
$(is_zproductDir ${2})${?} -eq 0 && \
|
||||
$(is_zinstanceDir ${3})${?} -eq 0 ]] ; then
|
||||
if [ ${1} = "add" ] ; then
|
||||
prod_add ${2} ${3}
|
||||
RESULT=$?
|
||||
elif [ ${1} = "del" ] ; then
|
||||
prod_del ${2} ${3}
|
||||
RESULT=$?
|
||||
else
|
||||
RESULT=${E_COMMAND}
|
||||
fi
|
||||
fi
|
||||
return ${RESULT}
|
||||
}
|
||||
|
||||
### MAIN
|
||||
|
||||
case "${#}" in
|
||||
0) mode_help ;;
|
||||
1) mode_interactive ${1} ;;
|
||||
2) mode_defaultZinst ${1} ${2} ;;
|
||||
3) mode_explicit ${1} ${2} ${3} ;;
|
||||
*) mode_help "Error: Too many parameters" ;;
|
||||
esac
|
||||
|
||||
RESULT=$?
|
||||
|
||||
if [ ${RESULT} -ne 0 ] ; then
|
||||
echo "ERROR ${?}"
|
||||
fi
|
||||
|
||||
|
||||
# vim:ts=8
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<herd>net-zope</herd>
|
||||
</pkgmetadata>
|
@ -1,22 +0,0 @@
|
||||
# Copyright 1999-2006 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-admin/zprod-manager/zprod-manager-0.3.1.ebuild,v 1.1 2006/11/06 05:28:09 aross Exp $
|
||||
|
||||
DESCRIPTION="Gentoo Zope Product selection tool"
|
||||
SRC_URI=""
|
||||
HOMEPAGE="http://www.gentoo.org/"
|
||||
|
||||
SLOT="0"
|
||||
LICENSE="GPL-2"
|
||||
IUSE=""
|
||||
KEYWORDS="~amd64 ~ppc ~sparc ~x86"
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND=">=dev-util/dialog-0.7
|
||||
sys-apps/grep
|
||||
sys-apps/sed
|
||||
>=net-zope/zope-2.6.0-r2"
|
||||
|
||||
src_install() {
|
||||
dosbin "${FILESDIR}/${PV}"/zprod-manager || die "install failed"
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright 1999-2008 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-admin/zprod-manager/zprod-manager-0.3.2-r1.ebuild,v 1.4 2008/11/30 18:39:00 armin76 Exp $
|
||||
|
||||
DESCRIPTION="Gentoo Zope Product selection tool"
|
||||
SRC_URI=""
|
||||
HOMEPAGE="http://www.gentoo.org/"
|
||||
|
||||
SLOT="0"
|
||||
LICENSE="GPL-2"
|
||||
IUSE=""
|
||||
KEYWORDS="amd64 ppc sparc x86"
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="dev-util/dialog
|
||||
net-zope/zope"
|
||||
|
||||
src_install() {
|
||||
dosbin "${FILESDIR}/${PV}"/zprod-manager || die "install failed"
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
# Copyright 1999-2008 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-admin/zprod-manager/zprod-manager-0.3.3.ebuild,v 1.1 2008/11/16 16:00:24 tupone Exp $
|
||||
|
||||
DESCRIPTION="Gentoo Zope Product selection tool"
|
||||
SRC_URI=""
|
||||
HOMEPAGE="http://www.gentoo.org/"
|
||||
|
||||
SLOT="0"
|
||||
LICENSE="GPL-2"
|
||||
IUSE=""
|
||||
KEYWORDS="~amd64 ~ppc ~sparc ~x86"
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="dev-util/dialog
|
||||
net-zope/zope"
|
||||
|
||||
src_install() {
|
||||
dosbin "${FILESDIR}/${PV}"/zprod-manager || die "install failed"
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
# Copyright 1999-2008 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-admin/zprod-manager/zprod-manager-0.3.ebuild,v 1.8 2008/06/06 23:28:58 tupone Exp $
|
||||
|
||||
DESCRIPTION="Gentoo Zope Product selection tool"
|
||||
SRC_URI=""
|
||||
HOMEPAGE="http://www.gentoo.org/"
|
||||
|
||||
SLOT="0"
|
||||
LICENSE="GPL-2"
|
||||
IUSE=""
|
||||
KEYWORDS="amd64 ppc sparc x86"
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND=">=dev-util/dialog-0.7
|
||||
sys-apps/grep
|
||||
sys-apps/sed
|
||||
>=net-zope/zope-2.6.0-r2"
|
||||
|
||||
src_install() {
|
||||
dosbin "${FILESDIR}"/${PV}/zprod-manager
|
||||
}
|
@ -1 +1,2 @@
|
||||
DIST duplicity-0.6.17.tar.gz 1119945 RMD160 e88bb833f7ed21f0b742caed9c28402c2b0601a5 SHA1 cee8f4793f3b2990447bb26c9131202930adf096 SHA256 891e56061ab15127e67c93b9b462760b055eb48636c177b56400925d0a77a458
|
||||
DIST duplicity-0.6.18.tar.gz 1101351 RMD160 f90705358857e40fb6f427e3cc96d4f81b6b9ba2 SHA1 6cd97457e2f43af3cc270e2f16e8891880dc44a6 SHA256 56bc583be1031762dd94082cb30e09e1347167aaa88188f8d6d6c052ad8f90af
|
||||
|
@ -0,0 +1,35 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-backup/duplicity/duplicity-0.6.18.ebuild,v 1.1 2012/03/01 22:57:04 radhermit Exp $
|
||||
|
||||
EAPI="4"
|
||||
|
||||
PYTHON_DEPEND="2"
|
||||
SUPPORT_PYTHON_ABIS="1"
|
||||
RESTRICT_PYTHON_ABIS="3.* *-jython"
|
||||
|
||||
inherit distutils
|
||||
|
||||
DESCRIPTION="duplicity is a secure backup system using gnupg to encrypt data"
|
||||
HOMEPAGE="http://www.nongnu.org/duplicity/"
|
||||
SRC_URI="http://code.launchpad.net/${PN}/0.6-series/${PV}/+download/${P}.tar.gz"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
|
||||
IUSE="s3"
|
||||
|
||||
DEPEND="
|
||||
>=net-libs/librsync-0.9.6
|
||||
app-crypt/gnupg
|
||||
"
|
||||
RDEPEND="${DEPEND}
|
||||
>=dev-python/py-gnupg-0.3.2
|
||||
>=dev-python/pexpect-2.1
|
||||
s3? ( dev-python/boto )
|
||||
"
|
||||
|
||||
src_prepare() {
|
||||
distutils_src_prepare
|
||||
sed -i -r "s/'COPYING',//" setup.py || die "Couldn't remove unnecessary COPYING file."
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
diff --git a/desktop/scripts/soffice.sh.in b/desktop/scripts/soffice.sh.in
|
||||
index defd7b2..ea2a809 100755
|
||||
--- a/desktop/scripts/soffice.sh.in
|
||||
+++ b/desktop/scripts/soffice.sh.in
|
||||
@@ -128,6 +128,9 @@ if echo "$checks" | grep -q "cc" ; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
+PYTHONPATH=$sd_prog${PYTHONPATH+:$PYTHONPATH}
|
||||
+export PYTHONPATH
|
||||
+
|
||||
case "`uname -s`" in
|
||||
NetBSD|OpenBSD|FreeBSD|DragonFly)
|
||||
# this is a temporary hack until we can live with the default search paths
|
||||
diff --git a/pyuno/source/module/uno.py b/pyuno/source/module/uno.py
|
||||
index f93ac5e..92a2891 100644
|
||||
--- a/pyuno/source/module/uno.py
|
||||
+++ b/pyuno/source/module/uno.py
|
||||
@@ -26,8 +26,12 @@
|
||||
# for a copy of the LGPLv3 License.
|
||||
#
|
||||
#*************************************************************************
|
||||
+import os
|
||||
import sys
|
||||
|
||||
+sys.path.append('%eprefix%/usr/%libdir%/libreoffice/program')
|
||||
+if getattr(os.environ, 'URE_BOOTSTRAP', None) is None:
|
||||
+ os.environ['URE_BOOTSTRAP'] = "vnd.sun.star.pathname:%eprefix%/usr/%libdir%/libreoffice/program/fundamentalrc"
|
||||
import pyuno
|
||||
|
||||
try:
|
||||
diff --git a/scripting/source/pyprov/officehelper.py b/scripting/source/pyprov/officehelper.py
|
||||
index 610ac5f..df243d0 100755
|
||||
--- a/scripting/source/pyprov/officehelper.py
|
||||
+++ b/scripting/source/pyprov/officehelper.py
|
||||
@@ -53,7 +53,7 @@ def bootstrap():
|
||||
if "UNO_PATH" in os.environ:
|
||||
sOffice = os.environ["UNO_PATH"]
|
||||
else:
|
||||
- sOffice = "" # lets hope for the best
|
||||
+ sOffice = "%eprefix%/usr/%libdir%/libreoffice/program"
|
||||
sOffice = os.path.join(sOffice, "soffice")
|
||||
if platform.startswith("win"):
|
||||
sOffice += ".exe"
|
@ -0,0 +1,26 @@
|
||||
diff --git a/src/graphics/GraphicsConverter.cpp b/src/graphics/GraphicsConverter.cpp
|
||||
index 97c4f68..8f05e62 100644
|
||||
--- a/src/graphics/GraphicsConverter.cpp
|
||||
+++ b/src/graphics/GraphicsConverter.cpp
|
||||
@@ -262,7 +262,7 @@ static void build_script(FileName const & from_file,
|
||||
LYXERR(Debug::GRAPHICS, "build_script ... ");
|
||||
typedef Graph::EdgePath EdgePath;
|
||||
|
||||
- script << "#!/usr/bin/env python\n"
|
||||
+ script << "#!/usr/bin/env python2\n"
|
||||
"# -*- coding: utf-8 -*-\n"
|
||||
"import os, shutil, sys\n\n"
|
||||
"def unlinkNoThrow(file):\n"
|
||||
diff --git a/src/support/os.cpp b/src/support/os.cpp
|
||||
index f36331c..02f5a93 100644
|
||||
--- a/src/support/os.cpp
|
||||
+++ b/src/support/os.cpp
|
||||
@@ -57,7 +57,7 @@ static string const python2(string const & binary, bool verbose = false)
|
||||
string const python()
|
||||
{
|
||||
// Check whether the first python in PATH is the right one.
|
||||
- static string command = python2("python -tt");
|
||||
+ static string command = python2("python2 -tt");
|
||||
|
||||
if (command.empty()) {
|
||||
// It was not, so check whether we can find it elsewhere in
|
@ -1,4 +1,2 @@
|
||||
DIST TaskCoach-1.2.27.tar.gz 2264467 RMD160 a95b695e70b476d1f20a3b7ba791f7f1670d118e SHA1 f283f589841c03e21329a90d6141708deadd9dab SHA256 bb1bf4de160e31ea557f8585f8160590a9feca66319546f0023faf8d8f8e27fe
|
||||
DIST TaskCoach-1.2.28.tar.gz 2284696 RMD160 d71b8e3da2fdda2541c137f45009f1b07e47e466 SHA1 3386a4ef910ef29ad9246b5b3157e94cd74c1e4b SHA256 dd0519701acff91dbb9a5476f7172c6a35f6bdb97716e835de6e797c8cdc5a65
|
||||
DIST TaskCoach-1.2.30.tar.gz 2303069 RMD160 ce0cfae0f822226293e848609b46096b7c0bb361 SHA1 4fc43f4e438f7655eb3e0a88f780d49b7837331c SHA256 bb74c86c289bee61ed1ff03e098b8b83108b3b55e59d6137aba7b3fa69cad616
|
||||
DIST TaskCoach-1.2.31.tar.gz 2315693 RMD160 9d48d8f15f3850519e3b510eb3913f371f344812 SHA1 ec1656f3c426daa868ef24ebc3b8b8c9d1535888 SHA256 f38366b507aa82a1643c6590f164913883155265394dab34157c6257ba0604d5
|
||||
DIST TaskCoach-1.3.8.tar.gz 2335838 RMD160 2d64d5fbabd8d28c555052ebfebd3d327007f02f SHA1 c3c6bbda1b868cf763c2fba1b004c3527f9f32e6 SHA256 b693448564dc6eded3c7e7c43adfe75dfa57f371b4af4c8f09ce70fbd839823d
|
||||
|
@ -1,18 +0,0 @@
|
||||
--- branches/Release1_1_Branch/taskcoach/taskcoachlib/gui/dialog/editor.py 2010/09/04 19:10:18 3595
|
||||
+++ branches/Release1_1_Branch/taskcoach/taskcoachlib/gui/dialog/editor.py 2010/10/05 20:49:36 3657
|
||||
@@ -687,9 +687,12 @@
|
||||
@patterns.eventSource
|
||||
def ok(self, event=None): # pylint: disable-msg=W0221
|
||||
for item in self.items:
|
||||
- item.setBudget(self._budgetEntry.get(), event=event)
|
||||
- item.setHourlyFee(self._hourlyFeeEntry.get(), event=event)
|
||||
- item.setFixedFee(self._fixedFeeEntry.get(), event=event)
|
||||
+ if len(self.items) == 1 or self._budgetLabel.IsChecked():
|
||||
+ item.setBudget(self._budgetEntry.get(), event=event)
|
||||
+ if len(self.items) == 1 or self._hourlyFeeLabel.IsChecked():
|
||||
+ item.setHourlyFee(self._hourlyFeeEntry.get(), event=event)
|
||||
+ if len(self.items) == 1 or self._fixedFeeLabel.IsChecked():
|
||||
+ item.setFixedFee(self._fixedFeeEntry.get(), event=event)
|
||||
|
||||
|
||||
class PageWithViewer(Page):
|
@ -1,46 +0,0 @@
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-office/taskcoach/taskcoach-1.2.27.ebuild,v 1.4 2011/10/04 11:23:23 nativemad Exp $
|
||||
|
||||
EAPI=3
|
||||
|
||||
PYTHON_DEPEND="2"
|
||||
SUPPORT_PYTHON_ABIS="1"
|
||||
RESTRICT_PYTHON_ABIS="2.4 3.*"
|
||||
PYTHON_MODNAME="buildlib taskcoachlib"
|
||||
|
||||
inherit distutils eutils
|
||||
|
||||
MY_PN="TaskCoach"
|
||||
MY_P="${MY_PN}-${PV}"
|
||||
|
||||
DESCRIPTION="Simple personal tasks and todo lists manager"
|
||||
HOMEPAGE="http://www.taskcoach.org http://pypi.python.org/pypi/TaskCoach"
|
||||
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 x86"
|
||||
IUSE="libnotify"
|
||||
DEPEND=">=dev-python/wxpython-2.8.9.2:2.8"
|
||||
RDEPEND="${DEPEND}
|
||||
libnotify? ( dev-python/notify-python )"
|
||||
|
||||
S="${WORKDIR}/${MY_P}"
|
||||
|
||||
DOCS="CHANGES.txt"
|
||||
|
||||
src_install() {
|
||||
distutils_src_install
|
||||
|
||||
# a bit ugly but...
|
||||
mv "${D}/usr/bin/taskcoach.py" "${D}/usr/bin/taskcoach" || die
|
||||
for file in "${D}"/usr/bin/taskcoach.py-*; do
|
||||
dir=$(dirname ${file})
|
||||
ver=$(basename ${file})
|
||||
ver=${ver#taskcoach.py-}
|
||||
mv "${file}" "${dir}/taskcoach-${ver}" || die
|
||||
done
|
||||
|
||||
doicon "icons.in/${PN}.png" || die
|
||||
make_desktop_entry ${PN} "Task Coach" ${PN} Office || die
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-office/taskcoach/taskcoach-1.2.28.ebuild,v 1.1 2011/09/27 12:47:18 caster Exp $
|
||||
|
||||
EAPI=3
|
||||
|
||||
PYTHON_DEPEND="2"
|
||||
SUPPORT_PYTHON_ABIS="1"
|
||||
RESTRICT_PYTHON_ABIS="2.4 3.*"
|
||||
PYTHON_MODNAME="buildlib taskcoachlib"
|
||||
|
||||
inherit distutils eutils
|
||||
|
||||
MY_PN="TaskCoach"
|
||||
MY_P="${MY_PN}-${PV}"
|
||||
|
||||
DESCRIPTION="Simple personal tasks and todo lists manager"
|
||||
HOMEPAGE="http://www.taskcoach.org http://pypi.python.org/pypi/TaskCoach"
|
||||
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="libnotify"
|
||||
DEPEND=">=dev-python/wxpython-2.8.9.2:2.8"
|
||||
RDEPEND="${DEPEND}
|
||||
libnotify? ( dev-python/notify-python )"
|
||||
|
||||
S="${WORKDIR}/${MY_P}"
|
||||
|
||||
DOCS="CHANGES.txt"
|
||||
|
||||
src_install() {
|
||||
distutils_src_install
|
||||
|
||||
# a bit ugly but...
|
||||
mv "${D}/usr/bin/taskcoach.py" "${D}/usr/bin/taskcoach" || die
|
||||
for file in "${D}"/usr/bin/taskcoach.py-*; do
|
||||
dir=$(dirname ${file})
|
||||
ver=$(basename ${file})
|
||||
ver=${ver#taskcoach.py-}
|
||||
mv "${file}" "${dir}/taskcoach-${ver}" || die
|
||||
done
|
||||
|
||||
doicon "icons.in/${PN}.png" || die
|
||||
make_desktop_entry ${PN} "Task Coach" ${PN} Office || die
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-office/taskcoach/taskcoach-1.2.30.ebuild,v 1.1 2011/11/04 23:23:25 caster Exp $
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-office/taskcoach/taskcoach-1.3.8.ebuild,v 1.1 2012/03/01 16:04:39 caster Exp $
|
||||
|
||||
EAPI=3
|
||||
|
@ -1,5 +1,6 @@
|
||||
DIST tcsh-6.16.00.tar.gz 886468 RMD160 ed23351273bb737c184658235f33869488e64696 SHA1 3d3536bbb9201abdf39b8b364b95e0a218970a5c SHA256 7603b8d67553e0a83159f0f463b642e3679a878a70743285bb7b288b314517d4
|
||||
DIST tcsh-6.17.00.tar.gz 890084 RMD160 2cc41a895799ade6d62640f877bb626f136dac35 SHA1 9bf67d5ce1b406178e9ba535ecd34553fe0d4d36 SHA256 575266122bc2bc351c84a7f858020c0e6b6f95a64ad4de3ce95e340f57e4a9a9
|
||||
DIST tcsh-6.17.06.tar.gz 919999 RMD160 34e92c7f2af089313c9c416b305e164b684b0f76 SHA1 f3754b0ac8bbccc655b5e4d247fff2c853cc7cc2 SHA256 c9eff6aa782ecec5c6719954b529fadac97c32f3ba4c56fa07c40d425c2d91df
|
||||
DIST tcsh-6.18.01.tar.gz 926872 RMD160 ea18bb6d4d6dca2700d74daa2940f67d45a18cb9 SHA1 eee2035645737197ff8059c84933a75d23cd76f9 SHA256 d81ca27851f3e8545666399b4bcf25433e602a195113b3f7c73886fef84c9fa8
|
||||
DIST tcsh-gentoo-patches-r1.8.tar.bz2 2484 RMD160 d2ac41730bbbdfb8db77a67a0104edc08bb4570e SHA1 9059e209f433a023f264907d84d55824ec6854f0 SHA256 77fa4ae60090ad5a6ec50185eec9070757eedb798b1c29327d27fc582cb59f37
|
||||
DIST tcsh-gentoo-patches-r1.9.tar.bz2 2488 RMD160 60abc2583e2ee0706558d4171756a07da31df6c9 SHA1 fcb945bb77afbd49687545da8b62239739583a08 SHA256 6375f48d78b64fd97fc2cb07e8117e41459521a8de3919d174eec321a98af483
|
||||
|
@ -0,0 +1,90 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-shells/tcsh/tcsh-6.18.01.ebuild,v 1.1 2012/03/01 16:30:48 grobian Exp $
|
||||
|
||||
EAPI="3"
|
||||
|
||||
inherit eutils flag-o-matic autotools prefix
|
||||
|
||||
CONFVER="1.9"
|
||||
|
||||
DESCRIPTION="Enhanced version of the Berkeley C shell (csh)"
|
||||
HOMEPAGE="http://www.tcsh.org/"
|
||||
SRC_URI="ftp://ftp.astron.com/pub/tcsh/${P}.tar.gz
|
||||
http://www.gentoo.org/~grobian/distfiles/tcsh-gentoo-patches-r${CONFVER}.tar.bz2"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
|
||||
IUSE="nls doc"
|
||||
RESTRICT="test"
|
||||
|
||||
# we need gettext because we run autoconf (AM_ICONV)
|
||||
RDEPEND=">=sys-libs/ncurses-5.1
|
||||
virtual/libiconv"
|
||||
DEPEND="${RDEPEND}
|
||||
sys-devel/gettext
|
||||
doc? ( dev-lang/perl )"
|
||||
|
||||
CONFDIR=${WORKDIR}/tcsh-gentoo-patches-r${CONFVER}
|
||||
|
||||
src_prepare() {
|
||||
epatch "${FILESDIR}"/${PN}-6.14.00-debian-dircolors.patch # bug #120792
|
||||
epatch "${FILESDIR}"/${PN}-6.14-makefile.patch # bug #151951
|
||||
epatch "${FILESDIR}"/${PN}-6.14-use-ncurses.patch
|
||||
eautoreconf
|
||||
|
||||
# fix gencat usage
|
||||
sed -i -e 's/cat \$\^ \$> | \$(GENCAT) \$@/rm -f $@; $(GENCAT) $@ $> $^/' \
|
||||
nls/Makefile.in || die
|
||||
|
||||
# unify ECHO behaviour
|
||||
echo "#undef ECHO_STYLE" >> config_f.h
|
||||
echo "#define ECHO_STYLE BOTH_ECHO" >> config_f.h
|
||||
|
||||
eprefixify "${CONFDIR}"/*
|
||||
# activate the right default PATH
|
||||
if [[ -z ${EPREFIX} ]] ; then
|
||||
sed -i \
|
||||
-e 's/^#MAIN//' -e '/^#PREFIX/d' \
|
||||
"${CONFDIR}"/csh.login || die
|
||||
else
|
||||
sed -i \
|
||||
-e 's/^#PREFIX//' -e '/^#MAIN/d' \
|
||||
"${CONFDIR}"/csh.login || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
# make tcsh look and live along the lines of the prefix
|
||||
append-flags -D_PATH_DOTCSHRC="'"'"${EPREFIX}/etc/csh.cshrc"'"'"
|
||||
append-flags -D_PATH_DOTLOGIN="'"'"${EPREFIX}/etc/csh.login"'"'"
|
||||
append-flags -D_PATH_DOTLOGOUT="'"'"${EPREFIX}/etc/csh.logout"'"'"
|
||||
append-flags -D_PATH_USRBIN="'"'"${EPREFIX}/usr/bin"'"'"
|
||||
append-flags -D_PATH_BIN="'"'"${EPREFIX}/bin"'"'"
|
||||
|
||||
econf \
|
||||
--prefix="${EPREFIX:-/}" \
|
||||
--datarootdir='${prefix}/usr/share' \
|
||||
$(use_enable nls) \
|
||||
|| die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake DESTDIR="${D}" install install.man || die
|
||||
|
||||
if use doc ; then
|
||||
perl tcsh.man2html tcsh.man || die
|
||||
dohtml tcsh.html/*.html
|
||||
fi
|
||||
|
||||
insinto /etc
|
||||
doins \
|
||||
"${CONFDIR}"/csh.cshrc \
|
||||
"${CONFDIR}"/csh.login
|
||||
|
||||
dodoc FAQ Fixes NewThings Ported README WishList Y2K
|
||||
|
||||
# bug #119703: add csh -> tcsh symlink
|
||||
dosym /bin/tcsh /bin/csh
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-embedded/msp430-binutils/msp430-binutils-2.21.1_p20120224.ebuild,v 1.1 2012/03/01 22:38:21 radhermit Exp $
|
||||
|
||||
PATCHVER="1.4"
|
||||
|
||||
BINUTILS_VER=${PV%_p*}
|
||||
|
||||
inherit toolchain-binutils
|
||||
|
||||
DESCRIPTION="Tools necessary to build programs for MSP430 microcontrollers"
|
||||
SRC_URI+=" http://dev.gentoo.org/~radhermit/distfiles/${P}.patch.bz2"
|
||||
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
|
||||
# needed to fix bug #381633
|
||||
RDEPEND=">=sys-devel/binutils-config-3-r2"
|
||||
|
||||
pkg_setup() {
|
||||
is_cross || die "Only cross-compile builds are supported"
|
||||
}
|
||||
|
||||
PATCHES=(
|
||||
"${WORKDIR}"/${P}.patch
|
||||
)
|
@ -0,0 +1,28 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-embedded/msp430-gcc/msp430-gcc-4.6.1_p20120224.ebuild,v 1.1 2012/03/01 22:40:36 radhermit Exp $
|
||||
|
||||
EAPI="4"
|
||||
|
||||
PATCH_VER="1.0"
|
||||
BRANCH_UPDATE=""
|
||||
|
||||
inherit toolchain
|
||||
|
||||
DESCRIPTION="The GNU Compiler Collection for MSP430 microcontrollers"
|
||||
LICENSE="GPL-3 LGPL-3 || ( GPL-3 libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.2"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
SRC_URI="${SRC_URI} http://dev.gentoo.org/~radhermit/distfiles/${P}.patch.bz2"
|
||||
|
||||
RDEPEND=""
|
||||
DEPEND="${RDEPEND}
|
||||
elibc_glibc? ( >=sys-libs/glibc-2.8 )
|
||||
${CATEGORY}/msp430-binutils"
|
||||
|
||||
pkg_pretend() {
|
||||
is_crosscompile || die "Only cross-compile builds are supported"
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
epatch "${DISTDIR}"/${P}.patch.bz2
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-embedded/msp430-libc/msp430-libc-20120224.ebuild,v 1.1 2012/03/01 22:31:35 radhermit Exp $
|
||||
|
||||
EAPI="4"
|
||||
|
||||
CHOST="msp430"
|
||||
CTARGET="msp430"
|
||||
|
||||
DESCRIPTION="C library for MSP430 microcontrollers"
|
||||
HOMEPAGE="http://mspgcc.sourceforge.net"
|
||||
SRC_URI="mirror://sourceforge/mspgcc/${P}.tar.bz2"
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="crosscompile_opts_headers-only"
|
||||
|
||||
DEPEND="sys-devel/crossdev"
|
||||
[[ ${CATEGORY/cross-} != ${CATEGORY} ]] \
|
||||
&& RDEPEND="!dev-embedded/msp430-libc" \
|
||||
|| RDEPEND=""
|
||||
|
||||
S="${WORKDIR}/${P}/src"
|
||||
|
||||
pkg_setup() {
|
||||
ebegin "Checking for msp430-gcc"
|
||||
if type -p msp430-gcc > /dev/null ; then
|
||||
eend 0
|
||||
else
|
||||
eend 1
|
||||
|
||||
eerror
|
||||
eerror "Failed to locate 'msp430-gcc' in \$PATH. You can install a MSP430 toolchain using:"
|
||||
eerror " $ crossdev -t msp430"
|
||||
eerror
|
||||
die "MSP430 toolchain not found"
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake PREFIX="${D}"/usr install
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-embedded/msp430mcu/msp430mcu-20120224.ebuild,v 1.1 2012/03/01 22:21:52 radhermit Exp $
|
||||
|
||||
EAPI="4"
|
||||
|
||||
inherit eutils
|
||||
|
||||
DESCRIPTION="MCU-specific data for MSP430 microcontrollers"
|
||||
HOMEPAGE="http://mspgcc.sourceforge.net"
|
||||
SRC_URI="mirror://sourceforge/mspgcc/${P}.tar.bz2"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
src_prepare() {
|
||||
epatch "${FILESDIR}"/${PN}-20111205-install.patch
|
||||
}
|
||||
|
||||
src_install() {
|
||||
MSP430MCU_ROOT="${S}" ./scripts/install.sh "${D}/usr"
|
||||
}
|
@ -1,12 +1,9 @@
|
||||
DIST otp_doc_html_R13B04.tar.gz 27440785 RMD160 7257fad19ecfeee69b1c7021692374d1e29aba79 SHA1 dc0e68cb1dd6f45cbd5ea792260b16f91eaa0e2f SHA256 fdad0db55ab9339703e7cd61626b5cca95f187084d1dabf07ac97f528b4f47aa
|
||||
DIST otp_doc_html_R14B02.tar.gz 28435253 RMD160 ae645dd9c6181f4da3b529a97f0f0166fb864647 SHA1 bccbad3fcc70ca8d4851c760c4b2234a4c719e67 SHA256 36d1052dbf1ab7d7858e270ad9ab5b5ad2988849e4629e69ae141a6f6d69f455
|
||||
DIST otp_doc_html_R14B03.tar.gz 28691748 RMD160 7be3c667de0b5e42f0d56eeadd155bcf977488cf SHA1 c662e3b4387772c916f2f8c3e9dbceb275207d8c SHA256 d05031cc9f3e3af63b891737f9f203c7ab862adf490d67f7d7e3a9d245667958
|
||||
DIST otp_doc_html_R14B04.tar.gz 28816088 RMD160 0e44a933ae35fe95d1ecd9958c9e86ce398e259f SHA1 86f76adee9bf953e5578d7998fda9e7dfc0d43f5 SHA256 3b066d23d82667e2d0477856b22ea94262d65baf7366babe1c10d8bddc28ab5a
|
||||
DIST otp_doc_html_R15B.tar.gz 28996680 RMD160 79606286c3708a56dbc9e54efb60f184fe36c809 SHA1 a163b940fa6e4c60f4c9cfe47d993977660e7ed1 SHA256 40504ad983b450a2c6f7611b3be88ebd6349079764520cca050e9c8f6e79dc93
|
||||
DIST otp_doc_man_R13B04.tar.gz 1033584 RMD160 3046e54a71bf6e114c9208f263caef831782d090 SHA1 660e52302d270138f8e9f2f2b6a562026998012c SHA256 3646198b64bbea0f3760987d20d3392b0b5b2955394a917b92a2c6664a310dd6
|
||||
DIST otp_doc_man_R14B02.tar.gz 1080313 RMD160 8a8429c12cf15095916ed5e67df562e6faa1f5d3 SHA1 d4533603b2406ad125ac0dc5e88fb3cdf2a35e34 SHA256 d254dea54fa7af38df8ac52889bb080548ea2335257eaf7dfc628c73b63b57ff
|
||||
DIST otp_doc_man_R14B03.tar.gz 1116113 RMD160 f6e30764fe122cc0e571f8338f7c3eb3ff3bd893 SHA1 6bd773d2eee069762ba344dc8825ac52722398e1 SHA256 78882849e69ab7449a75accbdaa85015209114a93e60cb6781e03f2af592a4e5
|
||||
DIST otp_doc_man_R14B04.tar.gz 1117663 RMD160 420d89fd32f2851253a5cef124ced50851dc2bb0 SHA1 41f4ea59c9622e39b30882e173983252b6faca81 SHA256 8514511e8a8ac3f3f67db06f333548edf283d9a8afcbc9e9eeca7b1af9a107da
|
||||
DIST otp_doc_man_R15B.tar.gz 1122044 RMD160 ba9352d78462a3ec3461ea955ae46b96cad95400 SHA1 4fb7b64ce06a5209a420914962784ca4a38d2113 SHA256 1839cc4cab3120401989e0e1d7ad6872a59e2fd9d3cd82f05ca8c4ebef18eb6b
|
||||
DIST otp_src_R13B04.tar.gz 59060560 RMD160 5546431e710814da2089d70d5d02c658a1a2f79b SHA1 fe785833a8029cbb3aee188bdb417f4da33fbd06 SHA256 e2694383b3857f5edfc242b8c3acbfba4683e448387fa124d8e587cba234af43
|
||||
DIST otp_src_R14B02.tar.gz 66133818 RMD160 87e3715decd883ec082ac20faac015bd96a9976c SHA1 3b117f93a4e28c376278bbcca0ede0f936952c88 SHA256 849d050b59821e9f2831fee2e3267d84b410eee860a55f6fc9320cc00b5205bd
|
||||
DIST otp_src_R14B03.tar.gz 70620709 RMD160 468736a53b2e74ab0cd0f706751b5b03cbfa87cd SHA1 109812114ef7c2855ade14b90813a870c89f6d43 SHA256 ae0d7c90e860a8be27248114d5c6441a316d44f7e31493d4bae8e7db0cae651d
|
||||
DIST otp_src_R14B04.tar.gz 70773703 RMD160 1619a05e7d3df9cb5f9c41e32d9cfb0d8b4edd56 SHA1 e469c20c8be6c51bb584a2dec235c4714a60b4db SHA256 099b35910e635b9148ac90f70fd9dd592920ed02406eb26c349efd8d1e959b6e
|
||||
DIST otp_src_R15B.tar.gz 74100507 RMD160 022ed91978e85f5a446a90825aa686dd608061a9 SHA1 8177a5d40e4a3d7eb8dc7f7898241a034f35ea72 SHA256 5bc34fc34fc890f84bae7ff1f7c81fbec2c9aa28a0ef51a57d7a8192204d8aa2
|
||||
|
@ -1,175 +0,0 @@
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/erlang/erlang-14.2.2-r1.ebuild,v 1.3 2011/12/07 17:44:39 ulm Exp $
|
||||
|
||||
EAPI=3
|
||||
WX_GTK_VER="2.8"
|
||||
|
||||
inherit elisp-common eutils java-pkg-opt-2 multilib versionator wxwidgets
|
||||
|
||||
# NOTE: If you need symlinks for binaries please tell maintainers or
|
||||
# open up a bug to let it be created.
|
||||
|
||||
# erlang uses a really weird versioning scheme which caused quite a few problems
|
||||
# already. Thus we do a slight modification converting all letters to digits to
|
||||
# make it more sane (see e.g. #26420)
|
||||
|
||||
# the next line selects the right source.
|
||||
ERL_VER=($(get_version_components))
|
||||
MY_PV="R$(get_major_version)B0${ERL_VER[2]}"
|
||||
|
||||
# ATTN!! Take care when processing the C, etc version!
|
||||
MY_P=otp_src_${MY_PV}
|
||||
|
||||
DESCRIPTION="Erlang programming language, runtime environment, and large collection of libraries"
|
||||
HOMEPAGE="http://www.erlang.org/"
|
||||
SRC_URI="http://www.erlang.org/download/${MY_P}.tar.gz
|
||||
http://erlang.org/download/otp_doc_man_${MY_PV}.tar.gz
|
||||
doc? ( http://erlang.org/download/otp_doc_html_${MY_PV}.tar.gz )"
|
||||
|
||||
LICENSE="ErlPL-1.1"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x64-solaris"
|
||||
IUSE="doc emacs halfword hipe java kpoll odbc smp sctp ssl tk wxwidgets"
|
||||
|
||||
RDEPEND=">=dev-lang/perl-5.6.1
|
||||
ssl? ( >=dev-libs/openssl-0.9.7d )
|
||||
emacs? ( virtual/emacs )
|
||||
java? ( >=virtual/jdk-1.2 )
|
||||
odbc? ( dev-db/unixODBC )"
|
||||
DEPEND="${RDEPEND}
|
||||
wxwidgets? ( x11-libs/wxGTK:2.8[opengl] )
|
||||
sctp? ( net-misc/lksctp-tools )
|
||||
tk? ( dev-lang/tk )"
|
||||
|
||||
S="${WORKDIR}/${MY_P}"
|
||||
|
||||
SITEFILE=50${PN}-gentoo.el
|
||||
|
||||
pkg_setup() {
|
||||
use wxwidgets && wxwidgets_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
use odbc || sed -i 's: odbc : :' lib/Makefile
|
||||
|
||||
# bug 263129, don't ignore LDFLAGS, reported upstream
|
||||
sed -e 's:LDFLAGS = \$(DED_LDFLAGS):LDFLAGS += \$(DED_LDFLAGS):' -i "${S}"/lib/megaco/src/flex/Makefile.in || die
|
||||
|
||||
if ! use wxwidgets; then
|
||||
sed -i 's: wx : :' lib/Makefile
|
||||
rm -rf lib/wx
|
||||
fi
|
||||
|
||||
# Nasty workaround, reported upstream
|
||||
cp "${S}"/lib/configure.in.src "${S}"/lib/configure.in || die
|
||||
epatch "${FILESDIR}/${P}-interface.patch" || die
|
||||
|
||||
# prevent configure from injecting -m32 by default on Darwin, bug #334155
|
||||
# Nasty hack
|
||||
sed -i -e 's/Darwin-i386/Darwin-NO/' configure.in || die
|
||||
sed -i -e '/\<\(LD\|C\)FLAGS="-m32/s/-m32//' erts/configure.in || die
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
use java || export JAVAC=false
|
||||
|
||||
econf \
|
||||
--enable-threads \
|
||||
--enable-shared-zlib \ \
|
||||
$(use_enable sctp) \
|
||||
$(use_enable halfword halfword-emulator) \
|
||||
$(use_enable hipe) \
|
||||
$(use_with ssl ssl "${EPREFIX}"/usr) \
|
||||
$(use_enable ssl dynamic-ssl-lib) \
|
||||
$(use_enable kpoll kernel-poll) \
|
||||
$(use_enable smp smp-support) \
|
||||
|| die
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
use java || export JAVAC=false
|
||||
emake -j1 || die
|
||||
|
||||
if use emacs ; then
|
||||
pushd lib/tools/emacs
|
||||
elisp-compile *.el || die
|
||||
popd
|
||||
fi
|
||||
}
|
||||
|
||||
extract_version() {
|
||||
sed -n -e "/^$2 = \(.*\)$/s::\1:p" "${S}/$1/vsn.mk"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local ERL_LIBDIR=/usr/$(get_libdir)/erlang
|
||||
local ERL_INTERFACE_VER=$(extract_version lib/erl_interface EI_VSN)
|
||||
local ERL_ERTS_VER=$(extract_version erts VSN)
|
||||
|
||||
emake -j1 INSTALL_PREFIX="${D}" install || die
|
||||
dodoc AUTHORS README.md
|
||||
|
||||
dosym "${ERL_LIBDIR}/bin/erl" /usr/bin/erl
|
||||
dosym "${ERL_LIBDIR}/bin/erlc" /usr/bin/erlc
|
||||
dosym "${ERL_LIBDIR}/bin/escript" /usr/bin/escript
|
||||
dosym \
|
||||
"${ERL_LIBDIR}/lib/erl_interface-${ERL_INTERFACE_VER}/bin/erl_call" \
|
||||
/usr/bin/erl_call
|
||||
dosym "${ERL_LIBDIR}/erts-${ERL_ERTS_VER}/bin/beam" /usr/bin/beam
|
||||
use smp && dosym "${ERL_LIBDIR}/erts-${ERL_ERTS_VER}/bin/beam.smp" /usr/bin/beam.smp
|
||||
|
||||
## Remove ${D} from the following files
|
||||
sed -e "s:${D}::g" -i "${ED}${ERL_LIBDIR}/bin/erl" || die
|
||||
sed -e "s:${D}::g" -i "${ED}${ERL_LIBDIR}/bin/start" || die
|
||||
grep -rle "${D}" "${ED}/${ERL_LIBDIR}/erts-${ERL_ERTS_VER}" | xargs sed -i -e "s:${D}::g"
|
||||
|
||||
## Clean up the no longer needed files
|
||||
rm "${ED}/${ERL_LIBDIR}/Install"||die
|
||||
|
||||
for i in "${WORKDIR}"/man/man* ; do
|
||||
dodir "${ERL_LIBDIR}/${i##${WORKDIR}}"
|
||||
done
|
||||
for file in "${WORKDIR}"/man/man*/*.[1-9]; do
|
||||
# doman sucks so we can't use it
|
||||
cp ${file} "${ED}/${ERL_LIBDIR}"/man/man${file##*.}/
|
||||
done
|
||||
# extend MANPATH, so the normal man command can find it
|
||||
# see bug 189639
|
||||
dodir /etc/env.d/
|
||||
echo "MANPATH=\"${EPREFIX}${ERL_LIBDIR}/man\"" > "${ED}/etc/env.d/90erlang"
|
||||
|
||||
if use doc ; then
|
||||
dohtml -A README,erl,hrl,c,h,kwc,info -r \
|
||||
"${WORKDIR}"/doc "${WORKDIR}"/lib "${WORKDIR}"/erts-*
|
||||
fi
|
||||
|
||||
if use emacs ; then
|
||||
pushd "${S}"
|
||||
elisp-install erlang lib/tools/emacs/*.{el,elc}
|
||||
sed -e "s:/usr/share:${EPREFIX}/usr/share:g" \
|
||||
"${FILESDIR}"/${SITEFILE} > "${T}"/${SITEFILE}
|
||||
elisp-site-file-install "${T}"/${SITEFILE}
|
||||
popd
|
||||
fi
|
||||
|
||||
# prepare erl for SMP, fixes bug #188112
|
||||
use smp && sed -i -e 's:\(exec.*erlexec\):\1 -smp:' \
|
||||
"${ED}/${ERL_LIBDIR}/bin/erl"
|
||||
|
||||
newinitd "${FILESDIR}"/epmd.init epmd || die
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
use emacs && elisp-site-regen
|
||||
elog
|
||||
elog "If you need a symlink to one of Erlang's binaries,"
|
||||
elog "please open a bug on http://bugs.gentoo.org/"
|
||||
elog
|
||||
elog "Gentoo's versioning scheme differs from the author's, so please refer to this version as ${MY_PV}"
|
||||
elog
|
||||
}
|
||||
|
||||
pkg_postrm() {
|
||||
use emacs && elisp-site-regen
|
||||
}
|
@ -1,2 +1 @@
|
||||
DIST gprolog-1.3.1.tar.gz 2949369 RMD160 f942f82e4034a59fd0bc5276542872375d7dc801 SHA1 d2912847725a0d917c6937c9402bcc21072b1a73 SHA256 3c33159b9d234647a06e78870c14a0518d6a2a5f85db906360777feb3d98c316
|
||||
DIST gprolog-1.4.0.tar.gz 3239624 RMD160 9034f30db714306794350c459f80275186cc303f SHA1 a19a4c53939235beed11657eabaa7a407869fbe9 SHA256 804a2fdd980d8ed9ba0b5e45e24aaad5e4ca08f67a532ea2b3813b9f8d99c6d0
|
||||
|
@ -1,40 +0,0 @@
|
||||
--- gprolog-1.3.1.orig/src/configure 2009-02-11 04:16:50.000000000 +1300
|
||||
+++ gprolog-1.3.1/src/configure 2009-02-12 18:33:38.000000000 +1300
|
||||
@@ -5510,7 +5510,7 @@
|
||||
# * C compiler flags *
|
||||
# ********************
|
||||
|
||||
-CFLAGS_MACHINE=
|
||||
+#CFLAGS_MACHINE=
|
||||
CFLAGS_PREFIX_REG=
|
||||
|
||||
{ echo "$as_me:$LINENO: checking for inline" >&5
|
||||
@@ -5612,17 +5612,17 @@
|
||||
CFLAGS_PREFIX_REG='-ffixed-%s'
|
||||
CFLAGS_UNSIGNED_CHAR='-funsigned-char'
|
||||
|
||||
- CFLAGS_MACHINE=
|
||||
- case "$host" in
|
||||
- mips*irix*) CFLAGS_MACHINE='-march=4000';;
|
||||
- *sparc*sunos4.1.3) CFLAGS_MACHINE='-msupersparc';;
|
||||
- *sparc*solaris) CFLAGS_MACHINE='-msupersparc';;
|
||||
- i686*) CFLAGS_MACHINE='-march=pentiumpro';;
|
||||
- i586*) CFLAGS_MACHINE='-march=pentium';;
|
||||
- i*86*) CFLAGS_MACHINE='-march=i486';;
|
||||
- powerpc*darwin*) CFLAGS_MACHINE='-mpowerpc -no-cpp-precomp';;
|
||||
- x86_64*solaris*) CFLAGS_MACHINE='-m64';;
|
||||
- esac
|
||||
+# CFLAGS_MACHINE=
|
||||
+# case "$host" in
|
||||
+# mips*irix*) CFLAGS_MACHINE='-march=4000';;
|
||||
+# *sparc*sunos4.1.3) CFLAGS_MACHINE='-msupersparc';;
|
||||
+# *sparc*solaris) CFLAGS_MACHINE='-msupersparc';;
|
||||
+# i686*) CFLAGS_MACHINE='-march=pentiumpro';;
|
||||
+# i586*) CFLAGS_MACHINE='-march=pentium';;
|
||||
+# i*86*) CFLAGS_MACHINE='-march=i486';;
|
||||
+# powerpc*darwin*) CFLAGS_MACHINE='-mpowerpc -no-cpp-precomp';;
|
||||
+# x86_64*solaris*) CFLAGS_MACHINE='-m64';;
|
||||
+# esac
|
||||
|
||||
case "$host" in
|
||||
i*86*) if test "$USE_EBP" != no; then
|
@ -1,63 +0,0 @@
|
||||
diff -ur gprolog-1.3.1.orig/src/Ma2Asm/Makefile.in gprolog-1.3.1/src/Ma2Asm/Makefile.in
|
||||
--- gprolog-1.3.1.orig/src/Ma2Asm/Makefile.in 2009-01-24 00:15:03.000000000 +1300
|
||||
+++ gprolog-1.3.1/src/Ma2Asm/Makefile.in 2010-08-21 11:58:52.000000000 +1200
|
||||
@@ -1,6 +1,7 @@
|
||||
GPLC = @GPLC@
|
||||
CC = @CC@ @CFLAGS_MACHINE@
|
||||
CFLAGS = @CFLAGS@
|
||||
+LDFLAGS = @LDFLAGS@
|
||||
|
||||
|
||||
all: ma2asm@EXE_SUFFIX@
|
||||
@@ -19,7 +20,7 @@
|
||||
|
||||
ma2asm@EXE_SUFFIX@: ma2asm@OBJ_SUFFIX@ ma_parser@OBJ_SUFFIX@ \
|
||||
ma2asm_inst@OBJ_SUFFIX@ ma2asm_inst.c
|
||||
- $(CC) $(CFLAGS) @CC_EXE_NAME_OPT@ma2asm@EXE_SUFFIX@ ma2asm@OBJ_SUFFIX@ ma2asm_inst@OBJ_SUFFIX@ ma_parser@OBJ_SUFFIX@
|
||||
+ $(CC) $(LDFLAGS) @CC_EXE_NAME_OPT@ma2asm@EXE_SUFFIX@ ma2asm@OBJ_SUFFIX@ ma2asm_inst@OBJ_SUFFIX@ ma_parser@OBJ_SUFFIX@
|
||||
|
||||
|
||||
clean:
|
||||
diff -ur gprolog-1.3.1.orig/src/TopComp/Makefile.in gprolog-1.3.1/src/TopComp/Makefile.in
|
||||
--- gprolog-1.3.1.orig/src/TopComp/Makefile.in 2009-01-24 00:15:03.000000000 +1300
|
||||
+++ gprolog-1.3.1/src/TopComp/Makefile.in 2010-08-21 12:01:58.000000000 +1200
|
||||
@@ -4,6 +4,7 @@
|
||||
HEXGPLC = @HEXGPLC@
|
||||
CC = @CC@ @CFLAGS_MACHINE@
|
||||
CFLAGS = @CFLAGS@
|
||||
+LDFLAGS = @LDFLAGS@
|
||||
LDLIBS = @LDLIBS@
|
||||
|
||||
EXECS = $(GPLC)@EXE_SUFFIX@ $(HEXGPLC)@EXE_SUFFIX@
|
||||
@@ -14,10 +15,10 @@
|
||||
|
||||
$(GPLC)@EXE_SUFFIX@: top_comp.c ../EnginePl/wam_regs.h \
|
||||
../EnginePl/gp_config.h decode_hexa.c copying.c prolog_path.c
|
||||
- $(CC) $(CFLAGS) @CC_EXE_NAME_OPT@$(GPLC)@EXE_SUFFIX@ top_comp.c $(LDLIBS)
|
||||
+ $(CC) $(LDFLAGS) $(CFLAGS) @CC_EXE_NAME_OPT@$(GPLC)@EXE_SUFFIX@ top_comp.c $(LDLIBS)
|
||||
|
||||
$(HEXGPLC)@EXE_SUFFIX@: hexfilter.c decode_hexa.c
|
||||
- $(CC) $(CFLAGS) @CC_EXE_NAME_OPT@$(HEXGPLC)@EXE_SUFFIX@ hexfilter.c
|
||||
+ $(CC) $(LDFLAGS) $(CFLAGS) @CC_EXE_NAME_OPT@$(HEXGPLC)@EXE_SUFFIX@ hexfilter.c
|
||||
|
||||
|
||||
|
||||
diff -ur gprolog-1.3.1.orig/src/Wam2Ma/Makefile.in gprolog-1.3.1/src/Wam2Ma/Makefile.in
|
||||
--- gprolog-1.3.1.orig/src/Wam2Ma/Makefile.in 2009-01-24 00:15:05.000000000 +1300
|
||||
+++ gprolog-1.3.1/src/Wam2Ma/Makefile.in 2010-08-21 11:53:51.000000000 +1200
|
||||
@@ -1,5 +1,6 @@
|
||||
CC = @CC@ @CFLAGS_MACHINE@
|
||||
CFLAGS = @CFLAGS@
|
||||
+LDFLAGS = @LDFLAGS@
|
||||
|
||||
|
||||
all: wam2ma@EXE_SUFFIX@
|
||||
@@ -12,7 +13,7 @@
|
||||
$(CC) $(CFLAGS) -c wam2ma.c
|
||||
|
||||
wam2ma@EXE_SUFFIX@: wam2ma@OBJ_SUFFIX@ wam_parser@OBJ_SUFFIX@
|
||||
- $(CC) $(CFLAGS) @CC_EXE_NAME_OPT@wam2ma@EXE_SUFFIX@ wam2ma@OBJ_SUFFIX@ wam_parser@OBJ_SUFFIX@
|
||||
+ $(CC) $(LDFLAGS) @CC_EXE_NAME_OPT@wam2ma@EXE_SUFFIX@ wam2ma@OBJ_SUFFIX@ wam_parser@OBJ_SUFFIX@
|
||||
|
||||
|
||||
clean:
|
@ -1,10 +0,0 @@
|
||||
--- gprolog-1.3.1.orig/src/Makefile.in 2009-01-24 00:15:03.000000000 +1300
|
||||
+++ gprolog-1.3.1/src/Makefile.in 2009-02-12 18:38:31.000000000 +1300
|
||||
@@ -57,7 +57,6 @@
|
||||
install-system:
|
||||
./mkinstalldirs $(INSTALL_DIR) $(INSTALL_DIR)/bin \
|
||||
$(INSTALL_DIR)/include $(INSTALL_DIR)/lib
|
||||
- for i in $(TXT_FILES); do $(INSTALL_DATA) ../$$i $(INSTALL_DIR); done
|
||||
for i in $(BIN_FILES); do $(INSTALL_PROGRAM) */$$i $(INSTALL_DIR)/bin; done
|
||||
for i in $(OBJ_FILES); do $(INSTALL_DATA) */$$i $(INSTALL_DIR)/lib; done
|
||||
for i in $(LIB_FILES); do $(INSTALL_DATA) */$$i $(INSTALL_DIR)/lib; done
|
@ -1,56 +0,0 @@
|
||||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/gprolog/gprolog-1.3.1-r1.ebuild,v 1.2 2010/11/08 07:30:59 keri Exp $
|
||||
|
||||
inherit eutils flag-o-matic
|
||||
|
||||
DESCRIPTION="GNU Prolog is a native Prolog compiler with constraint solving over finite domains (FD)"
|
||||
HOMEPAGE="http://www.gprolog.org/"
|
||||
SRC_URI="mirror://gnu/gprolog/${P}.tar.gz"
|
||||
S="${WORKDIR}"/${P}/src
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~ppc ~x86"
|
||||
IUSE="debug doc examples"
|
||||
|
||||
DEPEND=""
|
||||
|
||||
src_unpack() {
|
||||
unpack ${A}
|
||||
cd "${S}"
|
||||
epatch "${FILESDIR}"/${P}-CFLAGS_MACHINE.patch
|
||||
epatch "${FILESDIR}"/${P}-LDFLAGS.patch
|
||||
epatch "${FILESDIR}"/${P}-TXT_FILES.patch
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
CFLAGS_MACHINE="`get-flag -march` `get-flag -mcpu` `get-flag -mtune`"
|
||||
|
||||
append-flags -fno-strict-aliasing
|
||||
use debug && append-flags -DDEBUG
|
||||
|
||||
econf \
|
||||
CFLAGS_MACHINE="${CFLAGS_MACHINE}" \
|
||||
--with-c-flags="${CFLAGS}" \
|
||||
--with-install-dir="${D}"/usr \
|
||||
--with-doc-dir="${D}"/usr/share/doc/${PF} \
|
||||
--with-html-dir="${D}"/usr/share/doc/${PF}/html \
|
||||
--with-examples-dir="${D}"/usr/share/doc/${PF}/examples
|
||||
|
||||
emake || die "emake failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
make install-system || die "make install-system failed"
|
||||
|
||||
if use doc; then
|
||||
make install-html || die "make install-html failed"
|
||||
fi
|
||||
if use examples; then
|
||||
make install-examples || die "make install-examples failed"
|
||||
fi
|
||||
|
||||
cd "${S}"/..
|
||||
dodoc ChangeLog NEWS PROBLEMS README VERSION || die
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/gprolog/gprolog-1.3.1.ebuild,v 1.5 2010/03/12 18:25:04 keri Exp $
|
||||
|
||||
inherit eutils flag-o-matic
|
||||
|
||||
DESCRIPTION="GNU Prolog is a native Prolog compiler with constraint solving over finite domains (FD)"
|
||||
HOMEPAGE="http://www.gprolog.org/"
|
||||
SRC_URI="mirror://gnu/gprolog/${P}.tar.gz"
|
||||
S="${WORKDIR}"/${P}/src
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 ppc x86"
|
||||
IUSE="debug doc examples"
|
||||
|
||||
DEPEND=""
|
||||
|
||||
src_unpack() {
|
||||
unpack ${A}
|
||||
cd "${S}"
|
||||
epatch "${FILESDIR}"/${P}-CFLAGS_MACHINE.patch
|
||||
epatch "${FILESDIR}"/${P}-TXT_FILES.patch
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
CFLAGS_MACHINE="`get-flag -march` `get-flag -mcpu` `get-flag -mtune`"
|
||||
|
||||
append-flags -fno-strict-aliasing
|
||||
use debug && append-flags -DDEBUG
|
||||
|
||||
econf \
|
||||
CFLAGS_MACHINE="${CFLAGS_MACHINE}" \
|
||||
--with-c-flags="${CFLAGS}" \
|
||||
--with-install-dir="${D}"/usr \
|
||||
--with-doc-dir="${D}"/usr/share/doc/${PF} \
|
||||
--with-html-dir="${D}"/usr/share/doc/${PF}/html \
|
||||
--with-examples-dir="${D}"/usr/share/doc/${PF}/examples \
|
||||
|| die "econf failed"
|
||||
|
||||
emake || die "emake failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
make install-system || die "make install-system failed"
|
||||
|
||||
if use doc; then
|
||||
make install-html || die "make install-html failed"
|
||||
fi
|
||||
if use examples; then
|
||||
make install-examples || die "make install-examples failed"
|
||||
fi
|
||||
|
||||
cd "${S}"/..
|
||||
dodoc ChangeLog NEWS PROBLEMS README VERSION
|
||||
}
|
@ -0,0 +1,382 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.4.0.ebuild,v 1.1 2012/03/01 21:51:51 olemarkus Exp $
|
||||
|
||||
EAPI=4
|
||||
|
||||
inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool
|
||||
|
||||
SUHOSIN_VERSION=""
|
||||
FPM_VERSION="builtin"
|
||||
EXPECTED_TEST_FAILURES=""
|
||||
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
|
||||
|
||||
function php_get_uri ()
|
||||
{
|
||||
case "${1}" in
|
||||
"php-stas")
|
||||
echo "http://downloads.php.net/stas/${2}"
|
||||
;;
|
||||
"php-pre")
|
||||
echo "http://downloads.php.net/johannes/${2}"
|
||||
;;
|
||||
"php")
|
||||
echo "http://www.php.net/distributions/${2}"
|
||||
;;
|
||||
"suhosin")
|
||||
echo "http://download.suhosin.org/${2}"
|
||||
;;
|
||||
"olemarkus")
|
||||
echo "http://olemarkus.org/~olemarkus/gentoo/${2}"
|
||||
;;
|
||||
"gentoo")
|
||||
echo "mirror://gentoo/${2}"
|
||||
;;
|
||||
*)
|
||||
die "unhandled case in php_get_uri"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
PHP_MV="$(get_major_version)"
|
||||
SLOT="$(get_version_component_range 1-2)"
|
||||
|
||||
# alias, so we can handle different types of releases (finals, rcs, alphas,
|
||||
# betas, ...) w/o changing the whole ebuild
|
||||
PHP_PV="${PV/_rc/RC}"
|
||||
PHP_PV="${PHP_PV/_alpha/alpha}"
|
||||
PHP_PV="${PHP_PV/_beta/beta}"
|
||||
PHP_RELEASE="php"
|
||||
PHP_P="${PN}-${PHP_PV}"
|
||||
|
||||
PHP_PATCHSET_LOC="olemarkus"
|
||||
|
||||
PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")"
|
||||
|
||||
PHP_PATCHSET="1"
|
||||
PHP_PATCHSET_URI="
|
||||
$(php_get_uri "${PHP_PATCHSET_LOC}" "php-patchset-$SLOT-${PHP_PATCHSET}.tar.bz2")"
|
||||
|
||||
PHP_FPM_INIT_VER="4"
|
||||
PHP_FPM_CONF_VER="1"
|
||||
|
||||
if [[ ${SUHOSIN_VERSION} == *-gentoo ]]; then
|
||||
# in some cases we use our own suhosin patch (very recent version,
|
||||
# patch conflicts, etc.)
|
||||
SUHOSIN_TYPE="gentoo"
|
||||
else
|
||||
SUHOSIN_TYPE="suhosin"
|
||||
fi
|
||||
|
||||
if [[ -n ${SUHOSIN_VERSION} ]]; then
|
||||
SUHOSIN_PATCH="suhosin-patch-${SUHOSIN_VERSION}.patch";
|
||||
SUHOSIN_URI="$(php_get_uri ${SUHOSIN_TYPE} ${SUHOSIN_PATCH}.gz )"
|
||||
fi
|
||||
|
||||
SRC_URI="
|
||||
${PHP_SRC_URI}
|
||||
${PHP_PATCHSET_URI}"
|
||||
|
||||
if [[ -n ${SUHOSIN_VERSION} ]]; then
|
||||
SRC_URI="${SRC_URI}
|
||||
suhosin? ( ${SUHOSIN_URI} )"
|
||||
fi
|
||||
|
||||
DESCRIPTION="The PHP language runtime engine: CLI, CGI, FPM/FastCGI, Apache2 and embed SAPIs."
|
||||
HOMEPAGE="http://php.net/"
|
||||
LICENSE="PHP-3"
|
||||
|
||||
S="${WORKDIR}/${PHP_P}"
|
||||
|
||||
# We can build the following SAPIs in the given order
|
||||
SAPIS="embed cli cgi fpm apache2"
|
||||
|
||||
# Gentoo-specific, common features
|
||||
IUSE="kolab"
|
||||
|
||||
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
|
||||
IUSE="${IUSE}
|
||||
${SAPIS/cli/+cli}
|
||||
threads"
|
||||
|
||||
IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
|
||||
crypt +ctype curl curlwrappers debug doc
|
||||
enchant exif frontbase +fileinfo +filter firebird
|
||||
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
|
||||
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash
|
||||
mssql mysql mysqlnd mysqli nls
|
||||
oci8-instant-client odbc pcntl pdo +phar pic +posix postgres qdbm
|
||||
readline recode +session sharedmem
|
||||
+simplexml snmp soap sockets spell sqlite3 ssl
|
||||
sybase-ct sysvipc tidy +tokenizer truetype unicode wddx
|
||||
+xml xmlreader xmlwriter xmlrpc xpm xsl zip zlib"
|
||||
|
||||
# Enable suhosin if available
|
||||
[[ -n $SUHOSIN_VERSION ]] && IUSE="${IUSE} suhosin"
|
||||
|
||||
DEPEND="
|
||||
>=app-admin/eselect-php-0.6.2
|
||||
>=dev-libs/libpcre-8.12[unicode]
|
||||
apache2? ( www-servers/apache[threads=] )
|
||||
berkdb? ( =sys-libs/db-4* )
|
||||
bzip2? ( app-arch/bzip2 )
|
||||
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
|
||||
cjk? ( !gd? (
|
||||
virtual/jpeg
|
||||
media-libs/libpng
|
||||
sys-libs/zlib
|
||||
) )
|
||||
crypt? ( >=dev-libs/libmcrypt-2.4 )
|
||||
curl? ( >=net-misc/curl-7.10.5 )
|
||||
enchant? ( app-text/enchant )
|
||||
exif? ( !gd? (
|
||||
virtual/jpeg
|
||||
media-libs/libpng
|
||||
sys-libs/zlib
|
||||
) )
|
||||
firebird? ( dev-db/firebird )
|
||||
gd? ( virtual/jpeg media-libs/libpng sys-libs/zlib )
|
||||
gdbm? ( >=sys-libs/gdbm-1.8.0 )
|
||||
gmp? ( >=dev-libs/gmp-4.1.2 )
|
||||
iconv? ( virtual/libiconv )
|
||||
imap? ( virtual/imap-c-client[ssl=] )
|
||||
intl? ( dev-libs/icu )
|
||||
iodbc? ( dev-db/libiodbc )
|
||||
kerberos? ( virtual/krb5 )
|
||||
kolab? ( >=net-libs/c-client-2004g-r1 )
|
||||
ldap? ( >=net-nds/openldap-1.2.11 )
|
||||
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
|
||||
libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
|
||||
mssql? ( dev-db/freetds[mssql] )
|
||||
!mysqlnd? (
|
||||
mysql? ( virtual/mysql )
|
||||
mysqli? ( >=virtual/mysql-4.1 )
|
||||
)
|
||||
nls? ( sys-devel/gettext )
|
||||
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
|
||||
odbc? ( >=dev-db/unixODBC-1.8.13 )
|
||||
postgres? ( dev-db/postgresql-base )
|
||||
qdbm? ( dev-db/qdbm )
|
||||
readline? ( sys-libs/readline )
|
||||
recode? ( app-text/recode )
|
||||
sharedmem? ( dev-libs/mm )
|
||||
simplexml? ( >=dev-libs/libxml2-2.6.8 )
|
||||
snmp? ( >=net-analyzer/net-snmp-5.2 )
|
||||
soap? ( >=dev-libs/libxml2-2.6.8 )
|
||||
spell? ( >=app-text/aspell-0.50 )
|
||||
sqlite3? ( >=dev-db/sqlite-3.7.6.3 )
|
||||
ssl? ( >=dev-libs/openssl-0.9.7 )
|
||||
sybase-ct? ( dev-db/freetds )
|
||||
tidy? ( app-text/htmltidy )
|
||||
truetype? (
|
||||
=media-libs/freetype-2*
|
||||
>=media-libs/t1lib-5.0.0
|
||||
!gd? (
|
||||
virtual/jpeg media-libs/libpng sys-libs/zlib )
|
||||
)
|
||||
unicode? ( dev-libs/oniguruma )
|
||||
wddx? ( >=dev-libs/libxml2-2.6.8 )
|
||||
xml? ( >=dev-libs/libxml2-2.6.8 )
|
||||
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
|
||||
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
|
||||
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
|
||||
xpm? (
|
||||
x11-libs/libXpm
|
||||
virtual/jpeg
|
||||
media-libs/libpng sys-libs/zlib
|
||||
)
|
||||
xsl? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
|
||||
zip? ( sys-libs/zlib )
|
||||
zlib? ( sys-libs/zlib )
|
||||
virtual/mta
|
||||
"
|
||||
|
||||
php="=${CATEGORY}/${PF}"
|
||||
|
||||
REQUIRED_USE="
|
||||
truetype? ( gd )
|
||||
cjk? ( gd )
|
||||
exif? ( gd )
|
||||
|
||||
xpm? ( gd )
|
||||
gd? ( zlib )
|
||||
simplexml? ( xml )
|
||||
soap? ( xml )
|
||||
wddx? ( xml )
|
||||
xmlrpc? ( || ( xml iconv ) )
|
||||
xmlreader? ( xml )
|
||||
xsl? ( xml )
|
||||
ldap-sasl? ( ldap )
|
||||
kolab? ( imap )
|
||||
mhash? ( hash )
|
||||
phar? ( hash )
|
||||
mysqlnd? ( || (
|
||||
mysql
|
||||
mysqli
|
||||
pdo
|
||||
) )
|
||||
|
||||
qdbm? ( !gdbm )
|
||||
readline? ( !libedit )
|
||||
recode? ( !imap !mysql !mysqli )
|
||||
sharedmem? ( !threads )
|
||||
|
||||
!cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
|
||||
|
||||
[[ -n $SUHOSIN_VERSION ]] && RDEPEND="${RDEPEND} suhosin? (
|
||||
=${CATEGORY}/${PN}-${SLOT}*[unicode] )"
|
||||
|
||||
DEPEND="${DEPEND}
|
||||
sys-devel/flex
|
||||
>=sys-devel/m4-1.4.3
|
||||
>=sys-devel/libtool-1.5.18"
|
||||
|
||||
# They are in PDEPEND because we need PHP installed first!
|
||||
PDEPEND="doc? ( app-doc/php-docs )"
|
||||
|
||||
# No longer depend on the extension. The suhosin USE flag only installs the
|
||||
# patch
|
||||
#[[ -n $SUHOSIN_VERSION ]] && PDEPEND="${PDEPEND} suhosin? ( dev-php${PHP_MV}/suhosin )"
|
||||
|
||||
# Allow users to install production version if they want to
|
||||
|
||||
case "${PHP_INI_VERSION}" in
|
||||
production|development)
|
||||
;;
|
||||
*)
|
||||
PHP_INI_VERSION="development"
|
||||
;;
|
||||
esac
|
||||
|
||||
PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}"
|
||||
PHP_INI_FILE="php.ini"
|
||||
|
||||
want_apache
|
||||
|
||||
# eblit-core
|
||||
# Usage: <function> [version] [eval]
|
||||
# Main eblit engine
|
||||
eblit-core() {
|
||||
[[ -z $FILESDIR ]] && FILESDIR="$(dirname $EBUILD)/files"
|
||||
local e v func=$1 ver=$2 eval_=$3
|
||||
for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
|
||||
e="${FILESDIR}/eblits/${func}${v}.eblit"
|
||||
if [[ -e ${e} ]] ; then
|
||||
. "${e}"
|
||||
[[ ${eval_} == 1 ]] && eval "${func}() { eblit-run ${func} ${ver} ; }"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# eblit-include
|
||||
# Usage: [--skip] <function> [version]
|
||||
# Includes an "eblit" -- a chunk of common code among ebuilds in a given
|
||||
# package so that its functions can be sourced and utilized within the
|
||||
# ebuild.
|
||||
eblit-include() {
|
||||
local skipable=false r=0
|
||||
[[ $1 == "--skip" ]] && skipable=true && shift
|
||||
[[ $1 == pkg_* ]] && skipable=true
|
||||
|
||||
[[ -z $1 ]] && die "Usage: eblit-include <function> [version]"
|
||||
eblit-core $1 $2
|
||||
r="$?"
|
||||
${skipable} && return 0
|
||||
[[ "$r" -gt "0" ]] && die "Could not locate requested eblit '$1' in ${FILESDIR}/eblits/"
|
||||
}
|
||||
|
||||
# eblit-run-maybe
|
||||
# Usage: <function>
|
||||
# Runs a function if it is defined in an eblit
|
||||
eblit-run-maybe() {
|
||||
[[ $(type -t "$@") == "function" ]] && "$@"
|
||||
}
|
||||
|
||||
# eblit-run
|
||||
# Usage: <function> [version]
|
||||
# Runs a function defined in an eblit
|
||||
eblit-run() {
|
||||
eblit-include --skip common v2
|
||||
eblit-include "$@"
|
||||
eblit-run-maybe eblit-$1-pre
|
||||
eblit-${PN}-$1
|
||||
eblit-run-maybe eblit-$1-post
|
||||
}
|
||||
|
||||
# eblit-pkg
|
||||
# Usage: <phase> [version]
|
||||
# Includes the given functions AND evals them so they're included in the binpkgs
|
||||
eblit-pkg() {
|
||||
[[ -z $1 ]] && die "Usage: eblit-pkg <phase> [version]"
|
||||
eblit-core $1 $2 1
|
||||
}
|
||||
|
||||
eblit-pkg pkg_setup v3
|
||||
|
||||
src_prepare() { eblit-run src_prepare v4 ; }
|
||||
src_configure() { eblit-run src_configure v54 ; }
|
||||
src_compile() { eblit-run src_compile v2 ; }
|
||||
src_install() { eblit-run src_install v3 ; }
|
||||
src_test() { eblit-run src_test v1 ; }
|
||||
|
||||
#Do not use eblit for this because it will not get sourced when installing from
|
||||
#binary package (bug #380845)
|
||||
pkg_postinst() {
|
||||
# Output some general info to the user
|
||||
if use apache2 ; then
|
||||
APACHE2_MOD_DEFINE="PHP5"
|
||||
APACHE2_MOD_CONF="70_mod_php5"
|
||||
apache-module_pkg_postinst
|
||||
fi
|
||||
|
||||
# Create the symlinks for php
|
||||
for m in ${SAPIS}; do
|
||||
[[ ${m} == 'embed' ]] && continue;
|
||||
if use $m ; then
|
||||
local ci=$(eselect php show $m)
|
||||
if [[ -z $ci ]]; then
|
||||
eselect php set $m php${SLOT}
|
||||
einfo "Switched ${m} to use php:${SLOT}"
|
||||
einfo
|
||||
elif [[ $ci != "php${SLOT}" ]] ; then
|
||||
elog "To switch $m to use php:${SLOT}, run"
|
||||
elog " eselect php set $m php${SLOT}"
|
||||
elog
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
elog "Make sure that PHP_TARGETS in /etc/make.conf includes php${SLOT/./-} in order"
|
||||
elog "to compile extensions for the ${SLOT} ABI"
|
||||
elog
|
||||
if ! use readline && use cli ; then
|
||||
ewarn "Note that in order to use php interactivly, you need to enable"
|
||||
ewarn "the readline USE flag or php -a will hang"
|
||||
fi
|
||||
elog
|
||||
elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version."
|
||||
elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either"
|
||||
elog "'production' or 'development' in /etc/make.conf"
|
||||
ewarn "Both versions of php.ini can be found in /usr/share/doc/${PF}"
|
||||
|
||||
# check for not yet migrated old style config dirs
|
||||
ls "${ROOT}"/etc/php/*-php5 &>/dev/null
|
||||
if [[ $? -eq 0 ]]; then
|
||||
ewarn "Make sure to migrate your config files, starting with php-5.3.4 and php-5.2.16 config"
|
||||
ewarn "files are now kept at ${ROOT}etc/php/{apache2,cli,cgi,fpm}-php5.x"
|
||||
fi
|
||||
elog
|
||||
elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:"
|
||||
elog "http://www.gentoo.org/proj/en/php/php-upgrading.xml"
|
||||
elog
|
||||
|
||||
if ( [[ -z SUHOSIN_VERSION ]] && use suhosin && version_is_at_least 5.3.6_rc1 ) ; then
|
||||
ewarn "The suhosin USE flag now only installs the suhosin patch!"
|
||||
ewarn "If you want the suhosin extension, make sure you install"
|
||||
ewarn " dev-php/suhosin"
|
||||
ewarn
|
||||
fi
|
||||
}
|
@ -1,3 +1 @@
|
||||
DIST qp8.12.tar.gz 1459424 RMD160 d67b99a79e449bea7aefd43b841996373fb88717 SHA1 08e16e10b6ba4053c49a7c733ef955e18d6f941b SHA256 a184a9bf7feae32340c923fb74de84b0154abe665b1708d6fb9ee644cc0ad706
|
||||
DIST qp9.0.tar.gz 1460127 RMD160 fe2e6dcde878e2b17e56cddfaf64f956800c58c7 SHA1 291529c79964737990d901948f615d45905cce5a SHA256 0694c8f5c894e86bab252badec4394c37cdd800648c521bae6a2d7ad7470f32c
|
||||
DIST qp9.1.tar.gz 1460679 RMD160 63dd1f7fb8c78963b4d62470277bec5e2c54468e SHA1 a1ee6733a12b3b640057662ac8b5fec9577a2850 SHA256 1f3052f2700d537b33207943a3ade48b2b3aa5cd01cafc0475bcf26c645bc9af
|
||||
|
@ -1,38 +0,0 @@
|
||||
--- qp8.12.orig/src/gc.cc 2010-11-23 15:33:30.000000000 +1300
|
||||
+++ qp8.12/src/gc.cc 2010-12-04 12:37:04.000000000 +1300
|
||||
@@ -152,7 +152,7 @@
|
||||
{
|
||||
cerr << size << endl;
|
||||
heapobject* ptr = reinterpret_cast<heapobject*>(term);
|
||||
- cerr << hex << (u_int)(ptr) << " : " << *ptr << " " << *(ptr+1) << dec << endl;
|
||||
+ cerr << hex << (wordptr)(ptr) << " : " << *ptr << " " << *(ptr+1) << dec << endl;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
--- qp8.12.orig/src/objects.h 2010-11-23 15:33:30.000000000 +1300
|
||||
+++ qp8.12/src/objects.h 2010-12-02 20:40:53.000000000 +1300
|
||||
@@ -1234,18 +1234,12 @@
|
||||
<< this->getName() << "\" ";
|
||||
|
||||
#ifndef WIN32
|
||||
- switch (hasAssociatedItem())
|
||||
- {
|
||||
- case AssociatedNone:
|
||||
- std::cerr << "(no info)";
|
||||
- break;
|
||||
- case AssociatedInteger:
|
||||
- std::cerr << "int: " << getAssociatedInteger();
|
||||
- break;
|
||||
- case AssociatedAtom:
|
||||
- std::cerr << "atom: [" << std::hex << (wordptr) getAssociatedAtom() << std::dec << "]";
|
||||
- break;
|
||||
- }
|
||||
+ if (hasAssociatedInteger())
|
||||
+ std::cerr << "int: " << getAssociatedInteger();
|
||||
+ else if (hasAssociatedAtom())
|
||||
+ std::cerr << "atom: [" << std::hex << (wordptr) getAssociatedAtom() << std::dec << "]";
|
||||
+ else
|
||||
+ std::cerr << "(no info)";
|
||||
#endif
|
||||
}
|
||||
#endif
|
@ -1,21 +0,0 @@
|
||||
--- qp8.12.orig/src/Makefile.in 2010-11-23 15:33:42.000000000 +1300
|
||||
+++ qp8.12/src/Makefile.in 2010-12-04 07:15:27.000000000 +1300
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
#export DEBUGGING=
|
||||
|
||||
-export CXXFLAGS = @GCC_ALIAS_FLAG@ -Wall -D_GNU_SOURCE=1 $(OPTIMISATION) @DEBUGGING@ @GCCINCLUDES@ -Wno-uninitialized
|
||||
+#export CXXFLAGS = @GCC_ALIAS_FLAG@ -Wall -D_GNU_SOURCE=1 $(OPTIMISATION) @DEBUGGING@ @GCCINCLUDES@ -Wno-uninitialized
|
||||
export QACXXFLAGS = -Wall -D_GNU_SOURCE=1 @DEBUGGING@ @GCCINCLUDES@ -Wno-uninitialized
|
||||
|
||||
.PHONY: all
|
||||
@@ -79,6 +79,9 @@
|
||||
|
||||
# Targets
|
||||
|
||||
+.cc.o:
|
||||
+ $(CXX) $(CXXFLAGS) @GCC_ALIAS_FLAG@ -Wall -D_GNU_SOURCE=1 @DEBUGGING@ @GCCINCLUDES@ -Wno-uninitialized -c $<
|
||||
+
|
||||
.PHONY: commands
|
||||
commands: $(GENERATED) $(LIBRARIES) $(BIG_LIBRARY)
|
||||
@$(MAKE) $(ALL_COMMANDS)
|
@ -1,30 +0,0 @@
|
||||
--- qp8.12.orig/bin/qc.in 2010-11-23 15:33:14.000000000 +1300
|
||||
+++ qp8.12/bin/qc.in 2010-12-04 11:16:44.000000000 +1300
|
||||
@@ -27,13 +27,13 @@
|
||||
|
||||
##############################
|
||||
|
||||
-preprocess='@QPHOME@/bin/qppp'
|
||||
-expand='@QPHOME@/bin/qg'
|
||||
-qpcompile='@QPHOME@/bin/qc1'
|
||||
+preprocess='qppp'
|
||||
+expand='qg'
|
||||
+qpcompile='qc1'
|
||||
compversion='qup'
|
||||
-assemble='@QPHOME@/bin/qa'
|
||||
-link='@QPHOME@/bin/ql'
|
||||
-execute='@QPHOME@/bin/qem'
|
||||
+assemble='qa'
|
||||
+link='ql'
|
||||
+execute='qem'
|
||||
libqofiles="@QPHOME@/prolog/compiler/*.qo @QPHOME@/prolog/library/*.qo"
|
||||
|
||||
##############################
|
||||
--- qp8.12.orig/prolog/Makefile.in 2006-04-06 16:01:45.000000000 +1200
|
||||
+++ qp8.12/prolog/Makefile.in 2010-12-04 10:57:09.000000000 +1300
|
||||
@@ -1,3 +1,5 @@
|
||||
+PATH:=$(PATH):@QPHOME@/bin
|
||||
+
|
||||
.DEFAULT:
|
||||
@$(MAKE) -C compiler $@
|
||||
@$(MAKE) -C library $@
|
@ -1,41 +0,0 @@
|
||||
diff -ur qp9.0.orig/src/gc.cc qp9.0/src/gc.cc
|
||||
--- qp9.0.orig/src/gc.cc 2011-07-14 14:48:03.000000000 +1200
|
||||
+++ qp9.0/src/gc.cc 2011-11-19 09:55:20.000000000 +1300
|
||||
@@ -152,7 +152,7 @@
|
||||
{
|
||||
cerr << size << endl;
|
||||
heapobject* ptr = reinterpret_cast<heapobject*>(term);
|
||||
- cerr << hex << (u_int)(ptr) << " : " << *ptr << " " << *(ptr+1) << dec << endl;
|
||||
+ cerr << hex << (wordptr)(ptr) << " : " << *ptr << " " << *(ptr+1) << dec << endl;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
diff -ur qp9.0.orig/src/objects.h qp9.0/src/objects.h
|
||||
--- qp9.0.orig/src/objects.h 2011-07-14 14:48:03.000000000 +1200
|
||||
+++ qp9.0/src/objects.h 2011-11-19 09:55:20.000000000 +1300
|
||||
@@ -1242,18 +1242,12 @@
|
||||
<< this->getName() << "\" ";
|
||||
|
||||
#ifndef WIN32
|
||||
- switch (hasAssociatedItem())
|
||||
- {
|
||||
- case AssociatedNone:
|
||||
- std::cerr << "(no info)";
|
||||
- break;
|
||||
- case AssociatedInteger:
|
||||
- std::cerr << "int: " << getAssociatedInteger();
|
||||
- break;
|
||||
- case AssociatedAtom:
|
||||
- std::cerr << "atom: [" << std::hex << (wordptr) getAssociatedAtom() << std::dec << "]";
|
||||
- break;
|
||||
- }
|
||||
+ if (hasAssociatedInteger())
|
||||
+ std::cerr << "int: " << getAssociatedInteger();
|
||||
+ else if (hasAssociatedAtom())
|
||||
+ std::cerr << "atom: [" << std::hex << (wordptr) getAssociatedAtom() << std::dec << "]";
|
||||
+ else
|
||||
+ std::cerr << "(no info)";
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
Only in qp9.0/src: objects.h.orig
|
@ -1,22 +0,0 @@
|
||||
diff -ur qp9.0.orig/src/Makefile.in qp9.0/src/Makefile.in
|
||||
--- qp9.0.orig/src/Makefile.in 2011-07-14 14:48:14.000000000 +1200
|
||||
+++ qp9.0/src/Makefile.in 2011-11-19 09:51:48.000000000 +1300
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
#export DEBUGGING=
|
||||
|
||||
-export CXXFLAGS = @GCC_ALIAS_FLAG@ -Wall -D_GNU_SOURCE=1 $(OPTIMISATION) @DEBUGGING@ @GCCINCLUDES@ -Wno-uninitialized
|
||||
+#export CXXFLAGS = @GCC_ALIAS_FLAG@ -Wall -D_GNU_SOURCE=1 $(OPTIMISATION) @DEBUGGING@ @GCCINCLUDES@ -Wno-uninitialized
|
||||
export QACXXFLAGS = -Wall -D_GNU_SOURCE=1 @DEBUGGING@ @GCCINCLUDES@ -Wno-uninitialized
|
||||
|
||||
.PHONY: all
|
||||
@@ -79,6 +79,9 @@
|
||||
|
||||
# Targets
|
||||
|
||||
+.cc.o:
|
||||
+ $(CXX) $(CXXFLAGS) @GCC_ALIAS_FLAG@ -Wall -D_GNU_SOURCE=1 @DEBUGGING@ @GCCINCLUDES@ -Wno-uninitialized -c $<
|
||||
+
|
||||
.PHONY: commands
|
||||
commands: $(GENERATED) $(LIBRARIES) $(BIG_LIBRARY)
|
||||
@$(MAKE) $(ALL_COMMANDS)
|
@ -1,32 +0,0 @@
|
||||
diff -ur qp9.0.orig/bin/qc.in qp9.0/bin/qc.in
|
||||
--- qp9.0.orig/bin/qc.in 2011-07-14 14:47:48.000000000 +1200
|
||||
+++ qp9.0/bin/qc.in 2011-11-19 09:50:05.000000000 +1300
|
||||
@@ -27,13 +27,13 @@
|
||||
|
||||
##############################
|
||||
|
||||
-preprocess='@QPHOME@/bin/qppp'
|
||||
-expand='@QPHOME@/bin/qg'
|
||||
-qpcompile='@QPHOME@/bin/qc1'
|
||||
+preprocess='qppp'
|
||||
+expand='qg'
|
||||
+qpcompile='qc1'
|
||||
compversion='qup'
|
||||
-assemble='@QPHOME@/bin/qa'
|
||||
-link='@QPHOME@/bin/ql'
|
||||
-execute='@QPHOME@/bin/qem'
|
||||
+assemble='qa'
|
||||
+link='ql'
|
||||
+execute='qem'
|
||||
libqofiles="@QPHOME@/prolog/compiler/*.qo @QPHOME@/prolog/library/*.qo"
|
||||
|
||||
##############################
|
||||
diff -ur qp9.0.orig/prolog/Makefile.in qp9.0/prolog/Makefile.in
|
||||
--- qp9.0.orig/prolog/Makefile.in 2006-04-06 16:01:45.000000000 +1200
|
||||
+++ qp9.0/prolog/Makefile.in 2011-11-19 09:50:05.000000000 +1300
|
||||
@@ -1,3 +1,5 @@
|
||||
+PATH:=$(PATH):@QPHOME@/bin
|
||||
+
|
||||
.DEFAULT:
|
||||
@$(MAKE) -C compiler $@
|
||||
@$(MAKE) -C library $@
|
@ -1,101 +0,0 @@
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/qu-prolog/qu-prolog-8.12.ebuild,v 1.5 2011/06/23 20:02:13 ranger Exp $
|
||||
|
||||
EAPI=2
|
||||
|
||||
inherit eutils qt4-r2
|
||||
|
||||
MY_P=qp${PV}
|
||||
|
||||
DESCRIPTION="Qu-Prolog is an extended Prolog supporting quantifiers, object-variables and substitutions"
|
||||
HOMEPAGE="http://www.itee.uq.edu.au/~pjr/HomePages/QuPrologHome.html"
|
||||
SRC_URI="http://www.itee.uq.edu.au/~pjr/HomePages/QPFiles/${MY_P}.tar.gz"
|
||||
|
||||
LICENSE="as-is"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 ppc x86"
|
||||
IUSE="debug doc examples pedro qt4 readline threads"
|
||||
|
||||
RDEPEND="!dev-util/mpatch
|
||||
!dev-util/rej
|
||||
qt4? ( x11-libs/qt-gui:4 )
|
||||
pedro? ( net-misc/pedro )
|
||||
readline? ( app-misc/rlwrap )"
|
||||
|
||||
DEPEND="${RDEPEND}
|
||||
dev-lang/perl"
|
||||
|
||||
S="${WORKDIR}"/${MY_P}
|
||||
|
||||
src_prepare() {
|
||||
epatch "${FILESDIR}"/${P}-portage.patch
|
||||
epatch "${FILESDIR}"/${P}-cflags.patch
|
||||
epatch "${FILESDIR}"/${P}-cerr-ptr.patch
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
econf \
|
||||
--libdir=/usr/$(get_libdir) \
|
||||
$(use_enable debug) \
|
||||
$(use_enable threads multiple-threads)
|
||||
|
||||
if use qt4; then
|
||||
cd "${S}"/src/xqp
|
||||
eqmake4 xqp.pro
|
||||
fi
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
emake || die "emake failed"
|
||||
|
||||
if use qt4; then
|
||||
cd "${S}"/src/xqp
|
||||
emake || die "emake xqp failed"
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
sed -i -e "s|${S}|/usr/$(get_libdir)/qu-prolog|g" \
|
||||
bin/qc bin/qc1.qup bin/qecat bin/qg bin/qp || die
|
||||
|
||||
exeinto /usr/bin
|
||||
doexe bin/qa bin/qdeal bin/qem bin/ql || die
|
||||
doexe bin/qc bin/qc1.qup bin/qecat bin/qg bin/qp bin/qppp || die
|
||||
doexe bin/kq || die
|
||||
|
||||
if use qt4; then
|
||||
doexe src/xqp/xqp || die
|
||||
fi
|
||||
|
||||
insinto /usr/$(get_libdir)/${PN}/bin
|
||||
doins bin/rl_commands
|
||||
doins bin/qc1.qup.qx \
|
||||
bin/qecat.qx \
|
||||
bin/qg.qx \
|
||||
bin/qp.qx || die
|
||||
|
||||
insinto /usr/$(get_libdir)/${PN}/library
|
||||
doins prolog/library/*.qo || die
|
||||
|
||||
insinto /usr/$(get_libdir)/${PN}/compiler
|
||||
doins prolog/compiler/*.qo || die
|
||||
|
||||
doman doc/man/man1/*.1 || die
|
||||
|
||||
dodoc README || die
|
||||
|
||||
if use doc ; then
|
||||
docinto reference-manual
|
||||
dodoc doc/manual/*.html || die
|
||||
docinto user-guide
|
||||
dodoc doc/user/main.pdf || die
|
||||
fi
|
||||
|
||||
if use examples ; then
|
||||
insinto /usr/share/doc/${PF}/examples
|
||||
doins examples/*.ql || die
|
||||
docinto examples
|
||||
dodoc examples/README || die
|
||||
fi
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-lang/qu-prolog/qu-prolog-9.0.ebuild,v 1.1 2011/11/18 21:00:02 keri Exp $
|
||||
|
||||
EAPI=2
|
||||
|
||||
inherit eutils qt4-r2
|
||||
|
||||
MY_P=qp${PV}
|
||||
|
||||
DESCRIPTION="Qu-Prolog is an extended Prolog supporting quantifiers, object-variables and substitutions"
|
||||
HOMEPAGE="http://www.itee.uq.edu.au/~pjr/HomePages/QuPrologHome.html"
|
||||
SRC_URI="http://www.itee.uq.edu.au/~pjr/HomePages/QPFiles/${MY_P}.tar.gz"
|
||||
|
||||
LICENSE="as-is"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~ppc ~x86"
|
||||
IUSE="debug doc examples pedro qt4 readline threads"
|
||||
|
||||
RDEPEND="!dev-util/mpatch
|
||||
!dev-util/rej
|
||||
qt4? ( x11-libs/qt-gui:4 )
|
||||
pedro? ( net-misc/pedro )
|
||||
readline? ( app-misc/rlwrap )"
|
||||
|
||||
DEPEND="${RDEPEND}
|
||||
dev-lang/perl"
|
||||
|
||||
S="${WORKDIR}"/${MY_P}
|
||||
|
||||
src_prepare() {
|
||||
epatch "${FILESDIR}"/${P}-portage.patch
|
||||
epatch "${FILESDIR}"/${P}-cflags.patch
|
||||
epatch "${FILESDIR}"/${P}-cerr-ptr.patch
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
econf \
|
||||
--libdir=/usr/$(get_libdir) \
|
||||
$(use_enable debug) \
|
||||
$(use_enable threads multiple-threads)
|
||||
|
||||
if use qt4; then
|
||||
cd "${S}"/src/xqp
|
||||
eqmake4 xqp.pro
|
||||
fi
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
emake || die "emake failed"
|
||||
|
||||
if use qt4; then
|
||||
cd "${S}"/src/xqp
|
||||
emake || die "emake xqp failed"
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
sed -i -e "s|${S}|/usr/$(get_libdir)/qu-prolog|g" \
|
||||
bin/qc bin/qc1.qup bin/qecat bin/qg bin/qp || die
|
||||
|
||||
exeinto /usr/bin
|
||||
doexe bin/qa bin/qdeal bin/qem bin/ql || die
|
||||
doexe bin/qc bin/qc1.qup bin/qecat bin/qg bin/qp bin/qppp || die
|
||||
doexe bin/kq || die
|
||||
|
||||
if use qt4; then
|
||||
doexe src/xqp/xqp || die
|
||||
fi
|
||||
|
||||
insinto /usr/$(get_libdir)/${PN}/bin
|
||||
doins bin/rl_commands
|
||||
doins bin/qc1.qup.qx \
|
||||
bin/qecat.qx \
|
||||
bin/qg.qx \
|
||||
bin/qp.qx || die
|
||||
|
||||
insinto /usr/$(get_libdir)/${PN}/library
|
||||
doins prolog/library/*.qo || die
|
||||
|
||||
insinto /usr/$(get_libdir)/${PN}/compiler
|
||||
doins prolog/compiler/*.qo || die
|
||||
|
||||
doman doc/man/man1/*.1 || die
|
||||
|
||||
dodoc README || die
|
||||
|
||||
if use doc ; then
|
||||
docinto reference-manual
|
||||
dodoc doc/manual/*.html || die
|
||||
docinto user-guide
|
||||
dodoc doc/user/main.pdf || die
|
||||
fi
|
||||
|
||||
if use examples ; then
|
||||
insinto /usr/share/doc/${PF}/examples
|
||||
doins examples/*.ql || die
|
||||
docinto examples
|
||||
dodoc examples/README || die
|
||||
fi
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue