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

Contents of /www-client/mozilla-firefox/mozilla-firefox-1.0.4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.18 - (show annotations) (download)
Mon Jul 18 15:15:38 2005 UTC (15 years, 4 months ago) by agriffis
Branch: MAIN
CVS Tags: HEAD
Changes since 1.17: +1 -1 lines
FILE REMOVED
Install /usr/bin/firefox stub using install_mozilla_launcher_stub from
mozilla-launcher.eclass #99084
(Portage version: 2.0.51.20-r5)

1 # Copyright 1999-2005 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.0.4.ebuild,v 1.17 2005/07/12 18:51:17 agriffis Exp $
4
5 inherit makeedit flag-o-matic nsplugins eutils mozconfig mozilla-launcher multilib
6
7 S=${WORKDIR}/mozilla
8
9 DESCRIPTION="The Mozilla Firefox Web Browser"
10 HOMEPAGE="http://www.mozilla.org/projects/firefox/"
11 MY_PV=${PV/_rc/rc}
12 SRC_URI="http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${MY_PV}/source/firefox-${MY_PV}-source.tar.bz2
13 mirror://gentoo/mozilla-firefox-1.0-4ft2.patch.bz2
14 mirror://gentoo/mozilla-firefox-1.0.3-ia64.patch.bz2
15 mirror://gentoo/mozilla-jslibmath-alpha.patch
16 http://dev.gentoo.org/~agriffis/dist/mozilla-firefox-1.0.3-ia64.patch.bz2
17 http://dev.gentoo.org/~agriffis/dist/mozilla-jslibmath-alpha.patch
18 http://dev.gentoo.org/~agriffis/dist/mozilla-firefox-1.0-4ft2.patch.bz2"
19
20 LICENSE="MPL-1.1 NPL-1.1"
21 SLOT="0"
22 KEYWORDS="-alpha amd64 ~arm hppa ia64 ppc sparc x86"
23 IUSE="gnome java mozdevelop mozsvg"
24
25 # xrender.pc appeared for the first time in xorg-x11-6.7.0-r2
26 # and is required to build with support for cairo. #71504
27 RDEPEND="java? ( virtual/jre )
28 >=media-libs/libmng-1.0.0
29 mozsvg? (
30 >=x11-base/xorg-x11-6.7.0-r2
31 x11-libs/cairo
32 )
33 >=www-client/mozilla-launcher-1.28"
34
35 DEPEND="${RDEPEND}
36 java? ( >=dev-java/java-config-0.2.0 )"
37
38 # Needed by src_compile() and src_install().
39 # Would do in pkg_setup but that loses the export attribute, they
40 # become pure shell variables.
41 export MOZ_PHOENIX=1
42
43 src_unpack() {
44 unpack firefox-${MY_PV}-source.tar.bz2 || die "unpack failed"
45 cd ${S} || die "cd failed"
46
47 # alpha stubs patch from lfs project.
48 # <taviso@gentoo.org> (26 Jun 2003)
49 use alpha && epatch ${FILESDIR}/mozilla-1.3-alpha-stubs.patch
50
51 # hppa patches from Ivar <orskaug@stud.ntnu.no>
52 # <gmsoft@gentoo.org> (22 Dec 2004)
53 epatch ${FILESDIR}/mozilla-hppa.patch
54
55 # patch out ft caching code since the API changed between releases of
56 # freetype; this enables freetype-2.1.8+ compat.
57 # https://bugzilla.mozilla.org/show_bug.cgi?id=234035#c65
58 epatch ${DISTDIR}/mozilla-firefox-1.0-4ft2.patch.bz2
59
60 # patch to fix separate character on euro keyboards, bug 68995
61 epatch ${FILESDIR}/mozilla-firefox-1.0-kp_separator.patch
62
63 # some patches from Debian to set default preferences:
64 # - inherit LANG from env
65 # - shut off SSLv2 and 40-bit ciphers by default
66 # - disable application auto-updating
67 epatch ${FILESDIR}/mozilla-firefox-1.0.3-prefs.patch
68
69 # patch to solve segfaults on ia64, from Debian, originally from David
70 # Mosberger
71 epatch ${DISTDIR}/mozilla-firefox-1.0.3-ia64.patch.bz2
72
73 if has_version '>=x11-libs/cairo-0.3.0'; then
74 epatch ${FILESDIR}/svg-cairo-0.3.0-fix.patch
75 fi
76
77 # GCC4 compile fix, bug #87800
78 epatch ${FILESDIR}/${P}-gcc4.patch
79 }
80
81 src_compile() {
82 ####################################
83 #
84 # mozconfig, CFLAGS and CXXFLAGS setup
85 #
86 ####################################
87
88 mozconfig_init
89
90 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
91 # regardless of java setting.
92 mozconfig_annotate '' --enable-oji --enable-mathml
93
94 # Other ff-specific settings
95 mozconfig_use_enable mozdevelop jsd
96 mozconfig_use_enable mozdevelop xpctools
97 mozconfig_use_extension mozdevelop venkman
98 mozconfig_use_enable gnome gnomevfs
99 mozconfig_use_extension gnome gnomevfs
100 mozconfig_use_enable mozsvg svg
101 mozconfig_use_enable mozsvg svg-renderer-cairo
102 mozconfig_annotate '' --with-default-mozilla-five-home=/usr/$(get_libdir)/MozillaFirefox
103 mozconfig_annotate '' --prefix=/usr/$(get_libdir)/MozillaFirefox
104
105 # Finalize and report settings
106 mozconfig_final
107
108 # hardened GCC uses -fstack-protector-all by default, and this breaks
109 # firefox.
110 has_hardened && append-flags -fno-stack-protector-all
111 replace-flags -fstack-protector-all -fstack-protector
112
113 ####################################
114 #
115 # Configure and build Firefox
116 #
117 ####################################
118
119 # ./configure picks up the mozconfig stuff
120 export LD="$(tc-getLD)"
121 export CC="$(tc-getCC)"
122 export CXX="$(tc-getCXX)"
123 econf
124
125 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
126 # requirements while compiling
127 edit_makefiles
128
129 emake MOZ_PHOENIX=1 CXX="$(tc-getCXX)" CC="$(tc-getCC)" LD="$(tc-getLD)" || die
130 }
131
132 src_install() {
133 # Plugin path creation
134 PLUGIN_DIR="/usr/$(get_libdir)/nsbrowser/plugins"
135 dodir ${PLUGIN_DIR}
136
137 dodir /usr/$(get_libdir)/MozillaFirefox
138 cp -RL --no-preserve=links ${S}/dist/bin/* ${D}/usr/$(get_libdir)/MozillaFirefox
139
140 einfo "Installing includes and idl files..."
141 # Copy the include and idl files
142 dodir /usr/$(get_libdir)/MozillaFirefox/include/idl /usr/include
143 cd ${S}/dist
144 cp -LfR include/* ${D}/usr/$(get_libdir)/MozillaFirefox/include
145 cp -LfR idl/* ${D}/usr/$(get_libdir)/MozillaFirefox/include/idl
146 dosym /usr/$(get_libdir)/MozillaFirefox/include /usr/include/MozillaFirefox
147
148 # Dirty hack to get some applications using this header running
149 dosym /usr/$(get_libdir)/MozillaFirefox/include/necko/nsIURI.h /usr/lib/MozillaFirefox/include/nsIURI.h
150
151 cd ${S}/build/unix
152 # Fix firefox-config and install it
153 sed -i -e "s:/lib/firefox-${MY_PV}:/$(get_libdir)/MozillaFirefox:g" firefox-config
154 sed -i -e "s:/firefox-${MY_PV}:/MozillaFirefox:g" firefox-config
155 exeinto /usr/$(get_libdir)/MozillaFirefox
156 doexe firefox-config
157 # Fix pkgconfig files and install them
158 insinto /usr/$(get_libdir)/pkgconfig
159 for x in *.pc; do
160 if [[ -f ${x} ]]; then
161 sed -i -e "s:/lib/firefox-${MY_PV}:/$(get_libdir)/MozillaFirefox:g" ${x}
162 sed -i -e "s:/firefox-${MY_PV}:/MozillaFirefox:g" ${x}
163 doins ${x}
164 fi
165 done
166 cd ${S}
167
168
169 #fix permissions
170 chown -R root:root ${D}/usr/$(get_libdir)/MozillaFirefox
171
172 # Plugin path setup (rescuing the existent plugins)
173 src_mv_plugins /usr/$(get_libdir)/MozillaFirefox/plugins
174
175 dodir /usr/bin
176 cat <<EOF >${D}/usr/bin/firefox
177 #!/bin/sh
178 #
179 # Stub script to run mozilla-launcher. We used to use a symlink here but
180 # OOo brokenness makes it necessary to use a stub instead:
181 # http://bugs.gentoo.org/show_bug.cgi?id=78890
182
183 export MOZILLA_LAUNCHER=firefox
184 exec /usr/libexec/mozilla-launcher "\$@"
185 EOF
186 chmod 0755 ${D}/usr/bin/firefox
187 insinto /etc/env.d
188 doins ${FILESDIR}/10MozillaFirefox
189
190 # Set correct libdir in env.d file
191 dosed "s:/usr/lib:/usr/$(get_libdir):" /etc/env.d/10MozillaFirefox
192
193 # Fix icons to look the same everywhere
194 insinto /usr/$(get_libdir)/MozillaFirefox/icons
195 doins ${S}/build/package/rpm/SOURCES/mozicon16.xpm
196 doins ${S}/build/package/rpm/SOURCES/mozicon50.xpm
197
198 # Install icon and .desktop for menu entry
199 insinto /usr/share/pixmaps
200 doins ${FILESDIR}/icon/firefox-icon.png
201 # Fix bug 54179: Install .desktop file into /usr/share/applications
202 # instead of /usr/share/gnome/apps/Internet (18 Jun 2004 agriffis)
203 insinto /usr/share/applications
204 doins ${FILESDIR}/icon/mozillafirefox.desktop
205
206 # Normally firefox-0.9 must be run as root once before it can be
207 # run as a normal user. Drop in some initialized files to avoid
208 # this.
209 einfo "Extracting firefox-${PV} initialization files"
210 tar xjpf ${FILESDIR}/firefox-0.9-init.tar.bz2 -C ${D}/usr/$(get_libdir)/MozillaFirefox
211 }
212
213 pkg_preinst() {
214 export MOZILLA_FIVE_HOME=${ROOT}/usr/$(get_libdir)/MozillaFirefox
215
216 # Remove the old plugins dir
217 pkg_mv_plugins /usr/$(get_libdir)/MozillaFirefox/plugins
218
219 # Remove entire installed instance to prevent all kinds of
220 # problems... see bug 44772 for example
221 rm -rf "${MOZILLA_FIVE_HOME}"
222 }
223
224 pkg_postinst() {
225 export MOZILLA_FIVE_HOME="${ROOT}/usr/$(get_libdir)/MozillaFirefox"
226
227 # Needed to update the run time bindings for REGXPCOM
228 # (do not remove next line!)
229 env-update
230
231 # Register Components and Chrome
232 #
233 # Bug 67031: Set HOME=~root in case this is being emerged via sudo.
234 # Otherwise the following commands will create ~/.mozilla owned by root
235 # and 700 perms, which makes subsequent execution of firefox by user
236 # impossible.
237 einfo "Registering Components and Chrome..."
238 HOME=~root LD_LIBRARY_PATH=/usr/$(get_libdir)/MozillaFirefox ${MOZILLA_FIVE_HOME}/regxpcom
239 HOME=~root LD_LIBRARY_PATH=/usr/$(get_libdir)/MozillaFirefox ${MOZILLA_FIVE_HOME}/regchrome
240
241 # Fix permissions of component registry
242 chmod 0644 ${MOZILLA_FIVE_HOME}/components/compreg.dat
243
244 # Fix directory permissions
245 find ${MOZILLA_FIVE_HOME}/ -type d -perm 0700 -exec chmod 0755 {} \; || :
246
247 # Fix permissions on chrome files
248 find ${MOZILLA_FIVE_HOME}/chrome/ -name '*.rdf' -exec chmod 0644 {} \; || :
249
250 # This should be called in the postinst and postrm of all the
251 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
252 # thunderbird-bin ebuilds.
253 update_mozilla_launcher_symlinks
254 }
255
256 pkg_postrm() {
257 update_mozilla_launcher_symlinks
258 }

  ViewVC Help
Powered by ViewVC 1.1.20