# This package is loosely synced with FC # Produce a build suitable for release, i.e. use PGO/LTO. You can turn it off # when building locally to reduce build time. %global release_build 1 # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. %global run_firefox_tests 0 %ifarch x86_64 %{ix86} %global run_firefox_tests 0 %endif # Don't create debuginfo rpm packages. It reduces build time as # exctracting debuginfo takes long time. %global create_debuginfo 0 # Produce debug (non-optimized) package build. Suitable for debugging only # as the build is *very* slow. %global debug_build 0 %global build_with_clang 0 %global build_with_asan 0 %global test_offscreen 1 %global test_on_wayland 0 # Temporary disable tests on i586 due to failures %ifarch %{ix86} %global run_firefox_tests 0 %endif %global enable_mozilla_crashreporter 0 %ifarch x86_64 %{ix86} %global enable_mozilla_crashreporter 0 %endif %if %{build_with_asan} %global enable_mozilla_crashreporter 0 %endif %if !%{create_debuginfo} %define _unpackaged_files_terminate_build 0 %global debug_package %{nil} %global enable_mozilla_crashreporter 0 %endif ExclusiveArch: x86_64 # Place rpm-macros into proper location %global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) %global system_nss 0 %global system_libicu 0 %global hardened_build 1 %global use_bundled_cbindgen 1 %if %{debug_build} %global release_build 0 %endif %ifarch x86_64 aarch64 %global build_with_clang 1 %endif # Build PGO+LTO on x86_64 and aarch64 only due to build issues # on other arches. %global build_with_pgo 0 %ifarch x86_64 %if %{release_build} %global build_with_pgo 1 %endif %endif # (tpg) MOZILLA_FIVE_HOME %global mozappdir %{_libdir}/%{name} %global pluginsdir %{_libdir}/mozilla/plugins %global firefox_channel latest # exclude libnss from provides (eg: when system_nss is disabled) %global __provides_exclude %{?__provides_exclude:%__provides_exclude|}^libnss|^libnspr|^libsmime3|^libssl3|^libsoftokn3|^libfreeblpriv3|^libplc4|^libplds4 # exclude libnss from requires when system_nss is disabled (requires on ourselves): %if !%{?system_nss} %global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^libnss|^libnspr|^libsmime3|^libssl3|^libsoftokn3|^libfreeblpriv3|^libplc4|^libplds4 %endif %if 0%{?build_with_pgo} %global use_xvfb 1 %global build_tests 0 %endif %if 0%{?run_firefox_tests} %global use_xvfb 1 %global build_tests 1 %endif #%%if !0%%{?build_with_clang} #%%global disable_elfhack 1 #%%endif # Minimal required versions %global cairo_version 1.13.1 %global freetype_version 2.1.9 %global libnotify_version 0.7.0 %global libvpx_version 1.5.0-3 %if !0%{?system_libvpx} %global libvpx_version 1.8.2 %endif # this seems fragile, so require the exact version or later (#58754) %global nspr_version 4.25 %global nspr_build_version %(pkg-config --silence-errors --modversion nspr 2>/dev/null || echo 65536) %global nss_version 3.51.1 %global nss_build_version %(pkg-config --silence-errors --modversion nss 2>/dev/null || echo 65536) %global sqlite_version 3.31.1 # The actual sqlite version (see #480989): %global sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo 65536) %global mozappdir %{_libdir}/%{name} Summary: Mozilla Firefox Web browser Name: firefox-latest Version: 87.0 Release: %mkrel 0.1 URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Group: Networking/WWW # hg at https://hg.mozilla.org/releases/mozilla-release/ Source0: https://ftp.mozilla.org/pub/firefox/releases/%{version}/source/firefox-%{version}.source.tar.xz Source2: cbindgen-vendor.tar.xz Source4: %{name}.desktop Source8: firefox-searchengines-duckduckgo.xml # From Fedora: Source10: firefox-mozconfig Source12: firefox-mageia-default-prefs.js Source24: mozilla-api-key Source26: distribution.ini Source27: google-api-key # To generate cbindgen-vendor.tar.xz Source100: gen_cbindgen-vendor.sh # Extra privacy (Alt) Source200: firefox-extra-privacy.js # Fedora patches: # Build patches Patch3: mozilla-build-arm.patch # Always feel lucky for unsupported platforms: # https://bugzilla.mozilla.org/show_bug.cgi?id=1347128 Patch37: build-jit-atomic-always-lucky.patch Patch40: build-aarch64-skia.patch Patch41: build-disable-elfhack.patch Patch44: build-arm-libopus.patch Patch48: build-arm-wasm.patch Patch49: build-arm-libaom.patch Patch53: firefox-gcc-build.patch # Fedora specific patches #ARM run-time patch Patch226: rhbz-1354671.patch Patch408: mozilla-1663844.patch # PGO/LTO patches Patch600: firefox-pgo.patch Patch602: mozilla-1516803.patch # Upstream patches Patch412: mozilla-1337988.patch Patch415: Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch # Mageia patches: Patch1000: firefox-lang.patch Patch1002: firefox-vendor.patch Patch1003: firefox-disable-check-default-browser.patch # (OpenSuse) add patch to make firefox always use /usr/bin/firefox when "make firefox # the default web browser" is used fix mdv bug#58784 Patch1005: firefox-38.0-appname.patch Patch1009: fix-build.diff Patch1042: typenum-fix-cargo-checksum.patch # Patch by Martin Whitaker to fix building i586 with rust Patch1043: force-i586-host.patch # (martinw) don't check for cmov support when running on older CPUs Patch1044: bypass-cmov-assert-on-i586.patch # (tv) fix checksum b/c of missing files :-( : Patch1045: fix-checksum-for-missing-file.patch # Other customizations # avoid implicit setting MOZ_SERVICES_HEALTHREPORT force triggering MOZ_TELEMETRY_REPORTING=1 or MOZ_DATA_REPORTING=1 Patch5001: firefox-dont-trigger-moz-telemetry-reporting.patch Patch5002: firefox-dont-trigger-moz-data-reporting.patch # deb Patch5010: 0001-Avoid-wrong-sessionstore-data-to-keep-windows-out-of.patch Patch5011: 0001-Don-t-register-plugins-if-the-MOZILLA_DISABLE_PLUGIN.patch Patch5012: 0001-Set-DPI-to-system-settings.patch Patch5013: 0001-Set-program-name-from-the-remoting-name.patch # pld Patch5020: firefox-middle-click-paste.patch # opensuse Patch5100: mozilla-nongnome-proxies.patch Patch5101: mozilla-kde.patch Patch5102: mozilla-ntlm-full-path.patch Patch5103: mozilla-aarch64-startup-crash.patch Patch5104: mozilla-s390-context.patch Patch5105: mozilla-reduce-rust-debuginfo.patch Patch5106: mozilla-bmo1005535.patch Patch5107: mozilla-bmo1568145.patch Patch5108: mozilla-bmo1504834-part1.patch Patch5109: mozilla-bmo1504834-part2.patch Patch5110: mozilla-bmo1504834-part3.patch Patch5111: mozilla-bmo1512162.patch Patch5112: mozilla-fix-top-level-asm.patch Patch5113: mozilla-bmo1504834-part4.patch Patch5114: mozilla-bmo849632.patch Patch5115: mozilla-bmo1602730.patch Patch5116: mozilla-bmo998749.patch Patch5117: mozilla-bmo1626236.patch Patch5118: mozilla-s390x-skia-gradient.patch Patch5119: firefox-kde.patch BuildRequires: pkgconfig(nspr) >= %{nspr_version} %if %{?system_nss} BuildRequires: pkgconfig(nss) >= %{nss_version} BuildRequires: nss-static-devel >= %{nss_version} %endif BuildRequires: pkgconfig(libpng) BuildRequires: libjpeg-devel BuildRequires: zip BuildRequires: bzip2-devel BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtk+-2.0) BuildRequires: pkgconfig(krb5) BuildRequires: pkgconfig(pango) BuildRequires: pkgconfig(freetype2) >= %{freetype_version} BuildRequires: pkgconfig(xt) BuildRequires: pkgconfig(xrender) BuildRequires: pkgconfig(hunspell) BuildRequires: pkgconfig(libstartup-notification-1.0) BuildRequires: pkgconfig(libnotify) >= %{libnotify_version} BuildRequires: pkgconfig(dri) BuildRequires: pkgconfig(libcurl) BuildRequires: dbus-glib-devel %if 0%{?system_libvpx} BuildRequires: pkgconfig(libvpx) >= %{libvpx_version} %endif BuildRequires: autoconf2.1 BuildRequires: pkgconfig(libpulse) BuildRequires: pkgconfig(icu-i18n) >= 58.0 #BuildRequires: valgrind-devel BuildRequires: yasm BuildRequires: libatomic-devel BuildRequires: llvm BuildRequires: llvm-devel BuildRequires: clang BuildRequires: clang-devel %if 0%{?build_with_clang} BuildRequires: lld %endif BuildRequires: pipewire-devel BuildRequires: nodejs BuildRequires: nasm >= 1.13 %if %{?system_nss} Requires: %{mklibname nss 3} >= 2:%{nss_build_version} Requires: %{mklibname nspr 4} >= 2:%{nspr_build_version} %endif BuildRequires: pkgconfig(libavcodec) BuildRequires: python3-devel BuildRequires: pkgconfig(sqlite3) >= %{sqlite_version} Requires: %{mklibname sqlite3_ 0} >= %{sqlite_build_version} BuildRequires: pkgconfig(libffi) BuildRequires: rootcerts >= 1:20130411.00 BuildRequires: doxygen BuildRequires: libiw-devel BuildRequires: python3-setuptools BuildRequires: python3-virtualenv BuildRequires: pkgconfig(libproxy-1.0) %if 0%{?use_xvfb} BuildRequires: x11-server-xvfb %endif BuildRequires: rust >= 1.43.0 BuildRequires: cargo >= 1.43.0 %if %{build_with_asan} BuildRequires: libasan-devel %endif %if %{build_with_pgo} BuildRequires: compiler-rt %endif Provides: webclient #Requires: indexhtml Requires: xdg-utils # fixes bug #42096 Requires: mailcap Recommends: hunspell-en Requires: %{_lib}notify4 # make sure our default bookmarks are present Requires: desktop-common-data Recommends: %{_lib}canberra0 Recommends: %{_lib}cups2 %define ff_deps myspell-en_US Recommends: %{ff_deps} %description Mozilla Firefox is an open-source web browser, designed for standards compliance, performance and portability. %package devel Summary: Development files for %{name} Group: Development/Other %description devel Files and macros mainly for building Firefox extensions. %prep %setup -qn firefox-%{version} # Fedora patches: #patch37 -p1 -b .jit-atomic-lucky %patch40 -p1 -b .aarch64-skia %if 0%{?disable_elfhack} %patch41 -p1 -b .disable-elfhack %endif %patch3 -p1 -b .arm %patch44 -p1 -b .build-arm-libopus %patch48 -p1 -b .build-arm-wasm %patch49 -p1 -b .build-arm-libaom %ifarch aarch64 %patch226 -p1 -b .1354671 %endif %patch408 -p1 -b .1663844 %ifarch %{arm} %patch415 -p1 -b .1238661 %endif # PGO patches %if %{build_with_pgo} #%%if !%{build_with_clang} %patch600 -p1 -b .pgo %patch602 -p1 -b .1516803 #%%endif %endif # Mageia patches: %patch1000 -p1 -b .lang #patch1002 -p1 -b .vendor %patch1003 -p1 -b .defaultbrowser %patch1009 -p1 -b .fbts #patch1042 -p1 -b .typenum %patch1043 -p0 %patch1044 -p1 %patch1045 -p1 # other customizations # disable telemetry reporting %patch5001 -p1 %patch5002 -p1 # deb %patch5010 -p1 -b .sessionstore %patch5011 -p1 -b .registerplugin %patch5012 -p1 -b .setdpi %patch5013 -p1 -b .program # pld %patch5020 -p1 -b middleclick # # opensuse %patch5100 -p1 -b .noproxies #patch5101 -p1 -b .mozilla-kde %patch5102 -p1 -b .nltm %patch5103 -p1 -b .aarch64crash %patch5104 -p1 -b .s390contex %patch5105 -p1 -b .reducedebug %patch5106 -p1 -b .bmo1005535 %patch5107 -p1 -b .bmo1568145 %patch5108 -p1 -b .bmo1504834-p1 %patch5109 -p1 -b .bmo1504834-p2 %patch5110 -p1 -b .bmo1504834-p3 %patch5111 -p1 -b .bmo1512162 ##patch5112 -p1 -b .fixtoplevel %patch5113 -p1 -b .bo1504834-p4 %patch5114 -p1 -b .bmo849632 %patch5115 -p1 -b .bmo1602730 %patch5116 -p1 -b .bmo998749 %patch5117 -p1 -b .bmo1626236 %patch5118 -p1 -b .s390skia #patch5119 -p1 -b .firefox-kde # See also: # python/mozbuild/mozbuild/mozinfo.py # build/moz.configure/init.configure # https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/internals/preferences.html %{__rm} -f .mozconfig %{__cp} %{SOURCE10} .mozconfig # Mageia specific options: cat << EOF >> .mozconfig ac_add_options --enable-libproxy ac_add_options --with-system-png ac_add_options --with-distribution-id=org.mageia #ac_add_options --with-valgrind EOF # Options shared with FC: echo "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland" >> .mozconfig echo "ac_add_options --enable-official-branding" >> .mozconfig %{__cp} %{SOURCE24} mozilla-api-key %{__cp} %{SOURCE27} google-api-key echo "ac_add_options --prefix=\"%{_prefix}\"" >> .mozconfig echo "ac_add_options --libdir=\"%{_libdir}\"" >> .mozconfig %if %{?system_nss} echo "ac_add_options --with-system-nspr" >> .mozconfig echo "ac_add_options --with-system-nss" >> .mozconfig %else echo "ac_add_options --without-system-nspr" >> .mozconfig echo "ac_add_options --without-system-nss" >> .mozconfig %endif echo "ac_add_options --enable-system-ffi" >> .mozconfig %ifarch %{arm} echo "ac_add_options --disable-elf-hack" >> .mozconfig %endif %if %{?debug_build} echo "ac_add_options --enable-debug" >> .mozconfig echo "ac_add_options --disable-optimize" >> .mozconfig %else %global optimize_flags "none" %ifarch ppc64le aarch64 %global optimize_flags "-g -O2" %endif %if %{optimize_flags} != "none" echo 'ac_add_options --enable-optimize=%{?optimize_flags}' >> .mozconfig %else echo 'ac_add_options --enable-optimize' >> .mozconfig %endif echo "ac_add_options --disable-debug" >> .mozconfig %endif # Second arches fail to start with jemalloc enabled %ifnarch %{ix86} x86_64 echo "ac_add_options --disable-jemalloc" >> .mozconfig %endif %ifnarch %{ix86} x86_64 ppc64le echo "ac_add_options --disable-webrtc" >> .mozconfig %endif echo "ac_add_options --disable-crashreporter" >> .mozconfig echo "ac_add_options --with-system-jpeg" >> .mozconfig echo "ac_add_options --without-system-libvpx" >> .mozconfig %if %{?system_libicu} echo "ac_add_options --with-system-icu" >> .mozconfig %else echo "ac_add_options --without-system-icu" >> .mozconfig %endif %ifarch i586 # Rust seems to default to i686 otherwise echo "ac_add_options --host=i586-mageia-linux-gnu" >> .mozconfig echo "ac_add_options --target=i586-mageia-linux-gnu" >> .mozconfig %endif %if %{build_with_asan} echo "ac_add_options --enable-address-sanitizer" >> .mozconfig echo "ac_add_options --disable-jemalloc" >> .mozconfig %endif # api keys full path echo "ac_add_options --with-mozilla-api-keyfile=`pwd`/mozilla-api-key" >> .mozconfig # It seems that the api key we have is for the safe browsing only #echo "ac_add_options --with-google-location-service-api-keyfile=`pwd`/google-api-key" >> .mozconfig echo "ac_add_options --with-google-safebrowsing-api-keyfile=`pwd`/google-api-key" >> .mozconfig # Remove executable bit to make brp-mangle-shebangs happy. chmod -x third_party/rust/itertools/src/lib.rs chmod a-x third_party/rust/gfx-backend-vulkan/src/*.rs chmod a-x third_party/rust/gfx-hal/src/*.rs chmod a-x third_party/rust/ash/src/extensions/ext/*.rs chmod a-x third_party/rust/ash/src/extensions/khr/*.rs chmod a-x third_party/rust/ash/src/extensions/nv/*.rs find -name lib.rs | xargs chmod -x #--------------------------------------------------------------------- %build %if 0%{?use_bundled_cbindgen} mkdir -p my_rust_vendor cd my_rust_vendor %{__tar} xf %{SOURCE2} mkdir -p .cargo cat > .cargo/config < 6 MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fpermissive" %endif %if %{?hardened_build} MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fPIC -Wl,-z,relro -Wl,-z,now" %endif %if %{?debug_build} MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-O2//') %endif %ifarch s390 MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g1/') # If MOZ_DEBUG_FLAGS is empty, firefox's build will default it to "-g" which # overrides the -g1 from line above and breaks building on s390/arm # (OOM when linking, rhbz#1238225) export MOZ_DEBUG_FLAGS=" " %endif %ifarch %{arm} %{ix86} MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g0/') export MOZ_DEBUG_FLAGS=" " %endif %if !0%{?build_with_clang} %ifarch s390 ppc aarch64 %{ix86} MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %endif %ifarch %{arm} MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--strip-debug" echo "ac_add_options --enable-linker=gold" >> .mozconfig %endif %endif %ifarch %{arm} %{ix86} export RUSTFLAGS="-Cdebuginfo=0" %endif %if %{build_with_asan} MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fsanitize=address -Dxmalloc=myxmalloc" MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -fsanitize=address -ldl" %endif # We don't wantfirefox to use CK_GCM_PARAMS_V3 in nss #MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -DNSS_PKCS11_3_0_STRICT" echo "export CFLAGS=\"$MOZ_OPT_FLAGS\"" >> .mozconfig echo "export CXXFLAGS=\"$MOZ_OPT_FLAGS\"" >> .mozconfig echo "export LDFLAGS=\"$MOZ_LINK_FLAGS\"" >> .mozconfig %if 0%{?build_with_clang} echo "export LLVM_PROFDATA=\"llvm-profdata\"" >> .mozconfig echo "export AR=\"llvm-ar\"" >> .mozconfig echo "export NM=\"llvm-nm\"" >> .mozconfig echo "export RANLIB=\"llvm-ranlib\"" >> .mozconfig echo "ac_add_options --enable-linker=lld" >> .mozconfig %else echo "export CC=gcc" >> .mozconfig echo "export CXX=g++" >> .mozconfig echo "export AR=\"gcc-ar\"" >> .mozconfig echo "export NM=\"gcc-nm\"" >> .mozconfig echo "export RANLIB=\"gcc-ranlib\"" >> .mozconfig %endif %if 0%{?build_with_pgo} echo "ac_add_options MOZ_PGO=1" >> .mozconfig #echo "ac_add_options --enable-lto" >> .mozconfig # PGO build doesn't work with ccache export CCACHE_DISABLE=1 %endif MOZ_SMP_FLAGS=-j1 # On x86_64 architectures, Mozilla can build up to 4 jobs at once in parallel, # however builds tend to fail on other arches when building in parallel. %ifarch %{ix86} [ -z "$RPM_BUILD_NCPUS" ] && \ RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" [ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2 %endif %ifarch x86_64 ppc ppc64 ppc64le aarch64 [ -z "$RPM_BUILD_NCPUS" ] && \ RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" [ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2 [ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4 [ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j8 [ "$RPM_BUILD_NCPUS" -ge 16 ] && MOZ_SMP_FLAGS=-j16 [ "$RPM_BUILD_NCPUS" -ge 24 ] && MOZ_SMP_FLAGS=-j24 [ "$RPM_BUILD_NCPUS" -ge 32 ] && MOZ_SMP_FLAGS=-j32 [ "$RPM_BUILD_NCPUS" -ge 64 ] && MOZ_SMP_FLAGS=-j64 %endif # See https://firefox-source-docs.mozilla.org/setup/configuring_build_options.html for # build options. # echo "mk_add_options MOZ_MAKE_FLAGS=\"$MOZ_SMP_FLAGS\"" >> .mozconfig echo "mk_add_options MOZ_SERVICES_SYNC=1" >> .mozconfig # Disable telemetry reporting. # See toolkit/components/telemetry/docs/internals/preferences.rst and browser/moz.configure # or %%Source10 (firefox-mozconfig) where it is defined. echo "ac_add_options MOZ_TELEMETRY_REPORTING=" >> .mozconfig echo "export STRIP=/bin/true" >> .mozconfig echo "export MACH_USE_SYSTEM_PYTHON=1" >> .mozconfig export MACH_USE_SYSTEM_PYTHON=1 export MACH_NO_WRITE_TIMES=1 %if %{build_with_pgo} xvfb-run ./mach build --verbose 2>&1 | cat - %else ./mach build --verbose 2>&1 | cat - %endif # create debuginfo for crash-stats.mozilla.com %if %{enable_mozilla_crashreporter} make -C objdir buildsymbols %endif %install make -C objdir/browser/installer STRIP=/bin/true MOZ_PKG_FATAL_WARNINGS=0 # Copy files to buildroot %{__mkdir_p} %{buildroot}%{mozappdir} cp -rf objdir/dist/firefox/* %{buildroot}%{mozappdir} %{__mkdir_p} %{buildroot}%{_bindir} ln -sf %{mozappdir}/firefox %{buildroot}%{_bindir}/firefox-%{firefox_channel} mkdir -p %{buildroot}%{mozappdir}/browser/defaults/preferences/ # (tpg) desktop entry %{__mkdir_p} %{buildroot}%{_datadir}/applications install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/firefox-%{firefox_channel}.desktop # (tpg) icons #cp %{buildroot}%{mozappdir}/browser/chrome/icons/default/default16.png %{buildroot}/%{mozappdir}/browser/icons/ for i in 16 22 24 32 48 256; do %{__mkdir_p} %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps %{__install} -m 644 browser/branding/official/default$i.png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps/firefox-%{firefox_channel}.png ; done # exclusions rm -f %{buildroot}%{mozappdir}/README.txt rm -f %{buildroot}%{mozappdir}/removed-files rm -f %{buildroot}%{mozappdir}/precomplete # Default %{__cp} %{SOURCE12} %{buildroot}%{mozappdir}/browser/defaults/preferences # As default un-hide menu in toolbar at startup (old-school) cat <> %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-mageia-default-prefs.js pref("browser.showMenubar", true); EOF # display icon for Firefox button %{__mkdir_p} %{buildroot}%{mozappdir}/browser/defaults/profile/chrome cat << EOF > %{buildroot}%{mozappdir}/browser/defaults/profile/chrome/userChrome.css #appmenu-toolbar-button { list-style-image: url("chrome://branding/content/icon16.png"); } EOF # files in this directory are read on every startup, and can change/add # preferences for existing profiles # extensions.autoDisableScopes is a new preference added in firefox 8 # it defines "scopes" where newly installed addons are disabled by default # this is an additive bit field, and the value defaults to 15 (1+2+4+8) # we need to remove system scope (8) from it so language packs and other addons # which are installed systemwide won't get marked as 3rd party and disabled # documentation: http://kb.mozillazine.org/About:config_entries#Extensions. # or in toolkit/mozapps/extensions/AddonManager.jsm # we also need to disable the "disable addon selection dialog" %{__mkdir_p} %{buildroot}%{mozappdir}/browser/defaults/preferences cat << EOF > %{buildroot}%{mozappdir}/browser/defaults/preferences/mga.js pref("general.useragent.locale", "chrome://global/locale/intl.properties"); pref("extensions.autoDisableScopes", 0); pref("extensions.shownSelectionUI", true); EOF # FIXME: Add it back in mga.js when this search engine will be used by default. #user_pref("browser.search.selectedEngine","duckduckgo.com"); # other customizations cat <> %{buildroot}%{mozappdir}/browser/defaults/preferences/mga.js pref("browser.search.selectedEngine","duckduckgo.com"); pref("browser.urlbar.placeholderName", "DuckDuckGo"); EOF # extra privacy cat %{SOURCE200} >> %{buildroot}%{mozappdir}/browser/defaults/preferences/mga.js # Use the system hunspell dictionaries rm -fr %{buildroot}%{mozappdir}/dictionaries ln -s %{_datadir}/hunspell %{buildroot}%{mozappdir}/dictionaries # Add distribution.ini %{__mkdir_p} %{buildroot}%{mozappdir}/distribution %{__cp} %{SOURCE26} %{buildroot}%{mozappdir}/distribution # (lm) touch and %ghost bookmarks.html to a proper uninstall touch %{buildroot}%{mozappdir}/browser/defaults/profile/bookmarks.html mkdir -p %{buildroot}%{rpm_macros_dir} cat <%{buildroot}%{rpm_macros_dir}/macros.%{name} # Macros from %{name} package %%firefox_major %{version} %%firefox_version %{version} %%firefox_mozillapath %{mozappdir} %%firefox_pluginsdir %{pluginsdir} %%firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\} %%firefox_extdir %%(if [ "%%_target_cpu" = "noarch" ]; then echo %%{_datadir}/mozilla/extensions/%%{firefox_appid}; else echo %%{_libdir}/mozilla/extensions/%%{firefox_appid}; fi) EOF # temp build fix: mkdir -p %{buildroot}%{mozappdir}/browser/searchplugins cp -f %{SOURCE8} %{buildroot}%{mozappdir}/browser/searchplugins/duckduckgo.xml %post if [ ! -r /etc/sysconfig/oem ]; then case `grep META_CLASS /etc/sysconfig/system` in *powerpack) bookmark="mozilla-powerpack.html" ;; *desktop) bookmark="mozilla-one.html";; *) bookmark="mozilla-download.html";; esac ln -s -f %{_prefix}/share/mga/bookmarks/mozilla/$bookmark %{mozappdir}/browser/defaults/profile/bookmarks.html fi %files %{_bindir}/firefox-%{firefox_channel} %{_iconsdir}/hicolor/*/apps/*.png %{_datadir}/applications/*.desktop %{_libdir}/%{name}{,.*} %ghost %{mozappdir}/browser/defaults/profile/bookmarks.html %if %{build_with_asan} %{mozappdir}/llvm-symbolizer %endif %files devel %{rpm_macros_dir}/macros.%{name}