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

  ViewVC Help
Powered by ViewVC 1.1.30