/[gentoo-x86]/eclass/gnome2.eclass
Gentoo

Contents of /eclass/gnome2.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.56 - (hide annotations) (download)
Mon Aug 1 23:12:15 2005 UTC (8 years, 11 months ago) by foser
Branch: MAIN
Changes since 1.55: +5 -3 lines
die (#97761)

1 vapier 1.42 # Copyright 1999-2004 Gentoo Foundation
2 blocke 1.1 # Distributed under the terms of the GNU General Public License v2
3 foser 1.56 # $Header: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v 1.55 2005/07/23 14:04:46 foser Exp $
4 vapier 1.27 #
5     # Authors:
6     # Bruce A. Locke <blocke@shivan.org>
7 liquidx 1.36 # Spidler <spider@gentoo.org>
8 blocke 1.2
9 foser 1.45 inherit libtool gnome.org debug fdo-mime
10 blocke 1.1
11     # Gnome 2 ECLASS
12 spider 1.19
13 liquidx 1.30 G2CONF="" # extra configure opts passed to econf
14     ELTCONF="" # extra options passed to elibtoolize
15     SCROLLKEEPER_UPDATE="1" # whether to run scrollkeeper for this package
16     USE_DESTDIR="" # use make DESTDIR=${D} install rather than einstall
17 foser 1.56
18 foser 1.55 IUSE="debug"
19 foser 1.56
20 vapier 1.41 use debug && G2CONF="${G2CONF} --enable-debug=yes"
21 blocke 1.1
22 swegener 1.53 DEPEND=">=sys-apps/sed-4"
23 liquidx 1.34
24 blocke 1.9 gnome2_src_configure() {
25 foser 1.45
26 foser 1.47 # [ -n "${ELTCONF}" ] && elibtoolize ${ELTCONF}
27     elibtoolize ${ELTCONF}
28 foser 1.45
29 blocke 1.8 # doc keyword for gtk-doc
30 leonardop 1.49 G2CONF="${G2CONF} $(use_enable doc gtk-doc)"
31 blocke 1.1
32 liquidx 1.36 econf "$@" ${G2CONF} || die "./configure failure"
33 blocke 1.9
34     }
35    
36     gnome2_src_compile() {
37    
38 liquidx 1.36 gnome2_src_configure "$@"
39 blocke 1.1 emake || die "compile failure"
40    
41     }
42    
43     gnome2_src_install() {
44 azarah 1.21
45 azarah 1.22 # if this is not present, scrollkeeper-update may segfault and
46     # create bogus directories in /var/lib/
47 liquidx 1.30 dodir /var/lib/scrollkeeper
48 blocke 1.1
49 blocke 1.8 # we must delay gconf schema installation due to sandbox
50 blocke 1.3 export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1"
51    
52 liquidx 1.30 if [ -z "${USE_DESTDIR}" -o "${USE_DESTDIR}" = "0" ]; then
53 foser 1.56 einstall "scrollkeeper_localstate_dir=${D}/var/lib/scrollkeeper/" "$@" || die "einstall failed"
54 liquidx 1.30 else
55 liquidx 1.31 make DESTDIR=${D} \
56 foser 1.56 "$@" install || die "make DESTDIR install failed"
57 liquidx 1.30 fi
58 blocke 1.1
59 blocke 1.10 unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
60    
61 blocke 1.1 # manual document installation
62 liquidx 1.30 [ -n "${DOCS}" ] && dodoc ${DOCS}
63    
64     # do not keep /var/lib/scrollkeeper because:
65     # 1. scrollkeeper will get regenerated at pkg_postinst()
66     # 2. ${D}/var/lib/scrollkeeper contains only indexes for the current pkg
67     # thus it makes no sense if pkg_postinst ISN'T run for some reason.
68    
69     if [ -z "`find ${D} -name '*.omf'`" ]; then
70     export SCROLLKEEPER_UPDATE="0"
71 blocke 1.1 fi
72    
73 liquidx 1.30 # regenerate these in pkg_postinst()
74     rm -rf ${D}/var/lib/scrollkeeper
75 foser 1.45 # make sure this one doesn't get in the portage db
76     rm -fr ${D}/usr/share/applications/mimeinfo.cache
77    
78 spider 1.20 }
79    
80    
81     gnome2_gconf_install() {
82 foser 1.45
83 spider 1.20 if [ -x ${ROOT}/usr/bin/gconftool-2 ]
84     then
85 liquidx 1.30 unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
86 spider 1.20 export GCONF_CONFIG_SOURCE=`${ROOT}/usr/bin/gconftool-2 --get-default-source`
87 swegener 1.53 einfo "Installing GNOME 2 GConf schemas"
88 leonardop 1.49 grep "obj /etc/gconf/schemas" ${ROOT}/var/db/pkg/*/${PF}/CONTENTS | sed 's:obj \([^ ]*\) .*:\1:' | while read F; do
89     if [ -e "${F}" ]; then
90     # echo "DEBUG::gconf install ${F}"
91     ${ROOT}/usr/bin/gconftool-2 --makefile-install-rule ${F} 1>/dev/null
92     fi
93 spider 1.20 done
94     fi
95 foser 1.45
96 liquidx 1.32 }
97    
98 foser 1.39 gnome2_gconf_uninstall() {
99    
100     if [ -x ${ROOT}/usr/bin/gconftool-2 ]
101     then
102     unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
103     export GCONF_CONFIG_SOURCE=`${ROOT}/usr/bin/gconftool-2 --get-default-source`
104 swegener 1.53 einfo "Uninstalling GNOME 2 GConf schemas"
105 foser 1.39 cat ${ROOT}/var/db/pkg/*/${PN}-${PVR}/CONTENTS | grep "obj /etc/gconf/schemas" | sed 's:obj \([^ ]*\) .*:\1:' |while read F; do
106     # echo "DEBUG::gconf install ${F}"
107     ${ROOT}/usr/bin/gconftool-2 --makefile-uninstall-rule ${F} 1>/dev/null
108     done
109     fi
110    
111     }
112    
113 leonardop 1.54 gnome2_icon_cache_update() {
114     local updater=`which gtk-update-icon-cache`
115     if ! grep -q "obj /usr/share/icons" ${ROOT}/var/db/pkg/*/${PF}/CONTENTS \
116     || [ ! -x "$updater" ]; then
117     # Nothing to update
118     return
119     fi
120    
121     ebegin "Updating icons cache"
122    
123     local retval=0
124     for dir in \
125     $(find ${ROOT}/usr/share/icons -maxdepth 1 -mindepth 1 -type d); do
126     $updater -qf $dir || retval=$?
127     done
128    
129     eend $retval
130     }
131    
132 liquidx 1.32 gnome2_omf_fix() {
133 foser 1.45
134 liquidx 1.32 # workaround/patch against omf.make or omf-install/Makefile.in
135     # in order to remove redundant scrollkeeper-updates.
136     # - <liquidx@gentoo.org>
137 swegener 1.53
138 liquidx 1.32 local omf_makefiles
139    
140     omf_makefiles="$@"
141    
142     [ -f ${S}/omf-install/Makefile.in ] \
143     && omf_makefiles="${omf_makefiles} ${S}/omf-install/Makefile.in"
144 swegener 1.53
145 liquidx 1.34 # FIXME: does this really work? because omf.make only gets included
146     # when autoconf/automake is run. You should directly patch
147     # the Makefile.in's
148 swegener 1.53
149 liquidx 1.32 [ -f ${S}/omf.make ] \
150     && omf_makefiles="${omf_makefiles} ${S}/omf.make"
151    
152     for omf in ${omf_makefiles}; do
153     omfbase=$(basename ${omf})
154 liquidx 1.34 einfo "Fixing OMF Makefile: ${omf#${S}/}"
155     sed -i -e 's:-scrollkeeper-update.*::' ${omf}
156 liquidx 1.32 done
157 foser 1.45
158 blocke 1.1 }
159    
160 liquidx 1.30 gnome2_scrollkeeper_update() {
161 foser 1.45
162 azarah 1.22 if [ -x ${ROOT}/usr/bin/scrollkeeper-update ] && [ "${SCROLLKEEPER_UPDATE}" = "1" ]
163 blocke 1.3 then
164     echo ">>> Updating Scrollkeeper"
165 liquidx 1.30 scrollkeeper-update -q -p ${ROOT}/var/lib/scrollkeeper
166 blocke 1.1 fi
167 foser 1.45
168 blocke 1.1 }
169    
170 liquidx 1.30 gnome2_pkg_postinst() {
171 foser 1.45
172 liquidx 1.30 gnome2_gconf_install
173     gnome2_scrollkeeper_update
174 foser 1.45 fdo-mime_desktop_database_update
175     fdo-mime_mime_database_update
176 leonardop 1.54 gnome2_icon_cache_update
177 foser 1.45
178 liquidx 1.30 }
179    
180 foser 1.40 #gnome2_pkg_prerm() {
181 foser 1.39
182 foser 1.40 # gnome2_gconf_uninstall
183 foser 1.39
184 foser 1.40 #}
185 foser 1.39
186 liquidx 1.30 gnome2_pkg_postrm() {
187 foser 1.45
188 liquidx 1.30 gnome2_scrollkeeper_update
189 foser 1.45 fdo-mime_desktop_database_update
190     fdo-mime_mime_database_update
191 leonardop 1.54 gnome2_icon_cache_update
192 foser 1.45
193 liquidx 1.30 }
194    
195 foser 1.40 #EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_prerm pkg_postrm
196     EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm

  ViewVC Help
Powered by ViewVC 1.1.20