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

  ViewVC Help
Powered by ViewVC 1.1.30