summaryrefslogtreecommitdiff
path: root/firefox.spec
diff options
context:
space:
mode:
Diffstat (limited to 'firefox.spec')
-rw-r--r--firefox.spec290
1 files changed, 237 insertions, 53 deletions
diff --git a/firefox.spec b/firefox.spec
index 5d6286f..844e2ac 100644
--- a/firefox.spec
+++ b/firefox.spec
@@ -1,6 +1,20 @@
-# Use system nss/nspr?
+# Use system nspr/nss?
%define system_nss 1
+# Use system sqlite?
+%if 0%{?fedora} < 19
+%define system_sqlite 0
+%define system_ffi 0
+%else
+%define system_sqlite 1
+%define system_ffi 1
+%endif
+
+# Use system cairo?
+%define system_cairo 1
+
+%define enable_gstreamer 1
+
# Separated plugins are supported on x86(64) only
%ifarch %{ix86} x86_64
%define separated_plugins 1
@@ -13,13 +27,33 @@
%define default_bookmarks_file %{_datadir}/bookmarks/default-bookmarks.html
%define firefox_app_id \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
+# Minimal required versions
+%global cairo_version 1.10.2
+%global freetype_version 2.1.9
+%global libnotify_version 0.7.0
+%global libvpx_version 1.0.0
+
+%if %{?system_nss}
+%global nspr_version 4.10.2
+%global nspr_build_version %(pkg-config --silence-errors --modversion nspr 2>/dev/null || echo 65536)
+%global nss_version 3.15.2
+%global nss_build_version %(pkg-config --silence-errors --modversion nss 2>/dev/null || echo 65536)
+%endif
-%global xulrunner_version 26.0
-%global xulrunner_version_max 26.1
-%global xulrunner_release 1
-%global alpha_version 0
-%global beta_version 0
-%global rc_version 0
+%if %{?system_sqlite}
+%global sqlite_version 3.7.13
+# The actual sqlite version (see #480989):
+%global sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo 65536)
+%endif
+
+# gecko_dir_ver should be set to the version in our directory names
+# alpha_version should be set to the alpha number if using an alpha, 0 otherwise
+# beta_version should be set to the beta number if using a beta, 0 otherwise
+# rc_version should be set to the RC number if using an RC, 0 otherwise
+%global gecko_dir_ver %{version}
+%global alpha_version 0
+%global beta_version 0
+%global rc_version 0
%global mozappdir %{_libdir}/%{name}
%global langpackdir %{mozappdir}/langpacks
@@ -35,8 +69,7 @@
%if %{alpha_version} > 0
%global pre_version a%{alpha_version}
-%global pre_name alpha%{alpha_version}
-%global tarballdir mozilla-alpha
+%global tarballdir mozilla-beta
%endif
%if %{beta_version} > 0
%global pre_version b%{beta_version}
@@ -48,12 +81,6 @@
%global pre_name rc%{rc_version}
%global tarballdir mozilla-release
%endif
-%if %{defined pre_version}
-%global xulrunner_verrel %{xulrunner_version}-%{xulrunner_release}
-%global pre_tag .%{pre_version}
-%else
-%global xulrunner_verrel %{xulrunner_version}-%{xulrunner_release}
-%endif
Summary: Mozilla Firefox Web browser
Name: firefox
@@ -75,14 +102,26 @@ Source23: firefox.1
#Build patches
Patch0: firefox-install-dir.patch
-
-# Fedora patches
-Patch14: firefox-5.0-asciidel.patch
-Patch15: firefox-15.0-enable-addons.patch
-Patch16: firefox-duckduckgo.patch
+Patch2: mozilla-build.patch
+Patch3: mozilla-build-arm.patch
+Patch14: xulrunner-2.0-chromium-types.patch
+Patch17: xulrunner-24.0-gcc47.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=814879#c3
+Patch18: xulrunner-24.0-jemalloc-ppc.patch
+# workaround linking issue on s390 (JSContext::updateMallocCounter(size_t) not found)
+Patch19: xulrunner-24.0-s390-inlines.patch
+
+# Fedora specific patches
+# Unable to install addons from https pages
+Patch204: rhbz-966424.patch
+Patch214: firefox-5.0-asciidel.patch
+Patch215: firefox-15.0-enable-addons.patch
+Patch216: firefox-duckduckgo.patch
# Upstream patches
-Patch20: mozilla-938730.patch
+Patch300: mozilla-837563.patch
+Patch301: mozilla-938730.patch
+Patch302: mozilla-885002.patch
%if %{official_branding}
# Required by Mozilla Corporation
@@ -92,22 +131,82 @@ Patch20: mozilla-938730.patch
# Not yet approved by Mozillla Corporation
%endif
-
-# ---------------------------------------------------
+%if %{?system_nss}
+BuildRequires: nspr-devel >= %{nspr_version}
+BuildRequires: nss-devel >= %{nss_version}
+BuildRequires: nss-static >= %{nss_version}
+%endif
+%if %{?system_cairo}
+BuildRequires: cairo-devel >= %{cairo_version}
+%endif
+BuildRequires: libpng-devel
+BuildRequires: libjpeg-devel
+BuildRequires: zip
+BuildRequires: bzip2-devel
+BuildRequires: zlib-devel
+BuildRequires: libIDL-devel
+BuildRequires: gtk2-devel
+BuildRequires: krb5-devel
+BuildRequires: pango-devel
+BuildRequires: freetype-devel >= %{freetype_version}
+BuildRequires: libXt-devel
+BuildRequires: libXrender-devel
+BuildRequires: hunspell-devel
+BuildRequires: startup-notification-devel
+BuildRequires: alsa-lib-devel
+BuildRequires: libnotify-devel >= %{libnotify_version}
+BuildRequires: mesa-libGL-devel
+BuildRequires: libcurl-devel
+BuildRequires: libvpx-devel >= %{libvpx_version}
+BuildRequires: autoconf213
+BuildRequires: pulseaudio-libs-devel
+
+Requires: mozilla-filesystem
+%if %{?system_nss}
+Requires: nspr >= %{nspr_build_version}
+Requires: nss >= %{nss_build_version}
+%endif
BuildRequires: desktop-file-utils
BuildRequires: system-bookmarks
-BuildRequires: xulrunner-devel%{?_isa} >= %{xulrunner_verrel}
+%if %{?enable_gstreamer}
+BuildRequires: gstreamer-devel
+BuildRequires: gstreamer-plugins-base-devel
+%endif
+%if %{?system_sqlite}
+BuildRequires: sqlite-devel >= %{sqlite_version}
+Requires: sqlite >= %{sqlite_build_version}
+%endif
+
+%if %{?system_ffi}
+BuildRequires: libffi-devel
+%endif
-Requires: xulrunner%{?_isa} >= %{xulrunner_verrel}
Requires: system-bookmarks
Obsoletes: mozilla <= 37:1.7.13
Provides: webclient
-Conflicts: xulrunner%{?_isa} > %{xulrunner_version_max}
%description
Mozilla Firefox is an open-source web browser, designed for standards
compliance, performance and portability.
+%if %{enable_mozilla_crashreporter}
+%global moz_debug_prefix %{_prefix}/lib/debug
+%global moz_debug_dir %{moz_debug_prefix}%{mozappdir}
+%global uname_m %(uname -m)
+%global symbols_file_name %{name}-%{version}.en-US.%{_os}-%{uname_m}.crashreporter-symbols.zip
+%global symbols_file_path %{moz_debug_dir}/%{symbols_file_name}
+%global _find_debuginfo_opts -p %{symbols_file_path} -o debugcrashreporter.list
+%global crashreporter_pkg_name mozilla-crashreporter-%{name}-debuginfo
+%package -n %{crashreporter_pkg_name}
+Summary: Debugging symbols used by Mozilla's crash reporter servers
+Group: Development/Debug
+%description -n %{crashreporter_pkg_name}
+This package provides debug information for XULRunner, for use by
+Mozilla's crash reporter servers. If you are trying to locally
+debug %{name}, you want to install %{name}-debuginfo instead.
+%files -n %{crashreporter_pkg_name} -f debugcrashreporter.list
+%defattr(-,root,root)
+%endif
#---------------------------------------------------------------------
@@ -120,15 +219,25 @@ cd %{tarballdir}
# ignored during this compare.
%patch0 -p1
+%patch2 -p1 -b .bld
+%patch3 -p1 -b .arm
+%patch14 -p2 -b .chromium-types
+%patch17 -p1 -b .gcc47
+%patch18 -p2 -b .jemalloc-ppc
+%patch19 -p2 -b .s390-inlines
+
# For branding specific patches.
# Fedora patches
-%patch14 -p1 -b .asciidel
-%patch15 -p2 -b .addons
-%patch16 -p1 -b .duckduckgo
+%patch204 -p1 -b .966424
+%patch214 -p1 -b .asciidel
+%patch215 -p2 -b .addons
+%patch216 -p1 -b .duckduckgo
# Upstream patches
-%patch20 -p1 -b .938730
+%patch300 -p1 -b .837563
+%patch301 -p1 -b .938730
+%patch302 -p1 -b .885002
%if %{official_branding}
# Required by Mozilla Corporation
@@ -137,22 +246,34 @@ cd %{tarballdir}
# Not yet approved by Mozilla Corporation
%endif
-
%{__rm} -f .mozconfig
%{__cp} %{SOURCE10} .mozconfig
%if %{official_branding}
%{__cat} %{SOURCE11} >> .mozconfig
%endif
+%if %{?system_nss}
+echo "ac_add_options --with-system-nspr" >> .mozconfig
+echo "ac_add_options --with-system-nss" >> .mozconfig
+%else
+echo "ac_add_options --without-system-nspr" >> .mozconfig
+echo "ac_add_options --without-system-nss" >> .mozconfig
+%endif
-# Set up SDK path
-MOZILLA_SDK_PATH=`pkg-config --variable=sdkdir libxul`
-if [ -z "$MOZILLA_SDK_PATH" ]; then
- echo "XulRunner SDK is not available!"
- exit 1
-else
- echo "XulRunner SDK path: $MOZILLA_SDK_PATH"
- echo "ac_add_options --with-libxul-sdk=$MOZILLA_SDK_PATH" >> .mozconfig
-fi
+%if %{?system_sqlite}
+echo "ac_add_options --enable-system-sqlite" >> .mozconfig
+%else
+echo "ac_add_options --disable-system-sqlite" >> .mozconfig
+%endif
+
+%if %{?system_cairo}
+echo "ac_add_options --enable-system-cairo" >> .mozconfig
+%else
+echo "ac_add_options --disable-system-cairo" >> .mozconfig
+%endif
+
+%if %{?system_ffi}
+echo "ac_add_options --enable-system-ffi" >> .mozconfig
+%endif
%if !%{?separated_plugins}
echo "ac_add_options --disable-ipc" >> .mozconfig
@@ -165,36 +286,70 @@ echo "ac_add_options --disable-elf-hack" >> .mozconfig
%if %{?debug_build}
echo "ac_add_options --enable-debug" >> .mozconfig
echo "ac_add_options --disable-optimize" >> .mozconfig
+echo "ac_add_options --enable-dtrace" >> .mozconfig
%else
echo "ac_add_options --disable-debug" >> .mozconfig
echo "ac_add_options --enable-optimize" >> .mozconfig
%endif
-%if %{?system_nss}
-echo "ac_add_options --with-system-nspr" >> .mozconfig
-echo "ac_add_options --with-system-nss" >> .mozconfig
-%else
-echo "ac_add_options --without-system-nspr" >> .mozconfig
-echo "ac_add_options --without-system-nss" >> .mozconfig
-%endif
-
# s390(x) fails to start with jemalloc enabled
%ifarch s390 s390x
echo "ac_add_options --disable-jemalloc" >> .mozconfig
%endif
+%ifarch armv7hl
+echo "ac_add_options --with-arch=armv7-a" >> .mozconfig
+echo "ac_add_options --with-float-abi=hard" >> .mozconfig
+echo "ac_add_options --with-fpu=vfpv3-d16" >> .mozconfig
+echo "ac_add_options --disable-elf-hack" >> .mozconfig
+%endif
+%ifarch armv7hnl
+echo "ac_add_options --with-arch=armv7-a" >> .mozconfig
+echo "ac_add_options --with-float-abi=hard" >> .mozconfig
+echo "ac_add_options --with-fpu=neon" >> .mozconfig
+echo "ac_add_options --disable-elf-hack" >> .mozconfig
+%endif
+%ifarch armv5tel
+echo "ac_add_options --with-arch=armv5te" >> .mozconfig
+echo "ac_add_options --with-float-abi=soft" >> .mozconfig
+echo "ac_add_options --disable-elf-hack" >> .mozconfig
+%endif
+
+%ifnarch %{ix86} x86_64 armv7hl armv7hnl
+echo "ac_add_options --disable-methodjit" >> .mozconfig
+echo "ac_add_options --disable-monoic" >> .mozconfig
+echo "ac_add_options --disable-polyic" >> .mozconfig
+echo "ac_add_options --disable-tracejit" >> .mozconfig
+%endif
+
+%ifnarch %{ix86} x86_64 armv7hl armv7hnl
+echo "ac_add_options --disable-webrtc" >> .mozconfig
+%endif
+
#---------------------------------------------------------------------
%build
+%if %{?system_sqlite}
+# Do not proceed with build if the sqlite require would be broken:
+# make sure the minimum requirement is non-empty, ...
+sqlite_version=$(expr "%{sqlite_version}" : '\([0-9]*\.\)[0-9]*\.') || exit 1
+# ... and that major number of the computed build-time version matches:
+case "%{sqlite_build_version}" in
+ "$sqlite_version"*) ;;
+ *) exit 1 ;;
+esac
+%endif
+
cd %{tarballdir}
+# -fpermissive is needed to build with gcc 4.6+ which has become stricter
+#
# Mozilla builds with -Wall with exception of a few warnings which show up
# everywhere in the code; so, don't override that.
#
# Disable C++ exceptions since Mozilla code is not exception-safe
#
-MOZ_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | \
- %{__sed} -e 's/-Wall//')
+MOZ_OPT_FLAGS=$(echo "$RPM_OPT_FLAGS" | %{__sed} -e 's/-Wall//')
#rhbz#1037063
MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -Wformat-security -Wformat -Werror=format-security"
%if %{?debug_build}
@@ -208,6 +363,7 @@ MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
%endif
export CFLAGS=$MOZ_OPT_FLAGS
export CXXFLAGS=$MOZ_OPT_FLAGS
+export LDFLAGS=$MOZ_LINK_FLAGS
export PREFIX='%{_prefix}'
export LIBDIR='%{_libdir}'
@@ -215,15 +371,22 @@ export LIBDIR='%{_libdir}'
MOZ_SMP_FLAGS=-j1
# On x86 architectures, Mozilla can build up to 4 jobs at once in parallel,
# however builds tend to fail on other arches when building in parallel.
-%ifarch %{ix86} x86_64
+%ifarch %{ix86} x86_64 ppc ppc64
[ -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=-j8
%endif
-export LDFLAGS="-Wl,-rpath,%{mozappdir}"
-make -f client.mk build STRIP="/bin/true" MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS"
+#export LDFLAGS="-Wl,-rpath,%{mozappdir}"
+make -f client.mk build STRIP="/bin/true" MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS" MOZ_SERVICES_SYNC="1"
+
+# create debuginfo for crash-stats.mozilla.com
+%if %{enable_mozilla_crashreporter}
+#cd %{moz_objdir}
+make -C objdir buildsymbols
+%endif
#---------------------------------------------------------------------
@@ -344,6 +507,10 @@ ln -s %{mozappdir}/defaults/preferences $RPM_BUILD_ROOT/%{mozappdir}/browser/def
# Copy over the LICENSE
%{__install} -p -c -m 644 LICENSE $RPM_BUILD_ROOT/%{mozappdir}
+# Use the system hunspell dictionaries
+%{__rm} -rf ${RPM_BUILD_ROOT}%{mozappdir}/dictionaries
+ln -s %{_datadir}/myspell ${RPM_BUILD_ROOT}%{mozappdir}/dictionaries
+
# Enable crash reporter for Firefox application
%if %{enable_mozilla_crashreporter}
sed -i -e "s/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/" $RPM_BUILD_ROOT/%{mozappdir}/application.ini
@@ -441,8 +608,25 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%{mozappdir}/webapprt/omni.ja
%{mozappdir}/webapprt/webapprt.ini
%if %{enable_mozilla_crashreporter}
+%{mozappdir}/crashreporter
+%{mozappdir}/crashreporter.ini
+%{mozappdir}/Throbber-small.gif
%{mozappdir}/browser/crashreporter-override.ini
%endif
+%{mozappdir}/*.so
+%{mozappdir}/chrome.manifest
+%{mozappdir}/components
+%{mozappdir}/defaults
+%{mozappdir}/dependentlibs.list
+%{mozappdir}/dictionaries
+%{mozappdir}/mozilla-xremote-client
+%{mozappdir}/omni.ja
+%{mozappdir}/platform.ini
+%{mozappdir}/plugin-container
+%{mozappdir}/run-mozilla.sh
+%exclude %{_includedir}
+%exclude %{_libdir}/firefox-devel-%{version}
+%exclude %{_datadir}/idl
#---------------------------------------------------------------------
bgstack15