mirror of
https://abf.rosa.ru/djam/firefox-esr78.git
synced 2025-02-23 09:42:47 +00:00
477 lines
15 KiB
RPMSpec
477 lines
15 KiB
RPMSpec
# No build in 62.0.2
|
|
#%%define debug_package %%{nil}
|
|
|
|
#
|
|
# WARNING, READ FIRST:
|
|
#
|
|
# This is a special package that needs special treatment. Due to the amount of
|
|
# security updates it needs, it's common to ship new upstream versions instead of patching.
|
|
# That means this package MUST be BUILDABLE for stable official releases.
|
|
# This also means only STABLE upstream releases, NO betas.
|
|
# This is a discussed topic. Please, do not flame it again.
|
|
|
|
%ifarch %ix86
|
|
%define _host i686-unknown-linux-gnu
|
|
%endif
|
|
|
|
%define oname firefox
|
|
%define major 78.8.0
|
|
%define ff_epoch 0
|
|
# (tpg) set version HERE !!!
|
|
%define realver %{major}
|
|
%define firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
|
|
|
|
# (tpg) MOZILLA_FIVE_HOME
|
|
# https://bugzilla.rosalinux.ru/show_bug.cgi?id=10129
|
|
%define mozillalibdir %{_libdir}/%{oname}-esr
|
|
%define pluginsdir %{_libdir}/mozilla/plugins
|
|
|
|
# this seems fragile, so require the exact version or later (#58754)
|
|
#%%define sqlite3_version %%(pkg-config --modversion sqlite3 &>/dev/null && pkg-config --modversion sqlite3 2>/dev/null || echo 0)
|
|
%define nss_version %(pkg-config --modversion nss &>/dev/null && pkg-config --modversion nss 2>/dev/null || echo 0)
|
|
%define nspr_version %(pkg-config --modversion nspr &>/dev/null && pkg-config --modversion nspr 2>/dev/null |sed -e 's!\.0!!' || echo 0)
|
|
|
|
%define toolkit_gtk3 1
|
|
|
|
# Firefox 61.0: ERROR: Only GCC 6.1 or newer is supported (found version 5.5.0).
|
|
%define clang 1
|
|
|
|
%define use_bundled_cbindgen 1
|
|
|
|
# Requested 'nss >= 3.53.1' but version of NSS is 3.52.1
|
|
%bcond_with system_nss_nspr
|
|
|
|
# Do not make provides from plugins /usr/lib64/firefox/*.so
|
|
%global __provides_exclude_from ^%{_libdir}/firefox.*/.*\\.so$
|
|
# Do not require filtered out provides
|
|
# To inspect them:
|
|
# for i in /usr/lib64/firefox/* ; do if file $i | grep -q ELF ; then echo ; echo -- $i ; LC_ALL=C ldd $i | grep found ; fi; done
|
|
# To make this list:
|
|
# ( for i in /usr/lib64/firefox/* ; do if file $i | grep -q ELF ; then LC_ALL=C ldd $i | grep found | awk '{print $1}' | awk -F '\\.so' '{print $1}' ; fi; done ) | sort -u | tr '\n' '|'
|
|
%global __requires_exclude ^(liblgpllibs|libmozavutil|libmozgtk|libmozsandbox|libmozsqlite3|libmozwayland|libnspr4|libnss3|libnssutil3|libplc4|libplds4|libsmime3|libssl3|libxul)\\.so.*$
|
|
|
|
Summary: Next generation web browser
|
|
Name: firefox-esr78
|
|
Version: %{major}
|
|
Epoch: %{ff_epoch}
|
|
Release: 1
|
|
License: MPLv1+
|
|
Group: Networking/WWW
|
|
Url: http://www.mozilla.com/firefox/
|
|
Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}esr/source/%{oname}-%{version}esr.source.tar.xz
|
|
Source1: firefox.rpmlintrc
|
|
Source2: ru@dictionaries.addons.mozilla.org.tar.bz2
|
|
Source4: %{oname}.desktop
|
|
Source7: firefox.cfg
|
|
Source9: kde.js
|
|
Source10: mozilla-api-key
|
|
Source11: google-api-key
|
|
# for 2016.1
|
|
Source80: loffice-libcxx-wrapper.sh
|
|
# Fedora
|
|
# https://github.com/eqrion/cbindgen/releases
|
|
# version 0.14.2
|
|
Source12: cbindgen-vendor.tar.xz
|
|
Source13: gen_cbindgen-vendor.sh
|
|
|
|
# Patches for kde integration of FF
|
|
# http://www.rosenauer.org/hg/mozilla/summary
|
|
Patch11: mozilla-kde.patch
|
|
Patch12: firefox-kde.patch
|
|
Patch13: mozilla-kde-background.patch
|
|
|
|
# Fedora specific patches
|
|
# Unable to install addons from https pages
|
|
Patch215: firefox-enable-addons.patch
|
|
|
|
Patch219: mozilla-ntlm-full-path.patch
|
|
|
|
Patch300: firefox-56.0-build-error.patch
|
|
|
|
# Build errors in 62.0
|
|
Patch302: firefox-62.0.2-include-cmath.patch
|
|
|
|
BuildRequires: gtk+2-devel
|
|
%if %{toolkit_gtk3}
|
|
BuildRequires: gtk+3-devel
|
|
%endif
|
|
BuildRequires: rust
|
|
BuildRequires: cargo
|
|
BuildRequires: unzip
|
|
BuildRequires: zip
|
|
BuildRequires: clang
|
|
BuildRequires: clang-devel
|
|
%if 0%{?clang}
|
|
BuildRequires: lld
|
|
%endif
|
|
BuildRequires: nasm
|
|
BuildRequires: libatomic-devel
|
|
BuildRequires: pkgconfig(xinerama)
|
|
BuildRequires: pkgconfig(xscrnsaver)
|
|
BuildRequires: jpeg-devel
|
|
BuildRequires: zlib-devel
|
|
BuildRequires: glib2-devel
|
|
%if %{mdvver} >= 201910
|
|
BuildRequires: pkgconfig(python2)
|
|
%else
|
|
BuildRequires: pkgconfig(python)
|
|
%endif
|
|
BuildRequires: pkgconfig(python3)
|
|
BuildRequires: pkgconfig(libIDL-2.0)
|
|
BuildRequires: makedepend
|
|
BuildRequires: nodejs
|
|
%if %{with system_nss_nspr}
|
|
BuildRequires: nss-devel >= 2:3.24
|
|
BuildRequires: nss-static-devel
|
|
BuildRequires: pkgconfig(nspr) >= 4.17
|
|
%endif
|
|
BuildRequires: startup-notification-devel
|
|
BuildRequires: dbus-glib-devel
|
|
%ifnarch %armx %mips
|
|
BuildRequires: java-rpmbuild
|
|
BuildRequires: java-1.8.0-openjdk-devel
|
|
BuildRequires: yasm >= 1.0.1
|
|
%endif
|
|
%ifarch %arm
|
|
BuildRequires: libffi-devel
|
|
%endif
|
|
BuildRequires: rootcerts >= 1:20110830.00
|
|
BuildRequires: pkgconfig(xt)
|
|
BuildRequires: doxygen
|
|
BuildRequires: pkgconfig(alsa)
|
|
BuildRequires: wget
|
|
BuildRequires: pkgconfig(libnotify)
|
|
BuildRequires: pkgconfig(gl)
|
|
BuildRequires: autoconf2.1
|
|
BuildRequires: libiw-devel
|
|
BuildRequires: pkgconfig(gstreamer-1.0)
|
|
BuildRequires: pkgconfig(gstreamer-plugins-base-1.0)
|
|
BuildRequires: pkgconfig(opus)
|
|
BuildRequires: pkgconfig(libpulse)
|
|
BuildRequires: bzip2-devel
|
|
BuildRequires: pkgconfig(theoradec)
|
|
BuildRequires: pkgconfig(vorbis)
|
|
BuildRequires: pkgconfig(gconf-2.0)
|
|
BuildRequires: pkgconfig(fontconfig)
|
|
%if %{mdvver} < 201910
|
|
BuildRequires: stdc++-gcc10-devel
|
|
%endif
|
|
|
|
Provides: mozilla-firefox = %{EVRD}
|
|
Provides: webclient
|
|
|
|
%if %{with system_nss_nspr}
|
|
Requires: %{mklibname nss 3} >= 2:%{nss_version}
|
|
Requires: %{mklibname nspr 4} >= 2:%{nspr_version}
|
|
%endif
|
|
Requires: indexhtml
|
|
Requires: xdg-utils
|
|
# fixes bug #42096
|
|
Requires: mailcap
|
|
Recommends: %{_lib}canberra0
|
|
Recommends: %{_lib}cups2
|
|
|
|
Conflicts: firefox
|
|
Conflicts: firefox-esr24
|
|
Conflicts: firefox-esr45
|
|
Conflicts: firefox-esr52
|
|
Conflicts: firefox-esr60
|
|
Conflicts: firefox-esr68
|
|
Conflicts: firefox-esr < %{EVRD}
|
|
|
|
%description
|
|
The award-winning Web browser is now faster, more secure, and fully
|
|
customizable to your online life. With Firefox(R), we've added powerful new
|
|
features that make your online experience even better. It is an 'open source'
|
|
product which is freely available, and is acquiring a growing proportion of
|
|
international web browser usage.
|
|
|
|
Firefox claims to offer a more secure web browsing experience than other
|
|
products, with better protection against spyware and other Internet-based
|
|
security threats. It includes all the standard features of a modern web
|
|
browser, like Internet searching, tracking recently visited sites, setting up
|
|
shortcuts to favourite sites, customising the software behaviour and so on.
|
|
Firefox also includes features like 'tabbed browsing' (opening several web
|
|
sites as sections within the same window) and methods for controlling pop-up
|
|
windows, cookies and downloaded files.
|
|
|
|
%files
|
|
%doc AUTHORS CLOBBER LEGAL LICENSE README.txt
|
|
%{_bindir}/%{oname}
|
|
%{_bindir}/mozilla-firefox
|
|
%{_datadir}/applications/*.desktop
|
|
%{_datadir}/mozilla/extensions/%{firefox_appid}/
|
|
%{_iconsdir}/%{oname}.png
|
|
%{_iconsdir}/hicolor/*/apps/*.png
|
|
%{_liconsdir}/%{oname}.png
|
|
%{_miconsdir}/%{oname}.png
|
|
%{mozillalibdir}*
|
|
%dir %{_libdir}/mozilla
|
|
%dir %{_libdir}/mozilla/extensions
|
|
%dir %{_libdir}/mozilla/extensions/%{firefox_appid}
|
|
%dir %{pluginsdir}
|
|
|
|
#---------------------------------------------------------------------
|
|
|
|
%package devel
|
|
Summary: Development files for %{name}
|
|
Group: Development/Other
|
|
Conflicts: firefox-devel
|
|
Conflicts: firefox-esr-devel
|
|
Conflicts: firefox-esr24-devel
|
|
Conflicts: firefox-esr45-devel
|
|
Conflicts: firefox-esr52-devel
|
|
Conflicts: firefox-esr60-devel
|
|
Conflicts: firefox-esr68-devel
|
|
|
|
%description devel
|
|
Files and macros mainly for building Firefox extensions.
|
|
|
|
%files devel
|
|
%doc AUTHORS CLOBBER LEGAL LICENSE README.txt
|
|
%{_rpmmacrodir}/*%{name}*
|
|
|
|
#---------------------------------------------------------------------
|
|
|
|
%prep
|
|
%setup -qn %{oname}-%{version}
|
|
|
|
## KDE INTEGRATION
|
|
%patch11 -p1 -b .kdepatch
|
|
%patch12 -p1 -b .kdemoz
|
|
%patch13 -p1 -b .kdebackground
|
|
|
|
# Fedora patches
|
|
%patch215 -p1 -b .addons
|
|
|
|
%patch219 -p1 -b .ntlm
|
|
|
|
%if %{with system_nss_nspr}
|
|
%patch300 -p1
|
|
%endif
|
|
%patch302 -p1
|
|
|
|
pushd js/src
|
|
autoconf-2.13
|
|
popd
|
|
autoconf-2.13
|
|
|
|
%if %{with system_nss_nspr}
|
|
# needed to regenerate certdata.c
|
|
pushd security/nss/lib/ckfw/builtins
|
|
perl ./certdata.perl /etc/pki/tls/mozilla/certdata.txt
|
|
popd
|
|
%endif
|
|
|
|
%build
|
|
%if 0%{?use_bundled_cbindgen}
|
|
mkdir -p my_rust_vendor
|
|
cd my_rust_vendor
|
|
%{__tar} xf %{SOURCE12}
|
|
mkdir -p .cargo
|
|
cat > .cargo/config <<EOL
|
|
[source.crates-io]
|
|
replace-with = "vendored-sources"
|
|
|
|
[source.vendored-sources]
|
|
directory = "`pwd`"
|
|
EOL
|
|
|
|
env CARGO_HOME=.cargo cargo install cbindgen
|
|
export PATH=`pwd`/.cargo/bin:$PATH
|
|
%endif
|
|
cd -
|
|
|
|
export RUSTFLAGS="-Cdebuginfo=0"
|
|
|
|
%if 0%{?clang}
|
|
%define linker lld
|
|
%if %{mdvver} < 201910
|
|
# not using %%clang_gcc_wrapper here because it fails
|
|
# to deal with complex quotation like
|
|
# -DCPPUNIT_PLUGIN_EXPORT='extern "C" SAL_DLLPUBLIC_EXPORT'
|
|
for i in %noclang_optflags ; do
|
|
export CFLAGS="$(echo "$CFLAGS" | sed -e "s,${i},,g")"
|
|
export CXXFLAGS="$(echo "$CXXFLAGS" | sed -e "s,${i},,g")"
|
|
done
|
|
mkdir -p local_bin
|
|
install -m0755 %{SOURCE80} "local_bin/clang++"
|
|
export PATH="${PWD}/local_bin:${PATH}"
|
|
%endif
|
|
export CC=clang
|
|
export CXX=clang++
|
|
%if %{mdvver} < 201910
|
|
export CPP=clang-cpp
|
|
# libstdc++ from gcc5 is too old, use newer version of libstdc++
|
|
export CPPFLAGS="$CPPFLAGS -I%{_includedir}/libstdc++-gcc10 -I%{_includedir}/libstdc++-gcc10/$(ls %{_includedir}/libstdc++-gcc10/ | grep '\-linux-gnu' | head -n 1)"
|
|
export CXXFLAGS="$CXXFLAGS -nostdinc++ $CPPFLAGS -Wno-unused-command-line-argument"
|
|
export LIBCCX_LIBS="-lstdc++-gcc10"
|
|
%endif
|
|
%else
|
|
%define linker gold
|
|
CFLAGS="$CFLAGS -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object"
|
|
CXXFLAGS="$CXXFLAGS -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object"
|
|
export CFLAGS
|
|
export CXXFLAGS
|
|
%endif
|
|
|
|
export MOZCONFIG=`pwd`/mozconfig
|
|
cat << EOF > $MOZCONFIG
|
|
mk_add_options BUILD_OFFICIAL=1
|
|
mk_add_options MOZILLA_OFFICIAL=1
|
|
mk_add_options MOZ_MAKE_FLAGS="%{_smp_mflags}"
|
|
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj
|
|
ac_add_options --disable-crashreporter
|
|
# debug
|
|
#ac_add_options --disable-debug
|
|
#ac_add_options --disable-debug-symbols
|
|
%ifnarch aarch64
|
|
ac_add_options --disable-elf-hack
|
|
%endif
|
|
ac_add_options --disable-tests
|
|
ac_add_options --disable-updater
|
|
%if %{toolkit_gtk3}
|
|
ac_add_options --enable-default-toolkit=cairo-gtk3
|
|
%else
|
|
ac_add_options --enable-default-toolkit=cairo-gtk2
|
|
%endif
|
|
# # Enables security hardening compiler options
|
|
# ac_add_options --enable-hardening
|
|
# # https://bugzilla.mozilla.org/show_bug.cgi?id=1483822
|
|
# ac_add_options --enable-linker=%%{linker}
|
|
# # Optimization for size is broken with gcc7 and later
|
|
# ac_add_options --enable-optimize="-O2"
|
|
ac_add_options --enable-official-branding
|
|
ac_add_options --enable-release
|
|
# # Enable compatibility with older libstdc++
|
|
# #ac_add_options --enable-stdcxx-compat
|
|
ac_add_options --host=%{_host}
|
|
ac_add_options --libdir="%{_libdir}"
|
|
ac_add_options --prefix="%{_prefix}"
|
|
ac_add_options --with-distribution-id=org.rosa
|
|
# Uncomment the following line if you wish to use Google's geolocaton API
|
|
# (needed for use with saved maps with Google Maps)
|
|
ac_add_options --with-google-location-service-api-keyfile=%{SOURCE11}
|
|
ac_add_options --with-google-safebrowsing-api-keyfile=%{SOURCE11}
|
|
# Uncomment the following line if you wish to use Mozilla Location Service
|
|
ac_add_options --with-mozilla-api-keyfile=%{SOURCE10}
|
|
ac_add_options --with-system-jpeg
|
|
%if %{with system_nss_nspr}
|
|
ac_add_options --with-system-nspr
|
|
ac_add_options --with-system-nss
|
|
%endif
|
|
ac_add_options --with-system-zlib
|
|
ac_add_options --with-unsigned-addon-scopes=app
|
|
ac_add_options --without-system-libvpx
|
|
#ac_add_options --enable-rust-debug
|
|
ac_add_options --allow-addon-sideload
|
|
|
|
EOF
|
|
|
|
# force memory efficient linking and ets
|
|
%if 0%{?clang}
|
|
export LDFLAGS="%{ldflags} -Wl,--no-keep-memory"
|
|
%else
|
|
export LDFLAGS="%{ldflags} -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
|
|
%endif
|
|
|
|
export MOZ_SERVICES_SYNC="1"
|
|
export STRIP=/bin/true
|
|
|
|
# This is needed since Firefox 68, otherwise each language installation
|
|
# (and Firefox 68 from Mozilla binaries compared to old Firefox binaries
|
|
# from ROSA) will have their own profile (and users are missing bookmarks
|
|
# and such).
|
|
export MOZ_LEGACY_PROFILES="1"
|
|
|
|
./mach build
|
|
|
|
%install
|
|
# Make sure locale works for langpacks
|
|
cat > %{_builddir}/obj/dist/bin/browser/defaults/preferences/firefox-l10n.js << EOF
|
|
pref("general.useragent.locale", "chrome://global/locale/intl.properties");
|
|
EOF
|
|
|
|
make -C %{_builddir}/obj/browser/installer STRIP=/bin/true MOZ_PKG_FATAL_WARNINGS=0
|
|
|
|
# Copy files to buildroot
|
|
mkdir -p %{buildroot}%{mozillalibdir}
|
|
cp -rf %{_builddir}/obj/dist/firefox/* %{buildroot}%{mozillalibdir}
|
|
|
|
mkdir -p %{buildroot}%{_bindir}
|
|
ln -sf %{mozillalibdir}/firefox %{buildroot}%{_bindir}/firefox
|
|
pushd %{buildroot}%{_bindir}
|
|
ln -sf firefox mozilla-firefox
|
|
popd
|
|
mkdir -p %{buildroot}%{mozillalibdir}/defaults/preferences/
|
|
install -m 644 %{SOURCE9} %{buildroot}%{mozillalibdir}/defaults/preferences/kde.js
|
|
|
|
# Create and own %%_libdir/mozilla/plugins & firefox extensions directories
|
|
mkdir -p %{buildroot}%{pluginsdir}
|
|
mkdir -p %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_appid}
|
|
mkdir -p %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_appid}
|
|
# added ru dictionaries
|
|
tar xjf %{SOURCE2} -C %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_appid}/
|
|
|
|
# (tpg) desktop entry
|
|
mkdir -p %{buildroot}%{_datadir}/applications
|
|
install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/%{oname}.desktop
|
|
|
|
# (tpg) icons
|
|
for i in 16 22 24 32 48 256; do
|
|
# (cg) Not all icon sizes are installed with make install, so just redo it here.
|
|
install -m 644 browser/branding/official/default$i.png %{buildroot}%{mozillalibdir}/browser/chrome/icons/default/default$i.png
|
|
mkdir -p %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps
|
|
ln -sf %{mozillalibdir}/browser/chrome/icons/default/default$i.png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps/%{oname}.png ;
|
|
done
|
|
mkdir -p %{buildroot}{%{_liconsdir},%{_iconsdir},%{_miconsdir}}
|
|
ln -sf %{mozillalibdir}/browser/chrome/icons/default/default48.png %{buildroot}%{_liconsdir}/%{oname}.png
|
|
ln -sf %{mozillalibdir}/browser/chrome/icons/default/default32.png %{buildroot}%{_iconsdir}/%{oname}.png
|
|
ln -sf %{mozillalibdir}/browser/chrome/icons/default/default16.png %{buildroot}%{_miconsdir}/%{oname}.png
|
|
|
|
# exclusions
|
|
rm -f %{buildroot}%{mozillalibdir}/README.txt
|
|
rm -f %{buildroot}%{mozillalibdir}/removed-files
|
|
rm -f %{buildroot}%{mozillalibdir}/precomplete
|
|
|
|
install -m 644 %{SOURCE7} %{buildroot}%{mozillalibdir}/firefox.cfg
|
|
|
|
cat << EOF >> %{buildroot}%{mozillalibdir}/defaults/pref/config-prefs.js
|
|
pref("general.config.filename", "firefox.cfg");
|
|
pref("general.config.obscure_value", 0); // use this to disable the byte-shift
|
|
EOF
|
|
|
|
# display icon for Firefox button
|
|
mkdir -p %{buildroot}%{mozillalibdir}/defaults/profile/chrome
|
|
cat << EOF > %{buildroot}%{mozillalibdir}/defaults/profile/chrome/userChrome.css
|
|
#appmenu-toolbar-button {
|
|
list-style-image: url("chrome://branding/content/icon16.png");
|
|
}
|
|
EOF
|
|
|
|
# (lm) touch and %%ghost bookmarks.html to a proper uninstall
|
|
touch %{buildroot}%{mozillalibdir}/defaults/profile/bookmarks.html
|
|
|
|
cat <<FIN >macro
|
|
# Macros from %{name} package
|
|
%%firefox_major %{major}
|
|
%%firefox_epoch %{ff_epoch}
|
|
%%firefox_version %{major}
|
|
%%firefox_mozillapath %{mozillalibdir}
|
|
%%firefox_pluginsdir %{pluginsdir}
|
|
%%firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
|
|
%%firefox_extdir %%(if [ "%%_target_cpu" = "noarch" ]; then echo %%{_datadir}/mozilla/extensions/%%{firefox_appid}; else echo %%{_libdir}/mozilla/extensions/%%{firefox_appid}; fi)
|
|
FIN
|
|
%install_macro %{name} macro
|
|
|
|
mkdir -p %{buildroot}%{_docdir}/%{name}
|
|
|
|
%post
|
|
if [ ! -r /etc/sysconfig/oem ]; then
|
|
case `grep META_CLASS /etc/sysconfig/system` in
|
|
*powerpack) bookmark="mozilla-powerpack.html" ;;
|
|
*desktop) bookmark="mozilla-one.html";;
|
|
*) bookmark="mozilla-download.html";;
|
|
esac
|
|
ln -s -f ../../../../share/mdk/bookmarks/mozilla/$bookmark %{mozillalibdir}/defaults/profile/bookmarks.html
|
|
fi
|