/[packages]/updates/5/firefox/current/SPECS/firefox.spec
ViewVC logotype

Contents of /updates/5/firefox/current/SPECS/firefox.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1181653 - (show annotations) (download)
Fri Dec 8 08:46:03 2017 UTC (6 years, 4 months ago) by ns80
File size: 16624 byte(s)
- new version 52.5.2 that fixes CVE-2017-7843 and CVE-2017-7845 (mga#22129)

1 # WARNING: This package is synced with FC
2
3 #
4 # WARNING, READ FIRST:
5 #
6 # This is a special package that needs special treatment. Due to the amount of
7 # security updates it needs, it's common to ship new upstream versions instead of patching.
8 # That means this package MUST be BUILDABLE for stable official releases.
9 # This also means only STABLE upstream releases, NO betas.
10 # This is a discussed topic. Please, do not flame it again.
11
12 # Stay on ESR for stable releases and for cauldron before mageia 5.
13 # /!\ Do not update more than FF 45 for mga6. /!\
14 # ff 45 -> 52 -> 59
15
16 # Tentative workaround for BS cc1plus kill issue (09/2016)
17 #define _smp_ncpus_max 8
18
19 %define toolkit_gtk3 1
20
21 # Use system cairo?
22 %define system_cairo 0
23
24 %define major 52
25 %define ff_epoch 0
26 # (tpg) set version HERE !!!
27 %define extra esr
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}
33 %define pluginsdir %{_libdir}/mozilla/plugins
34
35 # libxul.so is provided by libxulrunnner2.0.
36 %global __requires_exclude libxul.so
37
38 # Minimal required versions
39 %global cairo_version 1.13.1
40 %global freetype_version 2.1.9
41 %global libnotify_version 0.7.0
42 %global libvpx_version 1.5.0
43
44 # this seems fragile, so require the exact version or later (#58754)
45 %global nspr_version 4.12
46 %global nspr_build_version %(pkg-config --silence-errors --modversion nspr 2>/dev/null || echo 65536)
47 %global nss_version 3.21.1
48 %global nss_build_version %(pkg-config --silence-errors --modversion nss 2>/dev/null || echo 65536)
49 %global sqlite_version 3.8.8.2
50 # The actual sqlite version (see #480989):
51 %global sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo 65536)
52
53
54 %define update_channel %{extra}%major
55
56 Summary: Mozilla Firefox Web browser
57 Name: firefox
58 Version: %{major}.5.2
59 Epoch: %{ff_epoch}
60 Release: %mkrel 1
61 License: MPLv1.1 or GPLv2+ or LGPLv2+
62 Group: Networking/WWW
63 Url: https://www.mozilla.org/firefox/organizations/
64 Source0: https://ftp.mozilla.org/pub/firefox/releases/%{realver}/source/%{name}-%{realver}.source.tar.xz
65 Source4: %{name}.desktop
66 Source8: %{name}-searchengines-duckduckgo.xml
67 Source9: kde.js
68 # From Fedora:
69 Source10: firefox-mozconfig
70
71 # Fedora patches:
72 Patch3: mozilla-build-arm.patch
73 Patch223: rhbz-1291190-appchooser-crash.patch
74
75 # Mageia patches:
76 Patch1000: firefox-lang.patch
77 # (OpenSuse) add patch to make firefox always use /usr/bin/firefox when "make firefox
78 # the default web browser" is used fix mdv bug#58784
79 Patch1005: firefox-38.0-appname.patch
80 Patch1008: firefox-disable-check-default-browser.patch
81 # Patches for kde integration of FF
82 # (doktor5000) if the patches need updating, grab both from the branch corresponding with the current firefox version at
83 # http://www.rosenauer.org/hg/mozilla
84 Patch1011: http://www.rosenauer.org/hg/mozilla/file/tip/mozilla-kde.patch
85 # (fwang) please modify patch12 with `sed -e 's/MozillaFirefox/firefox/'` to fit our desktop filename
86 Patch1012: http://www.rosenauer.org/hg/mozilla/file/tip/firefox-kde.patch
87
88 Patch1037: firefox-38.0-nss-version.patch
89 Patch1039: firefox-43.4.0-optimize-dont-force-O3.patch
90
91 BuildRequires: pkgconfig(nspr) >= %{nspr_version}
92 BuildRequires: pkgconfig(nss) >= %{nss_version}
93 BuildRequires: nss-static-devel >= %{nss_version}
94 %if %{?system_cairo}
95 BuildRequires: pkgconfig(cairo) >= %{cairo_version}
96 %endif
97 BuildRequires: pkgconfig(xinerama)
98 BuildRequires: pkgconfig(xscrnsaver)
99 BuildRequires: pkgconfig(libpng)
100 BuildRequires: libjpeg-devel
101 BuildRequires: zip
102 BuildRequires: bzip2-devel
103 BuildRequires: pkgconfig(zlib)
104 BuildRequires: pkgconfig(libIDL-2.0)
105 %if %{toolkit_gtk3}
106 BuildRequires: pkgconfig(gtk+-3.0)
107 %endif
108 BuildRequires: pkgconfig(gtk+-2.0)
109 BuildRequires: pkgconfig(pango)
110 BuildRequires: pkgconfig(xt)
111 BuildRequires: pkgconfig(hunspell)
112 BuildRequires: pkgconfig(libstartup-notification-1.0)
113 BuildRequires: pkgconfig(alsa)
114 BuildRequires: pkgconfig(libnotify) >= %{libnotify_version}
115 BuildRequires: pkgconfig(dri)
116 #BuildRequires: pkgconfig(libvpx) >= %{libvpx_version}
117 BuildRequires: autoconf2.1
118 BuildRequires: pkgconfig(libpulse)
119 BuildRequires: pkgconfig(icu-i18n)
120 BuildRequires: pkgconfig(gconf-2.0)
121 BuildRequires: yasm
122 Requires: %{mklibname nss 3} >= 2:%{nss_build_version}
123 Requires: %{mklibname nspr 4} >= 2:%{nspr_build_version}
124 BuildRequires: pkgconfig(gstreamer-1.0)
125 BuildRequires: pkgconfig(gstreamer-allocators-1.0)
126 BuildRequires: python
127 BuildRequires: pkgconfig(sqlite3) >= %{sqlite_version}
128 Requires: %{mklibname sqlite3_ 0} >= %{sqlite_build_version}
129 BuildRequires: pkgconfig(libffi)
130 BuildRequires: rootcerts >= 1:20130411.00
131 BuildRequires: doxygen
132 BuildRequires: libiw-devel
133 BuildRequires: python-virtualenv
134 BuildRequires: pkgconfig(libevent)
135 BuildRequires: pkgconfig(libproxy-1.0)
136
137 Provides: %{name} = %{epoch}:%{version}
138 Provides: mozilla-firefox = %{epoch}:%{version}-%{release}
139 Provides: webclient
140
141 Requires: indexhtml
142 Requires: xdg-utils
143 # fixes bug #42096
144 Requires: mailcap
145 Recommends: hunspell-en
146 Requires: %{_lib}notify4
147 Requires: gstreamer1.0-libav
148 # make sure our default bookmarks are present
149 Requires: desktop-common-data
150 # try to fix mga#1344 (automatic installation of proper -l10n package)
151 # packages requiring locales-XX will be automatically preferred when locales-XX
152 # is already installed
153 Recommends: firefox-l10n
154
155 Recommends: %{_lib}canberra0
156 Recommends: %{_lib}cups2
157 Obsoletes: firefox-ext-weave-sync
158 Obsoletes: firefox-beta < 25
159
160 %description
161 Mozilla Firefox is an open-source web browser, designed for standards
162 compliance, performance and portability.
163
164 %package devel
165 Summary: Development files for %{name}
166 Group: Development/Other
167 Obsoletes: firefox-beta-devel < 25
168
169 %description devel
170 Files and macros mainly for building Firefox extensions.
171
172 %prep
173 %if %{?extra}
174 #setup -q -n mozilla-%{update_channel}
175 %setup -q -n firefox-%{version}esr
176 %else
177 #setup -q -n mozilla-release
178 %setup -q -n %name-%version
179 %endif
180 # Fedora patches:
181 %patch3 -p2 -b .arm
182 %patch223 -p1 -b .appchooser-crash
183
184 # Mageia patches:
185 %patch1000 -p1 -b .lang
186 %patch1005 -p1 -b .appname
187 %patch1008 -p1 -b .defaultbrowser
188 %patch1011 -p1 -b .mozkde
189 %patch1012 -p1 -b .ffkde
190
191 %patch1037 -p0
192 %patch1039 -p1 -b .noo3_noos
193
194 pushd js/src
195 autoconf-2.13
196 popd
197 autoconf-2.13
198
199 %{__rm} -f .mozconfig
200 %{__cp} %{SOURCE10} .mozconfig
201 # Mageia specific options:
202 cat << EOF >> .mozconfig
203 ac_add_options --with-system-libevent
204 ac_add_options --enable-libproxy
205 ac_add_options --with-system-png
206 ac_add_options --with-distribution-id=org.mageia
207 ac_add_options --enable-update-channel=%{update_channel}
208 EOF
209
210 # Options shared with FC:
211 echo "ac_add_options --enable-official-branding" >> .mozconfig
212
213 %if %{toolkit_gtk3}
214 echo "ac_add_options --enable-default-toolkit=cairo-gtk3" >> .mozconfig
215 %else
216 echo "ac_add_options --enable-default-toolkit=cairo-gtk2" >> .mozconfig
217 %endif
218
219 echo "ac_add_options --with-system-nspr" >> .mozconfig
220 echo "ac_add_options --with-system-nss" >> .mozconfig
221
222 %if %{?system_cairo}
223 echo "ac_add_options --enable-system-cairo" >> .mozconfig
224 %else
225 echo "ac_add_options --disable-system-cairo" >> .mozconfig
226 %endif
227
228 echo "ac_add_options --enable-system-ffi" >> .mozconfig
229
230 #echo "ac_add_options --enable-gstreamer=1.0" >> .mozconfig
231
232 %ifarch %{arm}
233 echo "ac_add_options --disable-elf-hack" >> .mozconfig
234 %endif
235
236 echo "ac_add_options --disable-debug" >> .mozconfig
237 echo "ac_add_options --enable-optimize" >> .mozconfig
238
239 %ifarch armv7hl
240 echo "ac_add_options --with-arch=armv7-a" >> .mozconfig
241 echo "ac_add_options --with-float-abi=hard" >> .mozconfig
242 echo "ac_add_options --with-fpu=vfpv3-d16" >> .mozconfig
243 echo "ac_add_options --disable-elf-hack" >> .mozconfig
244 %endif
245 %ifarch armv7hnl
246 echo "ac_add_options --with-arch=armv7-a" >> .mozconfig
247 echo "ac_add_options --with-float-abi=hard" >> .mozconfig
248 echo "ac_add_options --with-fpu=neon" >> .mozconfig
249 echo "ac_add_options --disable-elf-hack" >> .mozconfig
250 echo "ac_add_options --disable-ion" >> .mozconfig
251 echo "ac_add_options --disable-yarr-jit" >> .mozconfig
252 %endif
253 %ifarch armv5tel
254 echo "ac_add_options --with-arch=armv5te" >> .mozconfig
255 echo "ac_add_options --with-float-abi=soft" >> .mozconfig
256 echo "ac_add_options --disable-elf-hack" >> .mozconfig
257 echo "ac_add_options --disable-ion" >> .mozconfig
258 echo "ac_add_options --disable-yarr-jit" >> .mozconfig
259 %endif
260
261 %ifnarch %{ix86} x86_64
262 echo "ac_add_options --disable-webrtc" >> .mozconfig
263 %endif
264
265 echo "ac_add_options --disable-crashreporter" >> .mozconfig
266
267 echo "ac_add_options --with-system-jpeg" >> .mozconfig
268
269 # Using the bundled libvpx because the mgav5 one is too old.
270 echo "ac_add_options --disable-system-libvpx" >> .mozconfig
271
272 # Using the bundled icu because the mgav5 one is too old.
273 echo "ac_add_options --disable-system-icu" >> .mozconfig
274 echo "ac_add_options --enable-alsa" >> .mozconfig
275
276 %build
277 # -fpermissive is needed to build with gcc 4.6+ which has become stricter
278 #
279 # Mozilla builds with -Wall with exception of a few warnings which show up
280 # everywhere in the code; so, don't override that.
281 #
282 # Disable C++ exceptions since Mozilla code is not exception-safe
283 #
284 MOZ_OPT_FLAGS=$(echo "$RPM_OPT_FLAGS" | %{__sed} -e 's/-Wall//')
285 #rhbz#1037063
286 # -Werror=format-security causes build failures when -Wno-format is explicitly given
287 # for some sources
288 # Explicitly force the hardening flags for Firefox so it passes the checksec test;
289 # See also https://fedoraproject.org/wiki/Changes/Harden_All_Packages
290 MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -Wformat-security -Wformat -Werror=format-security"
291 MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fPIC -Wl,-z,relro -Wl,-z,now"
292 %ifarch %{arm}
293 MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
294 %endif
295
296 export CFLAGS=$MOZ_OPT_FLAGS
297 export CXXFLAGS=$MOZ_OPT_FLAGS
298 export LDFLAGS=$MOZ_LINK_FLAGS
299
300 export PREFIX='%{_prefix}'
301 export LIBDIR='%{_libdir}'
302
303 MOZ_SMP_FLAGS=-j1
304 # On x86 architectures, Mozilla can build up to 4 jobs at once in parallel,
305 # however builds tend to fail on other arches when building in parallel.
306 %ifarch %{ix86} x86_64 ppc ppc64 ppc64le aarch64
307 [ -z "$RPM_BUILD_NCPUS" ] && \
308 RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"
309 MOZ_SMP_FLAGS=-j$RPM_BUILD_NCPUS
310 %endif
311
312 make -f client.mk build STRIP="/bin/true" MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS" MOZ_SERVICES_SYNC="1"
313
314 %install
315 make -C objdir/browser/installer STRIP=/bin/true MOZ_PKG_FATAL_WARNINGS=0
316
317 # Copy files to buildroot
318 %{__mkdir_p} %{buildroot}%{mozillalibdir}
319 cp -rf objdir/dist/firefox/* %{buildroot}%{mozillalibdir}
320
321 %{__mkdir_p} %{buildroot}%{_bindir}
322 ln -sf %{mozillalibdir}/firefox %{buildroot}%{_bindir}/firefox
323 pushd %{buildroot}%{_bindir}
324 ln -sf firefox mozilla-firefox
325 popd
326 mkdir -p %{buildroot}%{mozillalibdir}/browser/defaults/preferences/
327 install -m 644 %{SOURCE9} %{buildroot}%{mozillalibdir}/browser/defaults/preferences/kde.js
328
329 # Create and own %{_libdir}/mozilla/plugins & firefox extensions directories
330 %{__mkdir_p} %{buildroot}%{pluginsdir}
331 %{__mkdir_p} %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_appid}
332 %{__mkdir_p} %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_appid}
333
334 # (tpg) desktop entry
335 %{__mkdir_p} %{buildroot}%{_datadir}/applications
336 install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/%{name}.desktop
337
338 # (tpg) icons
339 %{__cp} %{buildroot}%{mozillalibdir}/browser/chrome/icons/default/default16.png %{buildroot}/%{mozillalibdir}/browser/icons/
340 for i in 16 22 24 32 48 256; do
341 %{__mkdir_p} %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps
342 %{__install} -m 644 browser/branding/official/default$i.png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps/%{name}.png ;
343 done
344 %{__mkdir_p} %{buildroot}{%{_liconsdir},%{_iconsdir},%{_miconsdir}}
345 ln -sf %{mozillalibdir}/browser/chrome/icons/default/default48.png %{buildroot}%{_liconsdir}/%{name}.png
346 ln -sf %{mozillalibdir}/browser/chrome/icons/default/default32.png %{buildroot}%{_iconsdir}/%{name}.png
347 ln -sf %{mozillalibdir}/browser/chrome/icons/default/default16.png %{buildroot}%{_miconsdir}/%{name}.png
348
349 # exclusions
350 rm -f %{buildroot}%{mozillalibdir}/README.txt
351 rm -f %{buildroot}%{mozillalibdir}/removed-files
352 rm -f %{buildroot}%{mozillalibdir}/precomplete
353
354 # this file is only used when creating a new user profile
355 %{__mkdir_p} %{buildroot}%{mozillalibdir}/distribution
356 install -D -m644 browser/app/profile/prefs.js %{buildroot}%{mozillalibdir}/distribution/distribution.ini
357 cat << EOF >> %{buildroot}%{mozillalibdir}/distribution/distribution.ini
358 [Global]
359 id=
360 version=
361 about=Firefox packaged by Mageia
362 [LocalizablePreferences]
363 browser.shell.checkDefaultBrowser="false"
364 browser.startup.homepage="file:///usr/share/indexhtml/index.html"
365 update_notifications.enabled="false"
366 EOF
367
368 # display icon for Firefox button
369 %{__mkdir_p} %{buildroot}%{mozillalibdir}/browser/defaults/profile/chrome
370 cat << EOF > %{buildroot}%{mozillalibdir}/browser/defaults/profile/chrome/userChrome.css
371 #appmenu-toolbar-button {
372 list-style-image: url("chrome://branding/content/icon16.png");
373 }
374 EOF
375
376 # files in this directory are read on every startup, and can change/add
377 # preferences for existing profiles
378 # extensions.autoDisableScopes is a new preference added in firefox 8
379 # it defines "scopes" where newly installed addons are disabled by default
380 # this is an additive bit field, and the value defaults to 15 (1+2+4+8)
381 # we need to remove system scope (8) from it so language packs and other addons
382 # which are installed systemwide won't get marked as 3rd party and disabled
383 # documentation: http://kb.mozillazine.org/About:config_entries#Extensions.
384 # or in toolkit/mozapps/extensions/AddonManager.jsm
385 # we also need to disable the "disable addon selection dialog"
386 # (doktor5000) - path has changed since FF 21
387 # http://mike.kaply.com/2013/04/24/major-changes-coming-in-firefox-21/
388 cat << EOF > %{buildroot}%{mozillalibdir}/browser/defaults/preferences/mga.js
389 pref("general.useragent.locale", "chrome://global/locale/intl.properties");
390 pref("extensions.autoDisableScopes", 0);
391 pref("extensions.shownSelectionUI", true);
392 EOF
393 # FIXME: Add it back in mga.js when this search engine will be used by default.
394 # user_pref("browser.search.selectedEngine","duckduckgo.com");
395
396 # use the system myspell dictionaries
397 rm -fr %{buildroot}%{mozillalibdir}/dictionaries
398 ln -s %{_datadir}/hunspell %{buildroot}%{mozillalibdir}/dictionaries
399
400 # (lm) touch and %ghost bookmarks.html to a proper uninstall
401 touch %{buildroot}%{mozillalibdir}/browser/defaults/profile/bookmarks.html
402
403 # Add stuff to build a plugin to -devel
404 mkdir -p %{buildroot}%{_includedir}
405 cp -a dom/plugins/base/np*.h %{buildroot}%{_includedir}
406 mkdir -p %{buildroot}/%{_datadir}/pkgconfig
407 cat <<EOF >%{buildroot}/%{_datadir}/pkgconfig/mozilla-plugin.pc
408 Name: Mozilla Plug-In API
409 Description: Mozilla Plug-In API
410 Version: %{version}
411 Cflags: -I%{_includedir} -DXP_UNIX
412 EOF
413
414 mkdir -p %{buildroot}%{_sys_macros_dir}
415 cat <<FIN >%{buildroot}%{_sys_macros_dir}/%{name}.macros
416 # Macros from %{name} package
417 %%firefox_major %{version}
418 %%firefox_epoch %{ff_epoch}
419 %%firefox_version %{version}
420 %%firefox_mozillapath %{mozillalibdir}
421 %%firefox_pluginsdir %{pluginsdir}
422 %%firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
423 %%firefox_extdir %%(if [ "%%_target_cpu" = "noarch" ]; then echo %%{_datadir}/mozilla/extensions/%%{firefox_appid}; else echo %%{_libdir}/mozilla/extensions/%%{firefox_appid}; fi)
424 FIN
425 # temp build fix:
426 mkdir -p %{buildroot}%{mozillalibdir}/browser/searchplugins
427 cp -f %{SOURCE8} %{buildroot}%{mozillalibdir}/browser/searchplugins/duckduckgo.xml
428
429 %pre
430 if [ -d %{mozillalibdir}/dictionaries ]; then
431 rm -fr %{mozillalibdir}/dictionaries
432 fi
433
434 %post
435 if [ ! -r /etc/sysconfig/oem ]; then
436 case `grep META_CLASS /etc/sysconfig/system` in
437 *powerpack) bookmark="mozilla-powerpack.html" ;;
438 *desktop) bookmark="mozilla-one.html";;
439 *) bookmark="mozilla-download.html";;
440 esac
441 ln -s -f %{_prefix}/share/mga/bookmarks/mozilla/$bookmark %{mozillalibdir}/browser/defaults/profile/bookmarks.html
442 fi
443
444 %files
445 %{_bindir}/%{name}
446 %{_bindir}/mozilla-firefox
447 %{_iconsdir}/hicolor/*/apps/*.png
448 %{_miconsdir}/%{name}.png
449 %{_iconsdir}/%{name}.png
450 %{_liconsdir}/%{name}.png
451 %{_datadir}/applications/*.desktop
452 %{mozillalibdir}
453 %ghost %{mozillalibdir}/browser/defaults/profile/bookmarks.html
454 %dir %{_libdir}/mozilla
455 %dir %{pluginsdir}
456 %dir %{_libdir}/mozilla/extensions/%{firefox_appid}
457 %dir %{_datadir}/mozilla/extensions/%{firefox_appid}
458
459 %files devel
460 %{_sys_macros_dir}/%{name}.macros
461 %{_includedir}/np*.h
462 %{_datadir}/pkgconfig/mozilla-plugin.pc

  ViewVC Help
Powered by ViewVC 1.1.30