firefox-esr68/firefox.spec

361 lines
12 KiB
RPMSpec
Raw Normal View History

#
# 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.
2018-06-27 13:56:18 +03:00
%define major 61.0
2016-12-01 21:03:29 +04:00
%define ff_epoch 0
2018-05-09 21:26:58 +03:00
%define relurl 0
2018-05-05 21:28:19 +03:00
%define rel_url 6b51784853e47e091d213d421a19cb623af718f0
# (tpg) set version HERE !!!
%define realver %{major}
%define firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
2012-02-01 14:23:54 +04:00
# (tpg) MOZILLA_FIVE_HOME
%define mozillalibdir %{_libdir}/%{name}-%{major}
2012-02-01 14:23:54 +04:00
%define pluginsdir %{_libdir}/mozilla/plugins
2012-02-01 15:22:14 +04:00
# this seems fragile, so require the exact version or later (#58754)
2018-03-20 23:04:44 +03:00
#%%define sqlite3_version %%(pkg-config --modversion sqlite3 &>/dev/null && pkg-config --modversion sqlite3 2>/dev/null || echo 0)
2012-02-01 15:22:14 +04:00
%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 _use_syshunspell 0
2016-11-30 12:54:25 +03:00
%define toolkit_gtk3 1
2015-09-25 11:51:45 +03:00
2018-06-27 13:56:18 +03:00
# Firefox 61.0: ERROR: Only GCC 6.1 or newer is supported (found version 5.5.0).
%define clang 1
Summary: Next generation web browser
2012-02-01 14:23:54 +04:00
Name: firefox
Version: %{major}
2016-12-01 21:03:29 +04:00
Epoch: %{ff_epoch}
2018-03-27 18:06:47 +03:00
Release: 1
2012-02-01 14:23:54 +04:00
License: MPLv1+
Group: Networking/WWW
Url: http://www.mozilla.com/firefox/
2018-05-09 21:26:58 +03:00
%if %{relurl}
2018-03-27 18:06:47 +03:00
Source0: https://hg.mozilla.org/releases/mozilla-release/archive/%{rel_url}.tar.bz2?/mozilla-release-%{rel_url}.tar.bz2
2018-05-09 21:26:58 +03:00
%else
Source0: https://archive.mozilla.org/pub/firefox/releases/%{realver}/source/%{name}-%{realver}.source.tar.xz
%endif
Source4: %{name}.desktop
2017-10-07 18:09:28 +03:00
Source7: firefox.cfg
2012-02-01 14:23:54 +04:00
Source9: kde.js
2017-10-03 17:09:33 +03:00
2016-11-16 14:21:30 +03:00
# Patches for kde integration of FF
# http://www.rosenauer.org/hg/mozilla/summary
Patch11: firefox-kde.patch
Patch12: mozilla-kde.patch
2018-01-25 00:12:49 +10:00
Patch13: mozilla-kde-background.patch
2017-10-03 17:09:33 +03:00
Patch35: firefox-37-build-with-time-independent-uuids.patch
2017-01-05 20:34:48 +08:00
Patch37: firefox-50.1-fix-glibc-check.patch
2013-02-15 16:06:39 +04:00
# Fedora specific patches
# Unable to install addons from https pages
2015-09-25 15:11:05 +03:00
Patch215: firefox-enable-addons.patch
Patch219: rhbz-1173156.patch
2015-09-25 11:51:45 +03:00
2017-10-03 17:09:33 +03:00
Patch300: firefox-56.0-build-error.patch
2012-02-01 14:23:54 +04:00
BuildRequires: gtk+2-devel
2015-09-25 11:51:45 +03:00
%if %{toolkit_gtk3}
2016-12-01 18:41:39 +03:00
BuildRequires: gtk+3-devel
2015-09-25 11:51:45 +03:00
%endif
2017-08-11 22:08:08 +03:00
BuildRequires: rust
BuildRequires: cargo
2012-02-01 14:23:54 +04:00
BuildRequires: unzip
BuildRequires: zip
2017-10-03 17:09:33 +03:00
BuildRequires: clang
BuildRequires: clang-devel
2018-06-27 13:56:18 +03:00
BuildRequires: lld
2013-05-13 14:05:37 +04:00
BuildRequires: pkgconfig(xinerama)
BuildRequires: pkgconfig(xscrnsaver)
2013-10-31 14:16:04 +04:00
BuildRequires: jpeg-devel
BuildRequires: zlib-devel
BuildRequires: glib2-devel
2017-01-05 20:34:48 +08:00
BuildRequires: python-devel
2013-05-13 14:05:37 +04:00
BuildRequires: pkgconfig(libIDL-2.0)
2012-02-01 14:23:54 +04:00
BuildRequires: makedepend
2016-08-03 18:50:25 +03:00
BuildRequires: nss-devel >= 2:3.24
BuildRequires: nss-static-devel
2017-10-03 17:09:33 +03:00
BuildRequires: pkgconfig(nspr) >= 4.17
BuildRequires: startup-notification-devel
BuildRequires: dbus-glib-devel
%ifnarch %arm %mips
2012-02-01 14:23:54 +04:00
BuildRequires: java-rpmbuild
2016-09-01 15:55:34 +03:00
BuildRequires: java-1.8.0-openjdk-devel
BuildRequires: yasm >= 1.0.1
%endif
%ifarch %arm
BuildRequires: libffi-devel
%endif
BuildRequires: rootcerts >= 1:20110830.00
2013-05-13 14:05:37 +04:00
BuildRequires: pkgconfig(xt)
%if %_use_syshunspell
BuildRequires: hunspell-devel
%endif
BuildRequires: doxygen
BuildRequires: pkgconfig(alsa)
2012-02-01 14:23:54 +04:00
BuildRequires: wget
2013-05-13 14:05:37 +04:00
BuildRequires: pkgconfig(libnotify)
2012-09-19 07:36:21 +00:00
BuildRequires: pkgconfig(gl)
BuildRequires: autoconf2.1
BuildRequires: libiw-devel
2014-06-10 16:43:04 +04:00
BuildRequires: pkgconfig(gstreamer-1.0)
BuildRequires: pkgconfig(gstreamer-plugins-base-1.0)
BuildRequires: pkgconfig(opus)
2014-03-19 17:07:59 +04:00
BuildRequires: pkgconfig(libpulse)
2014-02-11 18:11:29 +04:00
BuildRequires: bzip2-devel
2014-12-16 13:44:35 +03:00
BuildRequires: pkgconfig(theoradec)
BuildRequires: pkgconfig(vorbis)
2015-09-24 12:40:10 +03:00
BuildRequires: pkgconfig(gconf-2.0)
2017-01-05 21:37:33 +08:00
BuildRequires: pkgconfig(fontconfig)
2018-02-12 21:13:29 +03:00
Provides: %{name} = %{EVRD}
Provides: mozilla-firefox = %{EVRD}
2012-02-01 14:23:54 +04:00
Provides: webclient
Requires: %{mklibname nss 3} >= 2:%{nss_version}
Requires: %{mklibname nspr 4} >= 2:%{nspr_version}
Requires: indexhtml
2017-01-05 20:34:48 +08:00
Requires: xdg-utils
# fixes bug #42096
Requires: mailcap
%if %_use_syshunspell
Suggests: hunspell-en
%endif
Suggests: %{_lib}canberra0
Suggests: %{_lib}cups2
2012-02-01 14:23:54 +04:00
%description
2012-10-22 10:39:31 +00:00
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.
2012-02-01 14:23:54 +04:00
2016-11-30 12:54:25 +03:00
%files
%{_bindir}/%{name}
%{_bindir}/mozilla-firefox
%{_iconsdir}/hicolor/*/apps/*.png
%{_miconsdir}/%{name}.png
%{_iconsdir}/%{name}.png
%{_liconsdir}/%{name}.png
%{_datadir}/applications/*.desktop
%{_libdir}/%{name}-%{major}*
%dir %{_libdir}/mozilla
%dir %{_libdir}/mozilla/extensions
%dir %{pluginsdir}
%dir %{_libdir}/mozilla/extensions/%{firefox_appid}
%dir %{_datadir}/mozilla/extensions/%{firefox_appid}
#---------------------------------------------------------------------
%package devel
2012-02-01 14:23:54 +04:00
Summary: Development files for %{name}
Group: Development/Other
2016-11-30 12:54:25 +03:00
%description devel
2012-02-01 14:23:54 +04:00
Files and macros mainly for building Firefox extensions.
2016-11-30 12:54:25 +03:00
%files devel
%{_sys_macros_dir}/%{name}.macros
#---------------------------------------------------------------------
2012-02-01 14:23:54 +04:00
%prep
2018-05-09 21:26:58 +03:00
%if %{relurl}
2018-03-27 18:06:47 +03:00
%setup -qn mozilla-release-%{rel_url}
2018-05-09 21:26:58 +03:00
%else
%setup -q
%endif
2012-02-26 04:57:26 +04:00
2016-11-16 14:21:30 +03:00
## KDE INTEGRATION
%patch11 -p1 -b .kdepatch
%patch12 -p1 -b .kdemoz
2018-06-27 13:56:18 +03:00
#%%patch13 -p1 -b .kdebackground
2016-11-16 14:21:30 +03:00
%patch35 -p1
2017-01-05 20:34:48 +08:00
%patch37 -p1
2012-02-01 14:23:54 +04:00
# Fedora patches
2015-09-25 15:11:05 +03:00
%patch215 -p1 -b .addons
%patch219 -p2 -b .rhbz-1173156
2015-09-25 11:51:45 +03:00
2017-10-03 17:09:33 +03:00
%patch300 -p1
pushd js/src
autoconf-2.13
popd
autoconf-2.13
# needed to regenerate certdata.c
pushd security/nss/lib/ckfw/builtins
2017-01-25 15:25:15 +03:00
perl ./certdata.perl /etc/pki/tls/mozilla/certdata.txt
popd
2012-02-01 14:23:54 +04:00
%build
2017-01-05 20:34:48 +08:00
2018-06-27 13:56:18 +03:00
%if 0%{?clang}
export CC=clang
export CXX=clang++
export LINKER=ld.lld
%else
2017-01-05 20:34:48 +08:00
CFLAGS="$CFLAGS -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object"
CXXFLAGS="$CFLAGS -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object"
export CFLAGS
export CXXFLAGS
2018-06-27 13:56:18 +03:00
%endif
2017-01-05 20:34:48 +08:00
2012-02-01 15:22:14 +04:00
export MOZCONFIG=`pwd`/mozconfig
2012-02-01 14:23:54 +04:00
cat << EOF > $MOZCONFIG
mk_add_options MOZILLA_OFFICIAL=1
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZ_MAKE_FLAGS="%{_smp_mflags}"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj
ac_add_options --host=%{_host}
2017-01-05 18:51:02 +03:00
ac_add_options --target=%{_target_platform}
2017-01-05 20:34:48 +08:00
ac_add_options --enable-release
2012-02-01 14:23:54 +04:00
ac_add_options --prefix="%{_prefix}"
2016-09-01 15:52:43 +03:00
ac_add_options --libdir="%{_libdir}"
2012-02-01 14:23:54 +04:00
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-zlib
2017-01-05 20:34:48 +08:00
ac_add_options --with-system-jpeg
ac_add_options --with-pthreads
2016-03-09 09:56:10 +03:00
ac_add_options --without-system-libvpx
2014-02-11 18:11:29 +04:00
ac_add_options --with-system-bz2
2012-02-01 14:23:54 +04:00
ac_add_options --disable-updater
ac_add_options --disable-tests
2015-09-25 11:51:45 +03:00
%if %{toolkit_gtk3}
ac_add_options --enable-default-toolkit=cairo-gtk3
%else
ac_add_options --enable-default-toolkit=cairo-gtk2
%endif
2012-02-01 14:23:54 +04:00
ac_add_options --enable-official-branding
2017-01-05 20:34:48 +08:00
ac_add_options --disable-system-sqlite
2012-02-26 04:57:26 +04:00
ac_add_options --enable-startup-notification
ac_add_options --with-distribution-id=org.rosa
ac_add_options --disable-crashreporter
2017-08-11 22:08:08 +03:00
ac_add_options --disable-debug
2018-01-24 12:33:01 +03:00
#ac_add_options --enable-rust-debug
2012-02-28 14:08:45 +04:00
EOF
2012-02-01 14:23:54 +04:00
perl -p -i -e 's|\-0|\-9|g' config/make-jars.pl
export LDFLAGS="%{ldflags}"
2018-01-24 12:33:01 +03:00
./mach build
2012-02-01 14:23:54 +04:00
%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
2012-02-01 14:23:54 +04:00
# Copy files to buildroot
mkdir -p %{buildroot}%{mozillalibdir}
cp -rf %{_builddir}/obj/dist/firefox/* %{buildroot}%{mozillalibdir}
2012-02-01 14:23:54 +04:00
mkdir -p %{buildroot}%{_bindir}
ln -sf %{mozillalibdir}/firefox %{buildroot}%{_bindir}/firefox
pushd %{buildroot}%{_bindir}
ln -sf firefox mozilla-firefox
2012-02-28 14:08:45 +04:00
popd
mkdir -p %{buildroot}%{mozillalibdir}/defaults/preferences/
install -m 644 %{SOURCE9} %{buildroot}%{mozillalibdir}/defaults/preferences/kde.js
2012-02-01 14:23:54 +04:00
2018-01-24 12:33:01 +03:00
# 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}
2012-02-01 14:23:54 +04:00
# (tpg) desktop entry
mkdir -p %{buildroot}%{_datadir}/applications
install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/%{name}.desktop
2012-02-01 14:23:54 +04:00
# (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
2013-05-20 17:50:47 +04:00
ln -sf %{mozillalibdir}/browser/chrome/icons/default/default$i.png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps/%{name}.png ;
2012-02-01 14:23:54 +04:00
done
mkdir -p %{buildroot}{%{_liconsdir},%{_iconsdir},%{_miconsdir}}
2013-05-20 12:33:14 +04:00
ln -sf %{mozillalibdir}/browser/chrome/icons/default/default48.png %{buildroot}%{_liconsdir}/%{name}.png
ln -sf %{mozillalibdir}/browser/chrome/icons/default/default32.png %{buildroot}%{_iconsdir}/%{name}.png
ln -sf %{mozillalibdir}/browser/chrome/icons/default/default16.png %{buildroot}%{_miconsdir}/%{name}.png
2012-02-01 14:23:54 +04:00
# exclusions
rm -f %{buildroot}%{mozillalibdir}/README.txt
rm -f %{buildroot}%{mozillalibdir}/removed-files
rm -f %{buildroot}%{mozillalibdir}/precomplete
2017-10-07 18:09:28 +03:00
install -m 644 %{SOURCE7} %{buildroot}%{mozillalibdir}/firefox.cfg
2014-04-18 20:51:41 +04:00
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
2012-10-09 07:46:34 +00:00
EOF
# display icon for Firefox button
mkdir -p %{buildroot}%{mozillalibdir}/defaults/profile/chrome
2012-10-09 07:46:34 +00:00
cat << EOF > %{buildroot}%{mozillalibdir}/defaults/profile/chrome/userChrome.css
#appmenu-toolbar-button {
2017-01-25 21:15:47 +03:00
list-style-image: url("chrome://branding/content/icon16.png");
2012-10-09 07:46:34 +00:00
}
2012-02-01 15:22:14 +04:00
EOF
# use the system myspell dictionaries
rm -fr %{buildroot}%{mozillalibdir}/dictionaries
ln -s %{_datadir}/dict/mozilla/ %{buildroot}%{mozillalibdir}/dictionaries
2012-02-01 14:23:54 +04:00
2018-01-24 12:33:01 +03:00
# (lm) touch and %%ghost bookmarks.html to a proper uninstall
touch %{buildroot}%{mozillalibdir}/defaults/profile/bookmarks.html
2012-02-01 14:23:54 +04:00
mkdir -p %{buildroot}%{_sys_macros_dir}
cat <<FIN >%{buildroot}%{_sys_macros_dir}/%{name}.macros
# Macros from %{name} package
2017-01-25 21:15:47 +03:00
%%firefox_major %{major}
%%firefox_epoch %{ff_epoch}
2017-11-02 18:05:13 +03:00
%%firefox_version %{major}
2017-01-25 21:15:47 +03:00
%%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)
2012-02-01 14:23:54 +04:00
FIN
2015-07-03 17:15:53 +03:00
mkdir -p %{buildroot}%{_docdir}/%{name}
2013-02-13 14:54:40 +04:00
%pre
2013-05-21 11:25:44 +04:00
if [ -d %{mozillalibdir}/browser/dictionaries ]; then
2017-01-28 15:43:42 +03:00
rm -fr %{mozillalibdir}/browser/dictionaries
fi
2012-02-28 14:08:45 +04:00
2012-02-01 14:23:54 +04:00
%post
if [ ! -r /etc/sysconfig/oem ]; then
2017-01-25 21:15:47 +03:00
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
2012-02-01 14:23:54 +04:00
fi