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

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

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