]> git.pld-linux.org Git - packages/iceweasel.git/blob - iceweasel.spec
b33ae9dd28d8b6fda75f8fdce4000abd3e2a08db
[packages/iceweasel.git] / iceweasel.spec
1 # TODO:
2 #  - fix build with system xulrunner (23.0 build with system xul causes unresponsive searchbar)
3 #  - provide proper $DISPLAY for PGO (Xvfb, Xdummy...) for unattended builds
4 #
5 # Conditional build:
6 %bcond_with     tests           # enable tests (whatever they check)
7 %bcond_without  gnomeui         # disable gnomeui support
8 %bcond_without  gnome           # synonym for gnomeui (gconf, libnotify and gio are still enabled)
9 %bcond_without  kerberos        # disable krb5 support
10 %bcond_with     xulrunner       # build with system xulrunner
11 %bcond_with     pgo             # PGO-enabled build (requires working $DISPLAY == :100)
12
13 %if %{without gnome}
14 %undefine       with_gnomeui
15 %endif
16
17 # convert firefox release number to platform version: 19.0.x -> 19.0.x
18 %define         xulrunner_main  23.0
19 %define         xulrunner_ver   %(v=%{version}; echo %{xulrunner_main}${v#23.0})
20
21 %if %{without xulrunner}
22 # The actual sqlite version (see RHBZ#480989):
23 %define         sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo ERROR)
24 %endif
25
26 %define         nspr_ver        4.9.5
27 %define         nss_ver         3.14.3
28
29 Summary:        Iceweasel web browser
30 Summary(hu.UTF-8):      Iceweasel web böngésző
31 Summary(pl.UTF-8):      Iceweasel - przeglądarka WWW
32 Name:           iceweasel
33 Version:        23.0
34 Release:        1
35 License:        MPL 1.1 or GPL v2+ or LGPL v2.1+
36 Group:          X11/Applications/Networking
37 Source0:        http://releases.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}.source.tar.bz2
38 # Source0-md5:  794e0139c4df0392146353c655d94bb9
39 Source1:        %{name}-branding.tar.bz2
40 # Source1-md5:  513af080c920d916362b607a872adf00
41 Source2:        %{name}-rm_nonfree.sh
42 Source3:        %{name}.desktop
43 Source4:        %{name}.sh
44 Source5:        vendor.js
45 Source6:        vendor-ac.js
46 Patch0:         %{name}-branding.patch
47 Patch2:         %{name}-gcc3.patch
48 Patch7:         %{name}-prefs.patch
49 Patch8:         %{name}-pld-branding.patch
50 Patch9:         %{name}-no-subshell.patch
51 Patch10:        system-cairo.patch
52 Patch11:        %{name}-middle_click_paste.patch
53 Patch12:        %{name}-packaging.patch
54 # Edit patch below and restore --system-site-packages when system virtualenv gets 1.7 upgrade
55 Patch13:        system-virtualenv.patch
56 Patch14:        gyp-slashism.patch
57 URL:            http://www.pld-linux.org/Packages/Iceweasel
58 BuildRequires:  GConf2-devel >= 1.2.1
59 BuildRequires:  OpenGL-devel
60 BuildRequires:  ImageMagick
61 BuildRequires:  ImageMagick-coder-png
62 BuildRequires:  alsa-lib-devel
63 BuildRequires:  automake
64 BuildRequires:  bzip2-devel
65 BuildRequires:  cairo-devel >= 1.10.2-5
66 BuildRequires:  dbus-glib-devel >= 0.60
67 BuildRequires:  glib2-devel >= 1:2.20
68 BuildRequires:  gtk+2-devel >= 2:2.14
69 %{?with_kerberos:BuildRequires: heimdal-devel >= 0.7.1}
70 BuildRequires:  hunspell-devel
71 BuildRequires:  libIDL-devel >= 0.8.0
72 BuildRequires:  libdnet-devel
73 BuildRequires:  libevent-devel >= 1.4.7
74 # standalone libffi 3.0.9 or gcc's from 4.5(?)+
75 BuildRequires:  libffi-devel >= 6:3.0.9
76 %{?with_gnomeui:BuildRequires:  libgnomeui-devel >= 2.2.0}
77 BuildRequires:  libiw-devel
78 # requires libjpeg-turbo implementing at least libjpeg 6b API
79 BuildRequires:  libjpeg-devel >= 6b
80 BuildRequires:  libjpeg-turbo-devel
81 BuildRequires:  libnotify-devel >= 0.4
82 BuildRequires:  libpng(APNG)-devel >= 0.10
83 BuildRequires:  libpng-devel >= 1.5.13
84 BuildRequires:  libstdc++-devel
85 BuildRequires:  libvpx-devel >= 1.0.0
86 BuildRequires:  nspr-devel >= 1:%{nspr_ver}
87 BuildRequires:  nss-devel >= 1:%{nss_ver}
88 BuildRequires:  pango-devel >= 1:1.14.0
89 BuildRequires:  perl-modules >= 5.004
90 BuildRequires:  pkgconfig
91 BuildRequires:  pkgconfig(libffi) >= 3.0.9
92 BuildRequires:  python-modules
93 %{?with_pgo:BuildRequires:      python-modules-sqlite}
94 BuildRequires:  python-virtualenv
95 BuildRequires:  rpm >= 4.4.9-56
96 BuildRequires:  rpmbuild(macros) >= 1.601
97 BuildRequires:  sqlite3-devel >= 3.7.15.2
98 BuildRequires:  startup-notification-devel >= 0.8
99 BuildRequires:  xorg-lib-libXScrnSaver-devel
100 BuildRequires:  xorg-lib-libXext-devel
101 BuildRequires:  xorg-lib-libXinerama-devel
102 BuildRequires:  xorg-lib-libXt-devel
103 %if %{with xulrunner}
104 BuildRequires:  xulrunner-devel >= 2:%{xulrunner_ver}
105 %endif
106 BuildRequires:  zip
107 BuildRequires:  zlib-devel >= 1.2.3
108 Requires(post): mktemp >= 1.5-18
109 Requires:       desktop-file-utils
110 Requires:       hicolor-icon-theme
111 %if %{with xulrunner}
112 %requires_eq_to xulrunner xulrunner-devel
113 %else
114 Requires:       browser-plugins >= 2.0
115 Requires:       cairo >= 1.10.2-5
116 Requires:       dbus-glib >= 0.60
117 Requires:       glib2 >= 1:2.20
118 Requires:       gtk+2 >= 2:2.14
119 Requires:       libjpeg-turbo
120 Requires:       libpng >= 1.5.13
121 Requires:       libpng(APNG) >= 0.10
122 Requires:       myspell-common
123 Requires:       nspr >= 1:%{nspr_ver}
124 Requires:       nss >= 1:%{nss_ver}
125 Requires:       pango >= 1:1.14.0
126 Requires:       sqlite3 >= %{sqlite_build_version}
127 Requires:       startup-notification >= 0.8
128 %endif
129 Provides:       wwwbrowser
130 Obsoletes:      mozilla-firebird
131 Obsoletes:      mozilla-firefox
132 Obsoletes:      mozilla-firefox-lang-en < 2.0.0.8-3
133 Obsoletes:      mozilla-firefox-libs
134 Conflicts:      iceweasel-lang-resources < %{version}
135 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
136
137 %define         filterout_cpp           -D_FORTIFY_SOURCE=[0-9]+
138
139 # don't satisfy other packages
140 %define         _noautoprovfiles        %{_libdir}/%{name}
141 %if %{without xulrunner}
142 # and as we don't provide them, don't require either
143 %define         _noautoreq      libmozalloc.so libmozjs.so libxpcom.so libxul.so
144 %endif
145
146 %description
147 Iceweasel is an open-source web browser, designed for standards
148 compliance, performance and portability.
149
150 %description -l hu.UTF-8
151 Iceweasel egy nyílt forrású webböngésző, hatékonyságra és
152 hordozhatóságra tervezve.
153
154 %description -l pl.UTF-8
155 Iceweasel jest przeglądarką WWW rozpowszechnianą zgodnie z ideami
156 ruchu otwartego oprogramowania oraz tworzoną z myślą o zgodności ze
157 standardami, wydajnością i przenośnością.
158
159 %prep
160 %setup -qc
161 mv -f mozilla-release mozilla
162 %setup -q -T -D -a1
163 cd mozilla
164 /bin/sh %{SOURCE2}
165
166 %patch0 -p1
167
168 %if "%{cc_version}" < "3.4"
169 %patch2 -p2
170 %endif
171
172 %patch7 -p1
173 %patch8 -p1
174 %patch9 -p2
175 %patch10 -p2
176 %patch11 -p2
177 %patch12 -p2
178 %patch13 -p2
179 %patch14 -p2
180
181 # config/rules.mk is patched by us and js/src/config/rules.mk
182 # is supposed to be exact copy
183 cp -a config/rules.mk js/src/config/rules.mk
184
185 %if %{with pgo}
186 sed -i -e 's@__BROWSER_PATH__@"../../dist/bin/iceweasel-bin"@' build/automation.py.in
187 %endif
188
189 %build
190 cd mozilla
191 cp -f %{_datadir}/automake/config.* build/autoconf
192
193 cat << EOF > .mozconfig
194 . \$topsrcdir/browser/config/mozconfig
195
196 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-%{_target_cpu}
197 # parallel build fails on _xpidlgen/
198 %if %{without xulrunner}
199 mk_add_options MOZ_MAKE_FLAGS=%{_smp_mflags}
200 %endif
201 mk_add_options PROFILE_GEN_SCRIPT='@PYTHON@ @MOZ_OBJDIR@/_profile/pgo/profileserver.py'
202
203 # Options for 'configure' (same as command-line options).
204 ac_add_options --prefix=%{_prefix}
205 ac_add_options --exec-prefix=%{_exec_prefix}
206 ac_add_options --bindir=%{_bindir}
207 ac_add_options --sbindir=%{_sbindir}
208 ac_add_options --sysconfdir=%{_sysconfdir}
209 ac_add_options --datadir=%{_datadir}
210 ac_add_options --includedir=%{_includedir}
211 ac_add_options --libdir=%{_libdir}
212 ac_add_options --libexecdir=%{_libexecdir}
213 ac_add_options --localstatedir=%{_localstatedir}
214 ac_add_options --sharedstatedir=%{_sharedstatedir}
215 ac_add_options --mandir=%{_mandir}
216 ac_add_options --infodir=%{_infodir}
217 ac_add_options --disable-elf-hack
218 %if %{?debug:1}0
219 ac_add_options --disable-optimize
220 ac_add_options --enable-debug
221 ac_add_options --enable-debug-modules
222 ac_add_options --enable-debugger-info-modules
223 ac_add_options --enable-crash-on-assert
224 %else
225 ac_add_options --disable-debug
226 ac_add_options --disable-debug-modules
227 ac_add_options --disable-logging
228 ac_add_options --enable-optimize="%{rpmcflags} -Os"
229 %endif
230 ac_add_options --disable-strip
231 ac_add_options --disable-strip-libs
232 %if %{with tests}
233 ac_add_options --enable-tests
234 %else
235 ac_add_options --disable-tests
236 %endif
237 %if %{with gnomeui}
238 ac_add_options --enable-gnomeui
239 %else
240 ac_add_options --disable-gnomeui
241 %endif
242 ac_add_options --disable-gnomevfs
243 ac_add_options --disable-crashreporter
244 ac_add_options --disable-installer
245 ac_add_options --disable-javaxpcom
246 ac_add_options --disable-updater
247 ac_add_options --enable-gio
248 ac_add_options --enable-libxul
249 ac_add_options --enable-pango
250 ac_add_options --enable-shared-js
251 ac_add_options --enable-startup-notification
252 ac_add_options --enable-system-cairo
253 ac_add_options --enable-system-hunspell
254 ac_add_options --enable-system-sqlite
255 ac_add_options --with-distribution-id=org.pld-linux
256 ac_add_options --with-branding=iceweasel/branding
257 %if %{with xulrunner}
258 ac_add_options --with-libxul-sdk=$(pkg-config --variable=sdkdir libxul)
259 %endif
260 ac_add_options --with-pthreads
261 ac_add_options --with-system-bz2
262 ac_add_options --with-system-ffi
263 ac_add_options --with-system-jpeg
264 ac_add_options --with-system-libevent
265 ac_add_options --with-system-libvpx
266 ac_add_options --with-system-nspr
267 ac_add_options --with-system-nss
268 ac_add_options --with-system-png
269 ac_add_options --with-system-zlib
270 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
271 EOF
272
273 %if %{with pgo}
274 export DISPLAY=:100 
275 %{__make} -f client.mk profiledbuild \
276         DESTDIR=obj-%{_target_cpu}/dist \
277         STRIP="/bin/true" \
278         CC="%{__cc}" \
279         CXX="%{__cxx}"
280 %else
281 %{__make} -f client.mk build \
282         STRIP="/bin/true" \
283         CC="%{__cc}" \
284         CXX="%{__cxx}"
285 %endif
286
287 %install
288 rm -rf $RPM_BUILD_ROOT
289 cd mozilla
290 install -d \
291         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}} \
292         $RPM_BUILD_ROOT%{_desktopdir} \
293         $RPM_BUILD_ROOT%{_datadir}/%{name}/browser \
294         $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/plugins \
295
296 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/browser/plugins
297
298 cd obj-%{_target_cpu}
299 %{__make} -C browser/installer stage-package \
300         DESTDIR=$RPM_BUILD_ROOT \
301         installdir=%{_libdir}/%{name} \
302         PKG_SKIP_STRIP=1
303
304 %{__make} -C iceweasel/branding install \
305         DESTDIR=$RPM_BUILD_ROOT
306
307 cp -a dist/iceweasel/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
308
309 %if %{with xulrunner}
310 # >= 5.0 seems to require this
311 ln -s ../xulrunner $RPM_BUILD_ROOT%{_libdir}/%{name}/xulrunner
312 %endif
313
314 # move arch independant ones to datadir
315 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/chrome
316 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/icons $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/icons
317 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/searchplugins $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/searchplugins
318 %if %{without xulrunner}
319 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/defaults
320 mv $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/defaults/{pref,preferences}
321 %else
322 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/defaults
323 %endif
324
325 ln -s ../../../share/%{name}/browser/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/chrome
326 ln -s ../../../share/%{name}/browser/icons $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/icons
327 ln -s ../../../share/%{name}/browser/searchplugins $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/searchplugins
328 ln -s ../../../%{_lib}/%{name}/browser/extensions $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/extensions
329 ln -s ../../../share/%{name}/browser/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/defaults
330
331 %if %{without xulrunner}
332 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
333 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
334 %endif
335
336 sed 's,@LIBDIR@,%{_libdir},' %{SOURCE4} > $RPM_BUILD_ROOT%{_bindir}/iceweasel
337 chmod 755 $RPM_BUILD_ROOT%{_bindir}/iceweasel
338 ln -s iceweasel $RPM_BUILD_ROOT%{_bindir}/firefox
339 ln -s iceweasel $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
340
341 # install icons and desktop file
342 cp iceweasel/branding/{mozicon,default}128.png
343 for i in 16 32 48 64 128; do
344         install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps
345         cp -a iceweasel/branding/default${i}.png \
346                 $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps/iceweasel.png
347 done
348
349 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
350
351 # install our settings
352 cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/defaults/preferences/vendor.js
353
354 %if "%{pld_release}" == "ac"
355 cp -a %{SOURCE6} $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/defaults/preferences/vendor.js
356 %endif
357
358 # files created by iceweasel -register
359 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/components/compreg.dat
360 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/components/xpti.dat
361
362 cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/%{name}-chrome+xpcom-generate
363 #!/bin/sh
364 umask 022
365 rm -f %{_libdir}/%{name}/browser/components/{compreg,xpti}.dat
366
367 # it attempts to touch files in $HOME/.mozilla
368 # beware if you run this with sudo!!!
369 export HOME=$(mktemp -d)
370 # also TMPDIR could be pointing to sudo user's homedir
371 unset TMPDIR TMP || :
372
373 %{_libdir}/%{name}/iceweasel -register
374
375 rm -rf $HOME
376 EOF
377 chmod 755 $RPM_BUILD_ROOT%{_sbindir}/%{name}-chrome+xpcom-generate
378
379 %clean
380 rm -rf $RPM_BUILD_ROOT
381
382 %pretrans
383 if [ -d %{_datadir}/%{name}/extensions ] && [ ! -L %{_datadir}/%{name}/browser/extensions ]; then
384         install -d %{_libdir}/%{name}/browser
385         mv -v %{_datadir}/%{name}/extensions %{_libdir}/%{name}/browser/extensions
386 fi
387 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
388         mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
389 fi
390 exit 0
391
392 %post
393 %{_sbindir}/%{name}-chrome+xpcom-generate
394 %update_browser_plugins
395 %update_icon_cache hicolor
396 %update_desktop_database
397
398 %postun
399 if [ "$1" = 0 ]; then
400         %update_browser_plugins
401         %update_icon_cache hicolor
402 fi
403
404 %files
405 %defattr(644,root,root,755)
406 %attr(755,root,root) %{_bindir}/%{name}
407 %attr(755,root,root) %{_bindir}/firefox
408 %attr(755,root,root) %{_bindir}/mozilla-firefox
409 %attr(755,root,root) %{_sbindir}/%{name}-chrome+xpcom-generate
410
411 # browser plugins v2
412 %{_browserpluginsconfdir}/browsers.d/%{name}.*
413 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
414
415 %dir %{_libdir}/%{name}
416 %dir %{_libdir}/%{name}/browser
417 %dir %{_libdir}/%{name}/browser/components
418 %dir %{_libdir}/%{name}/browser/extensions
419 %dir %{_libdir}/%{name}/browser/plugins
420
421 %dir %{_datadir}/%{name}
422 %dir %{_datadir}/%{name}/browser
423 %{_datadir}/%{name}/browser/chrome
424 %{_datadir}/%{name}/browser/icons
425 %{_datadir}/%{name}/browser/searchplugins
426
427 # symlinks
428 %{_datadir}/%{name}/browser/extensions
429 %{_libdir}/%{name}/browser/chrome
430 %{_libdir}/%{name}/browser/icons
431 %{_libdir}/%{name}/browser/searchplugins
432 %if %{with xulrunner}
433 %{_libdir}/%{name}/xulrunner
434 %endif
435 %{_libdir}/%{name}/browser/defaults
436 %{_datadir}/%{name}/browser/defaults
437
438 %{_libdir}/%{name}/application.ini
439 %{_libdir}/%{name}/browser/blocklist.xml
440 %{_libdir}/%{name}/browser/chrome.manifest
441 # the signature of the default theme
442 %{_libdir}/%{name}/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
443 %{_libdir}/%{name}/browser/omni.ja
444 %{_libdir}/%{name}/browser/components/components.manifest
445 %attr(755,root,root) %{_libdir}/%{name}/browser/components/libbrowsercomps.so
446 %attr(755,root,root) %{_libdir}/%{name}/iceweasel
447 %{_libdir}/%{name}/webapprt
448 %attr(755,root,root) %{_libdir}/%{name}/webapprt-stub
449
450 %{_iconsdir}/hicolor/*/*/iceweasel.png
451 %{_desktopdir}/iceweasel.desktop
452
453 # files created by iceweasel -register
454 %ghost %{_libdir}/%{name}/browser/components/compreg.dat
455 %ghost %{_libdir}/%{name}/browser/components/xpti.dat
456
457 %if %{with crashreporter}
458 %{_libdir}/%{name}/crashreporter
459 %{_libdir}/%{name}/crashreporter-override.ini
460 %{_libdir}/%{name}/crashreporter.ini
461 %{_libdir}/%{name}/Throbber-small.gif
462 %endif
463
464 %if %{without xulrunner}
465 %{_libdir}/%{name}/dependentlibs.list
466 %{_libdir}/%{name}/platform.ini
467 %dir %{_libdir}/%{name}/components
468 %{_libdir}/%{name}/components/components.manifest
469 %attr(755,root,root) %{_libdir}/%{name}/components/libdbusservice.so
470 %attr(755,root,root) %{_libdir}/%{name}/components/libmozgnome.so
471 %attr(755,root,root) %{_libdir}/%{name}/iceweasel-bin
472 %attr(755,root,root) %{_libdir}/%{name}/libmozalloc.so
473 %attr(755,root,root) %{_libdir}/%{name}/libmozjs.so
474 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
475 %attr(755,root,root) %{_libdir}/%{name}/mozilla-xremote-client
476 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
477 %attr(755,root,root) %{_libdir}/%{name}/run-mozilla.sh
478 %{_libdir}/%{name}/dictionaries
479 %{_libdir}/%{name}/chrome.manifest
480 %{_libdir}/%{name}/omni.ja
481 %endif
This page took 0.102217 seconds and 2 git commands to generate.