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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Mon Dec 10 17:58:10 2007 UTC (6 years, 7 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
old
(Portage version: 2.1.3.19)

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

  ViewVC Help
Powered by ViewVC 1.1.20