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