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

Contents of /app-office/mozilla-sunbird/mozilla-sunbird-0.9_rc2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20