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

Contents of /eclass/gnome2.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.90 - (hide annotations) (download)
Tue Dec 7 06:20:40 2010 UTC (4 years ago) by eva
Branch: MAIN
Changes since 1.89: +3 -2 lines
list supported EAPI explicitely

1 leonardop 1.78 # Copyright 1999-2006 Gentoo Foundation
2 blocke 1.1 # Distributed under the terms of the GNU General Public License v2
3 eva 1.90 # $Header: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v 1.89 2010/12/07 06:19:54 eva Exp $
4 leonardop 1.77
5     #
6     # gnome2.eclass
7     #
8     # Exports portage base functions used by ebuilds written for packages using the
9 leonardop 1.78 # GNOME framework. For additional functions, see gnome2-utils.eclass.
10 leonardop 1.77 #
11     # Maintained by Gentoo's GNOME herd <gnome@gentoo.org>
12     #
13    
14 blocke 1.2
15 compnerd 1.80 inherit fdo-mime libtool gnome.org gnome2-utils
16 blocke 1.1
17 dang 1.86 case "${EAPI:-0}" in
18     0|1)
19     EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm
20     ;;
21 eva 1.90 2|3)
22 dang 1.86 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
23     ;;
24 eva 1.90 *) die "EAPI=${EAPI} is not supported" ;;
25 dang 1.86 esac
26 leonardop 1.77
27 allanonjl 1.63 # Extra configure opts passed to econf
28 compnerd 1.81 G2CONF=${G2CONF:-""}
29 spider 1.19
30 allanonjl 1.63 # Extra options passed to elibtoolize
31 compnerd 1.81 ELTCONF=${ELTCONF:-""}
32 leonardop 1.59
33 allanonjl 1.63 # Should we use EINSTALL instead of DESTDIR
34 compnerd 1.81 USE_EINSTALL=${USE_EINSTALL:-""}
35 leonardop 1.59
36 allanonjl 1.63 # Run scrollkeeper for this package?
37 compnerd 1.81 SCROLLKEEPER_UPDATE=${SCROLLKEEPER_UPDATE:-"1"}
38 leonardop 1.59
39    
40 foser 1.56
41 allanonjl 1.71 if [[ ${GCONF_DEBUG} != "no" ]]; then
42     IUSE="debug"
43     fi
44 blocke 1.1
45 leonardop 1.78
46 liquidx 1.34
47 allanonjl 1.63 gnome2_src_unpack() {
48     unpack ${A}
49 eva 1.83 cd "${S}"
50 dang 1.86 has ${EAPI:-0} 0 1 && gnome2_src_prepare
51     }
52 foser 1.45
53 dang 1.86 gnome2_src_prepare() {
54 allanonjl 1.63 # Prevent scrollkeeper access violations
55     gnome2_omf_fix
56 compnerd 1.81
57     # Run libtoolize
58     elibtoolize ${ELTCONF}
59 allanonjl 1.63 }
60 foser 1.45
61 allanonjl 1.63 gnome2_src_configure() {
62     # Update the GNOME configuration options
63 allanonjl 1.72 if [[ ${GCONF_DEBUG} != 'no' ]] ; then
64     if use debug ; then
65     G2CONF="${G2CONF} --enable-debug=yes"
66     fi
67 allanonjl 1.71 fi
68 compnerd 1.76
69     # Prevent a QA warning
70     if hasq doc ${IUSE} ; then
71     G2CONF="${G2CONF} $(use_enable doc gtk-doc)"
72     fi
73 blocke 1.1
74 leonardop 1.77 # Avoid sandbox violations caused by misbehaving packages (bug #128289)
75 dang 1.82 addwrite "/root/.gnome2"
76 allanonjl 1.70
77 allanonjl 1.63 # GST_REGISTRY is to work around gst-inspect trying to read/write /root
78     GST_REGISTRY="${S}/registry.xml" econf "$@" ${G2CONF} || die "configure failed"
79 blocke 1.9 }
80    
81     gnome2_src_compile() {
82 dang 1.86 has ${EAPI:-0} 0 1 && gnome2_src_configure "$@"
83 blocke 1.1 emake || die "compile failure"
84     }
85    
86     gnome2_src_install() {
87 abcd 1.87 has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
88 azarah 1.22 # if this is not present, scrollkeeper-update may segfault and
89     # create bogus directories in /var/lib/
90 leonardop 1.77 local sk_tmp_dir="/var/lib/scrollkeeper"
91 eva 1.89 dodir "${sk_tmp_dir}" || die "dodir failed"
92 blocke 1.1
93 blocke 1.8 # we must delay gconf schema installation due to sandbox
94 blocke 1.3 export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1"
95    
96 allanonjl 1.63 if [[ -z "${USE_EINSTALL}" || "${USE_EINSTALL}" = "0" ]]; then
97 leonardop 1.77 debug-print "Installing with 'make install'"
98 abcd 1.87 emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install || die "install failed"
99 liquidx 1.30 else
100 leonardop 1.77 debug-print "Installing with 'einstall'"
101 abcd 1.87 einstall "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" || die "einstall failed"
102 liquidx 1.30 fi
103 blocke 1.1
104 blocke 1.10 unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
105    
106 allanonjl 1.63 # Manual document installation
107 eva 1.89 if [[ -n "${DOCS}" ]]; then
108     dodoc ${DOCS} || die "dodoc failed"
109     fi
110 liquidx 1.30
111 allanonjl 1.63 # Do not keep /var/lib/scrollkeeper because:
112 leonardop 1.77 # 1. The scrollkeeper database is regenerated at pkg_postinst()
113 abcd 1.87 # 2. ${ED}/var/lib/scrollkeeper contains only indexes for the current pkg
114 liquidx 1.30 # thus it makes no sense if pkg_postinst ISN'T run for some reason.
115 remi 1.84 if [[ -z "$(find "${D}" -name '*.omf')" ]]; then
116 liquidx 1.30 export SCROLLKEEPER_UPDATE="0"
117 blocke 1.1 fi
118 abcd 1.87 rm -rf "${ED}${sk_tmp_dir}"
119 foser 1.45
120 allanonjl 1.63 # Make sure this one doesn't get in the portage db
121 abcd 1.87 rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
122 spider 1.20 }
123    
124 remi 1.84 gnome2_pkg_preinst() {
125     gnome2_gconf_savelist
126 remi 1.85 gnome2_icon_savelist
127 eva 1.88 gnome2_schemas_savelist
128 remi 1.84 }
129    
130 liquidx 1.30 gnome2_pkg_postinst() {
131     gnome2_gconf_install
132 foser 1.45 fdo-mime_desktop_database_update
133     fdo-mime_mime_database_update
134 leonardop 1.54 gnome2_icon_cache_update
135 eva 1.88 gnome2_schemas_update
136 swegener 1.79
137 leonardop 1.78 if [[ "${SCROLLKEEPER_UPDATE}" = "1" ]]; then
138     gnome2_scrollkeeper_update
139     fi
140 liquidx 1.30 }
141    
142 foser 1.40 #gnome2_pkg_prerm() {
143     # gnome2_gconf_uninstall
144     #}
145 foser 1.39
146 liquidx 1.30 gnome2_pkg_postrm() {
147 foser 1.45 fdo-mime_desktop_database_update
148     fdo-mime_mime_database_update
149 leonardop 1.54 gnome2_icon_cache_update
150 eva 1.88 gnome2_schemas_update --uninstall
151 leonardop 1.78
152     if [[ "${SCROLLKEEPER_UPDATE}" = "1" ]]; then
153     gnome2_scrollkeeper_update
154     fi
155 liquidx 1.30 }
156    
157 remi 1.84 # pkg_prerm

  ViewVC Help
Powered by ViewVC 1.1.20