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

Contents of /www-client/mozilla-firefox/mozilla-firefox-1.5.0.2-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (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.2: +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.2-r1.ebuild,v 1.2 2006/05/01 17:02:12 nixnut 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_FORCE="yes" epatch ${WORKDIR}/patch
83
84 # Fix a compilation issue using the 32-bit userland with 64-bit kernel on
85 # PowerPC, because with that configuration, it detects a ppc64 system.
86 # -- hansmi, 2005-11-13
87 if use ppc && [[ "${PROFILE_ARCH}" == ppc64 ]]; then
88 sed -i -e "s#OS_TEST=\`uname -m\`\$#OS_TEST=${ARCH}#" \
89 ${S}/configure
90 sed -i -e "s#OS_TEST :=.*uname -m.*\$#OS_TEST:=${ARCH}#" \
91 ${S}/security/coreconf/arch.mk
92 fi
93
94 WANT_AUTOCONF="2.13" \
95 eautoreconf || die "failed running eautoreconf"
96 }
97
98 src_compile() {
99 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
100
101 ####################################
102 #
103 # mozconfig, CFLAGS and CXXFLAGS setup
104 #
105 ####################################
106
107 mozconfig_init
108 mozconfig_config
109
110 mozconfig_annotate '' --enable-extensions=default,typeaheadfind
111 mozconfig_annotate '' --disable-mailnews
112 #mozconfig_annotate '' --enable-native-uconv
113 mozconfig_annotate '' --enable-image-encoder=all
114 mozconfig_annotate '' --enable-canvas
115 mozconfig_annotate '' --with-system-nspr
116 mozconfig_annotate '' --with-system-nss
117 mozconfig_annotate '' --enable-official-branding
118
119 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
120 # regardless of java setting.
121 mozconfig_annotate '' --enable-oji --enable-mathml
122
123 # Other ff-specific settings
124 mozconfig_use_enable mozdevelop jsd
125 mozconfig_use_enable mozdevelop xpctools
126 mozconfig_use_extension mozdevelop venkman
127 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
128
129 # Finalize and report settings
130 mozconfig_final
131
132 # hardened GCC uses -fstack-protector-all by default, which breaks us
133 gcc-specs-ssp && append-flags -fno-stack-protector-all
134 # remove -fstack-protector because now it borks firefox
135 CFLAGS=${CFLAGS/-fstack-protector-all/}
136 CFLAGS=${CFLAGS/-fstack-protector/}
137 CXXFLAGS=${CXXFLAGS/-fstack-protector-all/}
138 CXXFLAGS=${CXXFLAGS/-fstack-protector/}
139
140 append-flags -freorder-blocks -fno-reorder-functions
141
142 # Export CPU_ARCH_TEST as it is not exported by default.
143 case $(tc-arch) in
144 amd64) [[ ${ABI} == "x86" ]] && CPU_ARCH_TEST="x86" || CPU_ARCH_TEST="x86_64" ;;
145 *) CPU_ARCH_TEST=$(tc-arch) ;;
146 esac
147
148 export CPU_ARCH_TEST
149
150 ####################################
151 #
152 # Configure and build
153 #
154 ####################################
155
156 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
157 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
158 econf || die
159
160 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
161 # to econf, but the quotes cause configure to fail.
162 sed -i -e \
163 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
164 ${S}/config/autoconf.mk \
165 ${S}/xpfe/global/buildconfig.html
166
167 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
168 # requirements while compiling
169 edit_makefiles
170
171 emake || die
172 }
173
174 pkg_preinst() {
175 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
176
177 echo ""
178 einfo "We are removing old install before we continue. This is to help"
179 einfo "eliminate any problems during the install, sorry for those of you"
180 einfo "who disagree with this but this will ensure a sane build for everyone"
181 einfo "Comments and suggestion should be addressed to mozilla@gentoo.org"
182 rm -rf ${ROOT}${MOZILLA_FIVE_HOME}
183 echo ""
184 }
185
186 src_install() {
187 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
188
189 # Most of the installation happens here
190 dodir ${MOZILLA_FIVE_HOME}
191 cp -RL ${S}/dist/bin/* ${D}${MOZILLA_FIVE_HOME}
192
193 linguas
194 for X in ${linguas}; do
195 [[ ${X} != en ]] && xpi_install ${WORKDIR}/firefox-${X}-${PV}
196 done
197
198 local LANG=${linguas%% *}
199 if [[ ${LANG} != "" && ${LANG} != "en" ]]; then
200 ebegin "Setting default locale to ${LANG}"
201 sed -i "s:pref(\"general.useragent.locale\", \"en-US\"):pref(\"general.useragent.locale\", \"${LANG}\"):" \
202 ${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox.js \
203 ${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox-l10n.js
204 eend $? || die "sed failed to change locale"
205 fi
206
207 # Create /usr/bin/firefox
208 install_mozilla_launcher_stub firefox ${MOZILLA_FIVE_HOME}
209
210 # Install icon and .desktop for menu entry
211 doicon ${FILESDIR}/icon/firefox-icon.png
212 domenu ${FILESDIR}/icon/mozillafirefox-1.5.desktop
213
214 # Fix icons to look the same everywhere
215 insinto ${MOZILLA_FIVE_HOME}/icons
216 doins ${S}/dist/branding/mozicon16.xpm
217 doins ${S}/dist/branding/mozicon50.xpm
218
219 ####################################
220 #
221 # Install files necessary for applications to build against firefox
222 #
223 ####################################
224
225 ewarn "Installing includes and idl files..."
226 dodir ${MOZILLA_FIVE_HOME}/idl ${MOZILLA_FIVE_HOME}/include
227 cd ${S}/dist
228 cp -LfR include/* ${D}${MOZILLA_FIVE_HOME}/include || die "failed to copy"
229 cp -LfR idl/* ${D}${MOZILLA_FIVE_HOME}/idl || die "failed to copy"
230
231 # Dirty hack to get some applications using this header running
232 dosym ${MOZILLA_FIVE_HOME}/include/necko/nsIURI.h \
233 /usr/$(get_libdir)/${MOZILLA_FIVE_HOME##*/}/include/nsIURI.h
234
235
236 # Fix pkgconfig files and install them
237 insinto /usr/$(get_libdir)/pkgconfig
238 for x in ${S}/build/unix/*.pc; do
239 doins ${x}
240 done
241
242 ####################################
243 #
244 # Some preferences, probably gentoo.org as start-page also
245 #
246 ####################################
247
248 dodir ${MOZILLA_FIVE_HOME}/greprefs
249 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/greprefs/all-gentoo.js
250 dodir ${MOZILLA_FIVE_HOME}/defaults/pref
251 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/defaults/pref/all-gentoo.js
252
253 # Install docs
254 dodoc LEGAL
255 }
256
257 pkg_postinst() {
258 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
259
260 # This should be called in the postinst and postrm of all the
261 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
262 # thunderbird-bin ebuilds.
263 update_mozilla_launcher_symlinks
264
265 # Update mimedb for the new .desktop file
266 fdo-mime_desktop_database_update
267
268 echo ""
269 ewarn "Please remember to rebuild any packages that you have built"
270 ewarn "against firefox. Some packages might be broken by the upgrade; if this"
271 ewarn "is the case, please search at http://bugs.gentoo.org and open a new bug"
272 ewarn "if one does not exist. Before filing any bugs, please move or remove ~/.mozilla"
273 ewarn "and test with a clean profile directory."
274 ewarn "Thank you! anarchy@gentoo.org."
275
276 echo ""
277 einfo "Any regchrome errors can be ignored right now, this is due to"
278 einfo "mozilla-firefox-1.0.x. being unregistered with mozilla-launcher."
279
280 epause 15
281 }
282
283 pkg_postrm() {
284 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
285
286 update_mozilla_launcher_symlinks
287 }

  ViewVC Help
Powered by ViewVC 1.1.20