f58ee9503d70dffa98e86fcdbec1d8491b671a4d
[packages/firefox.git] / mozilla-firefox.spec
1 # NOTE: PLD distributes iceweasel instead
2 #
3 # TODO:
4 # - (12:22:58)  patrys:  can you also move _libdir/mozilla-firefox to just _libdir/firefox?
5 #   (12:23:25)  patrys:  it's not like we ship official firefox
6 # - fix wrapper script to allow playing with profiles (must not use -remote)
7 #
8 # Conditional build:
9 %bcond_with     tests           # enable tests (whatever they check)
10 %bcond_with     gtk3            # GTK+ 3.x instead of 2.x
11 %bcond_without  kerberos        # disable krb5 support
12 %bcond_with     xulrunner       # system xulrunner [no longer supported]
13 %bcond_with     shared_js       # shared libmozjs library
14
15 %if %{without xulrunner}
16 # The actual sqlite version (see RHBZ#480989):
17 %define         sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo ERROR)
18 %endif
19
20 %define         nspr_ver        4.10.8
21 %define         nss_ver         3.18.1
22
23 Summary:        Firefox Community Edition web browser
24 Summary(pl.UTF-8):      Firefox Community Edition - przeglądarka WWW
25 Name:           mozilla-firefox
26 Version:        38.0.1
27 Release:        1
28 License:        MPL v2.0
29 Group:          X11/Applications/Networking
30 Source0:        http://releases.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}.source.tar.bz2
31 # Source0-md5:  3c496e4ec072327b1ef2b820f15dff26
32 Source3:        %{name}.desktop
33 Source4:        %{name}.sh
34 Source5:        vendor.js
35 Source6:        vendor-ac.js
36 Patch0:         %{name}-branding.patch
37 Patch7:         %{name}-prefs.patch
38 Patch9:         %{name}-no-subshell.patch
39 Patch11:        %{name}-middle_click_paste.patch
40 Patch12:        %{name}-packaging.patch
41 Patch13:        %{name}-system-virtualenv.patch
42 Patch15:        %{name}-Disable-Firefox-Health-Report.patch
43 URL:            http://www.mozilla.org/projects/firefox/
44 BuildRequires:  OpenGL-devel
45 BuildRequires:  alsa-lib-devel
46 BuildRequires:  automake
47 BuildRequires:  bzip2-devel
48 BuildRequires:  cairo-devel >= 1.10.2-5
49 BuildRequires:  dbus-glib-devel >= 0.60
50 BuildRequires:  freetype-devel >= 1:2.1.8
51 BuildRequires:  gcc-c++ >= 6:4.4
52 BuildRequires:  glib2-devel >= 1:2.22
53 BuildRequires:  gstreamer-devel >= 1.0
54 BuildRequires:  gstreamer-plugins-base-devel >= 1.0
55 %{!?with_gtk3:BuildRequires:    gtk+2-devel >= 2:2.18.0}
56 %{?with_gtk3:BuildRequires:     gtk+3-devel >= 3.4.0}
57 %{?with_kerberos:BuildRequires: heimdal-devel >= 0.7.1}
58 BuildRequires:  hunspell-devel >= 1.2.3
59 BuildRequires:  libIDL-devel >= 0.8.0
60 # DECnet (dnprogs.spec), not dummy net (libdnet.spec)
61 #BuildRequires: libdnet-devel
62 BuildRequires:  libevent-devel >= 1.4.7
63 # standalone libffi 3.0.9 or gcc's from 4.5(?)+
64 BuildRequires:  libffi-devel >= 6:3.0.9
65 BuildRequires:  libicu-devel >= 50.1
66 # requires libjpeg-turbo implementing at least libjpeg 6b API
67 BuildRequires:  libjpeg-devel >= 6b
68 BuildRequires:  libjpeg-turbo-devel
69 BuildRequires:  libpng(APNG)-devel >= 0.10
70 BuildRequires:  libpng-devel >= 2:1.6.16
71 BuildRequires:  libstdc++-devel >= 6:4.4
72 BuildRequires:  libvpx-devel >= 1.3.0
73 BuildRequires:  nspr-devel >= 1:%{nspr_ver}
74 BuildRequires:  nss-devel >= 1:%{nss_ver}
75 BuildRequires:  pango-devel >= 1:1.22.0
76 BuildRequires:  pixman-devel >= 0.19.2
77 BuildRequires:  perl-modules >= 5.004
78 BuildRequires:  pkgconfig
79 BuildRequires:  pkgconfig(libffi) >= 3.0.9
80 BuildRequires:  pulseaudio-devel
81 BuildRequires:  python-modules >= 1:2.5
82 BuildRequires:  python-simplejson
83 BuildRequires:  python-virtualenv >= 1.9.1-4
84 BuildRequires:  readline-devel
85 BuildRequires:  rpm >= 4.4.9-56
86 BuildRequires:  rpmbuild(macros) >= 1.601
87 BuildRequires:  sqlite3-devel >= 3.8.9
88 BuildRequires:  startup-notification-devel >= 0.8
89 BuildRequires:  xorg-lib-libXScrnSaver-devel
90 BuildRequires:  xorg-lib-libXext-devel
91 BuildRequires:  xorg-lib-libXinerama-devel
92 BuildRequires:  xorg-lib-libXt-devel
93 %if %{with xulrunner}
94 BuildRequires:  xulrunner-devel >= 2:%{version}
95 %endif
96 BuildRequires:  zip
97 BuildRequires:  zlib-devel >= 1.2.3
98 Requires(post): mktemp >= 1.5-18
99 Requires:       browser-plugins >= 2.0
100 Requires:       desktop-file-utils
101 Requires:       hicolor-icon-theme
102 %if %{with xulrunner}
103 %requires_eq_to xulrunner xulrunner-devel
104 %else
105 Requires:       cairo >= 1.10.2-5
106 Requires:       dbus-glib >= 0.60
107 Requires:       glib2 >= 1:2.22
108 %{!?with_gtk3:Requires: gtk+2 >= 2:2.18.0}
109 %{?with_gtk3:Requires:  gtk+3 >= 3.4.0}
110 Requires:       libjpeg-turbo
111 Requires:       libpng >= 2:1.6.16
112 Requires:       libpng(APNG) >= 0.10
113 Requires:       libvpx >= 1.3.0
114 Requires:       myspell-common
115 Requires:       nspr >= 1:%{nspr_ver}
116 Requires:       nss >= 1:%{nss_ver}
117 Requires:       pango >= 1:1.22.0
118 Requires:       sqlite3 >= %{sqlite_build_version}
119 Requires:       startup-notification >= 0.8
120 %endif
121 Provides:       wwwbrowser
122 Obsoletes:      mozilla-firebird
123 Obsoletes:      mozilla-firefox-lang-en < 2.0.0.8-3
124 Obsoletes:      mozilla-firefox-libs
125 Conflicts:      mozilla-firefox-lang-resources < %{version}
126 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
127
128 %define         filterout_cpp           -D_FORTIFY_SOURCE=[0-9]+
129
130 # don't satisfy other packages (don't use %{name} here)
131 %define         _noautoprovfiles        %{_libdir}/mozilla-firefox
132 %if %{without xulrunner}
133 # and as we don't provide them, don't require either
134 %define         _noautoreq      libmozalloc.so libmozjs.so libxul.so
135 %endif
136
137 %description
138 Firefox Community Edition is an open-source web browser, designed for
139 standards compliance, performance and portability.
140
141 %description -l pl.UTF-8
142 Firefox Community Edition jest przeglądarką WWW rozpowszechnianą
143 zgodnie z ideami ruchu otwartego oprogramowania oraz tworzoną z myślą
144 o zgodności ze standardami, wydajnością i przenośnością.
145
146 %prep
147 %setup -qc
148 mv -f mozilla-release mozilla
149 cd mozilla
150
151 %patch0 -p1
152 %patch7 -p1
153 %patch9 -p2
154 %patch11 -p2
155 %patch12 -p1
156 %patch13 -p2
157 %patch15 -p1
158
159 %build
160 cd mozilla
161 cp -pf %{_datadir}/automake/config.* build/autoconf
162
163 cat << 'EOF' > .mozconfig
164 . $topsrcdir/browser/config/mozconfig
165
166 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-%{_target_cpu}
167
168 # Options for 'configure' (same as command-line options).
169 ac_add_options --build=%{_target_platform}
170 ac_add_options --host=%{_target_platform}
171 ac_add_options --prefix=%{_prefix}
172 ac_add_options --exec-prefix=%{_exec_prefix}
173 ac_add_options --bindir=%{_bindir}
174 ac_add_options --sbindir=%{_sbindir}
175 ac_add_options --sysconfdir=%{_sysconfdir}
176 ac_add_options --datadir=%{_datadir}
177 ac_add_options --includedir=%{_includedir}
178 ac_add_options --libdir=%{_libdir}
179 ac_add_options --libexecdir=%{_libexecdir}
180 ac_add_options --localstatedir=%{_localstatedir}
181 ac_add_options --sharedstatedir=%{_sharedstatedir}
182 ac_add_options --mandir=%{_mandir}
183 ac_add_options --infodir=%{_infodir}
184 %if %{?debug:1}0
185 ac_add_options --disable-optimize
186 ac_add_options --enable-debug
187 ac_add_options --enable-debug-modules
188 ac_add_options --enable-debugger-info-modules
189 ac_add_options --enable-crash-on-assert
190 %else
191 ac_add_options --disable-debug
192 ac_add_options --disable-debug-modules
193 ac_add_options --disable-logging
194 ac_add_options --enable-optimize="%{rpmcflags} -Os"
195 %endif
196 ac_add_options --disable-strip
197 ac_add_options --disable-strip-libs
198 ac_add_options --disable-install-strip
199 %if %{with tests}
200 ac_add_options --enable-tests
201 ac_add_options --enable-mochitest
202 %else
203 ac_add_options --disable-tests
204 ac_add_options --disable-mochitest
205 %endif
206 ac_add_options --disable-cpp-exceptions
207 ac_add_options --disable-crashreporter
208 ac_add_options --disable-elf-dynstr-gc
209 ac_add_options --disable-gconf
210 ac_add_options --disable-gnomeui
211 ac_add_options --disable-gnomevfs
212 ac_add_options --disable-installer
213 ac_add_options --disable-javaxpcom
214 ac_add_options --disable-long-long-warning
215 ac_add_options --disable-necko-wifi
216 ac_add_options --disable-pedantic
217 ac_add_options --disable-updater
218 ac_add_options --disable-xterm-updates
219 ac_add_options --enable-canvas
220 ac_add_options --enable-chrome-format=omni
221 ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
222 ac_add_options --enable-extensions=default
223 ac_add_options --enable-gio
224 ac_add_options --enable-gstreamer=1.0
225 ac_add_options --enable-libxul
226 ac_add_options --enable-mathml
227 ac_add_options --enable-pango
228 ac_add_options --enable-readline
229 ac_add_options --enable-safe-browsing
230 %{?with_shared_js:ac_add_options --enable-shared-js}
231 ac_add_options --enable-startup-notification
232 ac_add_options --enable-svg
233 ac_add_options --enable-system-cairo
234 ac_add_options --enable-system-ffi
235 ac_add_options --enable-system-hunspell
236 ac_add_options --enable-system-sqlite
237 ac_add_options --enable-url-classifier
238 ac_add_options --enable-xinerama
239 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
240 ac_add_options --with-distribution-id=org.pld-linux
241 %if %{with xulrunner}
242 ac_add_options --with-libxul-sdk=$(pkg-config --variable=sdkdir libxul)
243 %endif
244 ac_add_options --with-pthreads
245 ac_add_options --with-system-bz2
246 ac_add_options --with-system-icu
247 ac_add_options --with-system-jpeg
248 ac_add_options --with-system-libevent
249 ac_add_options --with-system-libvpx
250 ac_add_options --with-system-nspr
251 ac_add_options --with-system-nss
252 ac_add_options --with-system-ply
253 ac_add_options --with-system-png
254 ac_add_options --with-system-zlib
255 ac_add_options --with-x
256 EOF
257
258 %{__make} -j1 -f client.mk build \
259         CC="%{__cc}" \
260         CXX="%{__cxx}" \
261         MOZ_MAKE_FLAGS="%{_smp_mflags}"
262
263 %install
264 rm -rf $RPM_BUILD_ROOT
265 cd mozilla
266 install -d \
267         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}} \
268         $RPM_BUILD_ROOT%{_desktopdir} \
269         $RPM_BUILD_ROOT%{_datadir}/%{name}/browser \
270         $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/plugins
271
272 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/browser/plugins
273
274 %{__make} -C obj-%{_target_cpu}/browser/installer stage-package \
275         DESTDIR=$RPM_BUILD_ROOT \
276         installdir=%{_libdir}/%{name} \
277         PKG_SKIP_STRIP=1
278
279 cp -a obj-%{_target_cpu}/dist/firefox/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
280
281 %if %{with xulrunner}
282 # >= 5.0 seems to require this
283 ln -s ../xulrunner $RPM_BUILD_ROOT%{_libdir}/%{name}/xulrunner
284 %endif
285
286 # move arch independant ones to datadir
287 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/chrome
288 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/extensions $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/extensions
289 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/icons $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/icons
290 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/searchplugins $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/searchplugins
291 %if %{without xulrunner}
292 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/defaults
293 mv $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/defaults/{pref,preferences}
294 %else
295 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/defaults
296 %endif
297
298 ln -s ../../../share/%{name}/browser/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/chrome
299 ln -s ../../../share/%{name}/browser/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/defaults
300 ln -s ../../../share/%{name}/browser/extensions $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/extensions
301 ln -s ../../../share/%{name}/browser/icons $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/icons
302 ln -s ../../../share/%{name}/browser/searchplugins $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/searchplugins
303
304 %if %{without xulrunner}
305 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
306 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
307 %endif
308
309 sed 's,@LIBDIR@,%{_libdir},' %{SOURCE4} > $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
310 chmod 755 $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
311 ln -s mozilla-firefox $RPM_BUILD_ROOT%{_bindir}/firefox
312
313 # install icons and desktop file
314 for i in 48 64; do
315         install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps
316         cp -a browser/branding/unofficial/content/icon${i}.png \
317                 $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps/mozilla-firefox.png
318 done
319
320 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
321
322 # install our settings
323 %if "%{pld_release}" == "ac"
324 cp -a %{SOURCE6} $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/defaults/preferences/vendor.js
325 %else
326 cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/defaults/preferences/vendor.js
327 %endif
328
329 # files created by firefox -register
330 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/components/compreg.dat
331 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/components/xpti.dat
332
333 cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/%{name}-chrome+xpcom-generate
334 #!/bin/sh
335 umask 022
336 rm -f %{_libdir}/%{name}/browser/components/{compreg,xpti}.dat
337
338 # it attempts to touch files in $HOME/.mozilla
339 # beware if you run this with sudo!!!
340 export HOME=$(mktemp -d)
341 # also TMPDIR could be pointing to sudo user's homedir
342 unset TMPDIR TMP || :
343
344 %{_libdir}/%{name}/firefox -register
345
346 rm -rf $HOME
347 EOF
348 chmod 755 $RPM_BUILD_ROOT%{_sbindir}/%{name}-chrome+xpcom-generate
349
350 %clean
351 rm -rf $RPM_BUILD_ROOT
352
353 %pretrans
354 if [ -d %{_libdir}/%{name}/browser/extensions ] && [ ! -L %{_libdir}/%{name}/browser/extensions ]; then
355         install -d %{_datadir}/%{name}/browser
356         if [ -e %{_datadir}/%{name}/browser/extensions ]; then
357                 mv %{_datadir}/%{name}/browser/extensions{,.rpmsave}
358         fi
359         mv -v %{_libdir}/%{name}/browser/extensions %{_datadir}/%{name}/browser/extensions
360 fi
361 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
362         mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
363 fi
364 exit 0
365
366 %post
367 %{_sbindir}/%{name}-chrome+xpcom-generate
368 %update_browser_plugins
369 %update_icon_cache hicolor
370 %update_desktop_database
371
372 %postun
373 if [ "$1" = 0 ]; then
374         %update_browser_plugins
375         %update_icon_cache hicolor
376 fi
377
378 %files
379 %defattr(644,root,root,755)
380 %attr(755,root,root) %{_bindir}/%{name}
381 %attr(755,root,root) %{_bindir}/firefox
382 %attr(755,root,root) %{_sbindir}/%{name}-chrome+xpcom-generate
383
384 %{_desktopdir}/mozilla-firefox.desktop
385 %{_iconsdir}/hicolor/*/apps/mozilla-firefox.png
386
387 # browser plugins v2
388 %{_browserpluginsconfdir}/browsers.d/%{name}.*
389 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
390
391 %dir %{_libdir}/%{name}
392 %dir %{_libdir}/%{name}/browser
393 %dir %{_libdir}/%{name}/browser/components
394 %dir %{_libdir}/%{name}/browser/plugins
395
396 %dir %{_datadir}/%{name}
397 %dir %{_datadir}/%{name}/browser
398 %dir %{_datadir}/%{name}/browser/extensions
399 %{_datadir}/%{name}/browser/chrome
400 %{_datadir}/%{name}/browser/defaults
401 %{_datadir}/%{name}/browser/icons
402 %{_datadir}/%{name}/browser/searchplugins
403
404 # symlinks
405 %{_libdir}/%{name}/browser/extensions
406 %{_libdir}/%{name}/browser/chrome
407 %{_libdir}/%{name}/browser/icons
408 %{_libdir}/%{name}/browser/searchplugins
409 %if %{with xulrunner}
410 %{_libdir}/%{name}/xulrunner
411 %endif
412 %{_libdir}/%{name}/browser/defaults
413
414 %attr(755,root,root) %{_libdir}/%{name}/firefox
415 %attr(755,root,root) %{_libdir}/%{name}/firefox-bin
416 %attr(755,root,root) %{_libdir}/%{name}/run-mozilla.sh
417 %{_libdir}/%{name}/application.ini
418 %{_libdir}/%{name}/browser/blocklist.xml
419 %{_libdir}/%{name}/browser/chrome.manifest
420 %{_libdir}/%{name}/browser/components/components.manifest
421 %attr(755,root,root) %{_libdir}/%{name}/browser/components/libbrowsercomps.so
422 # the signature of the default theme
423 %{_datadir}/%{name}/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
424 %{_libdir}/%{name}/browser/omni.ja
425 %{_libdir}/%{name}/webapprt
426 %attr(755,root,root) %{_libdir}/%{name}/webapprt-stub
427
428 # files created by firefox -register
429 %ghost %{_libdir}/%{name}/browser/components/compreg.dat
430 %ghost %{_libdir}/%{name}/browser/components/xpti.dat
431
432 %if %{without xulrunner}
433 # private xulrunner instance
434 %{_libdir}/%{name}/dependentlibs.list
435 %{_libdir}/%{name}/platform.ini
436 %dir %{_libdir}/%{name}/components
437 %{_libdir}/%{name}/components/components.manifest
438 %attr(755,root,root) %{_libdir}/%{name}/components/libdbusservice.so
439 %attr(755,root,root) %{_libdir}/%{name}/components/libmozgnome.so
440 %attr(755,root,root) %{_libdir}/%{name}/libmozalloc.so
441 %{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
442 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
443 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
444 %{_libdir}/%{name}/dictionaries
445 %{_libdir}/%{name}/chrome.manifest
446 %{_libdir}/%{name}/omni.ja
447
448 %dir %{_libdir}/%{name}/gmp-clearkey
449 %dir %{_libdir}/%{name}/gmp-clearkey/0.1
450 %{_libdir}/%{name}/gmp-clearkey/0.1/clearkey.info
451 %attr(755,root,root) %{_libdir}/%{name}/gmp-clearkey/0.1/libclearkey.so
452 %endif
This page took 0.070174 seconds and 2 git commands to generate.