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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (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.2: +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-r1.ebuild,v 1.2 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"
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 # patch to fix math operations on alpha, makes maps.google.com work!
74 epatch ${DISTDIR}/mozilla-jslibmath-alpha.patch
75
76 if has_version '>=x11-libs/cairo-0.3.0'; then
77 epatch ${FILESDIR}/svg-cairo-0.3.0-fix.patch
78 fi
79
80 # GCC4 compile fix, bug #87800
81 epatch ${FILESDIR}/${P}-gcc4.patch
82 }
83
84 src_compile() {
85 ####################################
86 #
87 # mozconfig, CFLAGS and CXXFLAGS setup
88 #
89 ####################################
90
91 mozconfig_init
92
93 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
94 # regardless of java setting.
95 mozconfig_annotate '' --enable-oji --enable-mathml
96
97 # Other ff-specific settings
98 mozconfig_use_enable mozdevelop jsd
99 mozconfig_use_enable mozdevelop xpctools
100 mozconfig_use_extension mozdevelop venkman
101 mozconfig_use_enable gnome gnomevfs
102 mozconfig_use_extension gnome gnomevfs
103 mozconfig_use_enable mozsvg svg
104 mozconfig_use_enable mozsvg svg-renderer-cairo
105 mozconfig_annotate '' --with-default-mozilla-five-home=/usr/$(get_libdir)/MozillaFirefox
106 mozconfig_annotate '' --prefix=/usr/$(get_libdir)/MozillaFirefox
107
108 # Finalize and report settings
109 mozconfig_final
110
111 # hardened GCC uses -fstack-protector-all by default, and this breaks
112 # firefox.
113 has_hardened && append-flags -fno-stack-protector-all
114 replace-flags -fstack-protector-all -fstack-protector
115
116 ####################################
117 #
118 # Configure and build Firefox
119 #
120 ####################################
121
122 # ./configure picks up the mozconfig stuff
123 export LD="$(tc-getLD)"
124 export CC="$(tc-getCC)"
125 export CXX="$(tc-getCXX)"
126 econf
127
128 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
129 # requirements while compiling
130 edit_makefiles
131
132 emake MOZ_PHOENIX=1 CXX="$(tc-getCXX)" CC="$(tc-getCC)" LD="$(tc-getLD)" || die
133 }
134
135 src_install() {
136 # Plugin path creation
137 PLUGIN_DIR="/usr/$(get_libdir)/nsbrowser/plugins"
138 dodir ${PLUGIN_DIR}
139
140 dodir /usr/$(get_libdir)/MozillaFirefox
141 cp -RL --no-preserve=links ${S}/dist/bin/* ${D}/usr/$(get_libdir)/MozillaFirefox
142
143 einfo "Installing includes and idl files..."
144 # Copy the include and idl files
145 dodir /usr/$(get_libdir)/MozillaFirefox/include/idl /usr/include
146 cd ${S}/dist
147 cp -LfR include/* ${D}/usr/$(get_libdir)/MozillaFirefox/include
148 cp -LfR idl/* ${D}/usr/$(get_libdir)/MozillaFirefox/include/idl
149 dosym /usr/$(get_libdir)/MozillaFirefox/include /usr/include/MozillaFirefox
150
151 # Dirty hack to get some applications using this header running
152 dosym /usr/$(get_libdir)/MozillaFirefox/include/necko/nsIURI.h /usr/lib/MozillaFirefox/include/nsIURI.h
153
154 cd ${S}/build/unix
155 # Fix firefox-config and install it
156 sed -i -e "s:/lib/firefox-${MY_PV}:/$(get_libdir)/MozillaFirefox:g" firefox-config
157 sed -i -e "s:/firefox-${MY_PV}:/MozillaFirefox:g" firefox-config
158 exeinto /usr/$(get_libdir)/MozillaFirefox
159 doexe firefox-config
160 # Fix pkgconfig files and install them
161 insinto /usr/$(get_libdir)/pkgconfig
162 for x in *.pc; do
163 if [[ -f ${x} ]]; then
164 sed -i -e "s:/lib/firefox-${MY_PV}:/$(get_libdir)/MozillaFirefox:g" ${x}
165 sed -i -e "s:/firefox-${MY_PV}:/MozillaFirefox:g" ${x}
166 doins ${x}
167 fi
168 done
169 cd ${S}
170
171
172 #fix permissions
173 chown -R root:root ${D}/usr/$(get_libdir)/MozillaFirefox
174
175 # Plugin path setup (rescuing the existent plugins)
176 src_mv_plugins /usr/$(get_libdir)/MozillaFirefox/plugins
177
178 dodir /usr/bin
179 cat <<EOF >${D}/usr/bin/firefox
180 #!/bin/sh
181 #
182 # Stub script to run mozilla-launcher. We used to use a symlink here but
183 # OOo brokenness makes it necessary to use a stub instead:
184 # http://bugs.gentoo.org/show_bug.cgi?id=78890
185
186 export MOZILLA_LAUNCHER=firefox
187 exec /usr/libexec/mozilla-launcher "\$@"
188 EOF
189 chmod 0755 ${D}/usr/bin/firefox
190 insinto /etc/env.d
191 doins ${FILESDIR}/10MozillaFirefox
192
193 # Set correct libdir in env.d file
194 dosed "s:/usr/lib:/usr/$(get_libdir):" /etc/env.d/10MozillaFirefox
195
196 # Fix icons to look the same everywhere
197 insinto /usr/$(get_libdir)/MozillaFirefox/icons
198 doins ${S}/build/package/rpm/SOURCES/mozicon16.xpm
199 doins ${S}/build/package/rpm/SOURCES/mozicon50.xpm
200
201 # Install icon and .desktop for menu entry
202 insinto /usr/share/pixmaps
203 doins ${FILESDIR}/icon/firefox-icon.png
204 # Fix bug 54179: Install .desktop file into /usr/share/applications
205 # instead of /usr/share/gnome/apps/Internet (18 Jun 2004 agriffis)
206 insinto /usr/share/applications
207 doins ${FILESDIR}/icon/mozillafirefox.desktop
208
209 # Normally firefox-0.9 must be run as root once before it can be
210 # run as a normal user. Drop in some initialized files to avoid
211 # this.
212 einfo "Extracting firefox-${PV} initialization files"
213 tar xjpf ${FILESDIR}/firefox-0.9-init.tar.bz2 -C ${D}/usr/$(get_libdir)/MozillaFirefox
214 }
215
216 pkg_preinst() {
217 export MOZILLA_FIVE_HOME=${ROOT}/usr/$(get_libdir)/MozillaFirefox
218
219 # Remove the old plugins dir
220 pkg_mv_plugins /usr/$(get_libdir)/MozillaFirefox/plugins
221
222 # Remove entire installed instance to prevent all kinds of
223 # problems... see bug 44772 for example
224 rm -rf "${MOZILLA_FIVE_HOME}"
225 }
226
227 pkg_postinst() {
228 export MOZILLA_FIVE_HOME="${ROOT}/usr/$(get_libdir)/MozillaFirefox"
229
230 # Needed to update the run time bindings for REGXPCOM
231 # (do not remove next line!)
232 env-update
233
234 # Register Components and Chrome
235 #
236 # Bug 67031: Set HOME=~root in case this is being emerged via sudo.
237 # Otherwise the following commands will create ~/.mozilla owned by root
238 # and 700 perms, which makes subsequent execution of firefox by user
239 # impossible.
240 einfo "Registering Components and Chrome..."
241 HOME=~root LD_LIBRARY_PATH=/usr/$(get_libdir)/MozillaFirefox ${MOZILLA_FIVE_HOME}/regxpcom
242 HOME=~root LD_LIBRARY_PATH=/usr/$(get_libdir)/MozillaFirefox ${MOZILLA_FIVE_HOME}/regchrome
243
244 # Fix permissions of component registry
245 chmod 0644 ${MOZILLA_FIVE_HOME}/components/compreg.dat
246
247 # Fix directory permissions
248 find ${MOZILLA_FIVE_HOME}/ -type d -perm 0700 -exec chmod 0755 {} \; || :
249
250 # Fix permissions on chrome files
251 find ${MOZILLA_FIVE_HOME}/chrome/ -name '*.rdf' -exec chmod 0644 {} \; || :
252
253 # This should be called in the postinst and postrm of all the
254 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
255 # thunderbird-bin ebuilds.
256 update_mozilla_launcher_symlinks
257 }
258
259 pkg_postrm() {
260 update_mozilla_launcher_symlinks
261 }

  ViewVC Help
Powered by ViewVC 1.1.20