/[packages]/cauldron/firefox/current/SPECS/firefox.spec
ViewVC logotype

Contents of /cauldron/firefox/current/SPECS/firefox.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 792682 - (show annotations) (download)
Thu Oct 23 12:21:53 2014 UTC (9 years, 6 months ago) by doktor5000
File size: 16479 byte(s)
- add firefox-31.2-mga-gcc49-mediadata-symbols.patch to fix build
  o see https://bugzilla.mozilla.org/show_bug.cgi?id=999496 for details (SILENT)
- dropped unused firefox-32.0-1f10a8067853-undefined_reference.patch (SILENT)
1 #
2 # WARNING, READ FIRST:
3 #
4 # This is a special package that needs special treatment. Due to the amount of
5 # security updates it needs, it's common to ship new upstream versions instead of patching.
6 # That means this package MUST be BUILDABLE for stable official releases.
7 # This also means only STABLE upstream releases, NO betas.
8 # This is a discussed topic. Please, do not flame it again.
9
10 # Stay on ESR for stable releases and for cauldron before mageia 4.
11 # /!\ Do not update more than FF 24 for mga4. /!\
12
13
14 # (doktor5000) this switch enables to build with clang
15 # WARNING, DO NOT CHANGE THIS, If YOU DON'T TEST AND FIX FIREFOX AFTERWARDS!
16 # clang can build firefox without issues, but it will be really crashy
17 # during runtime, even for simple things
18 # see https://bugs.mageia.org/show_bug.cgi?id=14062
19 # and https://bugs.mageia.org/show_bug.cgi?id=13575
20 %define use_clang 0
21
22
23 %define major 31
24 %define ff_epoch 0
25 # (tpg) set version HERE !!!
26 %define extra esr
27 #define extra %nil
28 %define realver %{version}%extra
29 %define firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
30
31 # (tpg) MOZILLA_FIVE_HOME
32 %define mozillalibdir %{_libdir}/%{name}-%{version}
33 %define pluginsdir %{_libdir}/mozilla/plugins
34
35 # libxul.so is provided by libxulrunnner2.0.
36 %global __requires_exclude libxul.so
37
38 # this seems fragile, so require the exact version or later (#58754)
39 %define sqlite3_version %(pkg-config --modversion sqlite3 &>/dev/null && pkg-config --modversion sqlite3 2>/dev/null || echo 0)
40 %define nss_version %(pkg-config --modversion nss &>/dev/null && pkg-config --modversion nss 2>/dev/null || echo 0)
41 %define nspr_version %(pkg-config --modversion nspr &>/dev/null && pkg-config --modversion nspr 2>/dev/null || echo 0)
42
43 %define _use_syshunspell 1
44
45
46 %define update_channel %{extra}%major
47
48 Summary: Next generation web browser
49 Name: firefox
50 Version: %{major}.2.0
51 Epoch: %{ff_epoch}
52 Release: %mkrel 3
53 License: MPLv1+
54 Group: Networking/WWW
55 Url: http://www.mozilla.org/firefox/organizations/
56 Source0: https://ftp.mozilla.org/pub/mozilla.org/%{name}/releases/%{realver}/source/%{name}-%{realver}.source.tar.bz2
57 Source4: %{name}.desktop
58 Source8: %{name}-searchengines-duckduckgo.xml
59 Source9: kde.js
60 Patch1: firefox-6.0-lang.patch
61 Patch2: firefox-vendor.patch
62 Patch4: firefox-28.0-nss-binary.patch
63 # (OpenSuse) add patch to make firefox always use /usr/bin/firefox when "make firefox
64 # the default web browser" is used fix mdv bug#58784
65 Patch5: firefox-31.0-appname.patch
66 Patch6: firefox-7.0-fix-str-fmt.patch
67 Patch8: firefox-disable-check-default-browser.patch
68 Patch10: firefox-3.5.3-default-mail-handler.patch
69 # Patches for kde integration of FF
70 # (doktor5000) old URL, not updated often: https://build.opensuse.org/package/rawsourcefile/mozilla:Factory/MozillaFirefox/mozilla-kde.patch
71 Patch11: http://www.rosenauer.org/hg/mozilla/file/tip/mozilla-kde.patch
72 # (fwang) please modify patch12 with `sed -e 's/MozillaFirefox/firefox/'` to fit our desktop filename
73 # (doktor5000) old URL, not updated often: https://build.opensuse.org/package/rawsourcefile/mozilla:Factory/MozillaFirefox/firefox-kde.patch
74 Patch12: http://www.rosenauer.org/hg/mozilla/file/tip/firefox-kde.patch
75 Patch13: firefox-13-fix-nspr-include.patch
76 # taken from https://hg.mozilla.org/mozilla-central/rev/1f10a8067853
77 # see also https://bugzilla.mozilla.org/show_bug.cgi?id=999496
78 Patch14: firefox-31.2-mga-gcc49-mediadata-symbols.patch
79 Patch37: firefox-17.0-nss-version.patch
80
81 BuildRequires: gtk+2-devel
82 BuildRequires: unzip
83 BuildRequires: zip
84 BuildRequires: pkgconfig(xinerama)
85 BuildRequires: pkgconfig(xscrnsaver)
86 BuildRequires: libjpeg-devel
87 BuildRequires: pkgconfig(libpng) >= 1.6.10
88 BuildRequires: pkgconfig(zlib)
89 BuildRequires: pkgconfig(gio-2.0)
90 BuildRequires: pkgconfig(libIDL-2.0)
91 BuildRequires: makedepend
92 BuildRequires: pkgconfig(nss) >= 3.15.2
93 BuildRequires: nss-static-devel
94 BuildRequires: pkgconfig(nspr) >= 4.10.6
95 BuildRequires: pkgconfig(libstartup-notification-1.0)
96 BuildRequires: pkgconfig(dbus-glib-1)
97 BuildRequires: python
98 BuildRequires: pkgconfig(sqlite3) >= 3.7.17
99 %ifnarch %arm %mips
100 BuildRequires: valgrind
101 %if %{mgaversion} >= 4
102 BuildRequires: java-devel
103 BuildRequires: jpackage-utils
104 %else
105 BuildRequires: java-rpmbuild
106 %endif
107 BuildRequires: yasm >= 1.0.1
108 %endif
109 %ifarch %arm
110 BuildRequires: pkgconfig(libffi)
111 %endif
112 BuildRequires: rootcerts >= 1:20130411.00
113 BuildRequires: pkgconfig(xt)
114 %if %_use_syshunspell
115 BuildRequires: pkgconfig(hunspell)
116 %endif
117 BuildRequires: doxygen
118 BuildRequires: wget
119 BuildRequires: pkgconfig(libnotify)
120 BuildRequires: pkgconfig(cairo) >= 1.10
121 BuildRequires: pkgconfig(dri)
122 BuildRequires: pkgconfig(libvpx)
123 BuildRequires: autoconf2.1
124 BuildRequires: libiw-devel
125 BuildRequires: python-virtualenv
126 BuildRequires: icu-devel
127 BuildRequires: pkgconfig(gstreamer-1.0)
128 BuildRequires: pkgconfig(gstreamer-allocators-1.0)
129 BuildRequires: pkgconfig(alsa)
130 BuildRequires: pkgconfig(libevent)
131 BuildRequires: pkgconfig(libproxy-1.0)
132 BuildRequires: pkgconfig(libpulse)
133 BuildRequires: pkgconfig(ogg)
134 BuildRequires: pkgconfig(opus)
135 BuildRequires: pkgconfig(theoradec)
136 BuildRequires: pkgconfig(vorbis)
137 %if "%use_clang" == "1"
138 BuildRequires: clang
139 %endif
140
141 Provides: %{name} = %{epoch}:%{version}
142 Provides: mozilla-firefox = %{epoch}:%{version}-%{release}
143 Provides: webclient
144
145 Requires: %{mklibname sqlite3_ 0} >= %{sqlite3_version}
146 Requires: %{mklibname nss 3} >= 2:%{nss_version}
147 Requires: %{mklibname nspr 4} >= 2:%{nspr_version}
148 Requires: indexhtml
149 Requires: xdg-utils
150 # fixes bug #42096
151 Requires: mailcap
152 Recommends: hunspell-en
153 %if %{mgaversion} >= 4
154 Requires: %{_lib}notify4
155 Requires: gstreamer1.0-libav
156 %endif
157 # make sure our default bookmarks are present
158 Requires: desktop-common-data
159 # try to fix mga#1344 (automatic installation of proper -l10n package)
160 # packages requiring locales-XX will be automatically preferred when locales-XX
161 # is already installed
162 Recommends: firefox-l10n
163
164 Recommends: %{_lib}canberra0
165 Recommends: %{_lib}cups2
166 Obsoletes: firefox-ext-weave-sync
167 Obsoletes: firefox-beta < 25
168
169 %description
170 The award-winning Web browser is now faster, more secure, and fully customizable
171 to your online life. With Firefox(R), we've added powerful new features that
172 make your online experience even better. It is an 'open source' product which is
173 freely available, and is acquiring a growing proportion of international web
174 browser usage.
175
176 Firefox claims to offer a more secure web browsing experience than other products,
177 with better protection against spyware and other Internet-based security threats.
178 It includes all the standard features of a modern web browser, like Internet
179 searching, tracking recently visited sites, setting up shortcuts to favourite
180 sites, customising the software behaviour and so on. Firefox also includes
181 features like 'tabbed browsing' (opening several web sites as sections within the
182 same window) and methods for controlling pop-up windows, cookies and downloaded
183 files.
184
185 %package devel
186 Summary: Development files for %{name}
187 Group: Development/Other
188 Obsoletes: firefox-beta-devel < 25
189
190 %description devel
191 Files and macros mainly for building Firefox extensions.
192
193 %prep
194 %if %{?extra}
195 %setup -q -n mozilla-%update_channel
196 %else
197 %setup -q -n mozilla-release
198 %endif
199 %patch1 -p1 -b .lang
200 %patch2 -p1 -b .vendor
201 %patch4 -p0 -b .nss
202 %patch5 -p1 -b .appname
203 %patch8 -p1 -b .disable-software-update
204 %patch10 -p1 -b .default-mail-handler
205 %patch11 -p1 -b .mozkde
206 %patch12 -p1 -b .ffkde
207 %patch14 -p1 -b .mediadata-symbols
208
209 %patch37 -p0
210
211 pushd js/src
212 autoconf-2.13
213 popd
214 autoconf-2.13
215
216 # needed to regenerate certdata.c
217 pushd security/nss/lib/ckfw/builtins
218 perl ./certdata.perl < /etc/pki/tls/mozilla/certdata.txt
219 popd
220
221 %build
222 export MOZCONFIG=$PWD/mozconfig
223 cat << EOF > $MOZCONFIG
224 mk_add_options MOZILLA_OFFICIAL=1
225 mk_add_options BUILD_OFFICIAL=1
226 mk_add_options MOZ_MAKE_FLAGS="%{_smp_mflags}"
227 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj
228 # (doktor5000) this is a temporary workaround due to broken tarball
229 # see
230 mk_add_options AUTOCLOBBER=1
231 ac_add_options --host=%{_host}
232 ac_add_options --target=%{_target_platform}
233 ac_add_options --enable-optimize="%{optflags}"
234 ac_add_options --prefix="%{_prefix}"
235 ac_add_options --libdir="%{_libdir}"
236 ac_add_options --sysconfdir="%{_sysconfdir}"
237 ac_add_options --mandir="%{_mandir}"
238 ac_add_options --includedir="%{_includedir}"
239 ac_add_options --datadir="%{_datadir}"
240 ac_add_options --with-system-nspr
241 ac_add_options --with-system-nss
242 ac_add_options --with-system-zlib
243 ac_add_options --with-system-libvpx
244 ac_add_options --with-system-libevent
245 ac_add_options --with-system-harfbuzz
246 %if "%use_clang" == "0"
247 ac_add_options --disable-cpp-exceptions
248 %endif
249 ac_add_options --with-system-icu
250 ac_add_options --enable-webm
251 ac_add_options --enable-gio
252 ac_add_options --disable-gnomevfs
253 ac_add_options --disable-updater
254 ac_add_options --disable-tests
255 ac_add_options --disable-debug
256 ac_add_options --enable-official-branding
257 ac_add_options --enable-libproxy
258 %if %{mgaversion} >= 3
259 ac_add_options --with-system-png
260 %endif
261 ac_add_options --with-system-jpeg
262 ac_add_options --enable-system-cairo
263 ac_add_options --enable-system-sqlite
264 ac_add_options --enable-startup-notification
265 ac_add_options --enable-xinerama
266 ac_add_options --with-distribution-id=org.mageia
267 ac_add_options --disable-crashreporter
268 ac_add_options --enable-update-channel=%{update_channel}
269 ac_add_options --enable-gstreamer=1.0
270 %ifarch %arm
271 %if "%{_target_cpu}" != "armv7l"
272 ac_add_options --disable-methodjit
273 %endif
274 ac_add_options --enable-system-ffi
275 %endif
276 %ifnarch %arm %mips
277 ac_add_options --with-valgrind
278 ac_add_options --with-java-include-path=%{java_home}/include
279 ac_add_options --with-java-bin-path=%{java_home}/bin
280 %endif
281 ac_add_options --with-system-ogg
282 ac_add_options --enable-opus
283 ac_add_options --enable-webrtc
284 %if "%use_clang" == "1"
285 export CC="clang"
286 export CXX="clang++"
287 %endif
288
289 EOF
290
291 %ifarch %arm
292 export CFLAGS="-D__ARM_PCS $(echo %{optflags})"
293 export CXXFLAGS="$CFLAGS"
294 %endif
295
296 %if "%use_clang" == "1"
297 export CC="clang"
298 export CXX="clang++"
299 %endif
300
301 export LDFLAGS="%ldflags"
302 make -f client.mk build
303
304 %install
305 make -C %{_builddir}/obj/browser/installer STRIP=/bin/true MOZ_PKG_FATAL_WARNINGS=0
306
307 # Copy files to buildroot
308 %{__mkdir_p} %{buildroot}%{mozillalibdir}
309 cp -rf %{_builddir}/obj/dist/firefox/* %{buildroot}%{mozillalibdir}
310
311 %{__mkdir_p} %{buildroot}%{_bindir}
312 ln -sf %{mozillalibdir}/firefox %{buildroot}%{_bindir}/firefox
313 pushd %{buildroot}%{_bindir}
314 ln -sf firefox mozilla-firefox
315 popd
316 mkdir -p %{buildroot}%{mozillalibdir}/browser/defaults/preferences/
317 install -m 644 %{SOURCE9} %{buildroot}%{mozillalibdir}/browser/defaults/preferences/kde.js
318
319 # Create and own %_libdir/mozilla/plugins & firefox extensions directories
320 %{__mkdir_p} %{buildroot}%{pluginsdir}
321 %{__mkdir_p} %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_appid}
322 %{__mkdir_p} %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_appid}
323
324 # (tpg) desktop entry
325 %{__mkdir_p} %{buildroot}%{_datadir}/applications
326 install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/%{name}.desktop
327
328 # (tpg) icons
329 %{__cp} %{buildroot}%{mozillalibdir}/browser/chrome/icons/default/default16.png %{buildroot}/%{mozillalibdir}/browser/icons/
330 for i in 16 22 24 32 48 256; do
331 %{__mkdir_p} %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps
332 %{__install} -m 644 browser/branding/official/default$i.png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps/%{name}.png ;
333 done
334 %{__mkdir_p} %{buildroot}{%{_liconsdir},%{_iconsdir},%{_miconsdir}}
335 ln -sf %{mozillalibdir}/browser/chrome/icons/default/default48.png %{buildroot}%{_liconsdir}/%{name}.png
336 ln -sf %{mozillalibdir}/browser/chrome/icons/default/default32.png %{buildroot}%{_iconsdir}/%{name}.png
337 ln -sf %{mozillalibdir}/browser/chrome/icons/default/default16.png %{buildroot}%{_miconsdir}/%{name}.png
338
339 # exclusions
340 rm -f %{buildroot}%{mozillalibdir}/README.txt
341 rm -f %{buildroot}%{mozillalibdir}/removed-files
342 rm -f %{buildroot}%{mozillalibdir}/precomplete
343
344 # this file is only used when creating a new user profile
345 install -D -m644 browser/app/profile/prefs.js %{buildroot}%{mozillalibdir}/browser/defaults/profile/prefs.js
346 cat << EOF >> %{buildroot}%{mozillalibdir}/browser/defaults/profile/prefs.js
347 user_pref("browser.EULA.override", true);
348 user_pref("browser.shell.checkDefaultBrowser", false);
349 user_pref("browser.startup.homepage", "file:///usr/share/indexhtml/index.html");
350 user_pref("app.update.auto", false);
351 user_pref("app.update.enabled", false);
352 user_pref("app.update.autoInstallEnabled", false);
353 user_pref("browser.showQuitWarning", true);
354 EOF
355
356 # display icon for Firefox button
357 %{__mkdir_p} %{buildroot}%{mozillalibdir}/browser/defaults/profile/chrome
358 cat << EOF > %{buildroot}%{mozillalibdir}/browser/defaults/profile/chrome/userChrome.css
359 #appmenu-toolbar-button {
360 list-style-image: url("chrome://branding/content/icon16.png");
361 }
362 EOF
363
364 # files in this directory are read on every startup, and can change/add
365 # preferences for existing profiles
366 # extensions.autoDisableScopes is a new preference added in firefox 8
367 # it defines "scopes" where newly installed addons are disabled by default
368 # this is an additive bit field, and the value defaults to 15 (1+2+4+8)
369 # we need to remove system scope (8) from it so language packs and other addons
370 # which are installed systemwide won't get marked as 3rd party and disabled
371 # documentation: http://kb.mozillazine.org/About:config_entries#Extensions.
372 # or in toolkit/mozapps/extensions/AddonManager.jsm
373 # we also need to disable the "disable addon selection dialog"
374 # (doktor5000) - path has changed since FF 21
375 # http://mike.kaply.com/2013/04/24/major-changes-coming-in-firefox-21/
376 cat << EOF > %{buildroot}%{mozillalibdir}/browser/defaults/preferences/mga.js
377 pref("general.useragent.locale", "chrome://global/locale/intl.properties");
378 pref("extensions.autoDisableScopes", 0);
379 pref("extensions.shownSelectionUI", true);
380 EOF
381 # FIXME: Add it back in mga.js when this search engine will be used by default.
382 # user_pref("browser.search.selectedEngine","duckduckgo.com");
383
384 # use the system myspell dictionaries
385 rm -fr %{buildroot}%{mozillalibdir}/dictionaries
386 ln -s %{_datadir}/hunspell %{buildroot}%{mozillalibdir}/dictionaries
387
388 # (lm) touch and %ghost bookmarks.html to a proper uninstall
389 touch %{buildroot}%{mozillalibdir}/browser/defaults/profile/bookmarks.html
390
391 %find_lang %{name}
392
393 # Add stuff to build a plugin to -devel
394 mkdir -p %{buildroot}%{_includedir}
395 cp -a dom/plugins/base/np*.h %{buildroot}%{_includedir}
396 mkdir -p %{buildroot}/%{_datadir}/pkgconfig
397 cat <<EOF >%{buildroot}/%{_datadir}/pkgconfig/mozilla-plugin.pc
398 Name: Mozilla Plug-In API
399 Description: Mozilla Plug-In API
400 Version: %{version}
401 Cflags: -I%{_includedir} -DXP_UNIX
402 EOF
403
404 mkdir -p %{buildroot}%{_sys_macros_dir}
405 cat <<FIN >%{buildroot}%{_sys_macros_dir}/%{name}.macros
406 # Macros from %{name} package
407 %%firefox_major %{version}
408 %%firefox_epoch %{ff_epoch}
409 %%firefox_version %{version}
410 %%firefox_mozillapath %{mozillalibdir}
411 %%firefox_pluginsdir %{pluginsdir}
412 %%firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
413 %%firefox_extdir %%(if [ "%%_target_cpu" = "noarch" ]; then echo %%{_datadir}/mozilla/extensions/%%{firefox_appid}; else echo %%{_libdir}/mozilla/extensions/%%{firefox_appid}; fi)
414 FIN
415 cp -f %{SOURCE8} %{buildroot}%{mozillalibdir}/browser/searchplugins/duckduckgo.xml
416
417 %pre
418 if [ -d %{mozillalibdir}/dictionaries ]; then
419 rm -fr %{mozillalibdir}/dictionaries
420 fi
421
422 %post
423 if [ ! -r /etc/sysconfig/oem ]; then
424 case `grep META_CLASS /etc/sysconfig/system` in
425 *powerpack) bookmark="mozilla-powerpack.html" ;;
426 *desktop) bookmark="mozilla-one.html";;
427 *) bookmark="mozilla-download.html";;
428 esac
429 ln -s -f %_prefix/share/mga/bookmarks/mozilla/$bookmark %{mozillalibdir}/browser/defaults/profile/bookmarks.html
430 fi
431
432 %files -f %{name}.lang
433 %{_bindir}/%{name}
434 %{_bindir}/mozilla-firefox
435 %{_iconsdir}/hicolor/*/apps/*.png
436 %{_miconsdir}/%{name}.png
437 %{_iconsdir}/%{name}.png
438 %{_liconsdir}/%{name}.png
439 %{_datadir}/applications/*.desktop
440 %{_libdir}/%{name}-%{version}*
441 %ghost %{mozillalibdir}/browser/defaults/profile/bookmarks.html
442 %dir %{_libdir}/mozilla
443 %dir %{pluginsdir}
444 %dir %{_libdir}/mozilla/extensions/%{firefox_appid}
445 %dir %{_datadir}/mozilla/extensions/%{firefox_appid}
446
447 %files devel
448 %{_sys_macros_dir}/%{name}.macros
449 %{_includedir}/np*.h
450 %{_datadir}/pkgconfig/mozilla-plugin.pc

  ViewVC Help
Powered by ViewVC 1.1.30