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

Contents of /www-client/mozilla-firefox/mozilla-firefox-1.5-r11.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (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.1: +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-r11.ebuild,v 1.1 2006/02/01 22:13:20 anarchy Exp $
4
5 unset ALLOWED_FLAGS # stupid extra-functions.sh ... bug 49179
6 MOZ_FREETYPE2="no" # Need to disable for newer .. remove here and in mozconfig
7 # when older is removed from tree.
8 MOZ_PANGO="yes" # Need to enable for newer .. remove here and in mozconfig
9 # when older is removed from tree.
10
11 inherit flag-o-matic toolchain-funcs eutils mozconfig-2 mozilla-launcher makeedit multilib fdo-mime mozextension autotools
12
13 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"
14 SHORTLANGS="es-ES ga-IE nb-NO sv-SE"
15 PVER="1.4"
16
17 DESCRIPTION="Firefox Web Browser"
18 HOMEPAGE="http://www.mozilla.org/projects/firefox/"
19 SRC_URI="ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/source/firefox-${PV}-source.tar.bz2
20 mirror://gentoo/${P}-patches-${PVER}.tar.bz2
21 http://dev.gentoo.org/~anarchy/dist/${P}-patches-${PVER}.tar.bz2"
22
23 for X in ${LANGS} ; do
24 SRC_URI="${SRC_URI} linguas_${X/-/_}? ( http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/linux-i686/xpi/${X}.xpi )"
25 done
26
27 for X in ${SHORTLANGS} ; do
28 SRC_URI="${SRC_URI} linguas_${X%%-*}? ( http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/linux-i686/xpi/${X}.xpi )"
29 done
30
31 KEYWORDS="-* ~amd64 ~ppc ~x86"
32 SLOT="0"
33 LICENSE="MPL-1.1 NPL-1.1"
34 IUSE="java mozdevelop"
35
36 RDEPEND="java? ( virtual/jre )
37 >=www-client/mozilla-launcher-1.39
38 >=sys-devel/binutils-2.16.1
39 >=dev-libs/nss-3.10
40 >=dev-libs/nspr-4.6.1"
41
42 DEPEND="${RDEPEND}
43 app-arch/unzip
44 java? ( >=dev-java/java-config-0.2.0 )"
45
46 S=${WORKDIR}/mozilla
47
48 # Needed by src_compile() and src_install().
49 # Would do in pkg_setup but that loses the export attribute, they
50 # become pure shell variables.
51 export MOZ_CO_PROJECT=browser
52 export BUILD_OFFICIAL=1
53 export MOZILLA_OFFICIAL=1
54
55 linguas() {
56 local LANG
57 for LANG in ${LINGUAS//_/-}; do
58 if hasq ${LANG} ${LANGS} en; then
59 echo -n "${LANG} "
60 else
61 local SLANG
62 for SLANG in ${SHORTLANGS}; do
63 [[ ${LANG} == ${SLANG%%-*} ]] && \
64 echo -n "${SLANG} "
65 done
66 fi
67 done
68 }
69
70 src_unpack() {
71 unpack firefox-${PV}-source.tar.bz2 ${P}-patches-${PVER}.tar.bz2
72
73 LINGUAS=$(linguas)
74 for X in ${LINGUAS}; do
75 [[ ${X} != en ]] && xpi_unpack ${X}.xpi
76 done
77
78 if ! use alpha; then
79 rm ${WORKDIR}/patch/001_mozilla-1.3-alpha-stubs.patch.bz2
80 fi
81
82 # Apply our patches
83 cd ${S} || die "cd failed"
84 EPATCH_FORCE="yes" epatch ${WORKDIR}/patch
85
86 # Fix a compilation issue using the 32-bit userland with 64-bit kernel on
87 # PowerPC, because with that configuration, it detects a ppc64 system.
88 # -- hansmi, 2005-11-13
89 if use ppc && [[ "${PROFILE_ARCH}" == ppc64 ]]; then
90 sed -i -e "s#OS_TEST=\`uname -m\`\$#OS_TEST=${ARCH}#" \
91 ${S}/configure
92 sed -i -e "s#OS_TEST :=.*uname -m.*\$#OS_TEST:=${ARCH}#" \
93 ${S}/security/coreconf/arch.mk
94 fi
95
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
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 has_hardened && 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 ####################################
143 #
144 # Configure and build
145 #
146 ####################################
147
148 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
149 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
150 econf || die
151
152 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
153 # to econf, but the quotes cause configure to fail.
154 sed -i -e \
155 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
156 ${S}/config/autoconf.mk \
157 ${S}/xpfe/global/buildconfig.html
158
159 # Fixup the RPATH
160 sed -i -e \
161 's|#RPATH_FIXER|'"${MOZILLA_FIVE_HOME}"'|' \
162 ${S}/config/rules.mk \
163 ${S}/nsprpub/config/rules.mk \
164 ${S}/security/coreconf/rules.mk
165
166 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
167 # requirements while compiling
168 edit_makefiles
169
170 emake || die
171 }
172
173 pkg_preinst() {
174 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
175
176 echo ""
177 einfo "We are removing old install before we continue. This is to help"
178 einfo "eliminate any problems during the install, sorry for those of you"
179 einfo "who disagree with this but this will ensure a sane build for everyone"
180 einfo "Comments and suggestion should be addressed to mozilla@gentoo.org"
181 rm -rf ${ROOT}${MOZILLA_FIVE_HOME}
182 }
183
184 src_install() {
185 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
186
187 # Most of the installation happens here
188 dodir ${MOZILLA_FIVE_HOME}
189 cp -RL ${S}/dist/bin/* ${D}${MOZILLA_FIVE_HOME}
190
191 # Create directory structure to support portage-installed extensions.
192 # See update_chrome() in mozilla-launcher
193 keepdir ${MOZILLA_FIVE_HOME}/chrome.d
194 keepdir ${MOZILLA_FIVE_HOME}/extensions.d
195 cp ${D}${MOZILLA_FIVE_HOME}/chrome/installed-chrome.txt \
196 ${D}${MOZILLA_FIVE_HOME}/chrome.d/0_base-chrome.txt
197
198 LINGUAS=$(linguas)
199 for X in ${LINGUAS}; do
200 [[ ${X} != en ]] && xpi_install ${WORKDIR}/${X}
201 done
202
203 local LANG=${LINGUAS%% *}
204 if [[ ${LANG} != "" && ${LANG} != "en" ]]; then
205 ebegin "Setting default locale to ${LANG}"
206 sed -i "s:pref(\"general.useragent.locale\", \"en-US\"):pref(\"general.useragent.locale\", \"${LANG}\"):" \
207 ${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox.js \
208 ${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox-l10n.js
209 eend $? || die "sed failed to change locale"
210 fi
211
212 # Create /usr/bin/firefox
213 install_mozilla_launcher_stub firefox ${MOZILLA_FIVE_HOME}
214
215 # Install icon and .desktop for menu entry
216 doicon ${FILESDIR}/icon/firefox-icon.png
217 domenu ${FILESDIR}/icon/mozillafirefox-1.5.desktop
218
219 # Fix icons to look the same everywhere
220 insinto ${MOZILLA_FIVE_HOME}/icons
221 doins ${S}/dist/branding/mozicon16.xpm
222 doins ${S}/dist/branding/mozicon50.xpm
223
224 ####################################
225 #
226 # Install files necessary for applications to build against firefox
227 #
228 ####################################
229
230 ewarn "Installing includes and idl files..."
231 dodir ${MOZILLA_FIVE_HOME}/idl ${MOZILLA_FIVE_HOME}/include
232 cd ${S}/dist
233 cp -LfR include/* ${D}${MOZILLA_FIVE_HOME}/include || die "failed to copy"
234 cp -LfR idl/* ${D}${MOZILLA_FIVE_HOME}/idl || die "failed to copy"
235
236 # Dirty hack to get some applications using this header running
237 dosym ${MOZILLA_FIVE_HOME}/include/necko/nsIURI.h \
238 /usr/$(get_libdir)/${MOZILLA_FIVE_HOME##*/}/include/nsIURI.h
239
240
241 # Fix pkgconfig files and install them
242 insinto /usr/$(get_libdir)/pkgconfig
243 for x in ${S}/build/unix/*.pc; do
244 doins ${x}
245 done
246
247 ####################################
248 #
249 # Some preferences, probably gentoo.org as start-page also
250 #
251 ####################################
252
253 dodir ${MOZILLA_FIVE_HOME}/greprefs
254 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/greprefs/all-gentoo.js
255 dodir ${MOZILLA_FIVE_HOME}/defaults/pref
256 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/defaults/pref/all-gentoo.js
257
258 # Install docs
259 dodoc LEGAL
260 }
261
262 pkg_postinst() {
263 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
264
265 # This should be called in the postinst and postrm of all the
266 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
267 # thunderbird-bin ebuilds.
268 update_mozilla_launcher_symlinks
269
270 # Update mimedb for the new .desktop file
271 fdo-mime_desktop_database_update
272
273 echo ""
274 ewarn "Please remember to rebuild any packages that you have built"
275 ewarn "against firefox. Some packages might be busted please search"
276 ewarn "http://bugs.gentoo.org if no bug is open, then please open a new"
277 ewarn "bug report so these can be fixed. Before filling bugs make sure you"
278 ewarn "have moved $HOME/.mozilla our of way and tested with clean profile."
279 ewarn "Thank you! anarchy@gentoo.org."
280
281 echo ""
282 einfo "I am unable to brand firefox or thunderbird officially yet."
283 einfo "You will see that everything says Deer Park cause of this."
284
285 epause 15
286 }
287
288 pkg_postrm() {
289 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
290
291 update_mozilla_launcher_symlinks
292 }

  ViewVC Help
Powered by ViewVC 1.1.20