summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Shoemaker <kutsuya@gentoo.org>2003-02-26 07:14:18 +0000
committerJason Shoemaker <kutsuya@gentoo.org>2003-02-26 07:14:18 +0000
commit6d1d06501881e89f78c5260a4248f77bc5b7b3e2 (patch)
tree55fb19047c3019c85839b1e012c90b42d86227cc /eclass/zproduct.eclass
parentFixed dependencies and made very very minor changes to zope-config script. (diff)
downloadgentoo-2-6d1d06501881e89f78c5260a4248f77bc5b7b3e2.tar.gz
gentoo-2-6d1d06501881e89f78c5260a4248f77bc5b7b3e2.tar.bz2
gentoo-2-6d1d06501881e89f78c5260a4248f77bc5b7b3e2.zip
Fixed dependencies. Added functions to preserve certain .txt files from
do_doc. Changed a few einfo's to be more informative.
Diffstat (limited to 'eclass/zproduct.eclass')
-rw-r--r--eclass/zproduct.eclass73
1 files changed, 58 insertions, 15 deletions
diff --git a/eclass/zproduct.eclass b/eclass/zproduct.eclass
index 7a73f0ab989c..c3f25d1d77d8 100644
--- a/eclass/zproduct.eclass
+++ b/eclass/zproduct.eclass
@@ -1,34 +1,69 @@
# Copyright 2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# Author: Jason Shoemaker <kutsuya@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/eclass/zproduct.eclass,v 1.2 2003/02/18 09:00:45 carpaski Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/zproduct.eclass,v 1.3 2003/02/26 07:14:18 kutsuya Exp $
# This eclass is designed to streamline the construction of
# ebuilds for new zope products
ECLASS=zproduct
INHERITED="${INHERITED} ${ECLASS}"
-EXPORT_FUNCTIONS src_install pkg_prerm pkg_postinst
+EXPORT_FUNCTIONS src_install pkg_prerm pkg_postinst dottxt_protect dottxt_unprotect
-[ -z "$DESCRIPTION" ] && DESCRIPTION="Define me."
+DESCRIPTION="This is a zope product."
HOMEPAGE=""
SRC_URI=""
DEPEND=""
-RDEPEND=">=net-www/zope-2.6.0-r2"
+RDEPEND=">=net-www/zope-2.6.0-r2
+ app-admin/zprod-manager"
IUSE=""
SLOT="0"
KEYWORDS="x86"
S=${WORKDIR}
-ZI_DIR="/var/lib/zope/"
-ZP_DIR="/usr/share/zproduct"
+ZI_DIR="${ROOT}/var/lib/zope/"
+ZP_DIR="${ROOT}/usr/share/zproduct"
DOT_ZFOLDER_FPATH="${ZP_DIR}/${PF}/.zfolder.lst"
+# Temporarily rename .txt files that we don't want ripped out by do_doc.
+# Parameters:
+# $1 = list of .txt files(without .txt) to protect from do_docs
+# (can be empty)
+# $2 = src
+# Returns: a list of path(s) of where item should go, along with tmp file name
+
+dottxt_protect()
+{
+ local RESULT=0
+ local LIST_MKTEMP=""
+
+ [ -z "$1" ] && return
+ for N in $1 ; do
+ if [ -f "${2}/${N}" ] ; then
+ TMPFILE=$(mktemp ${S}/${N}.XXXXXXXXXX) || die 'mktemp error'
+ LIST_MKTEMP="${2}/$(basename $TMPFILE) $LIST_MKTEMP"
+ mv -f ${2}/$N $TMPFILE
+ fi
+ done
+ echo "$LIST_MKTEMP"
+}
+
+# Parameters:
+# $1 = list of tmp files(produced by dottxt_protect)
+
+dottxt_unprotect()
+{
+ local N=""
+ for N in $1 ; do
+ local SRC=${S}/$(basename $N)
+ mv -f ${SRC} ${N%.*}
+ done
+}
+
zproduct_src_install()
{
- local N=
## Assume that folders or files that shouldn't be installed
- # have been already been removed.
+ # in the zproduct directory have been already been removed.
## Assume $S set to the parent directory of the zproduct(s).
debug-print-function ${FUNCNAME} ${*}
@@ -50,18 +85,26 @@ zproduct_src_install()
do_docs)
#*Moves txt docs
debug-print-section do_docs
- docinto /
- dodoc *.txt
+ LIST_OUTER="$(dottxt_protect "refresh.txt $DOTTXT_PROTECT" ${S})"
+ docinto /
+ dodoc *.txt >/dev/null
rm -f *.txt
+ dodoc *.txt.* >/dev/null
+ rm -f *.txt.*
+ dottxt_unprotect "$LIST_OUTER"
for N in ${ZPROD_LIST} ; do
+ LIST_INNER="$(dottxt_protect "refresh.txt $DOTTXT_PROTECT" ${S}/${N})"
docinto ${N}
- dodoc ${N}/*.txt
+ dodoc ${N}/*.txt >/dev/null
rm -f ${N}/*.txt
+ dodoc ${N}/*.txt.* >/dev/null
+ rm -f ${N}/*.txt.*
if [ -d "${N}/docs" ] ; then
docinto ${N}/docs
dodoc ${N}/docs/*
rm -Rf ${N}/docs
fi
+ dottxt_unprotect "$LIST_INNER" $N
done ;;
do_install)
debug-print-section do_install
@@ -84,8 +127,8 @@ zproduct_pkg_postinst()
#*Use zprod-update to install this zproduct to the default zinstance.
debug-print-function ${FUNCNAME} ${*}
chown -R zope:root ${ZP_DIR}/${PF}
- einfo ">>> Installing zproduct into the .default zinstance..."
- /usr/sbin/zprod-update add ${ZP_DIR}/${PF}
+ einfo ">>> Installing ${PF} into the \"$(zope-config --zidef-get)\" zinstance..."
+ ${ROOT}/usr/sbin/zprod-manager add ${ZP_DIR}/${PF}
}
zproduct_pkg_prerm()
@@ -97,7 +140,7 @@ zproduct_pkg_prerm()
ZINST_LST=$(ls /var/lib/zope/)
if [ "${ZINST_LST}" ] ; then
for N in ${ZINST_LST} ; do
- /usr/sbin/zprod-update del ${ZP_DIR}/${PF} ${ZI_DIR}${N}
+ ${ROOT}/usr/sbin/zprod-manager del ${ZP_DIR}/${PF} ${ZI_DIR}${N}
done
fi
}
@@ -107,5 +150,5 @@ zproduct_pkg_prerm()
zproduct_pkg_config()
{
einfo "To add zproducts to other zinstances execute:"
- einfo "\tzprod-update add"
+ einfo "\tzprod-manager add"
}