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

Contents of /eclass/gnome2.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.64 - (hide annotations) (download)
Fri Mar 17 14:43:32 2006 UTC (8 years, 5 months ago) by allanonjl
Branch: MAIN
Changes since 1.63: +2 -2 lines
remove the sneaky doc flag that ended up in the eclass during migration. see #107962

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 allanonjl 1.64 # $Header: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v 1.63 2006/03/15 00:38:40 allanonjl Exp $
4 blocke 1.2
5 allanonjl 1.63 # GNOME 2 ECLASS
6     inherit libtool gnome.org debug fdo-mime eutils
7 blocke 1.1
8 allanonjl 1.63 # Extra configure opts passed to econf
9     G2CONF=${G2CONF:=""}
10 spider 1.19
11 allanonjl 1.63 # Extra options passed to elibtoolize
12     ELTCONF=${ELTCONF:=""}
13 leonardop 1.59
14 allanonjl 1.63 # Should we use EINSTALL instead of DESTDIR
15     USE_EINSTALL=${USE_EINSTALL:=""}
16 leonardop 1.59
17 allanonjl 1.63 # Run scrollkeeper for this package?
18     SCROLLKEEPER_UPDATE=${SCROLLKEEPER_UPDATE:="1"}
19 leonardop 1.59
20 allanonjl 1.63 # Where to put scrollkeeper data lives
21     SCROLLKEEPER_DIR=${SCROLLKEEPER_DIR:="/var/lib/scrollkeeper"}
22 leonardop 1.59
23 allanonjl 1.63 # Path to scrollkeeper-update
24     SCROLLKEEPER_UPDATE_BIN=${SCROLLKEEPER_UPDATE_BIN:="${ROOT}/usr/bin/scrollkeeper-update"}
25 foser 1.56
26 allanonjl 1.63 # Path to gconftool-2
27     GCONFTOOL_BIN=${GCONFTOOL_BIN:="${ROOT}/usr/bin/gconftool-2"}
28 foser 1.56
29 allanonjl 1.64 IUSE="debug"
30 blocke 1.1
31 allanonjl 1.63 DEPEND=">=sys-apps/sed-4
32     sys-apps/findutils"
33 liquidx 1.34
34 allanonjl 1.63 gnome2_src_unpack() {
35     unpack ${A}
36     cd ${S}
37 foser 1.45
38 allanonjl 1.63 # Prevent scrollkeeper access violations
39     gnome2_omf_fix
40     }
41 foser 1.45
42 allanonjl 1.63 gnome2_src_configure() {
43     # Update the GNOME configuration options
44 leonardop 1.59 use debug && G2CONF="${G2CONF} --enable-debug=yes"
45 leonardop 1.49 G2CONF="${G2CONF} $(use_enable doc gtk-doc)"
46 blocke 1.1
47 allanonjl 1.63 # Run libtoolize
48     elibtoolize ${ELTCONF}
49 blocke 1.9
50 allanonjl 1.63 # GST_REGISTRY is to work around gst-inspect trying to read/write /root
51     GST_REGISTRY="${S}/registry.xml" econf "$@" ${G2CONF} || die "configure failed"
52 blocke 1.9 }
53    
54     gnome2_src_compile() {
55 liquidx 1.36 gnome2_src_configure "$@"
56 blocke 1.1 emake || die "compile failure"
57     }
58    
59     gnome2_src_install() {
60 azarah 1.22 # if this is not present, scrollkeeper-update may segfault and
61     # create bogus directories in /var/lib/
62 allanonjl 1.63 dodir "${SCROLLKEEPER_DIR}"
63 blocke 1.1
64 blocke 1.8 # we must delay gconf schema installation due to sandbox
65 blocke 1.3 export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1"
66    
67 allanonjl 1.63 debug-print "You are testing with DESTDIR by default - AllanonJL"
68     if [[ -z "${USE_EINSTALL}" || "${USE_EINSTALL}" = "0" ]]; then
69     make DESTDIR=${D} "$@" install || die "install failed"
70 liquidx 1.30 else
71 allanonjl 1.63 einstall "scrollkeeper_localstate_dir=${D}${SCROLLKEEPER_DIR} " "$@" || die "einstall failed"
72 liquidx 1.30 fi
73 blocke 1.1
74 blocke 1.10 unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
75    
76 allanonjl 1.63 # Manual document installation
77     [[ -n "${DOCS}" ]] && dodoc ${DOCS}
78 liquidx 1.30
79 allanonjl 1.63 # Do not keep /var/lib/scrollkeeper because:
80 liquidx 1.30 # 1. scrollkeeper will get regenerated at pkg_postinst()
81     # 2. ${D}/var/lib/scrollkeeper contains only indexes for the current pkg
82     # thus it makes no sense if pkg_postinst ISN'T run for some reason.
83    
84 allanonjl 1.63 if [[ -z "$(find ${D} -name '*.omf')" ]]; then
85 liquidx 1.30 export SCROLLKEEPER_UPDATE="0"
86 blocke 1.1 fi
87    
88 allanonjl 1.63 # Regenerate these in pkg_postinst()
89     rm -rf "${D}${SCROLLKEEPER_DIR}"
90 foser 1.45
91 allanonjl 1.63 # Make sure this one doesn't get in the portage db
92     rm -fr "${D}/usr/share/applications/mimeinfo.cache"
93 spider 1.20 }
94    
95    
96     gnome2_gconf_install() {
97 allanonjl 1.63 if [[ -x ${GCONFTOOL_BIN} ]]; then
98     # We are ready to install the GCONF Scheme now
99     unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
100     export GCONF_CONFIG_SOURCE=$(${GCONFTOOL_BIN} --get-default-source)
101 foser 1.45
102 swegener 1.53 einfo "Installing GNOME 2 GConf schemas"
103 allanonjl 1.63
104     local contents="${ROOT}/var/db/pkg/*/${PN}-${PVR}/CONTENTS"
105    
106     for F in $(grep "obj /etc/gconf/schemas" ${contents} | sed 's:obj \([^ ]*\) .*:\1:' ); do
107     if [[ -e "${F}" ]]; then
108 leonardop 1.49 # echo "DEBUG::gconf install ${F}"
109 allanonjl 1.63 ${GCONFTOOL_BIN} --makefile-install-rule ${F} 1>/dev/null
110 leonardop 1.49 fi
111 spider 1.20 done
112     fi
113 liquidx 1.32 }
114    
115 foser 1.39 gnome2_gconf_uninstall() {
116 allanonjl 1.63 if [[ -x ${GCONFTOOL_BIN} ]]; then
117     unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
118     export GCONF_CONFIG_SOURCE=$(${GCONFTOOL_BIN} --get-default-source)
119 foser 1.39
120 swegener 1.53 einfo "Uninstalling GNOME 2 GConf schemas"
121 allanonjl 1.63
122     local contents="${ROOT}/var/db/pkg/*/${PN}-${PVR}/CONTENTS"
123    
124     for F in $(grep "obj /etc/gconf/schemas" ${contents} | sed 's:obj \([^ ]*\) .*:\1:' ); do
125 foser 1.39 # echo "DEBUG::gconf install ${F}"
126 allanonjl 1.63 ${GCONFTOOL_BIN} --makefile-uninstall-rule ${F} 1>/dev/null
127 foser 1.39 done
128     fi
129     }
130    
131 leonardop 1.54 gnome2_icon_cache_update() {
132 allanonjl 1.63 local updater=$(type -p gtk-update-icon-cache 2> /dev/null)
133    
134     ebegin "Updating icons cache"
135    
136     if [[ ! -x ${updater} ]] ; then
137     debug-print "${updater} is not executable"
138    
139     # We failed to run
140     eend 1
141    
142 leonardop 1.54 return
143     fi
144    
145 allanonjl 1.63 if ! grep -q "obj /usr/share/icons" ${ROOT}/var/db/pkg/*/${PF}/CONTENTS
146     then
147     debug-print "No items to update"
148    
149     # We are done successfully
150     eend 0
151    
152     return
153     fi
154 leonardop 1.54
155     local retval=0
156 allanonjl 1.63 local fails=( )
157    
158     for dir in $(find ${ROOT}/usr/share/icons -maxdepth 1 -mindepth 1 -type d)
159     do
160     if [[ -f "${dir}/index.theme" ]] ; then
161     local rv=0
162    
163     ${updater} -qf ${dir}
164     rv=$?
165    
166     if [[ ! $rv -eq 0 ]] ; then
167     debug-print "Updating cache failed on ${dir}"
168    
169     # Add to the list of failures
170     fails[$(( ${#fails[@]} + 1 ))]=$dir
171    
172     retval=2
173     fi
174 leonardop 1.62 fi
175 leonardop 1.54 done
176    
177 allanonjl 1.63 eend ${retval}
178    
179     for (( i = 0 ; i < ${#fails[@]} ; i++ )) ; do
180     eerror "Failed to update cache with icon ${fails[i]}"
181     done
182 leonardop 1.54 }
183    
184 liquidx 1.32 gnome2_omf_fix() {
185     # workaround/patch against omf.make or omf-install/Makefile.in
186     # in order to remove redundant scrollkeeper-updates.
187     # - <liquidx@gentoo.org>
188 swegener 1.53
189 allanonjl 1.63 local omf_makefiles filename
190 liquidx 1.32
191     omf_makefiles="$@"
192    
193 allanonjl 1.63 if [[ -f ${S}/omf-install/Makefile.in ]] ; then
194     omf_makefiles="${omf_makefiles} ${S}/omf-install/Makefile.in"
195     fi
196 swegener 1.53
197 liquidx 1.34 # FIXME: does this really work? because omf.make only gets included
198     # when autoconf/automake is run. You should directly patch
199     # the Makefile.in's
200 swegener 1.53
201 allanonjl 1.63 if [[ -f ${S}/omf.make ]] ; then
202     omf_makefiles="${omf_makefiles} ${S}/omf.make"
203     fi
204 liquidx 1.32
205 allanonjl 1.63 # testing fixing of all makefiles found
206     for filename in $(find ./ -name "Makefile.in" -o -name "Makefile.am") ; do
207     omf_makefiles="${omf_makefiles} ${filename}"
208     done
209    
210 leonardop 1.61 ebegin "Fixing OMF Makefiles"
211 allanonjl 1.63
212 leonardop 1.61 local retval=0
213 allanonjl 1.63 local fails=( )
214    
215     for omf in ${omf_makefiles} ; do
216     local rv=0
217    
218     sed -i -e 's:scrollkeeper-update:true:' ${omf}
219     retval=$?
220    
221     if [[ ! $rv -eq 0 ]] ; then
222     debug-print "updating of ${omf} failed"
223    
224     # Add to the list of failures
225     fails[$(( ${#fails[@]} + 1 ))]=$omf
226    
227     retval=2
228     fi
229 liquidx 1.32 done
230 allanonjl 1.63
231 leonardop 1.61 eend $retval
232 foser 1.45
233 allanonjl 1.63 for (( i = 0 ; i < ${#fails[@]} ; i++ )) ; do
234     eerror "Failed to update OMF Makefile ${fails[i]}"
235     done
236 blocke 1.1 }
237    
238 liquidx 1.30 gnome2_scrollkeeper_update() {
239 allanonjl 1.63 if [[ -x ${SCROLLKEEPER_UPDATE_BIN} && "${SCROLLKEEPER_UPDATE}" = "1" ]]
240 blocke 1.3 then
241 leonardop 1.60 einfo "Updating scrollkeeper database ..."
242 allanonjl 1.63 ${SCROLLKEEPER_UPDATE_BIN} -q -p ${ROOT}${SCROLLKEEPER_DIR}
243 blocke 1.1 fi
244     }
245    
246 liquidx 1.30 gnome2_pkg_postinst() {
247     gnome2_gconf_install
248     gnome2_scrollkeeper_update
249 foser 1.45 fdo-mime_desktop_database_update
250     fdo-mime_mime_database_update
251 leonardop 1.54 gnome2_icon_cache_update
252 liquidx 1.30 }
253    
254 foser 1.40 #gnome2_pkg_prerm() {
255     # gnome2_gconf_uninstall
256     #}
257 foser 1.39
258 liquidx 1.30 gnome2_pkg_postrm() {
259     gnome2_scrollkeeper_update
260 foser 1.45 fdo-mime_desktop_database_update
261     fdo-mime_mime_database_update
262 leonardop 1.54 gnome2_icon_cache_update
263 liquidx 1.30 }
264    
265 allanonjl 1.63 EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst pkg_postrm

  ViewVC Help
Powered by ViewVC 1.1.20