diff --git a/.firefox.metadata b/.firefox.metadata
index acf50d0..8c8247f 100644
--- a/.firefox.metadata
+++ b/.firefox.metadata
@@ -1,11 +1,11 @@
 18a8f30a0356c751b8d0ea6f76e764cab13ee046 SOURCES/Python-2.7.13.tar.xz
 a9effcc06cf80eaa22f12c1f7d6aa4266a1c4966 SOURCES/cbindgen-vendor-0.14.3.tar.xz
-be371c42648f5581cbde2446f4de861d26104758 SOURCES/firefox-78.2.0esr.source.tar.xz
-450b8e6b20368539c75c6e5e8b4a9eb4293e2fbe SOURCES/firefox-langpacks-78.2.0esr-20200818.tar.xz
+f2e0607bf57105e8741c0f941bcacee8a75d672a SOURCES/firefox-78.3.0esr.source.tar.xz
+444ca305428fc4778a7252f3cdc2e65495921dcd SOURCES/firefox-langpacks-78.3.0esr-20200918.tar.xz
 0de63f863b158454b9429234b52ed28a397ec45c SOURCES/gtk3-private-3.22.26-1.el6.src.rpm
 e188ab1a444697bc649e223c28389d82ca94c472 SOURCES/libffi-3.0.13-18.el7_3.src.rpm
-42b15d32c769dbb41863f9debebf56444cefbcd2 SOURCES/nodejs-10.21.0-3.el8_0.src.rpm
+5715f987bc0024ce5d72993cb101b8268350033b SOURCES/nodejs-10.21.0-5.fc32.src.rpm
 07d67c90367c3ec0d6cebc1a5793c21076d34b78 SOURCES/nspr-4.25.0-1.el8_0.src.rpm
-b6f9f3e52fdcfced1df9e2f45760bcabea69e26f SOURCES/nss-3.53.1-3.el8_0.src.rpm
+223c02166b1cb9863b9f453ef687d7805a93e7af SOURCES/nss-3.53.1-3.fc32.src.rpm
 a379070abf5000cde61411c97af7e733b267a4d3 SOURCES/openssl-1.0.2k-19.6.bundle.el7_7.src.rpm
 77fd30f7ebc12a629a31c1e252cec06af55a71fe SOURCES/yasm-1.2.0-3.el5.src.rpm
diff --git a/.gitignore b/.gitignore
index 7dfa0ed..683a467 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,11 +1,11 @@
 SOURCES/Python-2.7.13.tar.xz
 SOURCES/cbindgen-vendor-0.14.3.tar.xz
-SOURCES/firefox-78.2.0esr.source.tar.xz
-SOURCES/firefox-langpacks-78.2.0esr-20200818.tar.xz
+SOURCES/firefox-78.3.0esr.source.tar.xz
+SOURCES/firefox-langpacks-78.3.0esr-20200918.tar.xz
 SOURCES/gtk3-private-3.22.26-1.el6.src.rpm
 SOURCES/libffi-3.0.13-18.el7_3.src.rpm
-SOURCES/nodejs-10.21.0-3.el8_0.src.rpm
+SOURCES/nodejs-10.21.0-5.fc32.src.rpm
 SOURCES/nspr-4.25.0-1.el8_0.src.rpm
-SOURCES/nss-3.53.1-3.el8_0.src.rpm
+SOURCES/nss-3.53.1-3.fc32.src.rpm
 SOURCES/openssl-1.0.2k-19.6.bundle.el7_7.src.rpm
 SOURCES/yasm-1.2.0-3.el5.src.rpm
