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

Contents of /www-client/mozilla-firefox/mozilla-firefox-1.5.0.1-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Mon Jun 12 02:09:24 2006 UTC (14 years, 5 months ago) by anarchy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +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.1-r4.ebuild,v 1.4 2006/04/10 22:45:11 anarchy 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.2"
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 ~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} ${LANGS//-/_} en; then
55 hasq ${LANG//_/-} ${linguas} || \
56 linguas="${linguas} ${LANG//_/-}"
57 continue
58 else
59 local SLANG
60 for SLANG in ${SHORTLANGS}; do
61 if [[ ${LANG} == ${SLANG%%-*} ]]; then
62 hasq ${SLANG} ${linguas} || \
63 linguas="${linguas} ${SLANG}"
64 continue 2
65 fi
66 done
67 fi
68 ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
69 done
70 }
71
72 src_unpack() {
73 unpack firefox-${PV}-source.tar.bz2 ${P}-patches-${PVER}.tar.bz2
74
75 linguas
76 for X in ${linguas}; do
77 [[ ${X} != en ]] && xpi_unpack firefox-${X}-${PV}.xpi
78 done
79
80 # Apply our patches
81 cd ${S} || die "cd failed"
82 EPATCH_EXCLUDE="001_mozilla-1.3-alpha-stubs.patch.bz2"
83 EPATCH_FORCE="yes" epatch ${WORKDIR}/patch
84
85 # Fix a compilation issue using the 32-bit userland with 64-bit kernel on
86 # PowerPC, because with that configuration, it detects a ppc64 system.
87 # -- hansmi, 2005-11-13
88 if use ppc && [[ "${PROFILE_ARCH}" == ppc64 ]]; then
89 sed -i -e "s#OS_TEST=\`uname -m\`\$#OS_TEST=${ARCH}#" \
90 ${S}/configure
91 sed -i -e "s#OS_TEST :=.*uname -m.*\$#OS_TEST:=${ARCH}#" \
92 ${S}/security/coreconf/arch.mk
93 fi
94
95 WANT_AUTOCONF="2.13" \
96 eautoreconf || die "failed running eautoreconf"
97 }
98
99 src_compile() {
100 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
101
102 ####################################
103 #
104 # mozconfig, CFLAGS and CXXFLAGS setup
105 #
106 ####################################
107
108 mozconfig_init
109 mozconfig_config
110
111 mozconfig_annotate '' --enable-extensions=default,typeaheadfind
112 mozconfig_annotate '' --disable-mailnews
113 #mozconfig_annotate '' --enable-native-uconv
114 mozconfig_annotate '' --enable-image-encoder=all
115 mozconfig_annotate '' --enable-canvas
116 mozconfig_annotate '' --with-system-nspr
117 mozconfig_annotate '' --with-system-nss
118 mozconfig_annotate '' --enable-official-branding
119
120 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
121 # regardless of java setting.
122 mozconfig_annotate '' --enable-oji --enable-mathml
123
124 # Other ff-specific settings
125 mozconfig_use_enable mozdevelop jsd
126 mozconfig_use_enable mozdevelop xpctools
127 mozconfig_use_extension mozdevelop venkman
128 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
129
130 # Finalize and report settings
131 mozconfig_final
132
133 # hardened GCC uses -fstack-protector-all by default, which breaks us
134 has_hardened && append-flags -fno-stack-protector-all
135 # remove -fstack-protector because now it borks firefox
136 CFLAGS=${CFLAGS/-fstack-protector-all/}
137 CFLAGS=${CFLAGS/-fstack-protector/}
138 CXXFLAGS=${CXXFLAGS/-fstack-protector-all/}
139 CXXFLAGS=${CXXFLAGS/-fstack-protector/}
140
141 append-flags -freorder-blocks -fno-reorder-functions
142
143 # Export CPU_ARCH_TEST as it is not exported by default.
144 case $(tc-arch) in
145 amd64) [[ ${ABI} == "x86" ]] && CPU_ARCH_TEST="x86" || CPU_ARCH_TEST="x86_64" ;;
146 *) CPU_ARCH_TEST=$(tc-arch) ;;
147 esac
148
149 export CPU_ARCH_TEST
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}/xpfe/global/buildconfig.html
167
168 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
169 # requirements while compiling
170 edit_makefiles
171
172 emake || die
173 }
174
175 pkg_preinst() {
176 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
177
178 echo ""
179 einfo "We are removing old install before we continue. This is to help"
180 einfo "eliminate any problems during the install, sorry for those of you"
181 einfo "who disagree with this but this will ensure a sane build for everyone"
182 einfo "Comments and suggestion should be addressed to mozilla@gentoo.org"
183 rm -rf ${ROOT}${MOZILLA_FIVE_HOME}
184 echo ""
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}
193
194 linguas
195 for X in ${linguas}; do
196 [[ ${X} != en ]] && xpi_install ${WORKDIR}/firefox-${X}-${PV}
197 done
198
199 local LANG=${linguas%% *}
200 if [[ ${LANG} != "" && ${LANG} != "en" ]]; then
201 ebegin "Setting default locale to ${LANG}"
202 sed -i "s:pref(\"general.useragent.locale\", \"en-US\"):pref(\"general.useragent.locale\", \"${LANG}\"):" \
203 ${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox.js \
204 ${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox-l10n.js
205 eend $? || die "sed failed to change locale"
206 fi
207
208 # Create /usr/bin/firefox
209 install_mozilla_launcher_stub firefox ${MOZILLA_FIVE_HOME}
210
211 # Install icon and .desktop for menu entry
212 doicon ${FILESDIR}/icon/firefox-icon.png
213 domenu ${FILESDIR}/icon/mozillafirefox-1.5.desktop
214
215 # Fix icons to look the same everywhere
216 insinto ${MOZILLA_FIVE_HOME}/icons
217 doins ${S}/dist/branding/mozicon16.xpm
218 doins ${S}/dist/branding/mozicon50.xpm
219
220 ####################################
221 #
222 # Install files necessary for applications to build against firefox
223 #
224 ####################################
225
226 ewarn "Installing includes and idl files..."
227 dodir ${MOZILLA_FIVE_HOME}/idl ${MOZILLA_FIVE_HOME}/include
228 cd ${S}/dist
229 cp -LfR include/* ${D}${MOZILLA_FIVE_HOME}/include || die "failed to copy"
230 cp -LfR idl/* ${D}${MOZILLA_FIVE_HOME}/idl || die "failed to copy"
231
232 # Dirty hack to get some applications using this header running
233 dosym ${MOZILLA_FIVE_HOME}/include/necko/nsIURI.h \
234 /usr/$(get_libdir)/${MOZILLA_FIVE_HOME##*/}/include/nsIURI.h
235
236
237 # Fix pkgconfig files and install them
238 insinto /usr/$(get_libdir)/pkgconfig
239 for x in ${S}/build/unix/*.pc; do
240 doins ${x}
241 done
242
243 ####################################
244 #
245 # Some preferences, probably gentoo.org as start-page also
246 #
247 ####################################
248
249 dodir ${MOZILLA_FIVE_HOME}/greprefs
250 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/greprefs/all-gentoo.js
251 dodir ${MOZILLA_FIVE_HOME}/defaults/pref
252 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/defaults/pref/all-gentoo.js
253
254 # Install docs
255 dodoc LEGAL
256 }
257
258 pkg_postinst() {
259 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
260
261 # This should be called in the postinst and postrm of all the
262 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
263 # thunderbird-bin ebuilds.
264 update_mozilla_launcher_symlinks
265
266 # Update mimedb for the new .desktop file
267 fdo-mime_desktop_database_update
268
269 echo ""
270 ewarn "Please remember to rebuild any packages that you have built"
271 ewarn "against firefox. Some packages might be broken by the upgrade; if this"
272 ewarn "is the case, please search at http://bugs.gentoo.org and open a new bug"
273 ewarn "if one does not exist. Before filing any bugs, please move or remove ~/.mozilla"
274 ewarn "and test with a clean profile directory."
275 ewarn "Thank you! anarchy@gentoo.org."
276
277 echo ""
278 einfo "Any regchrome errors can be ignored right now, this is due to"
279 einfo "mozilla-firefox-1.0.x. being unregistered with mozilla-launcher."
280
281 epause 15
282 }
283
284 pkg_postrm() {
285 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
286
287 update_mozilla_launcher_symlinks
288 }

  ViewVC Help
Powered by ViewVC 1.1.20