File ff-dev-edition.spec of Package ff-dev-edition
#
# spec file for package ff-dev-edition
#
# Copyright (c) 2025 Nicola Clark
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
Name: ff-dev-edition
Release: 0
License: MPL-2.0
Summary: Mozilla Firefox Web Browser (Developer Edition)
URL: https://www.firefox.com/en-US/channel/desktop/developer
Group: Productivity/Networking/Web/Browsers
Version: 144.0~b7
%define pkg_version %{lua: print((string.gsub(rpm.expand("%{version}"), "~", "")))}
Source: https://ftp.mozilla.org/pub/devedition/releases/%{pkg_version}/source/firefox-%{pkg_version}.source.tar.xz
Source1: ff-dev-edition.desktop
# Please create your own keys should you need them :)
Source2: google-geolocation-api-key
Source3: google-safe-browsing-api-key
Patch1: fix-wmclass.patch
BuildRequires: alsa-devel
BuildRequires: clang-devel
BuildRequires: cargo
BuildRequires: curl
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: libXt-devel
BuildRequires: libproxy-devel
BuildRequires: nasm
BuildRequires: nodejs >= 12.22.12
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(libpulse)
BuildRequires: python3
BuildRequires: python3-curses
BuildRequires: python3-devel
BuildRequires: rust
BuildRequires: rust-cbindgen
BuildRequires: sccache
BuildRequires: unzip
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils
%description
Firefox Developer Edition provides early access to the latest web development
features and tools.
%{expand:%%global optflags %(echo "%optflags" | sed -e s/-flto=auto//) }
%define progdir %{_prefix}/%_lib/ff-dev-edition
%prep
%autosetup -p1 -n firefox-%{sub %pkg_version 0 -3}
%build
cat << EOF > .obsenv.sh
export CFLAGS="%{optflags}"
export CXXFLAGS="\$CFLAGS"
export LDFLAGS="\$LDFLAGS -fPIC -Wl,-z,relro,-z,now"
export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
export MOZCONFIG=$RPM_BUILD_DIR/mozconfig
export MOZILLA_OFFICIAL=1
export MOZ_TELEMETRY_REPORTING=1
EOF
source ./.obsenv.sh
cat << EOF > $MOZCONFIG
export MOZ_APP_REMOTINGNAME=ff-dev-edition
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1
mk_add_options MOZ_DEV_EDITION=1
mk_add_options MOZ_MAKE_FLAGS=%{?_smp_mflags}
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj
. \$topsrcdir/browser/config/mozconfig
ac_add_options --disable-bootstrap
ac_add_options --prefix=%{_prefix}
ac_add_options --libdir=%{_libdir}
ac_add_options --includedir=%{_includedir}
ac_add_options --allow-addon-sideload
ac_add_options --disable-debug
ac_add_options --disable-debug-symbols
ac_add_options --disable-updater
ac_add_options --disable-tests
ac_add_options --enable-alsa
ac_add_options --enable-crashreporter
ac_add_options --enable-default-toolkit=cairo-gtk3-wayland
ac_add_options --enable-install-strip
ac_add_options --enable-libproxy
ac_add_options --enable-lto
ac_add_options --enable-optimize
ac_add_options --enable-release
ac_add_options --enable-rust-simd
ac_add_options --enable-update-channel=aurora
ac_add_options --with-branding=browser/branding/aurora
ac_add_options --with-ccache=sccache
ac_add_options --with-google-location-service-api-keyfile=%{SOURCE2}
ac_add_options --with-google-safebrowsing-api-keyfile=%{SOURCE3}
# Will add later when working out specifics of the thing
# ac_add_options --with-mozilla-api-keyfile=%{SOURCE4}
ac_add_options --with-system-zlib
ac_add_options --with-unsigned-addon-scopes=app
ac_add_options --without-wasm-sandboxed-libraries
EOF
ccache -s
./mach build
ccache -s
%install
source ./.obsenv.sh
install -Dm 0644 %{SOURCE1} %{buildroot}%{_datadir}/applications/ff-dev-edition.desktop
DESTDIR="%{buildroot}" ./mach install
mv %{buildroot}%{_prefix}/%_lib/firefox %{buildroot}%{progdir}
find %{buildroot}%{progdir} \
-name "*.js" -o \
-name "*.jsm" -o \
-name "*.rdf" -o \
-name "*.properties" -o \
-name "*.dtd" -o \
-name "*.txt" -o \
-name "*.xml" -o \
-name "*.css" \
-exec chmod a-x {} +
find %{buildroot}%{progdir} -type f -name ".mkdir.done" -delete
rm %{buildroot}%{_bindir}/firefox
ln -sf ../%{_lib}/ff-dev-edition/firefox-bin %{buildroot}%{_bindir}/firefox-aurora
for size in 16 32 48 64 128; do
mkdir -p %{buildroot}%{_prefix}/share/icons/hicolor/${size}x${size}/apps
cp %{buildroot}%{progdir}/browser/chrome/icons/default/default$size.png \
%{buildroot}%{_prefix}/share/icons/hicolor/${size}x${size}/apps/ff-dev-edition.png
done
rm -f %{buildroot}%{progdir}/updater.ini
rm -f %{buildroot}%{progdir}/removed-files
rm -f %{buildroot}%{progdir}/README.txt
rm -f %{buildroot}%{progdir}/old-homepage-default.properties
rm -f %{buildroot}%{progdir}/run-mozilla.sh
rm -f %{buildroot}%{progdir}/LICENSE
rm -f %{buildroot}%{progdir}/precomplete
rm -f %{buildroot}%{progdir}/update-settings.ini
%fdupes %{buildroot}%{progdir}
%fdupes %{buildroot}%{_datadir}
%post
%desktop_database_post
%icon_theme_cache_post
exit 0
%postun
%icon_theme_cache_postun
%desktop_database_postun
exit 0
%files
%defattr(-,root,root)
%dir %{progdir}
%dir %{progdir}/browser/
%dir %{progdir}/browser/chrome/
%{progdir}/browser/chrome/icons
%{progdir}/browser/omni.ja
%{progdir}/defaults/
%{progdir}/gmp-clearkey/
%{progdir}/firefox
%{progdir}/firefox-bin
%{progdir}/application.ini
%{progdir}/dependentlibs.list
%{progdir}/*.so
%{progdir}/glxtest
%{progdir}/vaapitest
%{progdir}/omni.ja
%{progdir}/fonts/
%{progdir}/pingsender
%{progdir}/platform.ini
%{progdir}/crashhelper
%{progdir}/crashreporter
%{_datadir}/applications/ff-dev-edition.desktop
%{_prefix}/share/icons/hicolor/
%{_bindir}/firefox-aurora
%changelog