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

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

  ViewVC Help
Powered by ViewVC 1.1.20