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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1357875 - (show annotations) (download)
Fri Jan 18 09:38:20 2019 UTC (5 years, 3 months ago) by tv
File size: 16186 byte(s)
65.0b12
1 # This package is loosely synced with FC
2
3 %global system_nss 1
4 %global system_cairo 0
5 %global system_libicu 0
6 %global hardened_build 1
7 %global build_with_clang 0
8 %ifarch x86_64 aarch64
9 %global build_with_clang 1
10 %endif
11 %global build_with_pgo 0
12 %global use_bundled_cbindgen 1
13
14 # (tpg) MOZILLA_FIVE_HOME
15 %global mozillalibdir %{_libdir}/%{name}
16 %global pluginsdir %{_libdir}/mozilla/plugins
17 %global firefox_channel beta
18
19 %define prerel b12
20
21 # Build as a debug package?
22 %global debug_build 0
23 #%if !0%{?build_with_clang}
24 #%global disable_elfhack 1
25 #%endif
26
27 # Minimal required versions
28 %global cairo_version 1.13.1
29 %global freetype_version 2.1.9
30 %global libnotify_version 0.7.0
31 %global libvpx_version 1.5.0-3
32
33 # this seems fragile, so require the exact version or later (#58754)
34 %global nspr_version 4.19
35 %global nspr_build_version %(pkg-config --silence-errors --modversion nspr 2>/dev/null || echo 65536)
36 %global nss_version 3.40
37 %global nss_build_version %(pkg-config --silence-errors --modversion nss 2>/dev/null || echo 65536)
38 %global sqlite_version 3.22.0
39 # The actual sqlite version (see #480989):
40 %global sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo 65536)
41
42 %global mozappdir %{_libdir}/%{name}
43
44 Summary: Mozilla Firefox Web browser
45 Name: firefox-beta
46 Version: 65.0
47 Release: %mkrel 0.%{prerel}
48 Provides: %{name} = %{version}-0.%{prerel}
49 URL: https://www.mozilla.org/firefox/
50 License: MPLv1.1 or GPLv2+ or LGPLv2+
51 Group: Networking/WWW
52 Source0: https://ftp.mozilla.org/pub/firefox/releases/%{version}%prerel/source/firefox-%{version}%prerel.source.tar.xz
53 Source2: cbindgen-vendor.tar.xz
54 Source4: %{name}.desktop
55 Source8: firefox-searchengines-duckduckgo.xml
56 # From Fedora:
57 Source10: firefox-mozconfig
58 Source12: firefox-mageia-default-prefs.js
59 Source24: mozilla-api-key
60 Source26: distribution.ini
61 Source27: google-api-key
62 # To generate cbindgen-vendor.tar.xz
63 Source100: gen_cbindgen-vendor.sh
64 # Fedora patches:
65 Patch3: mozilla-build-arm.patch
66 Patch27: mozilla-1335250.patch
67 # Always feel lucky for unsupported platforms:
68 # https://bugzilla.mozilla.org/show_bug.cgi?id=1347128
69 Patch37: build-jit-atomic-always-lucky.patch
70 Patch40: build-aarch64-skia.patch
71 Patch41: build-disable-elfhack.patch
72 Patch42: prio-nss-build.patch
73
74 #ARM run-time patch
75 Patch226: rhbz-1354671.patch
76
77 # Upstream patches
78 Patch407: mozilla-1348576.patch
79 Patch410: mozilla-1321521.patch
80 Patch411: mozilla-1321521-2.patch
81 Patch412: mozilla-1337988.patch
82 Patch413: mozilla-1353817.patch
83
84 # Mageia patches:
85 Patch1000: firefox-lang.patch
86 Patch1002: firefox-vendor.patch
87 Patch1003: firefox-disable-check-default-browser.patch
88 # (OpenSuse) add patch to make firefox always use /usr/bin/firefox when "make firefox
89 # the default web browser" is used fix mdv bug#58784
90 Patch1005: firefox-38.0-appname.patch
91 Patch1009: fix-build.diff
92
93 %if %{?system_nss}
94 BuildRequires: pkgconfig(nspr) >= %{nspr_version}
95 BuildRequires: pkgconfig(nss) >= %{nss_version}
96 BuildRequires: nss-static-devel >= %{nss_version}
97 %endif
98 %if %{?system_cairo}
99 BuildRequires: pkgconfig(cairo) >= %{cairo_version}
100 %endif
101 BuildRequires: pkgconfig(libpng)
102 BuildRequires: libjpeg-devel
103 BuildRequires: zip
104 BuildRequires: bzip2-devel
105 BuildRequires: pkgconfig(zlib)
106 BuildRequires: pkgconfig(libIDL-2.0)
107 BuildRequires: pkgconfig(gtk+-3.0)
108 BuildRequires: pkgconfig(gtk+-2.0)
109 BuildRequires: pkgconfig(krb5)
110 BuildRequires: pkgconfig(pango)
111 BuildRequires: pkgconfig(freetype2) >= %{freetype_version}
112 BuildRequires: pkgconfig(xt)
113 BuildRequires: pkgconfig(xrender)
114 BuildRequires: pkgconfig(hunspell)
115 BuildRequires: pkgconfig(libstartup-notification-1.0)
116 BuildRequires: pkgconfig(libnotify) >= %{libnotify_version}
117 BuildRequires: pkgconfig(dri)
118 BuildRequires: dbus-glib-devel
119 BuildRequires: pkgconfig(libvpx) >= %{libvpx_version}
120 BuildRequires: autoconf2.1
121 BuildRequires: pkgconfig(libpulse)
122 BuildRequires: pkgconfig(icu-i18n) >= 58.0
123 BuildRequires: pkgconfig(gconf-2.0)
124 #BuildRequires: valgrind-devel
125 BuildRequires: yasm
126 BuildRequires: libatomic-devel
127 BuildRequires: clang-devel
128 BuildRequires: llvm
129 BuildRequires: llvm-devel
130 BuildRequires: clang
131 %if 0%{?build_with_clang}
132 BuildRequires: lld
133 %endif
134 BuildRequires: nodejs
135 %if %{?system_nss}
136 Requires: %{mklibname nss 3} >= 2:%{nss_build_version}
137 Requires: %{mklibname nspr 4} >= 2:%{nspr_build_version}
138 %endif
139 BuildRequires: pkgconfig(libavcodec)
140 BuildRequires: python2-devel
141 BuildRequires: pkgconfig(sqlite3) >= %{sqlite_version}
142 Requires: %{mklibname sqlite3_ 0} >= %{sqlite_build_version}
143 BuildRequires: pkgconfig(libffi)
144 BuildRequires: rootcerts >= 1:20130411.00
145 BuildRequires: doxygen
146 BuildRequires: libiw-devel
147 BuildRequires: python-setuptools
148 BuildRequires: python-virtualenv
149 BuildRequires: pkgconfig(libproxy-1.0)
150 Obsoletes: firefox-aurora < %{version}
151
152 BuildRequires: rust
153 BuildRequires: cargo
154
155 Provides: webclient
156
157 #Requires: indexhtml
158 Requires: xdg-utils
159 # fixes bug #42096
160 Requires: mailcap
161 Recommends: hunspell-en
162 Requires: %{_lib}notify4
163 # make sure our default bookmarks are present
164 Requires: desktop-common-data
165 Recommends: %{_lib}canberra0
166 Recommends: %{_lib}cups2
167 %define ff_deps myspell-en_US
168 Recommends: %{ff_deps}
169
170 %description
171 Mozilla Firefox is an open-source web browser, designed for standards
172 compliance, performance and portability.
173
174 %package devel
175 Summary: Development files for %{name}
176 Group: Development/Other
177 Obsoletes: firefox-aurora-devel < %{version}
178
179 %description devel
180 Files and macros mainly for building Firefox extensions.
181
182 %prep
183 %setup -qn firefox-%{version}
184 # Fedora patches:
185 %patch40 -p1
186 #patch37 -p1 -b .jit-atomic-lucky
187 %if 0%{?disable_elfhack}
188 %patch41 -p1 -b .disable-elfhack
189 %endif
190 %patch3 -p1 -b .arm
191 #patch42 -p1 -b .nss-build
192 %ifarch aarch64
193 %patch226 -p1 -b .1354671
194 %endif
195
196 %patch413 -p1 -b .1353817
197
198
199 # Mageia patches:
200 %patch1000 -p1 -b .lang
201 #patch1002 -p1 -b .vendor
202 %patch1003 -p1 -b .defaultbrowser
203 %patch1009 -p1 -b .fbts
204
205 # needed to regenerate certdata.c
206 #pushd ./security/nss/lib/ckfw/builtins
207 #perl ./certdata.perl < /etc/pki/tls/mozilla/certdata.txt
208 #popd
209
210 %{__rm} -f .mozconfig
211 %{__cp} %{SOURCE10} .mozconfig
212 # Mageia specific options:
213 cat << EOF >> .mozconfig
214 ac_add_options --enable-libproxy
215 ac_add_options --with-system-png
216 ac_add_options --with-distribution-id=org.mageia
217 #ac_add_options --with-valgrind
218 EOF
219
220 # Options shared with FC:
221 echo "ac_add_options --enable-default-toolkit=cairo-gtk3" >> .mozconfig
222 echo "ac_add_options --enable-official-branding" >> .mozconfig
223
224 %{__cp} %{SOURCE24} mozilla-api-key
225 %{__cp} %{SOURCE27} google-api-key
226
227 %if %{?system_nss}
228 echo "ac_add_options --with-system-nspr" >> .mozconfig
229 echo "ac_add_options --with-system-nss" >> .mozconfig
230 %else
231 echo "ac_add_options --without-system-nspr" >> .mozconfig
232 echo "ac_add_options --without-system-nss" >> .mozconfig
233 %endif
234
235 echo "ac_add_options --enable-system-sqlite" >> .mozconfig
236
237 %if %{?system_cairo}
238 echo "ac_add_options --enable-system-cairo" >> .mozconfig
239 %else
240 echo "ac_add_options --disable-system-cairo" >> .mozconfig
241 %endif
242
243 echo "ac_add_options --enable-system-ffi" >> .mozconfig
244
245 %ifarch %{arm}
246 echo "ac_add_options --disable-elf-hack" >> .mozconfig
247 %endif
248
249 %if %{?debug_build}
250 echo "ac_add_options --enable-debug" >> .mozconfig
251 echo "ac_add_options --disable-optimize" >> .mozconfig
252 %else
253 %global optimize_flags "none"
254 %ifarch armv7hl
255 # ARMv7 needs that (rhbz#1426850)
256 %global optimize_flags "-g -O2 -fno-schedule-insns"
257 # Disable libaom due to rhbz#1641623
258 echo "ac_add_options --disable-av1" >> .mozconfig
259 %endif
260 %ifarch ppc64le aarch64
261 %global optimize_flags "-g -O2"
262 %endif
263 %if %{optimize_flags} != "none"
264 echo 'ac_add_options --enable-optimize=%{?optimize_flags}' >> .mozconfig
265 %else
266 echo 'ac_add_options --enable-optimize' >> .mozconfig
267 %endif
268 echo "ac_add_options --disable-debug" >> .mozconfig
269 %endif
270
271 # Second arches fail to start with jemalloc enabled
272 %ifnarch %{ix86} x86_64
273 echo "ac_add_options --disable-jemalloc" >> .mozconfig
274 %endif
275
276 %ifnarch %{ix86} x86_64
277 echo "ac_add_options --disable-webrtc" >> .mozconfig
278 %endif
279
280 echo "ac_add_options --disable-crashreporter" >> .mozconfig
281
282 echo "ac_add_options --with-system-jpeg" >> .mozconfig
283
284 echo "ac_add_options --with-system-libvpx" >> .mozconfig
285
286 %if %{?system_libicu}
287 echo "ac_add_options --with-system-icu" >> .mozconfig
288 %else
289 echo "ac_add_options --without-system-icu" >> .mozconfig
290 %endif
291
292 %if 0%{?use_bundled_cbindgen}
293
294 mkdir -p my_rust_vendor
295 cd my_rust_vendor
296 %{__tar} xf %{SOURCE2}
297 cd -
298 mkdir -p .cargo
299 cat > .cargo/config <<EOL
300 [source.crates-io]
301 replace-with = "vendored-sources"
302
303 [source.vendored-sources]
304 directory = "`pwd`/my_rust_vendor"
305 EOL
306
307 env CARGO_HOME=.cargo cargo install cbindgen
308 %endif
309
310 %build
311 %if 0%{?use_bundled_cbindgen}
312 export PATH=`pwd`/.cargo/bin:$PATH
313 %endif
314
315 # -fpermissive is needed to build with gcc 4.6+ which has become stricter
316 #
317 # Mozilla builds with -Wall with exception of a few warnings which show up
318 # everywhere in the code; so, don't override that.
319 #
320 # Disable C++ exceptions since Mozilla code is not exception-safe
321 #
322 MOZ_OPT_FLAGS=$(echo "%{optflags}" | %{__sed} -e 's/-Wall//')
323 #rhbz#1037063
324 # -Werror=format-security causes build failures when -Wno-format is explicitly given
325 # for some sources
326 # Explicitly force the hardening flags for Firefox so it passes the checksec test;
327 # See also https://fedoraproject.org/wiki/Changes/Harden_All_Packages
328 MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -Wformat-security -Wformat -Werror=format-security"
329 # Disable null pointer gcc6 optimization in gcc6 (rhbz#1328045)
330 MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fno-delete-null-pointer-checks"
331 # Use hardened build?
332 %if 0%{?hardened_build}
333 MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fPIC -Wl,-z,relro -Wl,-z,now"
334 %endif
335 %if %{?debug_build}
336 MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-O2//')
337 %endif
338 %ifnarch x86_64
339 MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g1/')
340 # If MOZ_DEBUG_FLAGS is empty, firefox's build will default it to "-g" which
341 # overrides the -g1 from line above and breaks building on s390
342 # (OOM when linking, rhbz#1238225)
343 export MOZ_DEBUG_FLAGS=" "
344 %endif
345 %if !0%{?build_with_clang}
346 %ifarch s390 %{arm} ppc aarch64 %{ix86}
347 MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
348 %endif
349 %endif
350 %ifarch %{arm} %ix86
351 export RUSTFLAGS="-Cdebuginfo=0"
352 %endif
353 export CFLAGS=$MOZ_OPT_FLAGS
354 export CXXFLAGS=$MOZ_OPT_FLAGS
355 export LDFLAGS=$MOZ_LINK_FLAGS
356
357 export PREFIX='%{_prefix}'
358 export LIBDIR='%{_libdir}'
359
360 %if 0%{?build_with_clang}
361 export LLVM_PROFDATA="llvm-profdata"
362 #export AR="llvm-ar"
363 #export NM="llvm-nm"
364 export RANLIB="llvm-ranlib"
365 echo "ac_add_options --enable-linker=lld" >> .mozconfig
366 %else
367 export CC=gcc
368 export CXX=g++
369 #echo "ac_add_options --enable-linker=gold" >> .mozconfig
370 %endif
371 %if 0%{?build_with_pgo}
372 echo "ac_add_options MOZ_PGO=1" >> .mozconfig
373 %endif
374
375 MOZ_SMP_FLAGS=-j1
376 # On x86_64 architectures, Mozilla can build up to 4 jobs at once in parallel,
377 # however builds tend to fail on other arches when building in parallel.
378 %ifarch %{ix86} %{arm}
379 [ -z "$RPM_BUILD_NCPUS" ] && \
380 RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"
381 [ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2
382 %endif
383 %ifarch x86_64 ppc ppc64 ppc64le aarch64
384 [ -z "$RPM_BUILD_NCPUS" ] && \
385 RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"
386 [ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2
387 [ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4
388 %ifnarch aarch64
389 [ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j8
390 %endif
391 %endif
392
393 export MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS"
394 export MOZ_SERVICES_SYNC="1"
395 export STRIP=/bin/true
396 ./mach build
397
398 %install
399 make -C objdir/browser/installer STRIP=/bin/true MOZ_PKG_FATAL_WARNINGS=0
400
401 # Copy files to buildroot
402 %{__mkdir_p} %{buildroot}%{mozillalibdir}
403 cp -rf objdir/dist/firefox/* %{buildroot}%{mozillalibdir}
404
405 %{__mkdir_p} %{buildroot}%{_bindir}
406 ln -sf %{mozillalibdir}/firefox %{buildroot}%{_bindir}/firefox-%{firefox_channel}
407 mkdir -p %{buildroot}%{mozillalibdir}/browser/defaults/preferences/
408
409 # (tpg) desktop entry
410 %{__mkdir_p} %{buildroot}%{_datadir}/applications
411 install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/firefox-%{firefox_channel}.desktop
412
413 # (tpg) icons
414 #cp %{buildroot}%{mozillalibdir}/browser/chrome/icons/default/default16.png %{buildroot}/%{mozillalibdir}/browser/icons/
415 for i in 16 22 24 32 48 256; do
416 %{__mkdir_p} %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps
417 %{__install} -m 644 browser/branding/official/default$i.png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps/firefox-%{firefox_channel}.png ;
418 done
419
420 # exclusions
421 rm -f %{buildroot}%{mozillalibdir}/README.txt
422 rm -f %{buildroot}%{mozillalibdir}/removed-files
423 rm -f %{buildroot}%{mozillalibdir}/precomplete
424
425 # Default
426 %{__cp} %{SOURCE12} %{buildroot}%{mozillalibdir}/browser/defaults/preferences
427
428 # display icon for Firefox button
429 %{__mkdir_p} %{buildroot}%{mozillalibdir}/browser/defaults/profile/chrome
430 cat << EOF > %{buildroot}%{mozillalibdir}/browser/defaults/profile/chrome/userChrome.css
431 #appmenu-toolbar-button {
432 list-style-image: url("chrome://branding/content/icon16.png");
433 }
434 EOF
435
436 # files in this directory are read on every startup, and can change/add
437 # preferences for existing profiles
438 # extensions.autoDisableScopes is a new preference added in firefox 8
439 # it defines "scopes" where newly installed addons are disabled by default
440 # this is an additive bit field, and the value defaults to 15 (1+2+4+8)
441 # we need to remove system scope (8) from it so language packs and other addons
442 # which are installed systemwide won't get marked as 3rd party and disabled
443 # documentation: http://kb.mozillazine.org/About:config_entries#Extensions.
444 # or in toolkit/mozapps/extensions/AddonManager.jsm
445 # we also need to disable the "disable addon selection dialog"
446 %{__mkdir_p} %{buildroot}%{mozillalibdir}/browser/defaults/preferences
447 cat << EOF > %{buildroot}%{mozillalibdir}/browser/defaults/preferences/mga.js
448 pref("general.useragent.locale", "chrome://global/locale/intl.properties");
449 pref("extensions.autoDisableScopes", 0);
450 pref("extensions.shownSelectionUI", true);
451 EOF
452 # FIXME: Add it back in mga.js when this search engine will be used by default.
453 # user_pref("browser.search.selectedEngine","duckduckgo.com");
454
455 # Use the system hunspell dictionaries
456 rm -fr %{buildroot}%{mozillalibdir}/dictionaries
457 ln -s %{_datadir}/hunspell %{buildroot}%{mozillalibdir}/dictionaries
458
459 # Add distribution.ini
460 %{__mkdir_p} %{buildroot}%{mozappdir}/distribution
461 %{__cp} %{SOURCE26} %{buildroot}%{mozappdir}/distribution
462
463 # (lm) touch and %ghost bookmarks.html to a proper uninstall
464 touch %{buildroot}%{mozillalibdir}/browser/defaults/profile/bookmarks.html
465
466 mkdir -p %{buildroot}%{_sys_macros_dir}
467 cat <<FIN >%{buildroot}%{_sys_macros_dir}/%{name}.macros
468 # Macros from %{name} package
469 %%firefox_major %{version}
470 %%firefox_version %{version}
471 %%firefox_mozillapath %{mozillalibdir}
472 %%firefox_pluginsdir %{pluginsdir}
473 %%firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
474 %%firefox_extdir %%(if [ "%%_target_cpu" = "noarch" ]; then echo %%{_datadir}/mozilla/extensions/%%{firefox_appid}; else echo %%{_libdir}/mozilla/extensions/%%{firefox_appid}; fi)
475 FIN
476 # temp build fix:
477 mkdir -p %{buildroot}%{mozillalibdir}/browser/searchplugins
478 cp -f %{SOURCE8} %{buildroot}%{mozillalibdir}/browser/searchplugins/duckduckgo.xml
479
480 %pre
481 if [ -d %{mozillalibdir}/dictionaries ]; then
482 rm -fr %{mozillalibdir}/dictionaries
483 fi
484
485 %post
486 if [ ! -r /etc/sysconfig/oem ]; then
487 case `grep META_CLASS /etc/sysconfig/system` in
488 *powerpack) bookmark="mozilla-powerpack.html" ;;
489 *desktop) bookmark="mozilla-one.html";;
490 *) bookmark="mozilla-download.html";;
491 esac
492 ln -s -f %{_prefix}/share/mga/bookmarks/mozilla/$bookmark %{mozillalibdir}/browser/defaults/profile/bookmarks.html
493 fi
494
495 %files
496 %{_bindir}/firefox-%{firefox_channel}
497 %{_iconsdir}/hicolor/*/apps/*.png
498 %{_datadir}/applications/*.desktop
499 %{_libdir}/%{name}*
500 %ghost %{mozillalibdir}/browser/defaults/profile/bookmarks.html
501
502 %files devel
503 %{_sys_macros_dir}/%{name}.macros

  ViewVC Help
Powered by ViewVC 1.1.30