File firefox-kde-nightly-original.txt of Package firefox-kde-nightly
%global debug_package %{nil}
%define program firefox
%define type kde-nightly
%define conflicts firefox
%define build_timestamp %(date +"%Y%m%d")
Summary: Firefox Nightly Supercharged
Name: %{program}-%{type}
Version: %{build_timestamp}
Release: 186.16
License: MPLv1.1 or GPLv2+ or LGPLv2+
Group: Applications/Internet
URL: http://mozilla.org/%{program}
Source0: firefox-kde-nightly.tar.xz
Source1: %{name}.appdata.xml
Source2: %{name}.desktop
BuildRoot: %{_tmppath}/%{name}-%{version}
BuildRequires: mobile-config-firefox
BuildRequires: libvulkan1
BuildRequires: uget-integrator
BuildRequires: wget tar
BuildRequires: hicolor-icon-theme
BuildRequires: desktop-file-utils
%if 0%{?suse_version} || 0%{?fedora} || 0%{?mageia}
BuildRequires: fdupes
%endif
%if 0%{?suse_version}
BuildRequires: update-desktop-files
BuildRequires: appstream-glib
%endif
%if 0%{?fedora} || 0%{?rhel}
BuildRequires: libappstream-glib
%endif
%if 0%{?mageia}
BuildRequires: appstream-util
%endif
Provides: application(%{name}.desktop)
Provides: web_browser
Provides: appdata()
Provides: appdata(%{name}.appdata.xml)
ExclusiveArch: x86_64
%description
Mozilla %{program} %{type} - Mozilla Firefox build for Linux adapted to RPM package with daily updates and modified settings
%prep
%setup -q -n %{program}
%install
mkdir -p %{buildroot}%{_bindir} %{buildroot}%{_datadir}/applications %{buildroot}%{_libexecdir}/%{name}
cp -rf * %{buildroot}%{_libexecdir}/%{name}/
ln -s ../../%{_libexecdir}/%{name}/%{program} %{buildroot}%{_bindir}/%{name}
install -Dm644 %{SOURCE1} %{buildroot}%{_datadir}/metainfo/%{name}.appdata.xml
# icon
for x in 16 32 48 64 128
do
install -Dm644 browser/chrome/icons/default/default${x}.png %{buildroot}%{_datadir}/icons/hicolor/${x}x${x}/apps/%{name}.png
done
desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE2}
%if 0%{?suse_version}
%suse_update_desktop_file %{name}
%endif
%if 0%{?suse_version} || 0%{?fedora} || 0%{?rhel} || 0%{?mageia}
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.xml
%endif
# Remove problematic files
rm -f %{buildroot}%{_libexecdir}/%{name}/libonnxruntime.so
# Install uBlock, Privacy Badger and Decentraleyes
mkdir -p %{buildroot}%{_libexecdir}/%{name}/distribution
cat > %{buildroot}%{_libexecdir}/%{name}/distribution/policies.json << EOF
{
"policies": {
"DisableAppUpdate": false,
"Extensions": {
"Install": [
"https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi",
"https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi",
"https://addons.mozilla.org/firefox/downloads/latest/decentraleyes/latest.xpi"
],
"Uninstall": [],
"Locked": []
}
}
}
EOF
# Configuring default browser behavior/settings
cat >> %{buildroot}%{_libexecdir}/%{name}/defaults/pref/vendor.js << EOF
// Disable Update Alert
pref("app.update.enabled", false);
// Enable beta UI features
pref("browser.proton.enabled", true);
pref("browser.proton.tabs.enabled", true);
pref("browser.proton.appmenu.enabled", true);
pref("browser.newtabpage.activity-stream.newNewtabExperience.enabled", true);
// Enable Fission/site isolation and GPU rendering (required for fission)
pref("fission.autostart", true);
pref("gfx.webrender.all", true);
// Enable HTTP/3 experimental support
pref("network.http.http3.enabled", true);
// Stronger privacy by default
// Reject (known) trackers and partition third-party storage.
pref("network.cookie.cookieBehavior", 5);
// resistFingerprinting
pref("privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts", true);
pref("privacy.resistFingerprinting.randomDataOnCanvasExtract", true);
pref("privacy.resistFingerprinting.reduceTimerPrecision.jitter", true);
// Enable tracking protection
pref("privacy.trackingprotection.enabled", true);
pref("privacy.trackingprotection.fingerprinting.enabled", true);
pref("privacy.trackingprotection.cryptomining.enabled", true);
pref("privacy.trackingprotection.socialtracking.enabled", true);
pref("privacy.trackingprotection.block_cookies.enabled", true);
// Replace/Set Geolocation API to Mozilla servers instead of Google
pref("geo.provider.network.url", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%");
pref("geo.wifi.uri", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%");
// Enable Firefox telemetry to help Mozilla develop a killer browser
pref("datareporting.healthreport.uploadEnabled", true);
pref("datareporting.policy.dataSubmissionEnabled", true);
pref("browser.crashReports.unsubmittedCheck.autoSubmit2", true);
// Opt out of studies
pref("app.shield.optoutstudies.enabled", false);
EOF
%post
update-desktop-database &>/dev/null || :
%postun
update-desktop-database &>/dev/null || :
%files
%{_bindir}/%{name}
%{_libexecdir}/%{name}/
%{_datadir}/metainfo/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%changelog
* Mon Jul 22 2024 Sylar <renar.corp@hotmail.com>
- Fixed typos in preferences (pref instead of prefs)
- Updated extension installation URLs
- Improved code formatting
* Sat Feb 24 2024 Alexander W. Ahjolinna <ahjolinna@yahoo.com>
- Removed explicit library dependencies (let rpm auto-detect them)
- Removed problematic libonnxruntime.so file
- Fixed empty %post/%postun/%pre/%preun sections
- Removed specific branding requirement
- Consolidated all preferences into a single append operation
- Added desktop database updates in post/postun