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

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

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