/[gentoo-x86]/app-office/mozilla-sunbird/mozilla-sunbird-0.8.ebuild
Gentoo

Contents of /app-office/mozilla-sunbird/mozilla-sunbird-0.8.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Thu Nov 27 09:49:58 2008 UTC (5 years, 7 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Add missing it langpack, bug #248341
(Portage version: 2.1.4.5)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-office/mozilla-sunbird/mozilla-sunbird-0.8.ebuild,v 1.6 2008/07/18 11:56:20 aballier Exp $
4
5 WANT_AUTOCONF="2.1"
6
7 inherit flag-o-matic toolchain-funcs eutils mozconfig-2 mozilla-launcher makeedit multilib fdo-mime mozextension autotools
8
9 PATCH="${P}-patches-0.1"
10 LANGS="ca cs da de en-US es-AR es-ES eu fr ga-IE hu it ja ka ko lt mk mn nb-NO nl pa-IN pl pt-BR pt-PT ru sk sl sv-SE tr uk zh-CN"
11 NOSHORTLANGS="es-AR pt-BR zh-TW"
12
13 MY_PN="${PN/mozilla-}"
14 MY_P="${MY_PN}-${PV}"
15 DESCRIPTION="The Mozilla Sunbird Calendar"
16 HOMEPAGE="http://www.mozilla.org/projects/calendar/sunbird.html"
17 IUSE="bindist"
18 SRC_URI="http://releases.mozilla.org/pub/mozilla.org/calendar/${MY_PN}/releases/${PV}/source/lightning-${MY_P}-source.tar.bz2
19 mirror://gentoo/${PATCH}.tar.bz2"
20
21 # These are in
22 #
23 # http://releases.mozilla.org/pub/mozilla.org/calendar/sunbird/releases/${PV}/langpacks/
24 #
25 # for i in $LANGS $SHORTLANGS; do wget $i.xpi -O ${P}-$i.xpi; done
26 for X in ${LANGS} ; do
27 if [ "${X}" != "en" ] && [ "${X}" != "en-US" ]; then
28 SRC_URI="${SRC_URI}
29 linguas_${X/-/_}? ( http://dev.gentooexperimental.org/~armin76/dist/${P}-xpi/${P}-${X}.xpi )"
30 fi
31 IUSE="${IUSE} linguas_${X/-/_}"
32 # english is handled internally
33 if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
34 if [ "${X}" != "en-US" ]; then
35 SRC_URI="${SRC_URI}
36 linguas_${X%%-*}? ( http://dev.gentooexperimental.org/~armin76/dist/${P}-xpi/${P}-${X}.xpi )"
37 fi
38 IUSE="${IUSE} linguas_${X%%-*}"
39 fi
40 done
41
42 KEYWORDS="amd64 ~ppc ~ppc64 x86 ~x86-fbsd"
43 SLOT="0"
44 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
45
46 RDEPEND=">=www-client/mozilla-launcher-1.55
47 >=dev-libs/nss-3.11.7"
48
49 S="${WORKDIR}/mozilla"
50
51 # Needed by src_compile() and src_install().
52 # Would do in pkg_setup but that loses the export attribute, they
53 # become pure shell variables.
54 export MOZ_CO_PROJECT=calendar
55 export BUILD_OFFICIAL=1
56 export MOZILLA_OFFICIAL=1
57
58 linguas() {
59 local LANG SLANG
60 for LANG in ${LINGUAS}; do
61 if has ${LANG} en en_US; then
62 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
63 continue
64 elif has ${LANG} ${LANGS//-/_}; then
65 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
66 continue
67 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
68 for X in ${LANGS}; do
69 if [[ "${X}" == "${LANG}-"* ]] && \
70 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
71 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
72 continue 2
73 fi
74 done
75 fi
76 ewarn "Sorry, but ${PN} does not support the ${LANG} LINGUA"
77 done
78 }
79
80 pkg_setup(){
81 if ! built_with_use x11-libs/cairo X; then
82 eerror "Cairo is not built with X useflag."
83 eerror "Please add 'X' to your USE flags, and re-emerge cairo."
84 die "Cairo needs X"
85 fi
86
87 if ! built_with_use --missing true x11-libs/pango X; then
88 eerror "Pango is not built with X useflag."
89 eerror "Please add 'X' to your USE flags, and re-emerge pango."
90 die "Pango needs X"
91 fi
92
93 if ! use bindist; then
94 elog "You are enabling official branding. You may not redistribute this build"
95 elog "to any users on your network or the internet. Doing so puts yourself into"
96 elog "a legal problem with mozilla foundation"
97 fi
98
99 use moznopango && warn_mozilla_launcher_stub
100 }
101
102 src_unpack() {
103 unpack ${A%bz2*}bz2
104
105 linguas
106 for X in ${linguas}; do
107 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
108 done
109 if [[ ${linguas} != "" && ${linguas} != "en" ]]; then
110 einfo "Selected language packs (first will be default): ${linguas}"
111 fi
112
113 # Apply our patches
114 cd "${S}" || die "cd failed"
115 EPATCH_SUFFIX="patch" \
116 EPATCH_FORCE="yes" \
117 epatch "${WORKDIR}"/patch
118
119 eautoreconf
120 }
121
122 src_compile() {
123 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
124
125 ####################################
126 #
127 # mozconfig, CFLAGS and CXXFLAGS setup
128 #
129 ####################################
130
131 mozconfig_init
132 mozconfig_config
133
134 mozconfig_annotate '' --enable-application=calendar
135 mozconfig_annotate '' --enable-extensions=default
136 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
137 mozconfig_annotate '' --with-system-nss
138 mozconfig_annotate '' --with-system-nspr
139
140 if ! use bindist; then
141 mozconfig_annotate '' --enable-official-branding
142 fi
143
144 # Finalize and report settings
145 mozconfig_final
146
147 # hardened GCC uses -fstack-protector-all by default, which breaks us
148 gcc-specs-ssp && append-flags -fno-stack-protector-all
149 replace-flags -fstack-protector-all -fstack-protector
150
151 ####################################
152 #
153 # Configure and build
154 #
155 ####################################
156
157 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
158 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
159 econf || die
160
161 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
162 # to econf, but the quotes cause configure to fail.
163 sed -i -e \
164 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
165 "${S}"/config/autoconf.mk \
166 "${S}"/nsprpub/config/autoconf.mk \
167 "${S}"/xpfe/global/buildconfig.html
168
169 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
170 # requirements while compiling
171 edit_makefiles
172
173 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
174 emake ${jobs} || die
175 }
176
177 pkg_preinst() {
178 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
179
180 einfo "Removing old installs though some really ugly code. It potentially"
181 einfo "eliminates any problems during the install, however suggestions to"
182 einfo "replace this are highly welcome. Send comments and suggestions to"
183 einfo "mozilla@gentoo.org."
184 rm -rf "${ROOT}"/"${MOZILLA_FIVE_HOME}"
185 }
186
187 src_install() {
188 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
189
190 # Most of the installation happens here
191 dodir ${MOZILLA_FIVE_HOME}
192 cp -RL "${S}"/dist/bin/* "${D}"${MOZILLA_FIVE_HOME} || die "Copy of files failed"
193 touch "${D}"${MOZILLA_FIVE_HOME}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.manifest
194 touch "${D}"${MOZILLA_FIVE_HOME}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
195
196 linguas
197 for X in ${linguas}; do
198 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
199 done
200
201 local LANG=${linguas%% *}
202 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
203 einfo "Setting default locale to ${LANG}"
204 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
205 ${MOZILLA_FIVE_HOME}/defaults/pref/sunbird.js \
206 ${MOZILLA_FIVE_HOME}/defaults/pref/sunbird-l10n.js || \
207 die "sed failed to change locale"
208 fi
209
210 # Create /usr/bin/sunbird
211 install_mozilla_launcher_stub sunbird ${MOZILLA_FIVE_HOME}
212
213 # Install icon and .desktop for menu entry
214 if ! use bindist; then
215 doicon "${FILESDIR}"/icon/${PN}-icon.png
216 domenu "${FILESDIR}"/icon/${PN}.desktop
217 else
218 doicon "${FILESDIR}"/icon/${PN}-unbranded-icon.png
219 newmenu "${FILESDIR}"/icon/${PN}-unbranded.desktop \
220 ${PN}.desktop
221
222 fi
223 }
224
225 pkg_postinst() {
226 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
227
228 # This should be called in the postinst and postrm of all the
229 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
230 # thunderbird-bin ebuilds.
231 update_mozilla_launcher_symlinks
232 }
233
234 pkg_postrm() {
235 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
236
237 update_mozilla_launcher_symlinks
238 }

  ViewVC Help
Powered by ViewVC 1.1.20