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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20