Gentoo Archives: gentoo-commits

From: "Samuli Suominen (ssuominen)" <ssuominen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: xfconf.eclass
Date: Sat, 01 Aug 2009 20:08:32
Message-Id: E1MXKsY-0007mL-2S@stork.gentoo.org
1 ssuominen 09/08/01 20:08:30
2
3 Added: xfconf.eclass
4 Log:
5 xfconf.eclass
6
7 Revision Changes Path
8 1.1 eclass/xfconf.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/xfconf.eclass?rev=1.1&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/xfconf.eclass?rev=1.1&content-type=text/plain
12
13 Index: xfconf.eclass
14 ===================================================================
15 # Copyright 1999-2009 Gentoo Foundation
16 # Distributed under the terms of the GNU General Public License v2
17 # $Header: /var/cvsroot/gentoo-x86/eclass/xfconf.eclass,v 1.1 2009/08/01 20:08:30 ssuominen Exp $
18
19 # @ECLASS: xfconf.eclass
20 # @MAINTAINER:
21 # XFCE maintainers <xfce@g.o>
22 # @BLURB: Default XFCE ebuild layout
23 # @DESCRIPTION:
24 # Default XFCE ebuild layout
25
26 # @ECLASS-VARIABLE: EAUTORECONF
27 # @DESCRIPTION:
28 # Run eautoreconf instead of elibtoolize if set "yes"
29
30 # @ECLASS-VARIABLE: EINTLTOOLIZE
31 # @DESCRIPTION:
32 # Run intltoolize --force --copy --automake if set "yes"
33
34 # @ECLASS-VARIABLE: DOCS
35 # @DESCRIPTION:
36 # Define documentation to install
37
38 # @ECLASS-VARIABLE: PATCHES
39 # @DESCRIPTION:
40 # Define patches to apply
41
42 # @ECLASS-VARIABLE: XFCONF
43 # @DESCRIPTION:
44 # Define options for econf
45
46 inherit autotools base fdo-mime gnome2-utils libtool
47
48 MY_P=${P}
49 SRC_URI="mirror://xfce/xfce-${PV}/src/${MY_P}.tar.bz2"
50
51 if [[ "${EINTLTOOLIZE}" == "yes" ]]; then
52 _xfce4_intltool="dev-util/intltool"
53 fi
54
55 if [[ "${EAUTORECONF}" == "yes" ]]; then
56 _xfce4_m4="dev-util/xfce4-dev-tools"
57 fi
58
59 RDEPEND=""
60 DEPEND="${_xfce4_intltool}
61 ${_xfce4_m4}"
62
63 unset _xfce4_intltool
64 unset _xfce4_m4
65
66 EXPF="src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm"
67 case ${EAPI:-0} in
68 2) EXPF="${EXPF} src_prepare src_configure" ;;
69 1|0) ;;
70 *) die "Unknown EAPI." ;;
71 esac
72 EXPORT_FUNCTIONS ${EXPF}
73
74 # @FUNCTION: xfconf_src_unpack
75 # @DESCRIPTION:
76 # Run base_src_util autopatch and eautoreconf or elibtoolize
77 xfconf_src_unpack() {
78 unpack ${A}
79 cd "${S}"
80 has src_prepare ${EXPF} || xfconf_src_prepare
81 }
82
83 # @FUNCTION: xfconf_src_prepare
84 # @DESCRIPTION:
85 # Run base_src_util autopatch and eautoreconf or elibtoolize
86 xfconf_src_prepare() {
87 base_src_util autopatch
88
89 if [[ "${EINTLTOOLIZE}" == "yes" ]]; then
90 intltoolize --force --copy --automake || die "intltoolize failed"
91 fi
92
93 if [[ "${EAUTORECONF}" == "yes" ]]; then
94 AT_M4DIR="/usr/share/xfce4/dev-tools/m4macros" eautoreconf
95 else
96 elibtoolize
97 fi
98 }
99
100 # @FUNCTION: xfconf_src_configure
101 # @DESCRIPTION:
102 # Run econf with opts in XFCONF variable
103 xfconf_src_configure() {
104 econf ${XFCONF}
105 }
106
107 # @FUNCTION: xfconf_src_compile
108 # @DESCRIPTION:
109 # Run econf with opts in XFCONF variable
110 xfconf_src_compile() {
111 has src_configure ${EXPF} || xfconf_src_configure
112 emake || die "emake failed"
113 }
114
115 # @FUNCTION: xfconf_src_install
116 # @DESCRIPTION:
117 # Run emake install and install documentation in DOCS variable
118 xfconf_src_install() {
119 emake DESTDIR="${D}" install || die "emake install failed"
120
121 if [[ -n ${DOCS} ]]; then
122 dodoc ${DOCS} || die "dodoc failed"
123 fi
124 }
125
126 # @FUNCTION: xfconf_pkg_preinst
127 # @DESCRIPTION:
128 # Run gnome2_icon_savelist
129 xfconf_pkg_preinst() {
130 gnome2_icon_savelist
131 }
132
133 # @FUNCTION: xfconf_pkg_postinst
134 # @DESCRIPTION:
135 # Run fdo-mime_{desktop,mime}_database_update and gnome2_icon_cache_update
136 xfconf_pkg_postinst() {
137 fdo-mime_desktop_database_update
138 fdo-mime_mime_database_update
139 gnome2_icon_cache_update
140 }
141
142 # @FUNCTION: xfconf_pkg_postrm
143 # @DESCRIPTION:
144 # Run fdo-mime_{desktop,mime}_database_update and gnome2_icon_cache_update
145 xfconf_pkg_postrm() {
146 fdo-mime_desktop_database_update
147 fdo-mime_mime_database_update
148 gnome2_icon_cache_update
149 }