- link with libxpcom_core to get NS_NewGenericModule2 symbol
[packages/firefox.git] / mozilla-firefox.spec
CommitLineData
0d00fa1b
AM
1# TODO:
2# - handle locales differently (runtime, since it's possible to do)
3# - see ftp://ftp.debian.org/debian/pool/main/m/mozilla-firefox/*diff*
f37c2ce5
ER
4# for hints how to make locales
5# - make it more pld-like (bookmarks, default page etc..)
2f695f11 6#
ca6a7239
JB
7# Conditional build:
8%bcond_with tests # enable tests (whatever they check)
56cf7ebf 9%bcond_without gnome # disable all GNOME components (gnomevfs, gnome, gnomeui)
66c76b1e 10%bcond_with tidy # enable htmlvalidator extension (tidy)
5bc92bd8
ER
11#
12%define _tidy_ver 0.839
13%define _firefox_ver 2.0.0.4
c4f9bb37 14#
52dbdf60 15Summary: Firefox Community Edition web browser
948d1385 16Summary(pl.UTF-8): Firefox Community Edition - przeglądarka WWW
ea721d92 17Name: mozilla-firefox
8033a708 18Version: 2.0.0.4
19Release: 1
ea721d92 20License: MPL/LGPL
51c0f20a 21Group: X11/Applications/Networking
8359e4e0 22Source0: ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2
8033a708 23# Source0-md5: 99c14794976b2532addfcd2d836c6bb2
5bc92bd8
ER
24Source1: http://users.skynet.be/mgueury/mozilla/tidy_08x_source.zip
25# Source1-md5: ad63736e9d57de3e6c69696319b34b3b
26Source2: %{name}.desktop
27Source3: %{name}.sh
d541162e 28Patch0: mozilla-install.patch
52befddb 29Patch1: %{name}-lib_path.patch
5bc92bd8 30Patch2: %{name}-addon-tidy.patch
52befddb 31Patch3: %{name}-nopangoxft.patch
52befddb 32Patch5: %{name}-fonts.patch
524aaeae 33Patch69: %{name}-agent.patch
4d687af8 34Patch7: %{name}-myspell.patch
f37c2ce5
ER
35# if ac rebuild is needed...
36#PatchX: %{name}-ac.patch
5f561b4c 37URL: http://www.mozilla.org/projects/firefox/
56cf7ebf 38%{?with_gnome:BuildRequires: GConf2-devel >= 1.2.1}
e933d2a8 39BuildRequires: automake
56cf7ebf 40BuildRequires: cairo-devel >= 1.0.0
75e09104 41%{?with_gnome:BuildRequires: gnome-vfs2-devel >= 2.0}
af914259 42BuildRequires: gtk+2-devel >= 1:2.0.0
809fe433 43BuildRequires: krb5-devel
8a88dcf7 44BuildRequires: libIDL-devel >= 0.8.0
56cf7ebf 45%{?with_gnome:BuildRequires: libgnome-devel >= 2.0}
46%{?with_gnome:BuildRequires: libgnomeui-devel >= 2.2.0}
ea721d92 47BuildRequires: libjpeg-devel >= 6b
1dd3785b 48BuildRequires: libpng-devel >= 1.2.7
ea721d92 49BuildRequires: libstdc++-devel
4d687af8 50BuildRequires: myspell-devel
f37c2ce5
ER
51BuildRequires: nspr-devel >= 1:4.6.3
52BuildRequires: nss-devel >= 1:3.11.3-3
5bc92bd8 53%{?with_tidy:BuildRequires: opensp-devel}
56cf7ebf 54BuildRequires: pango-devel >= 1:1.6.0
55BuildRequires: perl-modules >= 5.004
1bb00684 56BuildRequires: pkgconfig
4d9eecad 57BuildRequires: rpmbuild(macros) >= 1.356
446ffaab
JB
58BuildRequires: xorg-lib-libXext-devel
59BuildRequires: xorg-lib-libXft-devel >= 2.1
60BuildRequires: xorg-lib-libXinerama-devel
61BuildRequires: xorg-lib-libXp-devel
de5abc0a 62BuildRequires: xorg-lib-libXt-devel
b0a3aa79 63BuildRequires: zip
1dd3785b 64BuildRequires: zlib-devel >= 1.2.3
f37c2ce5 65Requires(post): mktemp >= 1.5-18
ca6a7239 66Requires: %{name}-lang-resources = %{version}
f37c2ce5 67Requires: %{name}-libs = %{epoch}:%{version}-%{release}
1408fb17 68Requires: browser-plugins >= 2.0
f37c2ce5 69Requires: nspr >= 1:4.6.3
1a285f98 70Requires: nss >= 1:3.11.3
0d52cac8 71Provides: wwwbrowser
51c0f20a 72Obsoletes: mozilla-firebird
ea721d92 73BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
74
34dd92dd
JB
75# firefox/thunderbird/seamonkey provide their own versions
76%define _noautoreqdep libgkgfx.so libgtkxtbin.so libjsj.so libxpcom_compat.so libxpcom_core.so
6162f349 77%define _noautoprovfiles %{_libdir}/%{name}/components
4c7e703c 78# we don't want these to satisfy xulrunner-devel
626daa28 79%define _noautoprov libgtkembedmoz.so libmozjs.so libxpcom.so libxul.so
4c7e703c 80# and as we don't provide them, don't require either
626daa28 81%define _noautoreq libgtkembedmoz.so libmozjs.so libxpcom.so libxul.so
c14d6140 82
2de50ddb 83%define specflags -fno-strict-aliasing -fno-tree-vrp -fno-stack-protector
d3b02e37 84
ea721d92 85%description
52dbdf60
ER
86Firefox Community Edition is an open-source web browser, designed for
87standards compliance, performance and portability.
ea721d92 88
eace6cdf 89%description -l pl.UTF-8
c0bec9dd 90Firefox Community Edition jest przeglądarką WWW rozpowszechnianą
e236f127 91zgodnie z ideami ruchu otwartego oprogramowania oraz tworzoną z myślą
92o zgodności ze standardami, wydajnością i przenośnością.
ea721d92 93
f37c2ce5 94%package libs
52dbdf60 95Summary: Firefox Community Edition shared libraries
948d1385 96Summary(pl.UTF-8): Biblioteki współdzielone przeglądarki Firefox Community Edition
f37c2ce5 97Group: Libraries
7c40e3fe 98Conflicts: mozilla-firefox < 2.0-1.4
f37c2ce5
ER
99
100%description libs
52dbdf60 101Firefox Community Edition shared libraries.
f37c2ce5 102
eace6cdf
JR
103%description libs -l pl.UTF-8
104Biblioteki współdzielone przeglądarki Firefox Community Edition.
7c40e3fe 105
cdbdbff1 106%package lang-en
52dbdf60 107Summary: English resources for Firefox Community Edition
948d1385 108Summary(pl.UTF-8): Anglojęzyczne zasoby dla przeglądarki Firefox Community Edition
22a45100 109Group: X11/Applications/Networking
ca6a7239
JB
110Requires: %{name} = %{version}-%{release}
111Provides: %{name}-lang-resources = %{version}-%{release}
cdbdbff1 112
113%description lang-en
52dbdf60 114English resources for Firefox Community Edition.
cdbdbff1 115
eace6cdf
JR
116%description lang-en -l pl.UTF-8
117Anglojęzyczne zasoby dla przeglądarki Firefox Community Edition.
cdbdbff1 118
ea721d92 119%prep
5bc92bd8
ER
120%setup -qc %{?with_tidy:-a1}
121%if %{with tidy}
122mv mozilla_tidy_source/mozilla/extensions/tidy mozilla/extensions/tidy
123mv mozilla_tidy_source/tidy_extension .
124rm -rf mozilla/extensions/tidy/opensp
125%endif
56143477 126cd mozilla
d541162e 127%patch0 -p1
52befddb 128%patch1 -p1
e214dcc1 129%{?with_tidy:%patch2 -p1}
52befddb 130%patch3 -p1
52befddb 131%patch5 -p1
4d687af8 132%patch7 -p1
524aaeae 133%patch69 -p1
a4a42caf 134
f37c2ce5
ER
135# use system
136#rm -rf mozilla/nsprpub mozilla/security/nss
137
ea721d92 138%build
56143477 139cd mozilla
f37c2ce5
ER
140export CFLAGS="%{rpmcflags} $(%{_bindir}/pkg-config mozilla-nspr --cflags-only-I)"
141export CXXFLAGS="%{rpmcflags} $(%{_bindir}/pkg-config mozilla-nspr --cflags-only-I)"
52befddb 142
143cp -f %{_datadir}/automake/config.* build/autoconf
144cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
145cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf
146
52befddb 147cat << 'EOF' > .mozconfig
148. $topsrcdir/browser/config/mozconfig
149
f37c2ce5 150# Options for 'configure' (same as command-line options).
52befddb 151ac_add_options --prefix=%{_prefix}
152ac_add_options --exec-prefix=%{_exec_prefix}
153ac_add_options --bindir=%{_bindir}
154ac_add_options --sbindir=%{_sbindir}
155ac_add_options --sysconfdir=%{_sysconfdir}
156ac_add_options --datadir=%{_datadir}
157ac_add_options --includedir=%{_includedir}
158ac_add_options --libdir=%{_libdir}
159ac_add_options --libexecdir=%{_libexecdir}
160ac_add_options --localstatedir=%{_localstatedir}
161ac_add_options --sharedstatedir=%{_sharedstatedir}
162ac_add_options --mandir=%{_mandir}
163ac_add_options --infodir=%{_infodir}
cf471ce5 164%if %{?debug:1}0
f37c2ce5 165ac_add_options --disable-optimize
52befddb 166ac_add_options --enable-debug
167ac_add_options --enable-debug-modules
f37c2ce5
ER
168ac_add_options --enable-debugger-info-modules
169ac_add_options --enable-crash-on-assert
52befddb 170%else
171ac_add_options --disable-debug
f37c2ce5
ER
172ac_add_options --disable-logging
173ac_add_options --enable-optimize="%{rpmcflags}"
52befddb 174%endif
175%if %{with tests}
176ac_add_options --enable-tests
c4f9bb37 177%else
52befddb 178ac_add_options --disable-tests
c4f9bb37 179%endif
f37c2ce5
ER
180%if %{with gnome}
181ac_add_options --enable-gnomevfs
182ac_add_options --enable-gnomeui
183%else
184ac_add_options --disable-gnomevfs
185ac_add_options --disable-gnomeui
186%endif
52befddb 187ac_add_options --disable-freetype2
188ac_add_options --disable-installer
f37c2ce5
ER
189ac_add_options --disable-javaxpcom
190ac_add_options --disable-updater
52befddb 191ac_add_options --enable-default-toolkit=gtk2
164d575d 192ac_add_options --enable-svg
52befddb 193ac_add_options --enable-system-cairo
4d687af8 194ac_add_options --enable-system-myspell
52befddb 195ac_add_options --enable-xft
f37c2ce5 196ac_add_options --with-distribution-id=org.pld-linux
52befddb 197ac_add_options --with-system-nspr
f37c2ce5 198ac_add_options --with-system-nss
52befddb 199ac_add_options --with-system-zlib
f37c2ce5
ER
200ac_add_options --with-system-jpeg
201ac_add_options --with-system-png
6162f349 202ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
52befddb 203ac_cv_visibility_pragma=no
204EOF
33f81726 205
1698621e 206%{__make} -j1 -f client.mk build \
3d445135 207 CC="%{__cc}" \
33f81726 208 CXX="%{__cxx}"
ea721d92 209
210%install
211rm -rf $RPM_BUILD_ROOT
56143477 212cd mozilla
45f27404 213install -d \
f37c2ce5 214 $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}} \
45f27404 215 $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
93639547 216 $RPM_BUILD_ROOT%{_datadir}/%{name}
75e09104 217
6162f349 218%browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins
4d9eecad 219
f37c2ce5 220%{__make} -C xpinstall/packager stage-package \
d541162e 221 DESTDIR=$RPM_BUILD_ROOT \
6162f349 222 MOZ_PKG_APPDIR=%{_libdir}/%{name} \
f37c2ce5 223 PKG_SKIP_STRIP=1
ea721d92 224
f86547d4
ER
225# move arch independant ones to datadir
226mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome
227mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/defaults
f86547d4
ER
228mv $RPM_BUILD_ROOT%{_libdir}/%{name}/extensions $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions
229mv $RPM_BUILD_ROOT%{_libdir}/%{name}/greprefs $RPM_BUILD_ROOT%{_datadir}/%{name}/greprefs
230mv $RPM_BUILD_ROOT%{_libdir}/%{name}/icons $RPM_BUILD_ROOT%{_datadir}/%{name}/icons
231mv $RPM_BUILD_ROOT%{_libdir}/%{name}/init.d $RPM_BUILD_ROOT%{_datadir}/%{name}/init.d
232mv $RPM_BUILD_ROOT%{_libdir}/%{name}/res $RPM_BUILD_ROOT%{_datadir}/%{name}/res
233mv $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins $RPM_BUILD_ROOT%{_datadir}/%{name}/searchplugins
234ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
235ln -s ../../share/%{name}/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults
f86547d4
ER
236ln -s ../../share/%{name}/extensions $RPM_BUILD_ROOT%{_libdir}/%{name}/extensions
237ln -s ../../share/%{name}/greprefs $RPM_BUILD_ROOT%{_libdir}/%{name}/greprefs
238ln -s ../../share/%{name}/icons $RPM_BUILD_ROOT%{_libdir}/%{name}/icons
239ln -s ../../share/%{name}/init.d $RPM_BUILD_ROOT%{_libdir}/%{name}/init.d
240ln -s ../../share/%{name}/res $RPM_BUILD_ROOT%{_libdir}/%{name}/res
241ln -s ../../share/%{name}/searchplugins $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins
242
ade6d95c 243rm -rf $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
4d687af8
ER
244ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
245
5bc92bd8 246sed 's,@LIBDIR@,%{_libdir},' %{SOURCE3} > $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
f37c2ce5 247ln -s mozilla-firefox $RPM_BUILD_ROOT%{_bindir}/firefox
ea721d92 248
f37c2ce5 249install browser/base/branding/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png
ea721d92 250
5bc92bd8 251install %{SOURCE2} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
ea721d92 252
7c40e3fe 253# header/development files
93639547
ER
254rm $RPM_BUILD_ROOT%{_libdir}/%{name}/xpidl
255rm $RPM_BUILD_ROOT%{_libdir}/%{name}/xpt_dump
256rm $RPM_BUILD_ROOT%{_libdir}/%{name}/xpt_link
75e09104 257
f37c2ce5 258# files created by regxpcom and firefox -register
6162f349
ER
259touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat
260touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat
f37c2ce5 261
f86547d4
ER
262# what's this? it's content is invalid anyway.
263rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
264
f37c2ce5 265cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/%{name}-chrome+xpcom-generate
6d77929c 266#!/bin/sh
050f03d2 267umask 022
6162f349 268rm -f %{_libdir}/%{name}/components/{compreg,xpti}.dat
3eeab518 269
f37c2ce5
ER
270# it attempts to touch files in $HOME/.mozilla
271# beware if you run this with sudo!!!
272export HOME=$(mktemp -d)
273# also TMPDIR could be pointing to sudo user's homedir
274unset TMPDIR TMP || :
3eeab518 275
6162f349
ER
276LD_LIBRARY_PATH=%{_libdir}/%{name}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %{_libdir}/%{name}/regxpcom
277%{_libdir}/%{name}/firefox -register
3eeab518 278
56143477 279rm -rf $HOME
6d77929c 280EOF
3eeab518 281
6d77929c
JB
282%clean
283rm -rf $RPM_BUILD_ROOT
3eeab518 284
b1662829 285%pretrans
ade6d95c
ER
286if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
287 mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
288fi
4d687af8 289for d in chrome defaults extensions greprefs icons init.d res searchplugins; do
f86547d4
ER
290 if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
291 install -d %{_datadir}/%{name}
292 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
293 fi
294done
295exit 0
296
6d77929c 297%post
f37c2ce5 298%{_sbindir}/%{name}-chrome+xpcom-generate
4d9eecad
ER
299%update_browser_plugins
300
301%postun
302if [ "$1" = 0 ]; then
303 %update_browser_plugins
304fi
ea0245e6 305
ea721d92 306%files
307%defattr(644,root,root,755)
f37c2ce5 308%attr(755,root,root) %{_bindir}/%{name}
fb0d8197 309%attr(755,root,root) %{_bindir}/firefox
f37c2ce5
ER
310%attr(755,root,root) %{_sbindir}/%{name}-chrome+xpcom-generate
311
4d9eecad
ER
312# browser plugins v2
313%{_browserpluginsconfdir}/browsers.d/%{name}.*
314%config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
315
6162f349
ER
316%dir %{_libdir}/%{name}/components
317%attr(755,root,root) %{_libdir}/%{name}/components/*.so
318%{_libdir}/%{name}/components/*.js
319%{_libdir}/%{name}/components/*.xpt
320%dir %{_libdir}/%{name}/plugins
321%attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
6162f349
ER
322%attr(755,root,root) %{_libdir}/%{name}/*.sh
323%attr(755,root,root) %{_libdir}/%{name}/m*
324%attr(755,root,root) %{_libdir}/%{name}/f*
325%attr(755,root,root) %{_libdir}/%{name}/regxpcom
93639547
ER
326%attr(755,root,root) %{_libdir}/%{name}/xpcshell
327%attr(755,root,root) %{_libdir}/%{name}/xpicleanup
328%{_pixmapsdir}/mozilla-firefox.png
329%{_desktopdir}/mozilla-firefox.desktop
cdbdbff1 330
f86547d4
ER
331# symlinks
332%{_libdir}/%{name}/chrome
333%{_libdir}/%{name}/defaults
334%{_libdir}/%{name}/dictionaries
335%{_libdir}/%{name}/extensions
336%{_libdir}/%{name}/greprefs
337%{_libdir}/%{name}/icons
338%{_libdir}/%{name}/init.d
339%{_libdir}/%{name}/res
340%{_libdir}/%{name}/searchplugins
f37c2ce5
ER
341
342# browserconfig
6162f349 343%{_libdir}/%{name}/browserconfig.properties
f37c2ce5 344
6162f349
ER
345%{_libdir}/%{name}/LICENSE
346%{_libdir}/%{name}/README.txt
f86547d4
ER
347
348%dir %{_datadir}/%{name}
349%{_datadir}/%{name}/chrome
350%{_datadir}/%{name}/defaults
f86547d4
ER
351%{_datadir}/%{name}/greprefs
352%{_datadir}/%{name}/icons
353%{_datadir}/%{name}/init.d
354%{_datadir}/%{name}/res
355%{_datadir}/%{name}/searchplugins
356
357%dir %{_datadir}/%{name}/extensions
358# -dom-inspector subpackage?
359%{_datadir}/%{name}/extensions/inspector@mozilla.org
360# the signature of the default theme
361%{_datadir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
f37c2ce5
ER
362
363# files created by regxpcom and firefox -register
6162f349
ER
364%ghost %{_libdir}/%{name}/components/compreg.dat
365%ghost %{_libdir}/%{name}/components/xpti.dat
f37c2ce5
ER
366
367%files libs
368%defattr(644,root,root,755)
6162f349
ER
369%dir %{_libdir}/%{name}
370%attr(755,root,root) %{_libdir}/%{name}/*.so
f37c2ce5 371
cdbdbff1 372%files lang-en
ecf01c4d 373%defattr(644,root,root,755)
f86547d4
ER
374%{_datadir}/%{name}/chrome/en-US.jar
375%{_datadir}/%{name}/chrome/en-US.manifest
This page took 0.945167 seconds and 4 git commands to generate.