diff --git a/SOURCES/Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch b/SOURCES/Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch
deleted file mode 100644
index 6dfe2ad..0000000
--- a/SOURCES/Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up firefox-60.0/mfbt/LinuxSignal.h.mozilla-1238661 firefox-60.0/mfbt/LinuxSignal.h
---- firefox-60.0/mfbt/LinuxSignal.h.mozilla-1238661	2018-04-27 08:55:38.848241768 +0200
-+++ firefox-60.0/mfbt/LinuxSignal.h	2018-04-27 09:06:47.946769859 +0200
-@@ -22,7 +22,7 @@ __attribute__((naked)) void SignalTrampo
-                                              void* aContext) {
-   asm volatile("nop; nop; nop; nop" : : : "memory");
- 
--  asm volatile("b %0" : : "X"(H) : "memory");
-+  asm volatile("bx %0" : : "r"(H), "l"(aSignal), "l"(aInfo), "l"(aContext) : "memory");
- }
- 
- #  define MOZ_SIGNAL_TRAMPOLINE(h) (mozilla::SignalTrampoline<h>)
diff --git a/SOURCES/Bug-1526653---fix_user_vfp_armv7.patch b/SOURCES/Bug-1526653---fix_user_vfp_armv7.patch
deleted file mode 100644
index 3f84f95..0000000
--- a/SOURCES/Bug-1526653---fix_user_vfp_armv7.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From fd6847c9416f9eebde636e21d794d25d1be8791d Mon Sep 17 00:00:00 2001
-From: Mike Hommey <mh@glandium.org>
-Date: Sat, 1 Jun 2019 09:06:01 +0900
-Subject: [PATCH] Bug 1526653 - Include struct definitions for user_vfp and
- user_vfp_exc.
-
----
- js/src/wasm/WasmSignalHandlers.cpp | 11 ++++++++++-
- 1 file changed, 10 insertions(+), 1 deletion(-)
-
-diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
-index 636537f8478..383c380f04c 100644
---- a/js/src/wasm/WasmSignalHandlers.cpp
-+++ b/js/src/wasm/WasmSignalHandlers.cpp
-@@ -248,7 +248,16 @@ using mozilla::DebugOnly;
- #endif
- 
- #ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS
--#  include <sys/user.h>
-+struct user_vfp {
-+  unsigned long long fpregs[32];
-+  unsigned long fpscr;
-+};
-+
-+struct user_vfp_exc {
-+  unsigned long fpexc;
-+  unsigned long fpinst;
-+  unsigned long fpinst2;
-+};
- #endif
- 
- #if defined(ANDROID)
--- 
-2.20.1
-
diff --git a/SOURCES/firefox-centos-default-prefs.js b/SOURCES/firefox-centos-default-prefs.js
deleted file mode 100644
index ea10021..0000000
--- a/SOURCES/firefox-centos-default-prefs.js
+++ /dev/null
@@ -1,35 +0,0 @@
-pref("app.update.auto",                     false);
-pref("app.update.enabled",                  false);
-pref("app.update.autoInstallEnabled",       false);
-pref("general.smoothScroll",                true);
-pref("intl.locale.matchOS",                 true);
-pref("toolkit.storage.synchronous",         0);
-pref("toolkit.networkmanager.disable",      false);
-pref("offline.autoDetect",                  true);
-pref("browser.backspace_action",            2);
-pref("browser.display.use_system_colors",   true);
-pref("browser.download.folderList",         1);
-pref("browser.link.open_external",          3);
-pref("browser.shell.checkDefaultBrowser",   false);
-pref("network.manage-offline-status",       true);
-pref("extensions.shownSelectionUI",         true);
-pref("ui.SpellCheckerUnderlineStyle",       1);
-pref("startup.homepage_override_url",       "http://www.centos.org");
-pref("startup.homepage_welcome_url",        "http://www.centos.org");
-pref("browser.startup.homepage",            "data:text/plain,browser.startup.homepage=file:///usr/share/doc/HTML/index.html");
-pref("geo.wifi.uri", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%");
-pref("media.gmp-gmpopenh264.provider.enabled",false);
-pref("media.gmp-gmpopenh264.autoupdate",false);
-pref("media.gmp-gmpopenh264.enabled",false);
-pref("media.gmp-gmpopenh264.enabled",false);
-pref("plugins.notifyMissingFlash", false);
-/* See https://bugzilla.redhat.com/show_bug.cgi?id=1226489 */
-pref("browser.display.use_system_colors", false);
-pref("layers.use-image-offscreen-surfaces", false);
-/* Allow sending credetials to all https:// sites */
-pref("network.negotiate-auth.trusted-uris", "https://");
-pref("security.use_sqldb", false);
-/* Use OS settings for UI language */
-pref("intl.locale.requested", "");
-/* See https://bugzilla.redhat.com/show_bug.cgi?id=1672424 */
-pref("storage.nfs_filesystem", true);
diff --git a/SOURCES/rhel6-abiv2-mozbz1642174.patch b/SOURCES/rhel6-abiv2-mozbz1642174.patch
new file mode 100644
index 0000000..57d217c
--- /dev/null
+++ b/SOURCES/rhel6-abiv2-mozbz1642174.patch
@@ -0,0 +1,29 @@
+diff -up firefox-78.2.0/security/nss/lib/freebl/freebl.gyp.rhel6-abiv2-mozbz1642174 firefox-78.2.0/security/nss/lib/freebl/freebl.gyp
+--- firefox-78.2.0/security/nss/lib/freebl/freebl.gyp.rhel6-abiv2-mozbz1642174	2020-09-12 08:29:08.527410514 +0200
++++ firefox-78.2.0/security/nss/lib/freebl/freebl.gyp	2020-09-12 08:42:26.279064334 +0200
+@@ -259,7 +259,7 @@
+       'type': 'static_library',
+       'sources': [
+         'gcm-ppc.c',
+-        'sha512-p8.s',
++        #'sha512-p8.s',
+       ],
+       'dependencies': [
+         '<(DEPTH)/exports.gyp:nss_exports'
+diff -up firefox-78.2.0/security/nss/lib/freebl/Makefile.rhel6-abiv2-mozbz1642174 firefox-78.2.0/security/nss/lib/freebl/Makefile
+--- firefox-78.2.0/security/nss/lib/freebl/Makefile.rhel6-abiv2-mozbz1642174	2020-08-17 20:34:06.000000000 +0200
++++ firefox-78.2.0/security/nss/lib/freebl/Makefile	2020-09-12 08:28:08.089142990 +0200
+@@ -267,9 +267,12 @@ ifeq ($(CPU_ARCH),arm)
+ endif
+ ifeq ($(CPU_ARCH),ppc)
+     EXTRA_SRCS += gcm-ppc.c
+-    ASFILES += sha512-p8.s
+ ifdef USE_64
+     DEFINES += -DNSS_NO_INIT_SUPPORT
++		#PPC_ABI := $(shell $(CC) -dM -E - < /dev/null | awk '$$2 == "_CALL_ELF" {print $$3}')
++   # ifeq ($(PPC_ABI),2)
++   #     ASFILES += sha512-p8.s
++   # endif		
+ endif # USE_64
+ endif # ppc
+ endif # Linux
diff --git a/SOURCES/rhel6-auxvh.patch b/SOURCES/rhel6-auxvh.patch
new file mode 100644
index 0000000..3234196
--- /dev/null
+++ b/SOURCES/rhel6-auxvh.patch
@@ -0,0 +1,39 @@
+diff -up firefox-78.2.0/mozglue/build/ppc.cpp.ppc-vsx firefox-78.2.0/mozglue/build/ppc.cpp
+--- firefox-78.2.0/mozglue/build/ppc.cpp.ppc-vsx	2020-09-11 07:07:05.850864720 +0200
++++ firefox-78.2.0/mozglue/build/ppc.cpp	2020-09-11 07:08:48.884202679 +0200
+@@ -14,10 +14,6 @@
+ #if defined(XP_LINUX)
+ // Use the getauxval() function if available.
+ // ARCH_3_00 wasn't defined until glibc 2.23, so include just in case.
+-#  include <sys/auxv.h>
+-#  ifndef PPC_FEATURE2_ARCH_3_00
+-#    define PPC_FEATURE2_ARCH_3_00 0x00800000
+-#  endif
+ #endif
+ 
+ const unsigned PPC_FLAG_VMX = 1;
+@@ -33,24 +29,8 @@ static signed get_ppc_cpu_flags(void) {
+   }
+   cpu_flags = 0;
+ 
+-#if defined(XP_LINUX)
+-  // Try getauxval().
+-  unsigned long int cap = getauxval(AT_HWCAP);
+-  unsigned long int cap2 = getauxval(AT_HWCAP2);
+-
+-  if (cap & PPC_FEATURE_HAS_ALTIVEC) {
+-    cpu_flags |= PPC_FLAG_VMX;
+-  }
+-  if (cap & PPC_FEATURE_HAS_VSX) {
+-    cpu_flags |= PPC_FLAG_VSX;
+-  }
+-  if (cap2 & PPC_FEATURE2_ARCH_3_00) {
+-    cpu_flags |= PPC_FLAG_VSX3;
+-  }
+-#else
+   // Non-Linux detection here. Currently, on systems other than Linux,
+   // no CPU SIMD features will be detected.
+-#endif
+ 
+   return cpu_flags;
+ }
diff --git a/SOURCES/rhel6-dbusver.patch b/SOURCES/rhel6-dbusver.patch
new file mode 100644
index 0000000..d07224b
--- /dev/null
+++ b/SOURCES/rhel6-dbusver.patch
@@ -0,0 +1,41 @@
+diff -up firefox-78.2.0/third_party/rust/libdbus-sys/build.rs.rhel6-dbusver firefox-78.2.0/third_party/rust/libdbus-sys/build.rs
+--- firefox-78.2.0/third_party/rust/libdbus-sys/build.rs.rhel6-dbusver	2020-08-17 20:34:46.000000000 +0200
++++ firefox-78.2.0/third_party/rust/libdbus-sys/build.rs	2020-09-09 21:06:34.932374254 +0200
+@@ -3,5 +3,5 @@ extern crate pkg_config;
+ fn main() {
+     // See https://github.com/joshtriplett/metadeps/issues/9 for why we don't use
+     // metadeps here, but instead keep this manually in sync with Cargo.toml.
+-    pkg_config::Config::new().atleast_version("1.6").probe("dbus-1").unwrap();
++    pkg_config::Config::new().atleast_version("1.2").probe("dbus-1").unwrap();
+ }
+diff -up firefox-78.2.0/third_party/rust/libdbus-sys/.cargo-checksum.json.rhel6-dbusver firefox-78.2.0/third_party/rust/libdbus-sys/.cargo-checksum.json
+--- firefox-78.2.0/third_party/rust/libdbus-sys/.cargo-checksum.json.rhel6-dbusver	2020-08-17 20:35:05.000000000 +0200
++++ firefox-78.2.0/third_party/rust/libdbus-sys/.cargo-checksum.json	2020-09-09 21:11:37.045287830 +0200
+@@ -1 +1 @@
+-{"files":{"Cargo.toml":"7054b852a13a318562f3ef791e69802f234c9f3d943f2de2d1cef8b31fd0939a","LICENSE-APACHE":"453745410e3be8cf25d56872ea2aec975a78e6c9f217443d0bf908a5bce7c8ff","LICENSE-MIT":"de3911c2d98c8bd2d701ee721347053d9b55995a11f9a8c955e44d3ca1b376bf","build.rs":"9fbc218277d76a570c01c5795a7c8008f5458317cc036d7c88b1dc1a4af22fb7","src/lib.rs":"c8a0d43a3b7e9c8828d4946437379f1985492bd6b04fdd5e967bbcace2197c3d"},"package":"18cb88963258d00f4962205dbb5933d82780d9962c8c8a064b651d2ad7189210"}
+\ No newline at end of file
++{"files":{"Cargo.toml":"7054b852a13a318562f3ef791e69802f234c9f3d943f2de2d1cef8b31fd0939a","LICENSE-APACHE":"453745410e3be8cf25d56872ea2aec975a78e6c9f217443d0bf908a5bce7c8ff","LICENSE-MIT":"de3911c2d98c8bd2d701ee721347053d9b55995a11f9a8c955e44d3ca1b376bf","build.rs":"41d24ea34bd37eb7a47253ac0681da2dde73e52caf04bbcecf795965e5d36466","src/lib.rs":"31e939a4a7f537265a84c91ba940ac31ac0f66c53a49971f1b21bbd2e4a7b5e9"},"package":"18cb88963258d00f4962205dbb5933d82780d9962c8c8a064b651d2ad7189210"}
+diff -up firefox-78.2.0/third_party/rust/libdbus-sys/src/lib.rs.rhel6-dbusver firefox-78.2.0/third_party/rust/libdbus-sys/src/lib.rs
+--- firefox-78.2.0/third_party/rust/libdbus-sys/src/lib.rs.rhel6-dbusver	2020-08-17 20:34:38.000000000 +0200
++++ firefox-78.2.0/third_party/rust/libdbus-sys/src/lib.rs	2020-09-09 21:06:34.933374260 +0200
+@@ -252,13 +252,14 @@ extern "C" {
+     pub fn dbus_signature_validate_single(signature: *const c_char, error: *mut DBusError) -> u32;
+ 
+     pub fn dbus_threads_init_default() -> c_int;
++}
++    pub fn dbus_validate_bus_name(busname: *const c_char, error: *mut DBusError) -> u32 {return 1;}
++    pub fn dbus_validate_error_name(errorname: *const c_char, error: *mut DBusError) -> u32 {return 1;}
++    pub fn dbus_validate_interface(interface: *const c_char, error: *mut DBusError) -> u32 {return 1;}
++    pub fn dbus_validate_member(member: *const c_char, error: *mut DBusError) -> u32 {return 1;}
++    pub fn dbus_validate_path(path: *const c_char, error: *mut DBusError) -> u32 {return 1;}
+ 
+-    pub fn dbus_validate_bus_name(busname: *const c_char, error: *mut DBusError) -> u32;
+-    pub fn dbus_validate_error_name(errorname: *const c_char, error: *mut DBusError) -> u32;
+-    pub fn dbus_validate_interface(interface: *const c_char, error: *mut DBusError) -> u32;
+-    pub fn dbus_validate_member(member: *const c_char, error: *mut DBusError) -> u32;
+-    pub fn dbus_validate_path(path: *const c_char, error: *mut DBusError) -> u32;
+-
++extern "C" {
+     pub fn dbus_watch_get_enabled(watch: *mut DBusWatch) -> u32;
+     pub fn dbus_watch_get_flags(watch: *mut DBusWatch) -> c_uint;
+     pub fn dbus_watch_get_unix_fd(watch: *mut DBusWatch) -> c_int;
diff --git a/SOURCES/rhel6-kernel.patch b/SOURCES/rhel6-kernel.patch
new file mode 100644
index 0000000..4981285
--- /dev/null
+++ b/SOURCES/rhel6-kernel.patch
@@ -0,0 +1,16 @@
+diff -up firefox-78.2.0/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc.rhel6-kernel firefox-78.2.0/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
+--- firefox-78.2.0/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc.rhel6-kernel	2020-09-09 19:56:13.159597467 +0200
++++ firefox-78.2.0/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc	2020-09-09 19:56:31.457712629 +0200
+@@ -385,11 +385,7 @@ bool DeviceInfoLinux::IsDeviceNameMatche
+ 
+ bool DeviceInfoLinux::IsVideoCaptureDevice(struct v4l2_capability* cap)
+ {
+-  if (cap->capabilities & V4L2_CAP_DEVICE_CAPS) {
+-    return cap->device_caps & V4L2_CAP_VIDEO_CAPTURE;
+-  } else {
+-    return cap->capabilities & V4L2_CAP_VIDEO_CAPTURE;
+-  }
++  return false;
+ }
+ 
+ int32_t DeviceInfoLinux::FillCapabilities(int fd) {
diff --git a/SOURCES/rhel6-mach-fail.patch b/SOURCES/rhel6-mach-fail.patch
new file mode 100644
index 0000000..286be5e
--- /dev/null
+++ b/SOURCES/rhel6-mach-fail.patch
@@ -0,0 +1,12 @@
+diff -up firefox-78.2.0/python/mozbuild/mozbuild/controller/building.py.mach-fail firefox-78.2.0/python/mozbuild/mozbuild/controller/building.py
+--- firefox-78.2.0/python/mozbuild/mozbuild/controller/building.py.mach-fail	2020-09-09 19:25:18.552930506 +0200
++++ firefox-78.2.0/python/mozbuild/mozbuild/controller/building.py	2020-09-09 19:25:31.081010223 +0200
+@@ -591,7 +591,7 @@ class TerminalLoggingHandler(logging.Han
+             if self.footer:
+                 self.footer.clear()
+ 
+-            self.fh.write(msg.encode("utf-8"))
++            self.fh.write(msg)
+             self.fh.write('\n')
+ 
+             if self.footer:
diff --git a/SOURCES/rhel6-zconst.patch b/SOURCES/rhel6-zconst.patch
new file mode 100644
index 0000000..fedd335
--- /dev/null
+++ b/SOURCES/rhel6-zconst.patch
@@ -0,0 +1,12 @@
+diff -up firefox-78.2.0/tools/profiler/gecko/nsProfiler.cpp.zconst firefox-78.2.0/tools/profiler/gecko/nsProfiler.cpp
+--- firefox-78.2.0/tools/profiler/gecko/nsProfiler.cpp.zconst	2020-09-09 20:29:17.489123431 +0200
++++ firefox-78.2.0/tools/profiler/gecko/nsProfiler.cpp	2020-09-09 20:30:09.544457350 +0200
+@@ -523,7 +523,7 @@ nsProfiler::GetProfileDataAsGzippedArray
+             stream.opaque = nullptr;
+             stream.next_out = (Bytef*)outBuff.Elements();
+             stream.avail_out = outBuff.Length();
+-            stream.next_in = (z_const Bytef*)aResult.Data();
++            stream.next_in = (Bytef*)aResult.Data();
+             stream.avail_in = aResult.Length();
+ 
+             // A windowBits of 31 is the default (15) plus 16 for emitting a
diff --git a/SPECS/firefox.spec b/SPECS/firefox.spec
index 87729ba..e5663a5 100644
--- a/SPECS/firefox.spec
+++ b/SPECS/firefox.spec
@@ -1,12 +1,6 @@
 # Set for local builds only
 %global disable_toolsets  0
 
-%ifarch %{arm}
-%if %{defined el8}
-%undefine _debugsource_packages
-%endif
-%endif
-
 %ifarch i686
 # no debug package for the i686 because oom on i686 with debuginfos
 %global debug_package %{nil}
@@ -29,29 +23,32 @@
 %global rhel_minor_version 0
 %endif
 
-%global bundle_nss        0
 %global system_nss        1
-# Use system nspr/nss? FIXME
+%global bundle_nss        0
+
 %if 0%{?rhel} == 8
   %if 0%{?rhel_minor_version} < 2
 %global bundle_nss        1
   %endif
 %endif
-%if 0%{?rhel} == 7
-%global system_nss        1
-%global bundle_nss        1
-%endif
+
 %if 0%{?rhel} == 6
-%global bundle_nss        1
+%global system_nss        0
 %endif
 
 %define use_bundled_ffi   0
+
+%define use_bundled_python_2 1
+%define use_bundled_python_3 1
+
 %if 0%{?rhel} == 8
 %define use_bundled_python_2 1
 %define use_bundled_python_3 0
-%else
-%define use_bundled_python_2 1
-%define use_bundled_python_3 1
+%endif
+
+%if 0%{?rhel} == 7
+%define use_bundled_python_2 0
+%define use_bundled_python_3 0
 %endif
 
 %if 0%{?flatpak:1}
@@ -86,8 +83,8 @@
 %if 0%{?rhel} == 6
 %global dts_version       8
 %endif
-%global rust_version         1.31
-%global rust_toolset_version 1.35
+%global rust_version         1.41
+%global rust_toolset_version 1.41
 %global llvm_version      7.0
 %if 0%{?rhel} == 8
 %global llvm_version      6.0
@@ -139,12 +136,12 @@
 %endif
 
 %if 0%{?system_nss}
-%global nspr_version 4.21
+%global nspr_version 4.25
 # NSS/NSPR quite often ends in build override, so as requirement the version
 # we're building against could bring us some broken dependencies from time to time.
 #%global nspr_build_version %(pkg-config --silence-errors --modversion nspr 2>/dev/null || echo 65536)
 %global nspr_build_version %{nspr_version}
-%global nss_version 3.44
+%global nss_version 3.53.1
 #%global nss_build_version %(pkg-config --silence-errors --modversion nss 2>/dev/null || echo 65536)
 %global nss_build_version %{nss_version}
 %endif
@@ -159,26 +156,23 @@
 %define bundled_python_version_3 3.6.8
 %define use_bundled_openssl     0
 %define use_bundled_nodejs      0
+%define use_bundled_yasm        0
 
 %if 0%{?rhel} == 8
   %if 0%{?rhel_minor_version} <= 2
 %define use_bundled_nodejs      1
-%define use_bundled_python_2    1
   %endif
 %endif
 
-%if 0%{?rhel} < 8
+%if 0%{?rhel} == 7
 %define use_bundled_nodejs      1
 %define use_bundled_yasm        1
-%define use_bundled_python_2    1
-%if 0%{?rhel} == 6
-%define use_bundled_openssl     1
-%endif
 %endif
 
-# GTK3 bundling
-%define avoid_bundled_rebuild   0
 %if 0%{?rhel} == 6
+%define use_bundled_nodejs      1
+%define use_bundled_openssl     1
+%define use_bundled_yasm        1
 %define bundle_gtk3             1
 # In-tree libffi is able to build on following platforms, we have to bundle it for the rest
 %ifnarch x86_64 i686 aarch64
@@ -186,16 +180,16 @@
 %endif
 %endif
 
+# GTK3 bundling
+%define avoid_bundled_rebuild   0
+
 %define gtk3_nvr 3.22.26-1
 %define gtk3_install_path %{mozappdir}/bundled
 
-#%if 0%{?bundle_gtk3}
 # We could use %%include, but in %%files, %%post and other sections, but in these
 # sections it could lead to syntax errors about unclosed %%if. Work around it by
 # using the following macro
 %define include_file() %{expand:%(cat '%1')}
-#%endif
-
 
 %global mozappdir     %{_libdir}/%{name}
 %global mozappdirdev  %{_libdir}/%{name}-devel-%{version}
@@ -216,8 +210,8 @@
 
 Summary:        Mozilla Firefox Web browser
 Name:           firefox
-Version:        78.2.0
-Release:        3%{?dist}
+Version:        78.3.0
+Release:        1%{?dist}
 URL:            https://www.mozilla.org/firefox/
 License:        MPLv1.1 or GPLv2+ or LGPLv2+
 %if 0%{?rhel} == 7
@@ -229,7 +223,7 @@ ExclusiveArch:  i686 x86_64 ppc64 s390x
 
 Source0:        https://hg.mozilla.org/releases/mozilla-release/archive/firefox-%{version}%{?pre_version}.source.tar.xz
 %if %{build_langpacks}
-Source1:        firefox-langpacks-%{version}%{?pre_version}-20200818.tar.xz
+Source1:        firefox-langpacks-%{version}%{?pre_version}-20200918.tar.xz
 %endif
 Source2:        cbindgen-vendor-0.14.3.tar.xz
 Source10:       firefox-mozconfig
@@ -256,10 +250,10 @@ Source205:      gtk3-private-%{gtk3_nvr}-setup-flags-env.inc
 Source206:      gtk3-private-%{gtk3_nvr}-requires-provides-filter.inc
 Source301:      yasm-1.2.0-3.el5.src.rpm
 Source303:      libffi-3.0.13-18.el7_3.src.rpm
-Source304:      nodejs-10.21.0-3.el8_0.src.rpm
+Source304:      nodejs-10.21.0-5.fc32.src.rpm
 Source305:      openssl-1.0.2k-19.6.bundle.el7_7.src.rpm
 
-Source400:      nss-3.53.1-3.el8_0.src.rpm
+Source403:      nss-3.53.1-3.fc32.src.rpm
 Source401:      nss-setup-flags-env.inc
 Source402:      nspr-4.25.0-1.el8_0.src.rpm 
 #Python
@@ -310,12 +304,21 @@ Patch514:        mozilla-s390x-skia-gradient.patch
 Patch515:        mozilla-bmo1626236.patch
 Patch516:        D87019-thin-vec-big-endian.diff
 
+
 # CentOS patches
 %if 0%{?centos}
 Patch10000:      Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch
 Patch10001:      Bug-1526653---fix_user_vfp_armv7.patch
 %endif
 
+# RHEL6 patches
+Patch600:        rhel6-dbusver.patch
+Patch601:        rhel6-kernel.patch
+Patch602:        rhel6-mach-fail.patch
+Patch603:        rhel6-zconst.patch
+Patch604:        rhel6-auxvh.patch
+Patch605:        rhel6-abiv2-mozbz1642174.patch
+
 %if %{?system_nss}
 %if !0%{?bundle_nss}
 BuildRequires:  pkgconfig(nspr) >= %{nspr_version}
@@ -372,6 +375,7 @@ BuildRequires:  llvm-toolset-%{llvm_version}-llvm-devel
 %endif
 
 BuildRequires:  scl-utils
+BuildRequires:  findutils
 
 
 %if 0%{?rhel} == 8
@@ -388,6 +392,9 @@ BuildRequires:  nodejs >= 10.21
 %if 0%{?use_rustts}
 BuildRequires:  rust-toolset-%{rust_toolset_version}
 %endif
+%if 0%{?rhel} == 7
+#BuildRequires:  rh-nodejs12
+%endif
 %if 0%{?use_llvmts}
 BuildRequires:  llvm-toolset-%{llvm_version}
 BuildRequires:  llvm-toolset-%{llvm_version}-llvm-devel
@@ -408,7 +415,7 @@ BuildRequires:  openssl-devel
   %if 0%{?rhel_minor_version} >= 3
 BuildRequires:  pkgconfig(libpipewire-0.3)
   %else
-BuildRequires:  pkgconfig(libpipewire-0.2)
+BuildRequires:  pipewire-devel
   %endif
 %endif
 
@@ -505,11 +512,13 @@ BuildRequires:  pkgconfig(libffi)
 %endif
 
 %if %{?use_bundled_nodejs}
+%if !0%{?use_bundled_python_3}
 BuildRequires: python3-devel
+%endif
 BuildRequires: zlib-devel
-BuildRequires: brotli-devel
-BuildRequires: gcc >= 4.9.4
-BuildRequires: gcc-c++ >= 4.9.4
+#BuildRequires: brotli-devel
+#BuildRequires: gcc >= 4.9.4
+#BuildRequires: gcc-c++ >= 4.9.4
 BuildRequires: chrpath
 BuildRequires: libatomic
 BuildRequires: openssl-devel
@@ -626,7 +635,7 @@ echo "use_bundled_yasm      %{?use_bundled_yasm}"
   %endif
 %endif
 
-%patch236 -p1 -b .fedora-shebang-build
+#%patch236 -p1 -b .fedora-shebang-build
 
 %if 0%{?rhel} == 6
 %patch232 -p1 -b .hugepage
@@ -654,9 +663,20 @@ echo "use_bundled_yasm      %{?use_bundled_yasm}"
 %patch514 -p1 -b .mozilla-s390x-skia-gradient
 %patch515 -p1 -b .mozilla-bmo1626236
 %patch516 -p1 -b .D87019-thin-vec-big-endian.diff
+
+
 %patch1001 -p1 -b .ppc64le-inline
 %patch1004 -p1 -b .icu-make
 
+%if 0%{?rhel} == 6
+%patch600 -p1 -b .rhel6-dbusver
+%patch601 -p1 -b .rhel6-kernel
+%patch602 -p1 -b .rhel6-mach-fail
+%patch603 -p1 -b .rhel6-zconst
+%patch604 -p1 -b .rhel6-auxvh
+%patch605 -p1 -b .rhel6-abiv2-mozbz1642174
+%endif
+
 # CentOS patches
 %if 0%{?centos}
 %patch10000 -p1 -b .mozilla-1238661
@@ -713,12 +733,8 @@ echo "ac_add_options --disable-optimize" >> .mozconfig
 %endif
 %ifarch armv7hl
 # ARMv7 need that (rhbz#1426850)
-%if %{defined el8}
-%global optimize_flags "-g0 -O2 -fno-schedule-insns -fno-lto"
-%else
 %global optimize_flags "-g -O2 -fno-schedule-insns"
 %endif
-%endif
 %ifarch ppc64le aarch64
 %global optimize_flags "-g -O2"
 %endif
@@ -789,7 +805,8 @@ chmod a-x third_party/rust/ash/src/extensions/nv/*.rs
 
 %build
 ulimit -a
-set -e
+free
+#set -e
 # Hack for missing shell when building in brew on RHEL6
 %if 0%{?rhel} == 6
 export SHELL=/bin/sh
@@ -810,7 +827,9 @@ function install_rpms_to_current_dir() {
         %ifarch i386 i686
             ARCH_STR="i?86"
         %endif
-        PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR"
+        %if 0%{?rhel} > 6
+          PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR"
+        %endif
      fi
 
      for package in $(ls $PACKAGE_DIR/$PACKAGE_RPM)
@@ -839,15 +858,19 @@ function build_bundled_package() {
   if [ $PACKAGE_ALREADY_BUILD == 0 ]; then
     echo "Rebuilding $PACKAGE_RPM from $PACKAGE_SOURCE"; echo "==============================="
     rpmbuild --nodeps $PACKAGE_BUILD_OPTIONS --rebuild $PACKAGE_SOURCE
+    cat /var/tmp/rpm-tmp*
   fi
 
+  find $PACKAGE_DIR
   if [ ! -f $PACKAGE_DIR/$PACKAGE_RPM ]; then
     # Hack for tps tests
     ARCH_STR=%{_arch}
     %ifarch i386 i686
     ARCH_STR="i?86"
     %endif
-    export PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR"
+    %if 0%{?rhel} > 6
+      export PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR"
+    %endif
   fi
   pushd $PACKAGE_DIR
 
@@ -880,12 +903,12 @@ function build_bundled_package() {
 
 %if 0%{?bundle_nss}
    rpm -ivh %{SOURCE402}
-   rpmbuild --nodeps --define '_prefix %{gtk3_install_path}' --without=tests -ba %{_specdir}/nspr.spec
+   #rpmbuild --nodeps --define '_prefix %{gtk3_install_path}' --without=tests -ba %{_specdir}/nspr.spec
+   rpmbuild --nodeps --define '_prefix %{gtk3_install_path}' -ba %{_specdir}/nspr.spec
    pushd %{_buildrootdir}
-   install_rpms_to_current_dir nspr-4-*.rpm
+   install_rpms_to_current_dir nspr-4*.rpm
    install_rpms_to_current_dir nspr-devel*.rpm
    popd
-   #FIXME needs nspr install location and flags
    echo "Setting nspr flags"
    # nss-setup-flags-env.inc
    sed -i 's@%{gtk3_install_path}@%{_buildrootdir}%{gtk3_install_path}@g' %{_buildrootdir}%{gtk3_install_path}/%{_lib}/pkgconfig/nspr*.pc
@@ -896,12 +919,11 @@ function build_bundled_package() {
    export PKG_CONFIG_PATH=%{_buildrootdir}%{gtk3_install_path}/%{_lib}/pkgconfig
    export PATH="{_buildrootdir}%{gtk3_install_path}/bin:$PATH"
 
-   #%include_file %{SOURCE401}
    export PATH=%{_buildrootdir}/%{gtk3_install_path}/bin:$PATH
    echo $PKG_CONFIG_PATH
 
-   rpm -ivh %{SOURCE400}
-   rpmbuild --nodeps --define '_prefix %{gtk3_install_path}' --without=tests -ba %{_specdir}/nss.spec
+   rpm -ivh %{SOURCE403}
+   rpmbuild --nodeps --define '_prefix %{gtk3_install_path}' -ba %{_specdir}/nss.spec
    pushd %{_buildrootdir}
    #cleanup
    #rm -rf {_buildrootdir}/usr/lib/debug/*
@@ -920,6 +942,12 @@ function build_bundled_package() {
    popd
   %filter_provides_in %{gtk3_install_path}/%{_lib}
   %filter_requires_in %{gtk3_install_path}/%{_lib}
+  %filter_from_requires /libnss3.so.*/d
+  %filter_from_requires /libsmime3.so.*/d
+  %filter_from_requires /libssl3.so.*/d
+  %filter_from_requires /libnssutil3.so.*/d
+  %filter_from_requires /libnspr4.so.*/d
+
 %endif
 
 %if 0%{?bundle_gtk3}
@@ -952,7 +980,7 @@ function build_bundled_package() {
 # If needed build the bundled python 2.7 and 3.6 and put it in the PATH
 %if 0%{?use_bundled_python_3}
     pushd %{_builddir}/python3/Python-%{bundled_python_version_3}
-    ./configure --prefix="%{_buildrootdir}" --exec-prefix="%{_buildrootdir}" --libdir="%{_buildrootdir}/lib" --with-pydebug
+    ./configure --prefix="%{_buildrootdir}" --exec-prefix="%{_buildrootdir}" --libdir="%{_buildrootdir}/lib" || cat config.log
     make %{?_smp_mflags} install V=1 -j1
     cp Tools/scripts/pathfix.py %{_buildrootdir}/bin
     popd
@@ -961,8 +989,6 @@ function build_bundled_package() {
     pushd %{_builddir}/python2/Python-%{bundled_python_version_2}
     ./configure --prefix="%{_buildrootdir}" --exec-prefix="%{_buildrootdir}" --libdir="%{_buildrootdir}/lib" || cat config.log
     make %{?_smp_mflags} install V=1
-    which python2
-    which python
     popd    
 %endif
 
@@ -1009,6 +1035,11 @@ source scl_source enable devtoolset-%{dts_version}
 source scl_source enable rust-toolset-%{rust_toolset_version}
 %endif
 
+env
+which gcc
+which c++
+which g++
+which ld
 # Build and install local node if needed
 # ======================================
 %if %{use_bundled_nodejs}
@@ -1100,17 +1131,10 @@ MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g1/')
 export MOZ_DEBUG_FLAGS=" "
 %endif
 
-%ifarch %{arm}
-%if %{defined el8}
-MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g0/')
-export MOZ_DEBUG_FLAGS=" "
-%endif
-%endif
-
 # We don't wantfirefox to use CK_GCM_PARAMS_V3 in nss
 MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -DNSS_PKCS11_3_0_STRICT"
 
-%ifarch s390 %{arm} ppc aarch64 i686
+%ifarch s390 %{arm} ppc aarch64 i686 x86_64 s390x
 MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
 %endif
 %ifarch %{arm} i686
@@ -1141,12 +1165,12 @@ MOZ_SMP_FLAGS=-j1
 [ -z "$RPM_BUILD_NCPUS" ] && \
      RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"
 [ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2
-[ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4
-[ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j4
+[ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j2
+[ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j2
 %endif
 %endif
-#FIXME workaround for oom
 
+cat /proc/meminfo
 # Free memory in kB
 
 MEM_AVAILABLE=$(grep MemAvailable /proc/meminfo | awk '{ print $2 }')
@@ -1156,7 +1180,19 @@ TASK_SIZE=4000000
 MEM_CONSTRAINED_JOBS=$(( MEM_AVAILABLE / TASK_SIZE ))
 CPU_AVAILABLE=$(/usr/bin/getconf _NPROCESSORS_ONLN)
 # Pick the minimum from available CPUs or memory constrained number of jobs
-MOZ_SMP_FLAGS=-j$([ "$CPU_AVAILABLE" -le "$MEM_CONSTRAINED_JOBS" ] && echo "$CPU_AVAILABLE" || echo "$MEM_CONSTRAINED_JOBS")
+#MOZ_SMP_FLAGS=-j$([ "$CPU_AVAILABLE" -le "$MEM_CONSTRAINED_JOBS" ] && echo "$CPU_AVAILABLE" || echo "$MEM_CONSTRAINED_JOBS")
+
+cat /proc/meminfo
+# Free memory in kB
+
+MEM_AVAILABLE=$(grep MemAvailable /proc/meminfo | awk '{ print $2 }')
+
+# Usually the compiler processes can take 2 GB of memory at peaks
+TASK_SIZE=4000000
+MEM_CONSTRAINED_JOBS=$(( MEM_AVAILABLE / TASK_SIZE ))
+CPU_AVAILABLE=$(/usr/bin/getconf _NPROCESSORS_ONLN)
+# Pick the minimum from available CPUs or memory constrained number of jobs
+#MOZ_SMP_FLAGS=-j$([ "$CPU_AVAILABLE" -le "$MEM_CONSTRAINED_JOBS" ] && echo "$CPU_AVAILABLE" || echo "$MEM_CONSTRAINED_JOBS")
 
 %if 0%{?bundle_gtk3}
 # gtk3-private-setup-flags-env.inc
@@ -1174,7 +1210,7 @@ echo $PKG_CONFIG_PATH
 export MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS"
 export MOZ_SERVICES_SYNC="1"
 # we need to strip the sources on i686 because to we don't use rpm to generate debugsymbols because of oom
-%ifnarch i686
+%ifnarch i686 i386
 export STRIP=/bin/true
 %endif
 which node
@@ -1182,7 +1218,17 @@ echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"'
 env
 ls %{_buildrootdir}
 
+
+%if 0%{?rhel} == 6
+export POLICY_FILE="rhel6.config"
+export POLICT_PATH="/etc/pki/nss-legacy"
+%endif
+
+%if 0%{?use_llvmts}
+scl enable llvm-toolset-%{llvm_version} './mach build -v'
+%else
 ./mach build -v
+%endif
 
 # create debuginfo for crash-stats.mozilla.com
 %if %{enable_mozilla_crashreporter}
@@ -1237,7 +1283,9 @@ function install_rpms_to_current_dir() {
         %ifarch i386 i686
             ARCH_STR="i?86"
         %endif
-        PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR"
+        %if 0%{?rhel} > 6
+          PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR"
+        %endif
      fi
 
      for package in $(ls $PACKAGE_DIR/$PACKAGE_RPM)
@@ -1600,6 +1648,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 #---------------------------------------------------------------------
 
 %changelog
+* Fri Sep 18 2020 Jan Horak <jhorak@redhat.com>
+- Update to 78.3.0 build1
+
 * Tue Aug 18 2020 Jan Horak <jhorak@redhat.com> - 78.2.0-3
 - Update to 78.2.0 build1