|
|
LICENSE="ZPL" | LICENSE="ZPL" |
SLOT="${PV}" | SLOT="${PV}" |
| |
KEYWORDS="~x86 ~sparc ~ppc ~alpha ~amd64" |
KEYWORDS="x86 ~sparc ~ppc ~alpha ~amd64" |
IUSE="unicode" | IUSE="unicode" |
| |
RDEPEND="=dev-lang/python-2.3*" | RDEPEND="=dev-lang/python-2.3*" |
|
|
ZUID=zope | ZUID=zope |
ZGID=zope | ZGID=zope |
ZGID_INST="$(echo ${PN}-${PV} | sed -e 's/\./_/g' )" | ZGID_INST="$(echo ${PN}-${PV} | sed -e 's/\./_/g' )" |
ZS_DIR=${ROOT}/usr/lib/ |
ZS_DIR=${ROOT%/}/usr/lib/ |
ZI_DIR=${ROOT}/var/lib/zope/ |
ZI_DIR=${ROOT%/}/var/lib/zope/ |
ZSERVDIR=${ZS_DIR}${PN}-${PV}/ | ZSERVDIR=${ZS_DIR}${PN}-${PV}/ |
ZINSTDIR=${ZI_DIR}${PN}-${PV} |
ZINSTDIR=${ZI_DIR}${PN}-${PV}/ |
| |
RCNAME=zope.initd | RCNAME=zope.initd |
| |
|
|
# Parameters: | # Parameters: |
# $1 = instance directory | # $1 = instance directory |
# $2 = group | # $2 = group |
|
|
setup_security() { | setup_security() { |
# The old version made everything owned by zope:${DEFAULT_INSTANCE_GID}, | # The old version made everything owned by zope:${DEFAULT_INSTANCE_GID}, |
# and group-writable. This is like making everything in net-www/apache2 | # and group-writable. This is like making everything in net-www/apache2 |
|
|
# by the zope group, of which the zope user is a member, so that running | # by the zope group, of which the zope user is a member, so that running |
# zope instances will be able to read everything. | # zope instances will be able to read everything. |
# -- Andy Dustman | # -- Andy Dustman |
|
|
chown -R root:${2} ${1} | chown -R root:${2} ${1} |
chmod -R g+r,g-w,o-rwx ${1} | chmod -R g+r,g-w,o-rwx ${1} |
} | } |
|
|
if [ -d ${ZINSTDIR} ] ; then | if [ -d ${ZINSTDIR} ] ; then |
die "Default instance directory (${ZINSTDIR} already exists!" | die "Default instance directory (${ZINSTDIR} already exists!" |
fi | fi |
if [ -f ${ZI_DIR}/.default ] ; then |
if [ -f ${ZI_DIR}.default ] ; then |
def_instance=`cat ${ZI_DIR}/.default` |
def_instance=`cat ${ZI_DIR}.default` |
die "Default instance file (${ZI_DIR}/.default already exists -> $def_instance" |
die "Default instance file (${ZI_DIR}.default already exists -> $def_instance" |
fi | fi |
einfo "Creting default zope instance at ${ZINSTDIR} with command:" |
einfo "Creating default zope instance at ${ZINSTDIR} with command:" |
einfo "/usr/sbin/zope-config --zserv=${ZSERVDIR} --zinst=${ZINSTDIR} --zgid=${ZGID_INST} --zinituser" | einfo "/usr/sbin/zope-config --zserv=${ZSERVDIR} --zinst=${ZINSTDIR} --zgid=${ZGID_INST} --zinituser" |
ewarn "Default admin user created with password admin. Please change it." | ewarn "Default admin user created with password admin. Please change it." |
/usr/sbin/zope-config --zserv=${ZSERVDIR} --zinst=${ZINSTDIR} --zgid=${ZGID_INST} --zinituser | /usr/sbin/zope-config --zserv=${ZSERVDIR} --zinst=${ZINSTDIR} --zgid=${ZGID_INST} --zinituser |
|
|
enewgroup ${ZGID} 261 | enewgroup ${ZGID} 261 |
usermod -g ${ZGID} ${ZUID} 2>&1 >/dev/null || \ | usermod -g ${ZGID} ${ZUID} 2>&1 >/dev/null || \ |
enewuser ${ZUID} 261 /bin/bash ${ZS_DIR} ${ZGID} | enewuser ${ZUID} 261 /bin/bash ${ZS_DIR} ${ZGID} |
|
|
|
#[cs] Moved setup_security here to fix Bug #59217 |
|
setup_security ${D}${ZSERVDIR} ${ZGID} |
} | } |
| |
src_unpack() { | src_unpack() { |
|
|
} | } |
| |
src_compile() { | src_compile() { |
|
#[cs] TODO: ZOPE_DIR should be something else.... |
./configure --ignore-largefile --prefix=${ZOPE_DIR} || die "Failed to configure." | ./configure --ignore-largefile --prefix=${ZOPE_DIR} || die "Failed to configure." |
emake || die "Failed to compile." | emake || die "Failed to compile." |
} | } |
|
|
cd ${S} | cd ${S} |
fi | fi |
| |
make install PREFIX=${D}/${ZSERVDIR} |
make install PREFIX=${D}${ZSERVDIR} |
rm -rf ${D}${ZSERVDIR}/doc |
rm -rf ${D}${ZSERVDIR}doc |
dosym ${DOCDESTTREE} ${D}${ZSERVDIR}/doc |
dosym ${DOCDESTTREE} ${D}${ZSERVDIR}doc |
| |
skel=${D}${ZSERVDIR}/skel |
skel=${D}${ZSERVDIR}skel |
dodir /etc/init.d | dodir /etc/init.d |
cp ${FILESDIR}/${PV}/zope.initd ${skel}/zope.initd | cp ${FILESDIR}/${PV}/zope.initd ${skel}/zope.initd |
|
|
setup_security ${D}${ZSERVDIR} ${ZGID} |
|
} | } |
| |
pkg_postinst() { | pkg_postinst() { |
|
|
| |
# Delete .default if this ebuild is the default. zprod-manager will | # Delete .default if this ebuild is the default. zprod-manager will |
# have to handle a missing default; | # have to handle a missing default; |
# TODO: this should be checked |
# TODO: this should be checked |
rm -f ${ZI_DIR}/.default | rm -f ${ZI_DIR}/.default |
|
|
|
# TODO: Verify this is right. |
|
#if [ -e ${ZI_DIR}.default ]; then |
|
# if [ "$(cat ${ZI_DIR}.default)" = "${PN}-${PV}" ]; then |
|
# rm -f ${ZI_DIR}.default |
|
# fi |
|
#fi |
} | } |
| |
pkg_config() { | pkg_config() { |