summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlastair Tse <liquidx@gentoo.org>2003-04-15 10:23:40 +0000
committerAlastair Tse <liquidx@gentoo.org>2003-04-15 10:23:40 +0000
commitbe2f8881eaa9f3555fd094824fad8cf6253351a2 (patch)
tree328e5a15bf7993648bb5f35ee5a0f569c8f9048c
parentAdding dev-libs/libpcre as depend. Fixes #19345. (diff)
downloadgentoo-2-be2f8881eaa9f3555fd094824fad8cf6253351a2.tar.gz
gentoo-2-be2f8881eaa9f3555fd094824fad8cf6253351a2.tar.bz2
gentoo-2-be2f8881eaa9f3555fd094824fad8cf6253351a2.zip
* respects USE="debug"
* scrollkeeper-update now runs in postrm() * does not include /var/lib/scrollkeeper in the package * option to use make DESTDIR install rather than einstall
-rw-r--r--eclass/gnome2.eclass74
1 files changed, 43 insertions, 31 deletions
diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 9c3a78c39210..a27ad097a6c2 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v 1.29 2003/04/09 09:21:55 liquidx Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v 1.30 2003/04/15 10:23:40 liquidx Exp $
#
# Authors:
# Bruce A. Locke <blocke@shivan.org>
@@ -8,28 +8,26 @@
inherit libtool gnome.org
-if [ -n "$DEBUG" ]
-then
-inherit debug
-fi
+# accept both $DEBUG and USE="debug"
+[ -n "$DEBUG" -o -n "`use debug`" ] && inherit debug
# Gnome 2 ECLASS
ECLASS="gnome2"
INHERITED="$INHERITED $ECLASS"
-G2CONF=""
-if [ -n "$DEBUG" ]; then
- G2CONF="${G2CONF} --enable-debug=yes"
-fi
-
-ELTCONF=""
-SCROLLKEEPER_UPDATE="1"
+G2CONF="" # extra configure opts passed to econf
+ELTCONF="" # extra options passed to elibtoolize
+SCROLLKEEPER_UPDATE="1" # whether to run scrollkeeper for this package
+USE_DESTDIR="" # use make DESTDIR=${D} install rather than einstall
+[ -n "$DEBUG" -o -n "`use debug`" ] && G2CONF="${G2CONF} --enable-debug=yes"
gnome2_src_configure() {
elibtoolize ${ELTCONF}
# doc keyword for gtk-doc
- use doc && G2CONF="${G2CONF} --enable-gtk-doc" || G2CONF="${G2CONF} --disable-gtk-doc"
+ use doc \
+ && G2CONF="${G2CONF} --enable-gtk-doc" \
+ || G2CONF="${G2CONF} --disable-gtk-doc"
econf ${@} ${G2CONF} || die "./configure failure"
@@ -46,53 +44,67 @@ gnome2_src_install() {
# if this is not present, scrollkeeper-update may segfault and
# create bogus directories in /var/lib/
- [ -x ${ROOT}/bin/wc ] && dodir /var/lib/scrollkeeper
+ dodir /var/lib/scrollkeeper
# we must delay gconf schema installation due to sandbox
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1"
- einstall " scrollkeeper_localstate_dir=${D}/var/lib/scrollkeeper/ " ${@}
+ if [ -z "${USE_DESTDIR}" -o "${USE_DESTDIR}" = "0" ]; then
+ einstall " scrollkeeper_localstate_dir=${D}/var/lib/scrollkeeper/ " ${@}
+ else
+ make DESTDIR=${D} ${@} install
+ fi
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
# manual document installation
- if [ -n "${DOCS}" ]
- then
- dodoc ${DOCS}
+ [ -n "${DOCS}" ] && dodoc ${DOCS}
+
+ # do not keep /var/lib/scrollkeeper because:
+ # 1. scrollkeeper will get regenerated at pkg_postinst()
+ # 2. ${D}/var/lib/scrollkeeper contains only indexes for the current pkg
+ # thus it makes no sense if pkg_postinst ISN'T run for some reason.
+
+ if [ -z "`find ${D} -name '*.omf'`" ]; then
+ export SCROLLKEEPER_UPDATE="0"
fi
- # if empty, remove
- [ -x ${ROOT}/bin/wc ] && [ `ls -al ${D}/var/lib/scrollkeeper | wc -l` -eq 3 ] && \
- rm -rf ${D}/var/lib/scrollkeeper
- # only update scrollkeeper if this package needs it
- [ ! -d ${D}/var/lib/scrollkeeper ] && SCROLLKEEPER_UPDATE="0"
+ # regenerate these in pkg_postinst()
+ rm -rf ${D}/var/lib/scrollkeeper
}
gnome2_gconf_install() {
if [ -x ${ROOT}/usr/bin/gconftool-2 ]
then
- unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
+ unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
export GCONF_CONFIG_SOURCE=`${ROOT}/usr/bin/gconftool-2 --get-default-source`
einfo "installing gnome2 gconf schemas"
cat ${ROOT}/var/db/pkg/*/${PN}-${PVR}/CONTENTS | grep "obj /etc/gconf/schemas" | sed 's:obj \([^ ]*\) .*:\1:' |while read F; do
echo "DEBUG::gconf install ${F}"
- ${ROOT}/usr/bin/gconftool-2 --makefile-install-rule ${F}
+ ${ROOT}/usr/bin/gconftool-2 --makefile-install-rule ${F}
done
fi
- # schema installation
}
-gnome2_pkg_postinst() {
- gnome2_gconf_install
-
+gnome2_scrollkeeper_update() {
if [ -x ${ROOT}/usr/bin/scrollkeeper-update ] && [ "${SCROLLKEEPER_UPDATE}" = "1" ]
then
echo ">>> Updating Scrollkeeper"
- scrollkeeper-update -p ${ROOT}/var/lib/scrollkeeper
+ scrollkeeper-update -q -p ${ROOT}/var/lib/scrollkeeper
fi
}
-EXPORT_FUNCTIONS src_compile src_install pkg_postinst
+gnome2_pkg_postinst() {
+ gnome2_gconf_install
+ gnome2_scrollkeeper_update
+}
+
+gnome2_pkg_postrm() {
+ gnome2_scrollkeeper_update
+}
+
+
+EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm