cd486f
# Set for local builds only
cd486f
%global disable_toolsets  0
cd486f
cd486f
# Use system nspr/nss? FIXME
cd486f
%global system_nss        1
cd486f
%define use_bundled_ffi   0
cd486f
%define use_bundled_python 1
cd486f
%define bundle_gnome_extension 0
cd486f
cd486f
# Don't use system hunspell for now
cd486f
%global system_hunspell   0
cd486f
%global system_sqlite     0
cd486f
%global use_llvmts        1
cd486f
cd486f
%if 0%{?rhel} > 6
cd486f
%global system_ffi        1
cd486f
%else
cd486f
%global system_ffi        0
cd486f
%global use_llvmts        0
cd486f
%endif
cd486f
%if 0%{?rhel} < 8
cd486f
%global use_dts           1
cd486f
%endif
cd486f
cd486f
%if 0%{?rhel} == 7
cd486f
%define use_bundled_python 0
cd486f
%endif
cd486f
cd486f
%if 0%{?rhel} < 8
cd486f
%global use_rustts        1
cd486f
%endif
cd486f
%global dts_version       7
cd486f
%global rst_version       7
cd486f
%global llvm_version      7
cd486f
%if 0%{?rhel} == 8
cd486f
%global rst_version       1.26
cd486f
%global llvm_version      6.0
cd486f
%endif
cd486f
cd486f
%if 0%{?disable_toolsets}
cd486f
%global use_rustts        0
cd486f
%global use_dts           0
cd486f
%global use_llvmts        0
cd486f
%endif
cd486f
cd486f
# Use system cairo?
cd486f
%global system_cairo      0
cd486f
cd486f
# Use system libvpx?
cd486f
%global system_libvpx     0
cd486f
cd486f
# Use system libicu?
cd486f
%global system_libicu     0
cd486f
cd486f
# Big endian platforms
cd486f
%ifarch ppc64 s390x
cd486f
# Javascript Intl API is not supported on big endian platforms right now:
cd486f
# https://bugzilla.mozilla.org/show_bug.cgi?id=1322212
cd486f
%global big_endian        1
cd486f
%endif
cd486f
cd486f
# Hardened build?
cd486f
%global hardened_build    1
cd486f
cd486f
%global system_jpeg       1
cd486f
cd486f
%ifarch %{ix86} x86_64
cd486f
%global run_tests         0
cd486f
%else
cd486f
%global run_tests         0
cd486f
%endif
cd486f
cd486f
# Build as a debug package?
cd486f
%global debug_build       0
cd486f
cd486f
%global default_bookmarks_file  %{_datadir}/bookmarks/default-bookmarks.html
cd486f
%global firefox_app_id  \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
cd486f
# Minimal required versions
cd486f
%global cairo_version 1.13.1
cd486f
%global freetype_version 2.1.9
cd486f
%if %{?system_libvpx}
cd486f
%global libvpx_version 1.4.0
cd486f
%endif
cd486f
cd486f
%if %{?system_nss}
cd486f
%global nspr_version 4.19.0
cd486f
# NSS/NSPR quite often ends in build override, so as requirement the version
cd486f
# we're building against could bring us some broken dependencies from time to time.
cd486f
#%global nspr_build_version %(pkg-config --silence-errors --modversion nspr 2>/dev/null || echo 65536)
cd486f
%global nspr_build_version %{nspr_version}
cd486f
%global nss_version 3.36.0
cd486f
#%global nss_build_version %(pkg-config --silence-errors --modversion nss 2>/dev/null || echo 65536)
cd486f
%global nss_build_version %{nss_version}
cd486f
%endif
cd486f
cd486f
%if %{?system_sqlite}
cd486f
%global sqlite_version 3.8.4.2
cd486f
# The actual sqlite version (see #480989):
cd486f
%global sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo 65536)
cd486f
%endif
cd486f
cd486f
%define bundled_python_version 2.7.13
cd486f
%define use_bundled_yasm        1
cd486f
cd486f
# GTK3 bundling
cd486f
%define avoid_bundled_rebuild 0
cd486f
%if 0%{?rhel} == 6
cd486f
%define bundle_gtk3             1
cd486f
# In-tree libffi is able to build on following platforms, we have to bundle it for the rest
cd486f
%ifnarch x86_64 i686 aarch64
cd486f
%define use_bundled_ffi         1
cd486f
%endif
cd486f
%endif
cd486f
cd486f
%define gtk3_nvr 3.22.26-1
cd486f
%define gtk3_install_path %{mozappdir}/bundled
cd486f
cd486f
%if 0%{?bundle_gtk3}
cd486f
# We could use %%include, but in %%files, %%post and other sections, but in these
cd486f
# sections it could lead to syntax errors about unclosed %%if. Work around it by
cd486f
# using the following macro
cd486f
%define include_file() %{expand:%(cat '%1')}
cd486f
%endif
cd486f
cd486f
cd486f
%global mozappdir     %{_libdir}/%{name}
cd486f
%global mozappdirdev  %{_libdir}/%{name}-devel-%{version}
cd486f
%global langpackdir   %{mozappdir}/distribution/extensions
cd486f
%global tarballdir    %{name}-%{version}
cd486f
%global pre_version   esr
cd486f
cd486f
%global official_branding       1
cd486f
%global build_langpacks         1
cd486f
cd486f
%global enable_mozilla_crashreporter       0
cd486f
%if !%{debug_build}
cd486f
%ifarch %{ix86} x86_64
cd486f
%global enable_mozilla_crashreporter       0
cd486f
%endif
cd486f
%endif
cd486f
cd486f
Summary:        Mozilla Firefox Web browser
cd486f
Name:           firefox
cd486f
Version:        60.9.0
cd486f
Release:        1%{?pre_tag}%{?dist}
cd486f
URL:            https://www.mozilla.org/firefox/
cd486f
License:        MPLv1.1 or GPLv2+ or LGPLv2+
cd486f
%if 0%{?rhel} == 7
cd486f
ExcludeArch:    s390 ppc
cd486f
%endif
cd486f
%if 0%{?rhel} == 6
cd486f
ExclusiveArch:  i686 x86_64 ppc64 s390x
cd486f
%endif
cd486f
cd486f
Source0:        https://hg.mozilla.org/releases/mozilla-release/archive/firefox-%{version}%{?pre_version}.source.tar.xz
cd486f
%if %{build_langpacks}
cd486f
Source1:        firefox-langpacks-%{version}%{?pre_version}-20190902.tar.xz
cd486f
%endif
cd486f
Source10:       firefox-mozconfig
cd486f
Source12:       firefox-redhat-default-prefs.js
cd486f
Source20:       firefox.desktop
cd486f
Source21:       firefox.sh.in
cd486f
Source23:       firefox.1
cd486f
Source24:       mozilla-api-key
cd486f
Source25:       firefox-symbolic.svg
cd486f
Source26:       distribution.ini
cd486f
Source27:       google-api-key
cd486f
cd486f
Source200:      gtk3-private-%{gtk3_nvr}.el6.src.rpm
cd486f
Source201:      gtk3-private-%{gtk3_nvr}-post.inc
cd486f
Source202:      gtk3-private-%{gtk3_nvr}-postun.inc
cd486f
Source203:      gtk3-private-%{gtk3_nvr}-posttrans.inc
cd486f
Source204:      gtk3-private-%{gtk3_nvr}-files.inc
cd486f
Source205:      gtk3-private-%{gtk3_nvr}-setup-flags-env.inc
cd486f
Source206:      gtk3-private-%{gtk3_nvr}-requires-provides-filter.inc
cd486f
Source301:      yasm-1.2.0-3.el5.src.rpm
cd486f
Source303:      libffi-3.0.13-18.el7_3.src.rpm
cd486f
cd486f
#Python 2.7
cd486f
Source100:      https://www.python.org/ftp/python/%{bundled_python_version}/Python-%{bundled_python_version}.tar.xz
cd486f
# Build patches
cd486f
Patch3:         mozilla-build-arm.patch
cd486f
Patch4:         build-mozconfig-fix.patch
cd486f
Patch5:         build-gdk-version.patch
cd486f
Patch6:         build-nss-version.patch
cd486f
Patch26:        build-icu-big-endian.patch
cd486f
# Also fixes s390x: https://bugzilla.mozilla.org/show_bug.cgi?id=1376268
cd486f
Patch29:        build-big-endian.patch
cd486f
# Always feel lucky for unsupported platforms:
cd486f
# https://bugzilla.mozilla.org/show_bug.cgi?id=1347128
cd486f
Patch37:        build-jit-atomic-always-lucky.patch
cd486f
Patch40:        build-aarch64-skia.patch
cd486f
Patch41:        build-debug-qcms.patch
cd486f
Patch43:        xulrunner-24.0-jemalloc-ppc.patch
cd486f
#Patch44:        firefox-disable-dbus-remote.patch
cd486f
Patch45:        build-disable-elfhack.patch
cd486f
cd486f
# Fedora/RHEL specific patches
cd486f
Patch215:        firefox-enable-addons.patch
cd486f
Patch219:        rhbz-1173156.patch
cd486f
Patch224:        mozilla-1170092.patch
cd486f
Patch225:        mozilla-1005640-accept-lang.patch
cd486f
#ARM run-time patch
cd486f
Patch226:        rhbz-1354671.patch
cd486f
Patch230:        rhbz-1503632-nss.patch
cd486f
Patch231:        firefox-pipewire.patch
cd486f
Patch232:        mozilla-526293.patch
cd486f
cd486f
# Upstream patches
cd486f
Patch402:        mozilla-1196777.patch
cd486f
Patch406:        mozilla-256180.patch
cd486f
Patch413:        mozilla-1353817.patch
cd486f
Patch415:        mozilla-1436242.patch
cd486f
cd486f
# Debian patches
cd486f
cd486f
%if %{?system_nss}
cd486f
BuildRequires:  pkgconfig(nspr) >= %{nspr_version}
cd486f
BuildRequires:  pkgconfig(nss) >= %{nss_version}
cd486f
BuildRequires:  nss-static >= %{nss_version}
cd486f
%endif
cd486f
%if %{?system_cairo}
cd486f
BuildRequires:  pkgconfig(cairo) >= %{cairo_version}
cd486f
%endif
cd486f
BuildRequires:  pkgconfig(libpng)
cd486f
BuildRequires:  xz
cd486f
BuildRequires:  libXt-devel
cd486f
BuildRequires:  mesa-libGL-devel
cd486f
Requires:       liberation-fonts-common
cd486f
Requires:       liberation-sans-fonts
cd486f
%if %{?system_jpeg}
cd486f
BuildRequires:  libjpeg-devel
cd486f
%endif
cd486f
BuildRequires:  zip
cd486f
BuildRequires:  bzip2-devel
cd486f
BuildRequires:  pkgconfig(zlib)
cd486f
BuildRequires:  pkgconfig(libIDL-2.0)
cd486f
BuildRequires:  pkgconfig(gtk+-2.0)
cd486f
BuildRequires:  krb5-devel
cd486f
BuildRequires:  pkgconfig(pango)
cd486f
BuildRequires:  pkgconfig(freetype2) >= %{freetype_version}
cd486f
BuildRequires:  pkgconfig(xt)
cd486f
BuildRequires:  pkgconfig(xrender)
cd486f
%if %{?system_hunspell}
cd486f
BuildRequires:  hunspell-devel
cd486f
%endif
cd486f
BuildRequires:  pkgconfig(libstartup-notification-1.0)
cd486f
BuildRequires:  pkgconfig(libnotify)
cd486f
BuildRequires:  pkgconfig(dri)
cd486f
BuildRequires:  pkgconfig(libcurl)
cd486f
BuildRequires:  dbus-glib-devel
cd486f
%if %{?system_libvpx}
cd486f
BuildRequires:  libvpx-devel >= %{libvpx_version}
cd486f
%endif
cd486f
BuildRequires:  autoconf213
cd486f
BuildRequires:  pkgconfig(libpulse)
cd486f
BuildRequires:  pkgconfig(gconf-2.0)
cd486f
cd486f
%if 0%{?use_dts}
cd486f
BuildRequires:  devtoolset-%{dts_version}-gcc-c++
cd486f
BuildRequires:  devtoolset-%{dts_version}-gcc
cd486f
BuildRequires:  devtoolset-%{dts_version}-binutils
cd486f
BuildRequires:  devtoolset-%{dts_version}-libatomic-devel
cd486f
%if 0%{?use_llvmts}
cd486f
BuildRequires:  llvm-toolset-%{llvm_version}
cd486f
BuildRequires:  llvm-toolset-%{llvm_version}-llvm-devel
cd486f
%endif
cd486f
%endif
cd486f
cd486f
%if 0%{?rhel} == 8
cd486f
BuildRequires:  cargo
cd486f
BuildRequires:  rust >= 1.24
cd486f
BuildRequires:  llvm >= %{llvm_version}
cd486f
BuildRequires:  llvm-devel >= %{llvm_version}
cd486f
BuildRequires:  clang >= %{llvm_version}
cd486f
%else
cd486f
%if 0%{?use_rustts}
cd486f
BuildRequires:  rust-toolset-%{rst_version}-cargo
cd486f
BuildRequires:  rust-toolset-%{rst_version}-rust >= 1.24
cd486f
%endif
cd486f
%if 0%{?use_llvmts}
cd486f
BuildRequires:  llvm-toolset-%{llvm_version}
cd486f
BuildRequires:  llvm-toolset-%{llvm_version}-llvm-devel
cd486f
%endif
cd486f
%endif
cd486f
cd486f
%if 0%{?use_bundled_python}
cd486f
#%if 0%{?rhel} == 6
cd486f
# Needed for Python in RHEL6
cd486f
BuildRequires:  openssl-devel
cd486f
#%endif
cd486f
%endif
cd486f
cd486f
%if 0%{?rhel} == 8
cd486f
BuildRequires:  pipewire-devel
cd486f
%endif
cd486f
cd486f
%if 0%{?bundle_gtk3}
cd486f
BuildRequires:        automake
cd486f
BuildRequires:        autoconf
cd486f
BuildRequires:        cups-devel
cd486f
BuildRequires:        dbus-devel
cd486f
BuildRequires:        desktop-file-utils
cd486f
BuildRequires:        expat-devel
cd486f
BuildRequires:        fontpackages-devel
cd486f
BuildRequires:        gamin-devel
cd486f
BuildRequires:        gettext-devel
cd486f
BuildRequires:        git
cd486f
BuildRequires:        intltool
cd486f
BuildRequires:        jasper-devel
cd486f
BuildRequires:        libepoxy-devel
cd486f
BuildRequires:        libcroco-devel
cd486f
BuildRequires:        libffi-devel
cd486f
BuildRequires:        libpng-devel
cd486f
BuildRequires:        libtiff-devel
cd486f
BuildRequires:        libtool
cd486f
BuildRequires:        libxml2-devel
cd486f
BuildRequires:        libX11-devel
cd486f
BuildRequires:        libXcomposite-devel
cd486f
BuildRequires:        libXcursor-devel
cd486f
BuildRequires:        libXinerama-devel
cd486f
BuildRequires:        libXevie-devel
cd486f
BuildRequires:        libXrandr-devel
cd486f
BuildRequires:        libXrender-devel
cd486f
BuildRequires:        libXtst-devel
cd486f
BuildRequires:        mesa-libGL-devel
cd486f
BuildRequires:        mesa-libEGL-devel
cd486f
BuildRequires:        pixman-devel
cd486f
BuildRequires:        rest-devel
cd486f
BuildRequires:        readline-devel
cd486f
# TODO: We miss that dependency in our bundled gtk3 package.
cd486f
# As a hotfix we put it here and fix gtk3 in next release.
cd486f
Requires:             mesa-libEGL%{?_isa}
cd486f
Requires:             libcroco%{?_isa}
cd486f
Requires:             mesa-libGL%{?_isa}
cd486f
Requires:             bzip2-libs%{?_isa}
cd486f
Requires:             libXtst%{?_isa}
cd486f
%else
cd486f
BuildRequires:        gtk3-devel
cd486f
BuildRequires:        glib2-devel
cd486f
%endif
cd486f
cd486f
Requires:       mozilla-filesystem
cd486f
Requires:       p11-kit-trust
cd486f
%if %{?system_nss}
cd486f
Requires:       nspr >= %{nspr_build_version}
cd486f
Requires:       nss >= %{nss_build_version}
cd486f
%endif
cd486f
cd486f
%if 0%{?rhel} < 8
cd486f
BuildRequires:  python2-devel
cd486f
%endif
cd486f
cd486f
BuildRequires:  desktop-file-utils
cd486f
BuildRequires:  system-bookmarks
cd486f
Requires:       redhat-indexhtml
cd486f
%if %{?system_sqlite}
cd486f
BuildRequires:  pkgconfig(sqlite3) >= %{sqlite_version}
cd486f
Requires:       sqlite >= %{sqlite_build_version}
cd486f
%endif
cd486f
cd486f
cd486f
%if %{?run_tests}
cd486f
BuildRequires:  xorg-x11-server-Xvfb
cd486f
%endif
cd486f
cd486f
%if %{?system_ffi}
cd486f
  %if !%{use_bundled_ffi}0
cd486f
BuildRequires:  pkgconfig(libffi)
cd486f
  %endif
cd486f
%endif
cd486f
cd486f
Obsoletes:      mozilla <= 37:1.7.13
cd486f
Provides:       webclient
cd486f
cd486f
%description
cd486f
Mozilla Firefox is an open-source web browser, designed for standards
cd486f
compliance, performance and portability.
cd486f
cd486f
%if %{enable_mozilla_crashreporter}
cd486f
%global moz_debug_prefix %{_prefix}/lib/debug
cd486f
%global moz_debug_dir %{moz_debug_prefix}%{mozappdir}
cd486f
%global uname_m %(uname -m)
cd486f
%global symbols_file_name %{name}-%{version}.en-US.%{_os}-%{uname_m}.crashreporter-symbols.zip
cd486f
%global symbols_file_path %{moz_debug_dir}/%{symbols_file_name}
cd486f
%global _find_debuginfo_opts -p %{symbols_file_path} -o debugcrashreporter.list
cd486f
%global crashreporter_pkg_name mozilla-crashreporter-%{name}-debuginfo
cd486f
%package -n %{crashreporter_pkg_name}
cd486f
Summary: Debugging symbols used by Mozilla's crash reporter servers
cd486f
%description -n %{crashreporter_pkg_name}
cd486f
This package provides debug information for Firefox, for use by
cd486f
Mozilla's crash reporter servers.  If you are trying to locally
cd486f
debug %{name}, you want to install %{name}-debuginfo instead.
cd486f
%files -n %{crashreporter_pkg_name} -f debugcrashreporter.list
cd486f
%endif
cd486f
cd486f
%if %{run_tests}
cd486f
%global testsuite_pkg_name mozilla-%{name}-testresults
cd486f
%package -n %{testsuite_pkg_name}
cd486f
Summary: Results of testsuite
cd486f
%description -n %{testsuite_pkg_name}
cd486f
This package contains results of tests executed during build.
cd486f
%files -n %{testsuite_pkg_name}
cd486f
/test_results
cd486f
%endif
cd486f
cd486f
#---------------------------------------------------------------------
cd486f
cd486f
%if %{?bundle_gnome_extension}
cd486f
%package        -n firefox-gnome-shell-extension
cd486f
%global         firefox_gnome_shell_addon_name addon-751081-latest.xpi
cd486f
Summary:        Support for managing GNOME Shell Extensions through web browsers
cd486f
Requires:       %{name}%{?_isa} = %{version}-%{release}
cd486f
cd486f
License:        GPLv3+
cd486f
URL:            https://wiki.gnome.org/Projects/GnomeShellIntegrationForChrome
cd486f
Source2:        https://addons.mozilla.org/firefox/downloads/latest/gnome-shell-integration/platform:2/%{firefox_gnome_shell_addon_name}
cd486f
cd486f
Requires:       dbus
cd486f
Requires:       gnome-icon-theme
cd486f
Requires:       gnome-shell
cd486f
Requires:       hicolor-icon-theme
cd486f
Requires:       mozilla-filesystem
cd486f
cd486f
%description -n firefox-gnome-shell-extension
cd486f
Browser extension for Firefox and native host messaging connector that provides 
cd486f
integration with GNOME Shell and the corresponding extensions repository 
cd486f
https://extensions.gnome.org.
cd486f
cd486f
%files -n firefox-gnome-shell-extension
cd486f
%{mozappdir}/distribution/extensions/chrome-gnome-shell@gnome.org.xpi
cd486f
%endif # bundle_gnome_extension
cd486f
cd486f
%prep
cd486f
%setup -q -T -c -n python -a 100
cd486f
%setup -q -n %{tarballdir}
cd486f
# Build patches, can't change backup suffix from default because during build
cd486f
# there is a compare of config and js/config directories and .orig suffix is
cd486f
# ignored during this compare.
cd486f
cd486f
%patch29 -p1 -b .big-endian
cd486f
%patch37 -p1 -b .jit-atomic-lucky
cd486f
%patch40 -p1 -b .aarch64-skia
cd486f
%if %{?debug_build}
cd486f
%patch41 -p1 -b .build-debug-qcms
cd486f
%endif
cd486f
%patch43 -p1 -b .jemalloc-ppc
cd486f
# Disable DBus remote on RHEL6 as it does not build here.
cd486f
#%if 0%{?rhel} == 6
cd486f
#%patch44 -p1 -b .disable-dbus-remote
cd486f
#%endif
cd486f
%if 0%{?rhel} == 8
cd486f
%patch45 -p1 -b .disable-elfhack
cd486f
%endif
cd486f
cd486f
%patch3  -p1 -b .arm
cd486f
%patch4  -p1 -b .build-mozconfig-fix
cd486f
%patch5  -p1 -b .gdk-version
cd486f
%patch6  -p1 -b .nss-version
cd486f
cd486f
# Fedora patches
cd486f
%patch215 -p1 -b .addons
cd486f
%patch219 -p1 -b .rhbz-1173156
cd486f
%patch224 -p1 -b .1170092
cd486f
%patch225 -p1 -b .1005640-accept-lang
cd486f
%if 0%{?rhel} == 8
cd486f
%patch231 -p1 -b .pipewire
cd486f
%endif
cd486f
%patch232 -p1 -b .mozilla-526293
cd486f
cd486f
# This ensures no migration of certdb to sqlite on the RHEL6 and RHEL7.
cd486f
# This needs to stay for the future releases
cd486f
%if 0%{?rhel} < 8
cd486f
%patch230 -p1 -b .1503632-nss
cd486f
%endif
cd486f
cd486f
#ARM run-time patch
cd486f
%ifarch aarch64
cd486f
%patch226 -p1 -b .1354671
cd486f
%endif
cd486f
cd486f
%patch402 -p1 -b .1196777
cd486f
%patch406 -p1 -b .256180
cd486f
%patch413 -p1 -b .1353817
cd486f
%patch415 -p1 -b .1436242
cd486f
cd486f
cd486f
# Patch for big endian platforms only
cd486f
%if 0%{?big_endian}
cd486f
%patch26 -p1 -b .icu
cd486f
%endif
cd486f
cd486f
%{__rm} -f .mozconfig
cd486f
%{__cp} %{SOURCE10} .mozconfig
cd486f
%if %{official_branding}
cd486f
echo "ac_add_options --enable-official-branding" >> .mozconfig
cd486f
%endif
cd486f
%{__cp} %{SOURCE24} mozilla-api-key
cd486f
%{__cp} %{SOURCE27} google-api-key
cd486f
cd486f
%if %{?system_nss}
cd486f
echo "ac_add_options --with-system-nspr" >> .mozconfig
cd486f
echo "ac_add_options --with-system-nss" >> .mozconfig
cd486f
%else
cd486f
echo "ac_add_options --without-system-nspr" >> .mozconfig
cd486f
echo "ac_add_options --without-system-nss" >> .mozconfig
cd486f
%endif
cd486f
cd486f
%if %{?system_sqlite}
cd486f
echo "ac_add_options --enable-system-sqlite" >> .mozconfig
cd486f
%else
cd486f
echo "ac_add_options --disable-system-sqlite" >> .mozconfig
cd486f
%endif
cd486f
cd486f
%if %{?system_cairo}
cd486f
echo "ac_add_options --enable-system-cairo" >> .mozconfig
cd486f
%else
cd486f
echo "ac_add_options --disable-system-cairo" >> .mozconfig
cd486f
%endif
cd486f
cd486f
%if 0%{?use_bundled_ffi}
cd486f
echo "ac_add_options --enable-system-ffi" >> .mozconfig
cd486f
%endif
cd486f
%if 0%{?system_ffi}
cd486f
echo "ac_add_options --enable-system-ffi" >> .mozconfig
cd486f
%endif
cd486f
cd486f
%ifarch %{arm}
cd486f
echo "ac_add_options --disable-elf-hack" >> .mozconfig
cd486f
%endif
cd486f
cd486f
%if %{?system_hunspell}
cd486f
echo "ac_add_options --enable-system-hunspell" >> .mozconfig
cd486f
%else
cd486f
echo "ac_add_options --disable-system-hunspell" >> .mozconfig
cd486f
%endif
cd486f
cd486f
%if %{?debug_build}
cd486f
echo "ac_add_options --enable-debug" >> .mozconfig
cd486f
echo "ac_add_options --disable-optimize" >> .mozconfig
cd486f
%else
cd486f
%global optimize_flags "none"
cd486f
%ifnarch s390 s390x
cd486f
%global optimize_flags "-g -O2"
cd486f
%endif
cd486f
%ifarch armv7hl
cd486f
# ARMv7 need that (rhbz#1426850)
cd486f
%global optimize_flags "-g -O2 -fno-schedule-insns"
cd486f
%endif
cd486f
%ifarch ppc64le aarch64
cd486f
%global optimize_flags "-g -O2"
cd486f
%endif
cd486f
%if %{optimize_flags} != "none"
cd486f
echo 'ac_add_options --enable-optimize=%{?optimize_flags}' >> .mozconfig
cd486f
%else
cd486f
echo 'ac_add_options --enable-optimize' >> .mozconfig
cd486f
%endif
cd486f
echo "ac_add_options --disable-debug" >> .mozconfig
cd486f
%endif
cd486f
cd486f
# Second arches fail to start with jemalloc enabled
cd486f
%ifnarch %{ix86} x86_64
cd486f
echo "ac_add_options --disable-jemalloc" >> .mozconfig
cd486f
%endif
cd486f
cd486f
%ifnarch %{ix86} x86_64
cd486f
echo "ac_add_options --disable-webrtc" >> .mozconfig
cd486f
%endif
cd486f
cd486f
%if !%{enable_mozilla_crashreporter}
cd486f
echo "ac_add_options --disable-crashreporter" >> .mozconfig
cd486f
%endif
cd486f
cd486f
%if %{?run_tests}
cd486f
echo "ac_add_options --enable-tests" >> .mozconfig
cd486f
%endif
cd486f
cd486f
%if !%{?system_jpeg}
cd486f
echo "ac_add_options --without-system-jpeg" >> .mozconfig
cd486f
%else
cd486f
echo "ac_add_options --with-system-jpeg" >> .mozconfig
cd486f
%endif
cd486f
cd486f
%if %{?system_libvpx}
cd486f
echo "ac_add_options --with-system-libvpx" >> .mozconfig
cd486f
%else
cd486f
echo "ac_add_options --without-system-libvpx" >> .mozconfig
cd486f
%endif
cd486f
cd486f
%if %{?system_libicu}
cd486f
echo "ac_add_options --with-system-icu" >> .mozconfig
cd486f
%else
cd486f
echo "ac_add_options --without-system-icu" >> .mozconfig
cd486f
%endif
cd486f
%ifarch s390 s390x
cd486f
echo "ac_add_options --disable-ion" >> .mozconfig
cd486f
%endif
cd486f
cd486f
%ifarch %{ix86}
cd486f
echo "ac_add_options --disable-stylo" >> .mozconfig
cd486f
%endif
cd486f
%if 0%{?rhel} == 6
cd486f
echo "ac_add_options --disable-stylo" >> .mozconfig
cd486f
%endif
cd486f
cd486f
# Remove executable bit to make brp-mangle-shebangs happy.
cd486f
chmod -x third_party/rust/itertools/src/lib.rs
cd486f
cd486f
#---------------------------------------------------------------------
cd486f
cd486f
%build
cd486f
cd486f
#GTK3 >>
cd486f
%if ! 0%{?avoid_bundled_rebuild}
cd486f
    rm -rf %{_buildrootdir}/*
cd486f
%endif
cd486f
export PATH="%{_buildrootdir}/bin:$PATH"
cd486f
cd486f
function install_rpms_to_current_dir() {
cd486f
    PACKAGE_RPM=$(eval echo $1)
cd486f
    PACKAGE_DIR=%{_rpmdir}
cd486f
cd486f
    if [ ! -f $PACKAGE_DIR/$PACKAGE_RPM ]; then
cd486f
        # Hack for tps tests
cd486f
        ARCH_STR=%{_arch}
cd486f
        %ifarch i386 i686
cd486f
            ARCH_STR="i?86"
cd486f
        %endif
cd486f
        PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR"
cd486f
     fi
cd486f
cd486f
     for package in $(ls $PACKAGE_DIR/$PACKAGE_RPM)
cd486f
     do
cd486f
         echo "$package"
cd486f
         rpm2cpio "$package" | cpio -idu
cd486f
     done
cd486f
}
cd486f
cd486f
function build_bundled_package() {
cd486f
  PACKAGE_RPM=$1
cd486f
  PACKAGE_FILES=$2
cd486f
  PACKAGE_SOURCE=$3
cd486f
  PACKAGE_DIR="%{_topdir}/RPMS"
cd486f
cd486f
  PACKAGE_ALREADY_BUILD=0
cd486f
  %if %{?avoid_bundled_rebuild}
cd486f
    if ls $PACKAGE_DIR/$PACKAGE_RPM; then
cd486f
      PACKAGE_ALREADY_BUILD=1
cd486f
    fi
cd486f
    if ls $PACKAGE_DIR/%{_arch}/$PACKAGE_RPM; then
cd486f
      PACKAGE_ALREADY_BUILD=1
cd486f
    fi
cd486f
  %endif
cd486f
  if [ $PACKAGE_ALREADY_BUILD == 0 ]; then
cd486f
    echo "Rebuilding $PACKAGE_RPM from $PACKAGE_SOURCE"; echo "==============================="
cd486f
    rpmbuild --nodeps --rebuild $PACKAGE_SOURCE
cd486f
  fi
cd486f
cd486f
  if [ ! -f $PACKAGE_DIR/$PACKAGE_RPM ]; then
cd486f
    # Hack for tps tests
cd486f
    ARCH_STR=%{_arch}
cd486f
    %ifarch i386 i686
cd486f
    ARCH_STR="i?86"
cd486f
    %endif
cd486f
    PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR"
cd486f
  fi
cd486f
  pushd $PACKAGE_DIR
cd486f
  echo "Installing $PACKAGE_DIR/$PACKAGE_RPM"; echo "==============================="
cd486f
  rpm2cpio $PACKAGE_DIR/$PACKAGE_RPM | cpio -iduv
cd486f
  # Clean rpms to avoid including them to package
cd486f
  %if ! 0%{?avoid_bundled_rebuild}
cd486f
    rm -f $PACKAGE_FILES
cd486f
  %endif
cd486f
cd486f
  PATH=$PACKAGE_DIR/usr/bin:$PATH
cd486f
  export PATH
cd486f
  LD_LIBRARY_PATH=$PACKAGE_DIR/usr/%{_lib}
cd486f
  export LD_LIBRARY_PATH
cd486f
  popd
cd486f
}
cd486f
cd486f
# Build and install local yasm if needed
cd486f
# ======================================
cd486f
%if %{use_bundled_yasm}
cd486f
  build_bundled_package 'yasm-1*.rpm' 'yasm-*.rpm' '%{SOURCE301}'
cd486f
%endif
cd486f
cd486f
cd486f
%if 0%{?bundle_gtk3}
cd486f
   %if ! 0%{?avoid_bundled_rebuild}
cd486f
    rpm -ivh %{SOURCE200}
cd486f
    rpmbuild --nodeps --define '_prefix %{gtk3_install_path}' -ba %{_specdir}/gtk3-private.spec
cd486f
   %endif
cd486f
   rm -rf %{_buildrootdir}/*
cd486f
   pushd %{_buildrootdir}
cd486f
   install_rpms_to_current_dir gtk3-private-%{gtk3_nvr}*.rpm
cd486f
   install_rpms_to_current_dir gtk3-private-devel-%{gtk3_nvr}*.rpm
cd486f
   install_rpms_to_current_dir gtk3-private-rpm-scripts-%{gtk3_nvr}*.rpm
cd486f
   popd
cd486f
%endif
cd486f
cd486f
# If needed build the bundled python 2.7 and put it in the PATH
cd486f
%if 0%{?use_bundled_python}
cd486f
    pushd %{_builddir}/python/Python-%{bundled_python_version}
cd486f
    #if ! 0%{?avoid_bundled_rebuild}
cd486f
        # Build Python 2.7 and set environment
cd486f
        # Pydebug set optimization to level 0, -O3 crashes on gcc 8 ATM
cd486f
        ./configure --with-pydebug --prefix="%{_buildrootdir}" --exec-prefix="%{_buildrootdir}" --libdir="%{_buildrootdir}/lib"
cd486f
    #endif
cd486f
    make %{?_smp_mflags} install V=1
cd486f
    popd
cd486f
%endif
cd486f
cd486f
%if 0%{?bundle_gtk3}
cd486f
# gtk3-private-3.22.26.el6-1-requires-provides-filter.inc
cd486f
%include_file %{SOURCE206}
cd486f
%endif
cd486f
%if 0%{use_bundled_ffi}
cd486f
  # Install libraries to the predefined location to later add them to the Firefox libraries
cd486f
  rpm -ivh %{SOURCE303}
cd486f
  rpmbuild --nodeps --define '_prefix %{gtk3_install_path}' -ba %{_specdir}/libffi.spec
cd486f
  pushd %{_buildrootdir}
cd486f
  install_rpms_to_current_dir 'libffi*.rpm'
cd486f
  popd
cd486f
  %filter_from_requires /libffi.so.6/d
cd486f
%endif
cd486f
%filter_setup
cd486f
cd486f
# GTK3 <<
cd486f
cd486f
%if %{?system_sqlite}
cd486f
# Do not proceed with build if the sqlite require would be broken:
cd486f
# make sure the minimum requirement is non-empty, ...
cd486f
sqlite_version=$(expr "%{sqlite_version}" : '\([0-9]*\.\)[0-9]*\.') || exit 1
cd486f
# ... and that major number of the computed build-time version matches:
cd486f
case "%{sqlite_build_version}" in
cd486f
  "$sqlite_version"*) ;;
cd486f
  *) exit 1 ;;
cd486f
esac
cd486f
%endif
cd486f
cd486f
# We need to disable exit on error temporarily for the following scripts:
cd486f
set +e
cd486f
%if 0%{?use_dts}
cd486f
source scl_source enable devtoolset-%{dts_version}
cd486f
%endif
cd486f
%if 0%{?use_rustts}
cd486f
source scl_source enable rust-toolset-%{rst_version}
cd486f
%endif
cd486f
cd486f
set -e
cd486f
# Hack for missing shell when building in brew on RHEL6
cd486f
%if 0%{?rhel} == 6
cd486f
export SHELL=/bin/sh
cd486f
%endif
cd486f
cd486f
echo "Generate big endian version of config/external/icu/data/icud58l.dat"
cd486f
%if 0%{?big_endian}
cd486f
  ./mach python intl/icu_sources_data.py .
cd486f
  ls -l config/external/icu/data
cd486f
  rm -f config/external/icu/data/icudt*l.dat
cd486f
%endif
cd486f
cd486f
# Update the various config.guess to upstream release for aarch64 support
cd486f
find ./ -name config.guess -exec cp /usr/lib/rpm/config.guess {} ';'
cd486f
cd486f
# -fpermissive is needed to build with gcc 4.6+ which has become stricter
cd486f
#
cd486f
# Mozilla builds with -Wall with exception of a few warnings which show up
cd486f
# everywhere in the code; so, don't override that.
cd486f
#
cd486f
# Disable C++ exceptions since Mozilla code is not exception-safe
cd486f
#
cd486f
MOZ_OPT_FLAGS=$(echo "%{optflags}" | %{__sed} -e 's/-Wall//')
cd486f
#rhbz#1037063
cd486f
# -Werror=format-security causes build failures when -Wno-format is explicitly given
cd486f
# for some sources
cd486f
# Explicitly force the hardening flags for Firefox so it passes the checksec test;
cd486f
# See also https://fedoraproject.org/wiki/Changes/Harden_All_Packages
cd486f
MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -Wformat-security -Wformat -Werror=format-security"
cd486f
%if 0%{?fedora} > 23
cd486f
# Disable null pointer gcc6 optimization in gcc6 (rhbz#1328045)
cd486f
MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fno-delete-null-pointer-checks"
cd486f
%endif
cd486f
# Use hardened build?
cd486f
%if %{?hardened_build}
cd486f
MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fPIC -Wl,-z,relro -Wl,-z,now"
cd486f
%endif
cd486f
%if %{?debug_build}
cd486f
MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-O2//')
cd486f
%endif
cd486f
%ifarch s390
cd486f
MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g1/')
cd486f
# If MOZ_DEBUG_FLAGS is empty, firefox's build will default it to "-g" which
cd486f
# overrides the -g1 from line above and breaks building on s390
cd486f
# (OOM when linking, rhbz#1238225)
cd486f
export MOZ_DEBUG_FLAGS=" "
cd486f
%endif
cd486f
%ifarch s390 %{arm} ppc aarch64 i686
cd486f
MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
cd486f
%endif
cd486f
%ifarch %{arm}
cd486f
export RUSTFLAGS="-Cdebuginfo=0"
cd486f
%endif
cd486f
export CFLAGS=$MOZ_OPT_FLAGS
cd486f
export CXXFLAGS=$MOZ_OPT_FLAGS
cd486f
export LDFLAGS=$MOZ_LINK_FLAGS
cd486f
cd486f
export PREFIX='%{_prefix}'
cd486f
export LIBDIR='%{_libdir}'
cd486f
cd486f
MOZ_SMP_FLAGS=-j1
cd486f
# On x86 architectures, Mozilla can build up to 4 jobs at once in parallel,
cd486f
# however builds tend to fail on other arches when building in parallel.
cd486f
%ifarch %{ix86} x86_64 ppc ppc64 ppc64le aarch64
cd486f
[ -z "$RPM_BUILD_NCPUS" ] && \
cd486f
     RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"
cd486f
[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2
cd486f
[ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4
cd486f
[ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j8
cd486f
%endif
cd486f
cd486f
%if 0%{?bundle_gtk3}
cd486f
# gtk3-private-setup-flags-env.inc
cd486f
%include_file %{SOURCE205}
cd486f
%endif
cd486f
cd486f
#make -f client.mk build STRIP="/bin/true" MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS" MOZ_SERVICES_SYNC="1"
cd486f
export MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS"
cd486f
export MOZ_SERVICES_SYNC="1"
cd486f
export STRIP=/bin/true
cd486f
%if 0%{?rhel} == 8
cd486f
export LLVM_CONFIG=/usr/bin/llvm-config-64
cd486f
%endif
cd486f
./mach build -v
cd486f
cd486f
# create debuginfo for crash-stats.mozilla.com
cd486f
%if %{enable_mozilla_crashreporter}
cd486f
#cd %{moz_objdir}
cd486f
make -C objdir buildsymbols
cd486f
%endif
cd486f
cd486f
%if %{?run_tests}
cd486f
%if %{?system_nss}
cd486f
ln -s /usr/bin/certutil objdir/dist/bin/certutil
cd486f
ln -s /usr/bin/pk12util objdir/dist/bin/pk12util
cd486f
cd486f
%endif
cd486f
mkdir test_results
cd486f
./mach --log-no-times check-spidermonkey &> test_results/check-spidermonkey || true
cd486f
./mach --log-no-times check-spidermonkey &> test_results/check-spidermonkey-2nd-run || true
cd486f
./mach --log-no-times cppunittest &> test_results/cppunittest || true
cd486f
xvfb-run ./mach --log-no-times crashtest &> test_results/crashtest || true
cd486f
./mach --log-no-times gtest &> test_results/gtest || true
cd486f
xvfb-run ./mach --log-no-times jetpack-test &> test_results/jetpack-test || true
cd486f
# not working right now ./mach marionette-test &> test_results/marionette-test || true
cd486f
xvfb-run ./mach --log-no-times mochitest-a11y &> test_results/mochitest-a11y || true
cd486f
xvfb-run ./mach --log-no-times mochitest-browser &> test_results/mochitest-browser || true
cd486f
xvfb-run ./mach --log-no-times mochitest-chrome &> test_results/mochitest-chrome || true
cd486f
xvfb-run ./mach --log-no-times mochitest-devtools &> test_results/mochitest-devtools || true
cd486f
xvfb-run ./mach --log-no-times mochitest-plain &> test_results/mochitest-plain || true
cd486f
xvfb-run ./mach --log-no-times reftest &> test_results/reftest || true
cd486f
xvfb-run ./mach --log-no-times webapprt-test-chrome &> test_results/webapprt-test-chrome || true
cd486f
xvfb-run ./mach --log-no-times webapprt-test-content &> test_results/webapprt-test-content || true
cd486f
./mach --log-no-times webidl-parser-test &> test_results/webidl-parser-test || true
cd486f
xvfb-run ./mach --log-no-times xpcshell-test &> test_results/xpcshell-test || true
cd486f
%if %{?system_nss}
cd486f
rm -f  objdir/dist/bin/certutil
cd486f
rm -f  objdir/dist/bin/pk12util
cd486f
%endif
cd486f
cd486f
%endif
cd486f
#---------------------------------------------------------------------
cd486f
cd486f
%install
cd486f
%if 0%{?rhel} == 6
cd486f
export SHELL=/bin/sh
cd486f
%endif
cd486f
cd486f
%if 0%{?bundle_gtk3}
cd486f
function install_rpms_to_current_dir() {
cd486f
    PACKAGE_RPM=$(eval echo $1)
cd486f
    PACKAGE_DIR=%{_rpmdir}
cd486f
cd486f
    if [ ! -f $PACKAGE_DIR/$PACKAGE_RPM ]; then
cd486f
        # Hack for tps tests
cd486f
        ARCH_STR=%{_arch}
cd486f
        %ifarch i386 i686
cd486f
            ARCH_STR="i?86"
cd486f
        %endif
cd486f
        PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR"
cd486f
     fi
cd486f
cd486f
     for package in $(ls $PACKAGE_DIR/$PACKAGE_RPM)
cd486f
     do
cd486f
         echo "$package"
cd486f
         rpm2cpio "$package" | cpio -idu
cd486f
     done
cd486f
}
cd486f
cd486f
pushd %{buildroot}
cd486f
# Install gtk3-private again to the buildroot, but without devel subpackage
cd486f
install_rpms_to_current_dir gtk3-private-%{gtk3_nvr}*.rpm
cd486f
install_rpms_to_current_dir gtk3-private-rpm-scripts-%{gtk3_nvr}*.rpm
cd486f
popd
cd486f
%endif
cd486f
cd486f
# Install bundled libffi
cd486f
%if %{use_bundled_ffi}
cd486f
  pushd %{buildroot}
cd486f
  install_rpms_to_current_dir libffi-3*.rpm
cd486f
  popd
cd486f
%endif
cd486f
cd486f
# set up our default bookmarks
cd486f
%{__cp} -p %{default_bookmarks_file} objdir/dist/bin/browser/chrome/en-US/locale/browser/bookmarks.html
cd486f
cd486f
# Make sure locale works for langpacks
cd486f
%{__cat} > objdir/dist/bin/browser/defaults/preferences/firefox-l10n.js << EOF
cd486f
pref("general.useragent.locale", "chrome://global/locale/intl.properties");
cd486f
EOF
cd486f
cd486f
DESTDIR=%{buildroot} make -C objdir install
cd486f
cd486f
%{__mkdir_p} %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications}
cd486f
cd486f
desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE20}
cd486f
cd486f
# set up the firefox start script
cd486f
%{__rm} -rf %{buildroot}%{_bindir}/firefox
cd486f
%{__cat} %{SOURCE21} > %{buildroot}%{_bindir}/firefox
cd486f
%if 0%{?bundle_gtk3}
cd486f
sed -i -e 's|%RHEL_ENV_VARS%|export XDG_DATA_DIRS="$MOZ_LIB_DIR/firefox/bundled/share:/usr/share:$XDG_DATA_DIRS"\nexport FONTCONFIG_FILE="$MOZ_LIB_DIR/firefox/bundled/etc/fonts/fonts.conf"|' %{buildroot}%{_bindir}/firefox
cd486f
%else
cd486f
sed -i -e 's|%RHEL_ENV_VARS%||' %{buildroot}%{_bindir}/firefox
cd486f
%endif
cd486f
cd486f
%{__chmod} 755 %{buildroot}%{_bindir}/firefox
cd486f
cd486f
%{__install} -p -D -m 644 %{SOURCE23} %{buildroot}%{_mandir}/man1/firefox.1
cd486f
cd486f
%{__rm} -f %{buildroot}/%{mozappdir}/firefox-config
cd486f
%{__rm} -f %{buildroot}/%{mozappdir}/update-settings.ini
cd486f
cd486f
for s in 16 22 24 32 48 256; do
cd486f
    %{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps
cd486f
    %{__cp} -p browser/branding/official/default${s}.png \
cd486f
               %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/firefox.png
cd486f
done
cd486f
cd486f
# Install hight contrast icon
cd486f
%{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps
cd486f
%{__cp} -p %{SOURCE25} \
cd486f
           %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps
cd486f
cd486f
# Register as an application to be visible in the software center
cd486f
#
cd486f
# NOTE: It would be *awesome* if this file was maintained by the upstream
cd486f
# project, translated and installed into the right place during `make install`.
cd486f
#
cd486f
# See http://www.freedesktop.org/software/appstream/docs/ for more details.
cd486f
#
cd486f
%{__mkdir_p} %{buildroot}%{_datadir}/appdata
cd486f
cat > %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml <
cd486f
cd486f
cd486f
cd486f
BugReportURL: https://bugzilla.mozilla.org/show_bug.cgi?id=1071061
cd486f
SentUpstream: 2014-09-22
cd486f
-->
cd486f
<application>
cd486f
  <id type="desktop">firefox.desktop</id>
cd486f
  <metadata_license>CC0-1.0</metadata_license>
cd486f
  <description>
cd486f
    

cd486f
      Bringing together all kinds of awesomeness to make browsing better for you.
cd486f
      Get to your favorite sites quickly – even if you don’t remember the URLs.
cd486f
      Type your term into the location bar (aka the Awesome Bar) and the autocomplete
cd486f
      function will include possible matches from your browsing history, bookmarked
cd486f
      sites and open tabs.
cd486f
    

cd486f
    
cd486f
  </description>
cd486f
  <url type="homepage">http://www.mozilla.org/</url>
cd486f
  <screenshots>
cd486f
    <screenshot type="default">https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/a.png</screenshot>
cd486f
    <screenshot>https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/b.png</screenshot>
cd486f
    <screenshot>https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/c.png</screenshot>
cd486f
  </screenshots>
cd486f
  
cd486f
  <updatecontact>someone_who_cares@upstream_project.org</updatecontact>
cd486f
   -->
cd486f
</application>
cd486f
EOF
cd486f
cd486f
echo > %{name}.lang
cd486f
%if %{build_langpacks}
cd486f
# Extract langpacks, make any mods needed, repack the langpack, and install it.
cd486f
%{__mkdir_p} %{buildroot}%{langpackdir}
cd486f
%{__tar} xf %{SOURCE1}
cd486f
for langpack in `ls firefox-langpacks/*.xpi`; do
cd486f
  language=`basename $langpack .xpi`
cd486f
  extensionID=langpack-$language@firefox.mozilla.org
cd486f
  %{__mkdir_p} $extensionID
cd486f
  unzip -qq $langpack -d $extensionID
cd486f
  find $extensionID -type f | xargs chmod 644
cd486f
cd486f
  cd $extensionID
cd486f
  zip -qq -r9mX ../${extensionID}.xpi *
cd486f
  cd -
cd486f
cd486f
  %{__install} -m 644 ${extensionID}.xpi %{buildroot}%{langpackdir}
cd486f
  language=`echo $language | sed -e 's/-/_/g'`
cd486f
  echo "%%lang($language) %{langpackdir}/${extensionID}.xpi" >> %{name}.lang
cd486f
done
cd486f
%{__rm} -rf firefox-langpacks
cd486f
cd486f
# Install langpack workaround (see #707100, #821169)
cd486f
function create_default_langpack() {
cd486f
language_long=$1
cd486f
language_short=$2
cd486f
cd %{buildroot}%{langpackdir}
cd486f
ln -s langpack-$language_long@firefox.mozilla.org.xpi langpack-$language_short@firefox.mozilla.org.xpi
cd486f
cd -
cd486f
echo "%%lang($language_short) %{langpackdir}/langpack-$language_short@firefox.mozilla.org.xpi" >> %{name}.lang
cd486f
}
cd486f
cd486f
# Table of fallbacks for each language
cd486f
# please file a bug at bugzilla.redhat.com if the assignment is incorrect
cd486f
create_default_langpack "bn-IN" "bn"
cd486f
create_default_langpack "es-AR" "es"
cd486f
create_default_langpack "fy-NL" "fy"
cd486f
create_default_langpack "ga-IE" "ga"
cd486f
create_default_langpack "gu-IN" "gu"
cd486f
create_default_langpack "hi-IN" "hi"
cd486f
create_default_langpack "hy-AM" "hy"
cd486f
create_default_langpack "nb-NO" "nb"
cd486f
create_default_langpack "nn-NO" "nn"
cd486f
create_default_langpack "pa-IN" "pa"
cd486f
create_default_langpack "pt-PT" "pt"
cd486f
create_default_langpack "sv-SE" "sv"
cd486f
create_default_langpack "zh-TW" "zh"
cd486f
%endif # build_langpacks
cd486f
cd486f
# Keep compatibility with the old preference location.
cd486f
%{__mkdir_p} %{buildroot}%{mozappdir}/defaults/preferences
cd486f
%{__mkdir_p} %{buildroot}%{mozappdir}/browser/defaults
cd486f
ln -s %{mozappdir}/defaults/preferences $RPM_BUILD_ROOT/%{mozappdir}/browser/defaults/preferences
cd486f
# Default preferences
cd486f
%{__cp} %{SOURCE12} %{buildroot}%{mozappdir}/defaults/preferences/all-redhat.js
cd486f
cd486f
# System config dir
cd486f
%{__mkdir_p} %{buildroot}/%{_sysconfdir}/%{name}/pref
cd486f
cd486f
# System extensions
cd486f
%{__mkdir_p} %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_app_id}
cd486f
%{__mkdir_p} %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_app_id}
cd486f
cd486f
# Copy over the LICENSE
cd486f
%{__install} -p -c -m 644 LICENSE %{buildroot}/%{mozappdir}
cd486f
cd486f
# Use the system hunspell dictionaries
cd486f
%{__rm} -rf %{buildroot}%{mozappdir}/dictionaries
cd486f
ln -s %{_datadir}/myspell %{buildroot}%{mozappdir}/dictionaries
cd486f
cd486f
# Enable crash reporter for Firefox application
cd486f
%if %{enable_mozilla_crashreporter}
cd486f
sed -i -e "s/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/" %{buildroot}/%{mozappdir}/application.ini
cd486f
# Add debuginfo for crash-stats.mozilla.com
cd486f
%{__mkdir_p} %{buildroot}/%{moz_debug_dir}
cd486f
%{__cp} objdir/dist/%{symbols_file_name} %{buildroot}/%{moz_debug_dir}
cd486f
%endif
cd486f
cd486f
%if %{run_tests}
cd486f
# Add debuginfo for crash-stats.mozilla.com
cd486f
%{__mkdir_p} %{buildroot}/test_results
cd486f
%{__cp} test_results/* %{buildroot}/test_results
cd486f
%endif
cd486f
cd486f
cd486f
# Copy over run-mozilla.sh
cd486f
%{__cp} build/unix/run-mozilla.sh %{buildroot}%{mozappdir}
cd486f
cd486f
# Add distribution.ini
cd486f
%{__mkdir_p} %{buildroot}%{mozappdir}/distribution
cd486f
%{__cp} %{SOURCE26} %{buildroot}%{mozappdir}/distribution
cd486f
cd486f
# Remove copied libraries to speed up build
cd486f
rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libmozjs.so
cd486f
rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libmozalloc.so
cd486f
rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libxul.so
cd486f
cd486f
%if %{bundle_gnome_extension}
cd486f
# Gnome extension
cd486f
%{__mkdir_p} %{buildroot}%{mozappdir}/distribution/extensions
cd486f
%{__cp} -p %{SOURCE2} %{buildroot}%{mozappdir}/distribution/extensions/chrome-gnome-shell@gnome.org.xpi
cd486f
chmod 644 %{buildroot}%{mozappdir}/distribution/extensions/chrome-gnome-shell@gnome.org.xpi
cd486f
%endif
cd486f
#---------------------------------------------------------------------
cd486f
cd486f
cd486f
cd486f
%preun
cd486f
# is it a final removal?
cd486f
if [ $1 -eq 0 ]; then
cd486f
  %{__rm} -rf %{mozappdir}/components
cd486f
  %{__rm} -rf %{mozappdir}/extensions
cd486f
  %{__rm} -rf %{mozappdir}/plugins
cd486f
  %{__rm} -rf %{langpackdir}
cd486f
fi
cd486f
cd486f
%clean
cd486f
rm -rf %{_srcrpmdir}/gtk3-private-%{gtk3_nvr}*.src.rpm
cd486f
find %{_rpmdir} -name "gtk3-private-*%{gtk3_nvr}*.rpm" -delete
cd486f
rm -rf %{_srcrpmdir}/libffi*.src.rpm
cd486f
find %{_rpmdir} -name "libffi*.rpm" -delete
cd486f
cd486f
%post
cd486f
update-desktop-database &> /dev/null || :
cd486f
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
cd486f
%if 0%{?bundle_gtk3}
cd486f
# gtk3-private-post.inc
cd486f
%include_file %{SOURCE201}
cd486f
%endif
cd486f
cd486f
%postun
cd486f
update-desktop-database &> /dev/null || :
cd486f
if [ $1 -eq 0 ] ; then
cd486f
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
cd486f
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
cd486f
fi
cd486f
%if 0%{?bundle_gtk3}
cd486f
# gtk3-private-postun.inc
cd486f
%include_file %{SOURCE202}
cd486f
%endif
cd486f
cd486f
%posttrans
cd486f
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
cd486f
%if 0%{?bundle_gtk3}
cd486f
# gtk3-private-posttrans.inc
cd486f
%include_file %{SOURCE203}
cd486f
%endif
cd486f
cd486f
%files -f %{name}.lang
cd486f
%{_bindir}/firefox
cd486f
%{mozappdir}/firefox
cd486f
%{mozappdir}/firefox-bin
cd486f
%doc %{_mandir}/man1/*
cd486f
%dir %{_sysconfdir}/%{name}
cd486f
%dir %{_sysconfdir}/%{name}/*
cd486f
%dir %{_datadir}/mozilla/extensions/*
cd486f
%dir %{_libdir}/mozilla/extensions/*
cd486f
%{_datadir}/appdata/*.appdata.xml
cd486f
%{_datadir}/applications/*.desktop
cd486f
%dir %{mozappdir}
cd486f
%doc %{mozappdir}/LICENSE
cd486f
%{mozappdir}/browser/chrome
cd486f
%{mozappdir}/browser/chrome.manifest
cd486f
%{mozappdir}/defaults/preferences/*
cd486f
%{mozappdir}/browser/defaults/preferences
cd486f
%{mozappdir}/browser/features/*.xpi
cd486f
%{mozappdir}/distribution/distribution.ini
cd486f
# That's Windows only
cd486f
%ghost %{mozappdir}/browser/features/aushelper@mozilla.org.xpi
cd486f
%attr(644, root, root) %{mozappdir}/browser/blocklist.xml
cd486f
%dir %{mozappdir}/browser/extensions
cd486f
%{mozappdir}/browser/extensions/*
cd486f
%if %{build_langpacks}
cd486f
%dir %{langpackdir}
cd486f
%endif
cd486f
%{mozappdir}/browser/omni.ja
cd486f
%{mozappdir}/chrome.manifest
cd486f
%{mozappdir}/run-mozilla.sh
cd486f
%{mozappdir}/application.ini
cd486f
%{mozappdir}/pingsender
cd486f
%exclude %{mozappdir}/removed-files
cd486f
%{_datadir}/icons/hicolor/16x16/apps/firefox.png
cd486f
%{_datadir}/icons/hicolor/22x22/apps/firefox.png
cd486f
%{_datadir}/icons/hicolor/24x24/apps/firefox.png
cd486f
%{_datadir}/icons/hicolor/256x256/apps/firefox.png
cd486f
%{_datadir}/icons/hicolor/32x32/apps/firefox.png
cd486f
%{_datadir}/icons/hicolor/48x48/apps/firefox.png
cd486f
%{_datadir}/icons/hicolor/symbolic/apps/firefox-symbolic.svg
cd486f
%if %{enable_mozilla_crashreporter}
cd486f
%{mozappdir}/crashreporter
cd486f
%{mozappdir}/crashreporter.ini
cd486f
%{mozappdir}/minidump-analyzer
cd486f
%{mozappdir}/Throbber-small.gif
cd486f
%{mozappdir}/browser/crashreporter-override.ini
cd486f
%endif
cd486f
%{mozappdir}/*.so
cd486f
%{mozappdir}/gtk2/*.so
cd486f
%{mozappdir}/defaults/pref/channel-prefs.js
cd486f
%{mozappdir}/dependentlibs.list
cd486f
%{mozappdir}/dictionaries
cd486f
%{mozappdir}/omni.ja
cd486f
%{mozappdir}/platform.ini
cd486f
%{mozappdir}/plugin-container
cd486f
%{mozappdir}/gmp-clearkey
cd486f
%{mozappdir}/fonts/EmojiOneMozilla.ttf
cd486f
%if !%{?system_libicu}
cd486f
#%{mozappdir}/icudt*.dat
cd486f
%endif
cd486f
%if !%{?system_nss}
cd486f
%{mozappdir}/libfreeblpriv3.chk
cd486f
%{mozappdir}/libnssdbm3.chk
cd486f
%{mozappdir}/libsoftokn3.chk
cd486f
%exclude %{mozappdir}/libnssckbi.so
cd486f
%endif
cd486f
%if 0%{use_bundled_ffi}
cd486f
%{mozappdir}/bundled/%{_lib}/libffi.so*
cd486f
%exclude %{_datadir}/doc/libffi*
cd486f
%endif
cd486f
cd486f
%if 0%{?bundle_gtk3}
cd486f
# gtk3-private-files.inc
cd486f
%include_file %{SOURCE204}
cd486f
%endif
cd486f
cd486f
cd486f
#---------------------------------------------------------------------
cd486f
cd486f
%changelog
cd486f
* Mon Sep  2 2019 Jan Horak <jhorak@redhat.com> - 60.9.0-1
cd486f
- Update to 60.9.0 ESR
cd486f
cd486f
* Wed Jul 3 2019 Jan Horak <jhorak@redhat.com> - 60.8.0-1
cd486f
- Update to 60.8.0 ESR
cd486f
cd486f
* Thu Jun 20 2019 Jan Horak <jhorak@redhat.com> - 60.7.2-3
cd486f
- Update to 60.7.2 ESR
cd486f
cd486f
* Wed Jun 19 2019 Martin Stransky <stransky@redhat.com> - 60.7.1-1
cd486f
- Updated to 60.7.1 ESR
cd486f
cd486f
* Wed May 15 2019 Martin Stransky <stransky@redhat.com> - 60.7.0-1
cd486f
- Updated to 60.7.0 ESR
cd486f
cd486f
* Thu May 9 2019 Martin Stransky <stransky@redhat.com> - 60.6.3-1
cd486f
- Updated to 60.6.3 ESR
cd486f
cd486f
* Tue May 7 2019 Martin Stransky <stransky@redhat.com> - 60.6.2-1
cd486f
- Updated to 60.6.2 ESR
cd486f
cd486f
* Mon Mar 27 2019 Martin Stransky <stransky@redhat.com> - 60.6.1-2
cd486f
- Added fix for mozbz#526293 - show remote locations on file chooser dialog.
cd486f
cd486f
* Mon Mar 25 2019 Martin Stransky <stransky@redhat.com> - 60.6.1-1
cd486f
- Update to 60.6.1 ESR (Build 1)
cd486f
cd486f
* Fri Mar 15 2019 Martin Stransky <stransky@redhat.com> - 60.6.0-3
cd486f
- Added Google API keys (mozbz#1531176)
cd486f
cd486f
* Thu Mar 14 2019 Martin Stransky <stransky@redhat.com> - 60.6.0-2
cd486f
- Update to 60.6.0 ESR (Build 2)
cd486f
cd486f
* Wed Mar 13 2019 Martin Stransky <stransky@redhat.com> - 60.6.0-1
cd486f
- Update to 60.6.0 ESR (Build 1)
cd486f
cd486f
* Wed Feb 13 2019 Jan Horak <jhorak@redhat.com> - 60.5.1-1
cd486f
- Update to 60.5.1 ESR
cd486f
cd486f
* Wed Feb 6 2019 Martin Stransky <stransky@redhat.com> - 60.5.0-3
cd486f
- Added fix for rhbz#1672424 - Firefox crashes on NFS drives.
cd486f
cd486f
* Fri Jan 25 2019 Martin Stransky <stransky@redhat.com> - 60.5.0-2
cd486f
- Updated to 60.5.0 ESR build2
cd486f
cd486f
* Tue Jan 22 2019 Martin Stransky <stransky@redhat.com> - 60.5.0-1
cd486f
- Updated to 60.5.0 ESR build1
cd486f
cd486f
* Thu Jan 10 2019 Jan Horak <jhorak@redhat.com> - 60.4.0-3
cd486f
- Fixing fontconfig warnings (rhbz#1601475)
cd486f
cd486f
* Wed Jan  9 2019 Jan Horak <jhorak@redhat.com> - 60.4.0-2
cd486f
- Added pipewire patch from Tomas Popela (rhbz#1664270)
cd486f
cd486f
* Wed Dec  5 2018 Jan Horak <jhorak@redhat.com> - 60.4.0-1
cd486f
- Update to 60.4.0 ESR
cd486f
cd486f
* Tue Dec  4 2018 Jan Horak <jhorak@redhat.com> - 60.3.0-2
cd486f
- Added firefox-gnome-shell-extension
cd486f
cd486f
* Fri Oct 19 2018 Jan Horak <jhorak@redhat.com> - 60.3.0-1
cd486f
- Update to 60.3.0 ESR
cd486f
cd486f
* Wed Oct 10 2018 Jan Horak <jhorak@redhat.com> - 60.2.2-2
cd486f
- Added patch for rhbz#1633932
cd486f
cd486f
* Tue Oct  2 2018 Jan Horak <jhorak@redhat.com> - 60.2.2-1
cd486f
- Update to 60.2.2 ESR
cd486f
cd486f
* Mon Sep 24 2018 Jan Horak <jhorak@redhat.com> - 60.2.1-1
cd486f
- Update to 60.2.1 ESR
cd486f
cd486f
* Fri Aug 31 2018 Jan Horak <jhorak@redhat.com> - 60.2.0-1
cd486f
- Update to 60.2.0 ESR
cd486f
cd486f
* Tue Aug 28 2018 Jan Horak <jhorak@redhat.com> - 60.1.0-9
cd486f
- Do not set user agent (rhbz#1608065)
cd486f
- GTK dialogs are localized now (rhbz#1619373)
cd486f
- JNLP association works again (rhbz#1607457)
cd486f
cd486f
* Thu Aug 16 2018 Jan Horak <jhorak@redhat.com> - 60.1.0-8
cd486f
- Fixed homepage and bookmarks (rhbz#1606778)
cd486f
- Fixed missing file associations in RHEL6 (rhbz#1613565)
cd486f
cd486f
* Thu Jul 12 2018 Jan Horak <jhorak@redhat.com> - 60.1.0-7
cd486f
- Run at-spi-bus if not running already (for the bundled gtk3)
cd486f
cd486f
* Mon Jul  9 2018 Jan Horak <jhorak@redhat.com> - 60.1.0-6
cd486f
- Fix for missing schemes for bundled gtk3
cd486f
cd486f
* Mon Jun 25 2018 Martin Stransky <stransky@redhat.com> - 60.1.0-5
cd486f
- Added mesa-libEGL dependency to gtk3/rhel6
cd486f
cd486f
* Sun Jun 24 2018 Martin Stransky <stransky@redhat.com> - 60.1.0-4
cd486f
- Disabled jemalloc on all second arches
cd486f
cd486f
* Fri Jun 22 2018 Martin Stransky <stransky@redhat.com> - 60.1.0-3
cd486f
- Updated to 60.1.0 ESR build2
cd486f
cd486f
* Thu Jun 21 2018 Martin Stransky <stransky@redhat.com> - 60.1.0-2
cd486f
- Disabled jemalloc on second arches
cd486f
cd486f
* Wed Jun 20 2018 Martin Stransky <stransky@redhat.com> - 60.1.0-1
cd486f
- Updated to 60.1.0 ESR
cd486f
cd486f
* Wed Jun 13 2018 Jan Horak <jhorak@redhat.com> - 60.0-12
cd486f
- Fixing bundled libffi issues
cd486f
- Readded some requirements
cd486f
cd486f
* Mon Jun 11 2018 Martin Stransky <stransky@redhat.com> - 60.0-10
cd486f
- Added fix for mozilla BZ#1436242 - IPC crashes.
cd486f
cd486f
* Mon Jun 11 2018 Jan Horak <jhorak@redhat.com> - 60.0-9
cd486f
- Bundling libffi for the sec-arches
cd486f
- Added openssl-devel for the Python
cd486f
- Fixing bundled gtk3
cd486f
cd486f
* Fri May 18 2018 Martin Stransky <stransky@redhat.com> - 60.0-8
cd486f
- Added fix for mozilla BZ#1458492
cd486f
cd486f
* Wed May 16 2018 Martin Stransky <stransky@redhat.com> - 60.0-7
cd486f
- Added patch from rhbz#1498561 to fix ppc64(le) crashes.
cd486f
cd486f
* Wed May 16 2018 Martin Stransky <stransky@redhat.com> - 60.0-6
cd486f
- Disabled jemalloc on second arches
cd486f
cd486f
* Sun May  6 2018 Jan Horak <jhorak@redhat.com> - 60.0-4
cd486f
- Update to 60.0 ESR
cd486f
cd486f
* Thu Mar  8 2018 Jan Horak <jhorak@redhat.com> - 52.7.0-1
cd486f
- Update to 52.7.0 ESR
cd486f
cd486f
* Mon Jan 29 2018 Martin Stransky <stransky@redhat.com> - 52.6.0-2
cd486f
- Build Firefox for desktop arches only (x86_64 and ppc64le)
cd486f
cd486f
* Thu Jan 18 2018 Martin Stransky <stransky@redhat.com> - 52.6.0-1
cd486f
- Update to 52.6.0 ESR
cd486f
cd486f
* Thu Nov  9 2017 Jan Horak <jhorak@redhat.com> - 52.5.0-1
cd486f
- Update to 52.5.0 ESR
cd486f
cd486f
* Mon Sep 25 2017 Jan Horak <jhorak@redhat.com> - 52.4.0-1
cd486f
- Update to 52.4.0 ESR
cd486f
cd486f
* Thu Aug  3 2017 Jan Horak <jhorak@redhat.com> - 52.3.0-3
cd486f
- Update to 52.3.0 ESR (b2)
cd486f
- Require correct nss version
cd486f
cd486f
* Tue Jun 13 2017 Jan Horak <jhorak@redhat.com> - 52.2.0-1
cd486f
- Update to 52.2.0 ESR
cd486f
cd486f
* Wed May 24 2017 Jan Horak <jhorak@redhat.com> - 52.1.2-1
cd486f
- Update to 52.1.2 ESR
cd486f
cd486f
* Wed May 24 2017 Jan Horak <jhorak@redhat.com> - 52.0-7
cd486f
- Added fix for accept language (rhbz#1454322)
cd486f
cd486f
* Wed Mar 22 2017 Jan Horak <jhorak@redhat.com> - 52.0-6
cd486f
- Removing patch required for older NSS from RHEL 7.3
cd486f
- Added patch for rhbz#1414564
cd486f
cd486f
* Fri Mar 17 2017 Martin Stransky <stransky@redhat.com> - 52.0-5
cd486f
- Added fix for mozbz#1348168/CVE-2017-5428
cd486f
cd486f
* Mon Mar  6 2017 Jan Horak <jhorak@redhat.com> - 52.0-4
cd486f
- Update to 52.0 ESR (b4)
cd486f
cd486f
* Thu Mar 2 2017 Martin Stransky <stransky@redhat.com> - 52.0-3
cd486f
- Added fix for rhbz#1423012 - ppc64 gfx crashes
cd486f
cd486f
* Wed Mar  1 2017 Jan Horak <jhorak@redhat.com> - 52.0-2
cd486f
- Enable system nss
cd486f
cd486f
* Tue Feb 28 2017 Martin Stransky <stransky@redhat.com> - 52.0-1
cd486f
- Update to 52.0ESR (B1)
cd486f
- Build RHEL7 package for Gtk3
cd486f
cd486f
* Mon Feb 27 2017 Martin Stransky <stransky@redhat.com> - 52.0-0.13
cd486f
- Added fix for rhbz#1414535
cd486f
cd486f
* Tue Feb 21 2017 Jan Horak <jhorak@redhat.com> - 52.0-0.12
cd486f
- Update to 52.0b8
cd486f
cd486f
* Tue Feb  7 2017 Jan Horak <jhorak@redhat.com> - 52.0-0.11
cd486f
- Readded addons patch
cd486f
cd486f
* Mon Feb  6 2017 Jan Horak <jhorak@redhat.com> - 52.0-0.10
cd486f
- Update to 52.0b3
cd486f
cd486f
* Tue Jan 31 2017 Jan Horak <jhorak@redhat.com> - 52.0-0.9
cd486f
- Update to 52.0b2
cd486f
cd486f
* Fri Jan 27 2017 Jan Horak <jhorak@redhat.com> - 52.0-0.8
cd486f
- Update to 52.0b1
cd486f
cd486f
* Thu Dec  8 2016 Jan Horak <jhorak@redhat.com> - 52.0-0.5
cd486f
- Firefox Aurora 52 testing build