/[gentoo-x86]/www-client/mozilla-firefox/mozilla-firefox-1.5.0.3.ebuild
Gentoo

Contents of /www-client/mozilla-firefox/mozilla-firefox-1.5.0.3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Mon Jun 12 02:09:25 2006 UTC (14 years, 5 months ago) by anarchy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
removed most vulnerable versions, will remove 1.0.7 soon as ia64 marks 1.5.0.4 stable
(Portage version: 2.1)
 (Unsigned Manifest commit)

1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-client/mozilla-firefox/mozilla-firefox-1.5.0.3.ebuild,v 1.6 2006/05/23 17:56:17 gustavoz Exp $
4
5 unset ALLOWED_FLAGS # stupid extra-functions.sh ... bug 49179
6
7 inherit flag-o-matic toolchain-funcs eutils mozconfig-2 mozilla-launcher makeedit multilib fdo-mime mozextension autotools
8
9 LANGS="ar ca cs da de el en-GB es-AR es-ES fi fr ga-IE he hu it ja ko mk nb-NO nl pl pt-BR ro ru sk sl sv-SE tr zh-CN zh-TW"
10 SHORTLANGS="es-ES ga-IE nb-NO sv-SE"
11 PVER="1.0"
12
13 DESCRIPTION="Firefox Web Browser"
14 HOMEPAGE="http://www.mozilla.org/projects/firefox/"
15 SRC_URI="ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/source/firefox-${PV}-source.tar.bz2
16 mirror://gentoo/${P}-patches-${PVER}.tar.bz2
17 http://dev.gentoo.org/~anarchy/dist/${P}-patches-${PVER}.tar.bz2"
18
19 for X in ${LANGS} ; do
20 SRC_URI="${SRC_URI} linguas_${X/-/_}? ( mirror://gentoo/firefox-${X}-${PV}.xpi )"
21 done
22
23 for X in ${SHORTLANGS} ; do
24 SRC_URI="${SRC_URI} linguas_${X%%-*}? ( mirror://gentoo/firefox-${X}-${PV}.xpi )"
25 done
26
27 KEYWORDS="-* amd64 ~ia64 ppc ~sparc ~x86"
28 SLOT="0"
29 LICENSE="MPL-1.1 NPL-1.1"
30 IUSE="java mozdevelop"
31
32 RDEPEND="java? ( virtual/jre )
33 >=www-client/mozilla-launcher-1.39
34 >=sys-devel/binutils-2.16.1
35 >=dev-libs/nss-3.10
36 >=dev-libs/nspr-4.6.1"
37
38 DEPEND="${RDEPEND}
39 java? ( >=dev-java/java-config-0.2.0 )"
40
41 S=${WORKDIR}/mozilla
42
43 # Needed by src_compile() and src_install().
44 # Would do in pkg_setup but that loses the export attribute, they
45 # become pure shell variables.
46 export MOZ_CO_PROJECT=browser
47 export BUILD_OFFICIAL=1
48 export MOZILLA_OFFICIAL=1
49
50 linguas() {
51 linguas=
52 local LANG
53 for LANG in ${LINGUAS}; do
54 if hasq ${LANG} en en_US; then
55 hasq en ${linguas} || \
56 linguas="${linguas:+"${linguas} "}en"
57 continue
58 elif hasq ${LANG} ${LANGS//-/_}; then
59 hasq ${LANG//_/-} ${linguas} || \
60 linguas="${linguas:+"${linguas} "}${LANG//_/-}"
61 continue
62 else
63 local SLANG
64 for SLANG in ${SHORTLANGS}; do
65 if [[ ${LANG} == ${SLANG%%-*} ]]; then
66 hasq ${SLANG} ${linguas} || \
67 linguas="${linguas:+"${linguas} "}${SLANG}"
68 continue 2
69 fi
70 done
71 fi
72 ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
73 done
74 }
75
76 src_unpack() {
77 unpack firefox-${PV}-source.tar.bz2 ${P}-patches-${PVER}.tar.bz2
78
79 linguas
80 for X in ${linguas}; do
81 [[ ${X} != en ]] && xpi_unpack firefox-${X}-${PV}.xpi
82 done
83
84 # Apply our patches
85 cd ${S} || die "cd failed"
86 EPATCH_FORCE="yes" epatch ${WORKDIR}/patch
87
88 # Fix a compilation issue using the 32-bit userland with 64-bit kernel on
89 # PowerPC, because with that configuration, it detects a ppc64 system.
90 # -- hansmi, 2005-11-13
91 if use ppc && [[ "${PROFILE_ARCH}" == ppc64 ]]; then
92 sed -i -e "s#OS_TEST=\`uname -m\`\$#OS_TEST=${ARCH}#" \
93 ${S}/configure
94 sed -i -e "s#OS_TEST :=.*uname -m.*\$#OS_TEST:=${ARCH}#" \
95 ${S}/security/coreconf/arch.mk
96 fi
97
98 # Fix sparc bus errors #115729 <gustavoz>
99 use sparc && epatch ${FILESDIR}/firefox-bus-error.patch
100
101 WANT_AUTOCONF="2.13" \
102 eautoreconf || die "failed running 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-extensions=default,typeaheadfind
118 mozconfig_annotate '' --disable-mailnews
119 #mozconfig_annotate '' --enable-native-uconv
120 mozconfig_annotate '' --enable-image-encoder=all
121 mozconfig_annotate '' --enable-canvas
122 mozconfig_annotate '' --with-system-nspr
123 mozconfig_annotate '' --with-system-nss
124 mozconfig_annotate '' --enable-official-branding
125
126 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
127 # regardless of java setting.
128 mozconfig_annotate '' --enable-oji --enable-mathml
129
130 # Other ff-specific settings
131 mozconfig_use_enable mozdevelop jsd
132 mozconfig_use_enable mozdevelop xpctools
133 mozconfig_use_extension mozdevelop venkman
134 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
135
136 # Finalize and report settings
137 mozconfig_final
138
139 # hardened GCC uses -fstack-protector-all by default, which breaks us
140 gcc-specs-ssp && append-flags -fno-stack-protector-all
141 # remove -fstack-protector because now it borks firefox
142 CFLAGS=${CFLAGS/-fstack-protector-all/}
143 CFLAGS=${CFLAGS/-fstack-protector/}
144 CXXFLAGS=${CXXFLAGS/-fstack-protector-all/}
145 CXXFLAGS=${CXXFLAGS/-fstack-protector/}
146
147 append-flags -freorder-blocks -fno-reorder-functions
148
149 # Export CPU_ARCH_TEST as it is not exported by default.
150 case $(tc-arch) in
151 amd64) [[ ${ABI} == "x86" ]] && CPU_ARCH_TEST="x86" || CPU_ARCH_TEST="x86_64" ;;
152 *) CPU_ARCH_TEST=$(tc-arch) ;;
153 esac
154
155 export CPU_ARCH_TEST
156
157 ####################################
158 #
159 # Configure and build
160 #
161 ####################################
162
163 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
164 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
165 econf || die
166
167 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
168 # to econf, but the quotes cause configure to fail.
169 sed -i -e \
170 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
171 ${S}/config/autoconf.mk \
172 ${S}/xpfe/global/buildconfig.html
173
174 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
175 # requirements while compiling
176 edit_makefiles
177
178 emake || die
179 }
180
181 pkg_preinst() {
182 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
183
184 echo ""
185 einfo "We are removing old install before we continue. This is to help"
186 einfo "eliminate any problems during the install, sorry for those of you"
187 einfo "who disagree with this but this will ensure a sane build for everyone"
188 einfo "Comments and suggestion should be addressed to mozilla@gentoo.org"
189 rm -rf ${ROOT}${MOZILLA_FIVE_HOME}
190 echo ""
191 }
192
193 src_install() {
194 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
195
196 # Most of the installation happens here
197 dodir ${MOZILLA_FIVE_HOME}
198 cp -RL ${S}/dist/bin/* ${D}${MOZILLA_FIVE_HOME}
199
200 linguas
201 for X in ${linguas}; do
202 [[ ${X} != en ]] && xpi_install ${WORKDIR}/firefox-${X}-${PV}
203 done
204
205 local LANG=${linguas%% *}
206 if [[ ${LANG} != "" && ${LANG} != "en" ]]; then
207 ebegin "Setting default locale to ${LANG}"
208 sed -i "s:pref(\"general.useragent.locale\", \"en-US\"):pref(\"general.useragent.locale\", \"${LANG}\"):" \
209 ${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox.js \
210 ${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox-l10n.js
211 eend $? || die "sed failed to change locale"
212 fi
213
214 # Create /usr/bin/firefox
215 install_mozilla_launcher_stub firefox ${MOZILLA_FIVE_HOME}
216
217 # Install icon and .desktop for menu entry
218 doicon ${FILESDIR}/icon/firefox-icon.png
219 domenu ${FILESDIR}/icon/mozillafirefox-1.5.desktop
220
221 # Fix icons to look the same everywhere
222 insinto ${MOZILLA_FIVE_HOME}/icons
223 doins ${S}/dist/branding/mozicon16.xpm
224 doins ${S}/dist/branding/mozicon50.xpm
225
226 ####################################
227 #
228 # Install files necessary for applications to build against firefox
229 #
230 ####################################
231
232 ewarn "Installing includes and idl files..."
233 dodir ${MOZILLA_FIVE_HOME}/idl ${MOZILLA_FIVE_HOME}/include
234 cd ${S}/dist
235 cp -LfR include/* ${D}${MOZILLA_FIVE_HOME}/include || die "failed to copy"
236 cp -LfR idl/* ${D}${MOZILLA_FIVE_HOME}/idl || die "failed to copy"
237
238 # Dirty hack to get some applications using this header running
239 dosym ${MOZILLA_FIVE_HOME}/include/necko/nsIURI.h \
240 /usr/$(get_libdir)/${MOZILLA_FIVE_HOME##*/}/include/nsIURI.h
241
242
243 # Fix pkgconfig files and install them
244 insinto /usr/$(get_libdir)/pkgconfig
245 for x in ${S}/build/unix/*.pc; do
246 doins ${x}
247 done
248
249 ####################################
250 #
251 # Some preferences, probably gentoo.org as start-page also
252 #
253 ####################################
254
255 dodir ${MOZILLA_FIVE_HOME}/greprefs
256 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/greprefs/all-gentoo.js
257 dodir ${MOZILLA_FIVE_HOME}/defaults/pref
258 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/defaults/pref/all-gentoo.js
259
260 # Install docs
261 dodoc LEGAL
262 }
263
264 pkg_postinst() {
265 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
266
267 # This should be called in the postinst and postrm of all the
268 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
269 # thunderbird-bin ebuilds.
270 update_mozilla_launcher_symlinks
271
272 # Update mimedb for the new .desktop file
273 fdo-mime_desktop_database_update
274
275 echo ""
276 ewarn "Please remember to rebuild any packages that you have built"
277 ewarn "against firefox. Some packages might be broken by the upgrade; if this"
278 ewarn "is the case, please search at http://bugs.gentoo.org and open a new bug"
279 ewarn "if one does not exist. Before filing any bugs, please move or remove ~/.mozilla"
280 ewarn "and test with a clean profile directory."
281 ewarn "Thank you! anarchy@gentoo.org."
282
283 echo ""
284 einfo "Any regchrome errors can be ignored right now, this is due to"
285 einfo "mozilla-firefox-1.0.x. being unregistered with mozilla-launcher."
286
287 epause 15
288 }
289
290 pkg_postrm() {
291 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
292
293 update_mozilla_launcher_symlinks
294 }

  ViewVC Help
Powered by ViewVC 1.1.20