# Use system sqlite? %define system_sqlite 0 %define system_ffi 0 # Use system nss/nspr? %ifarch ppc %define system_nss 0 %else %define system_nss 1 %endif # Disable webm %define enable_webm 0 # Use system cairo? %define system_cairo 0 # Build as a debug package? %define debug_build 0 # Minimal required versions %if %{?system_nss} %global nspr_version 4.10.0 %global nss_version 3.15.1 %endif %global cairo_version 1.10.2 %global freetype_version 2.1.9 %define homepage file:///usr/share/doc/HTML/index.html # Bookmark variables %define desktop_file_utils_ver 0.9 %define firefox_app_id \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\} %define mozappdir %{_libdir}/%{name} %define langpackdir %{mozappdir}/langpacks %if %{?system_sqlite} %define 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 %define official_branding 1 %define build_langpacks 1 %if %{official_branding} %define tarballdir mozilla-esr24 %define ext_version esr %endif Summary: Mozilla Firefox Web browser Name: firefox Version: 24.5.0 Release: 1%{?prever}%{?dist} URL: http://www.mozilla.org/projects/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Group: Applications/Internet # From ftp://ftp.mozilla.org/pub/firefox/releases/%{version}%{?pretag}/source Source0: firefox-%{version}%{?prever}%{?ext_version}.source.tar.bz2 %if %{build_langpacks} Source1: firefox-langpacks-%{version}%{?ext_version}-20140422.tar.bz2 %endif Source10: firefox-mozconfig Source11: firefox-mozconfig-branded Source12: firefox-redhat-default-prefs.js Source13: firefox-redhat-default-bookmarks.html Source20: firefox.desktop Source21: firefox.sh.in Source23: firefox.1 Source31: pysqlite-2.6.3.tar.gz Source100: find-external-requires Source201: setuptools-0.6c11-py2.4.egg # Build patches Patch0: firefox-install-dir.patch Patch3: xulrunner-2.0-chromium-types.patch Patch4: xulrunner-24.0-gcc47.patch Patch5: xulrunner-24.0-jemalloc-ppc.patch Patch7: xulrunner-webrtc-secondarch.patch Patch8: xulrunner-nspr-version.patch Patch9: mozilla-python.patch Patch10: xulrunner-24.0-s390-inlines.patch Patch11: xulrunner-missing-pysqlite.patch # RPM specific patches Patch12: firefox-17.0-enable-addons.patch Patch13: rhbz-966424.patch Patch15: firefox-24.0-default.patch Patch16: mozilla-python2.patch Patch17: firefox-system-nss-3.15.3.patch # Upstream patches Patch100: firefox-5.0-asciidel.patch Patch102: xulrunner-nasm-webm.patch Patch200: firefox-duckduckgo.patch %if %{official_branding} # Required by Mozilla Corporation %else # Not yet approved by Mozillla Corporation %endif # --------------------------------------------------- BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: desktop-file-utils %if %{?enable_webm} BuildRequires: nasm %endif %if %{?system_sqlite} BuildRequires: sqlite-devel >= %{sqlite_version} Requires: sqlite >= %{sqlite_build_version} %endif %if %{?system_nss} BuildRequires: nspr-devel >= %{nspr_version} BuildRequires: nss-devel >= %{nss_version} Requires: nspr >= %{nspr_version} Requires: nss >= %{nss_version} %endif %if %{?system_sqlite} BuildRequires: sqlite-devel >= %{sqlite_version} Requires: sqlite >= %{sqlite_build_version} %endif BuildRequires: libpng-devel BuildRequires: libjpeg-devel BuildRequires: zip BuildRequires: bzip2-devel BuildRequires: zlib-devel BuildRequires: libIDL-devel BuildRequires: gtk2-devel BuildRequires: gnome-vfs2-devel BuildRequires: libgnome-devel BuildRequires: libgnomeui-devel BuildRequires: krb5-devel BuildRequires: pango-devel BuildRequires: freetype-devel >= %{freetype_version} BuildRequires: libXt-devel BuildRequires: libXrender-devel BuildRequires: startup-notification-devel BuildRequires: python-devel BuildRequires: sqlite-devel BuildRequires: python-setuptools BuildRequires: alsa-lib-devel BuildRequires: libnotify-devel BuildRequires: autoconf213 BuildRequires: mesa-libGL-devel BuildRequires: gcc44-c++ Requires: desktop-file-utils >= %{desktop_file_utils_ver} %if %{?system_nss} Requires: nspr >= %{nspr_version} Requires: nss >= %{nss_version} %endif Conflicts: firefox < 3.6 Obsoletes: mozilla <= 37:1.7.13 Provides: webclient Obsoletes: firefox < 24.0 Conflicts: firefox < 24.0 %if %{?enable_webm} BuildRequires: nasm %endif ExcludeArch: ppc64 #--------------------------------------------------------------------- # Override internal dependency generator to avoid showing libraries provided by this package # in dependencies: AutoProv: 0 %define _use_internal_dependency_generator 0 %define __find_requires %{SOURCE100} %description Mozilla Firefox is an open-source web browser, designed for standards compliance, performance and portability. #--------------------------------------------------------------------- %prep %setup -q -c cd %{tarballdir} # Build patches # We have to keep original patch backup extension to go thru configure without problems with tests %patch0 -p1 -b .orig %patch3 -p2 -b .chromium-types.patch %patch4 -p2 -b .gcc47.patch %patch5 -p2 -b .jemalloc-ppc.patch %patch7 -p2 -b .webrtc sed -e 's/__RH_NSPR_VERSION__/%{nspr_version}/' %{P:%%PATCH8} > version.patch %{__patch} -p1 -b --suffix .nspr --fuzz=0 < version.patch %patch9 -p1 -b .python %patch10 -p2 -b .s390-inlines # RPM specific patches %patch11 -p1 -b .pysqlite %patch12 -p1 -b .addons %patch13 -p1 -b .rhbz-966424 %patch15 -p2 -b .default %patch16 -p1 -b .python2 %patch17 -p2 -b .nss-3.15.3 # For branding specific patches. %patch100 -p1 -b .asciidel %patch102 -p2 -b .webm %patch200 -p1 -b .duckduckgo %if %{official_branding} # Required by Mozilla Corporation %else # Not yet approved by Mozilla Corporation %endif %{__rm} -f .mozconfig %{__cp} %{SOURCE10} .mozconfig %if %{official_branding} %{__cat} %{SOURCE11} >> .mozconfig #%{__cp} %{SOURCE200} python/virtualenv/ %{__cp} %{SOURCE201} python/virtualenv/ %endif %if %{?system_sqlite} echo "ac_add_options --enable-system-sqlite" >> .mozconfig %else echo "ac_add_options --disable-system-sqlite" >> .mozconfig %endif %if %{?enable_webm} echo "ac_add_options --without-system-libvpx" >> .mozconfig echo "ac_add_options --enable-webm" >> .mozconfig echo "ac_add_options --enable-webrtc" >> .mozconfig echo "ac_add_options --enable-ogg" >> .mozconfig %else echo "ac_add_options --without-system-libvpx" >> .mozconfig echo "ac_add_options --disable-webm" >> .mozconfig echo "ac_add_options --disable-webrtc" >> .mozconfig echo "ac_add_options --disable-ogg" >> .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 %{?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 # RHEL 5 mozconfig changes: echo "ac_add_options --disable-system-hunspell" >> .mozconfig echo "ac_add_options --disable-libnotify" >> .mozconfig echo "ac_add_options --enable-jemalloc" >> .mozconfig # s390(x) and ppc(64) fail to start with jemalloc enabled %ifarch s390 s390x ppc ppc64 echo "ac_add_options --disable-jemalloc" >> .mozconfig %endif # Copy pysqlite tarball to location from where it will be installed, for RHEL5 only %{__cp} %{SOURCE31} testing/mozbase/mozprofile # Debug build flags %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 # Link some python modules for Python 2.4 compatibility ln -s ../frontend/ python/mozbuild/mozbuild/backend/ #--------------------------------------------------------------------- %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} # 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 -fpermissive" | %{__sed} -e 's/-Wall//') %ifarch %{ix86} # i386 target is missing sync_bool_compare_and_swap/sync_add_and_fetch # gcc build-in functions MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-march=i386/-march=i686/') %endif %if %{?debug_build} MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-O2//') %endif %ifarch s390 MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g1/') %endif %ifarch s390 %{arm} ppc MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %endif %ifarch s390 s390x MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fno-builtin-ffs" %endif %ifarch ppc MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -static-libgcc" # This fix problem with: symbol `_restgpr_30_x' out of range MOZ_LINK_FLAGS="-lgcc_s $MOZ_LINK_FLAGS" %endif export CC=gcc44 export GCC=gcc44 export CXX=g++44 export CFLAGS=$MOZ_OPT_FLAGS export CXXFLAGS=$MOZ_OPT_FLAGS export LDFLAGS=$MOZ_LINK_FLAGS export PREFIX='%{_prefix}' export LIBDIR='%{_libdir}' # hack for brew export SHELL=/bin/sh 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 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 MOZ_APP_DIR=%{_libdir}/%{name} make -f client.mk build STRIP="/bin/true" MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS" #--------------------------------------------------------------------- %install cd %{tarballdir} %{__rm} -rf $RPM_BUILD_ROOT # set up our prefs and add it to the package manifest file, so it gets pulled in # to omni.jar which gets created during make install %{__cp} %{SOURCE12} objdir/dist/bin/browser/defaults/preferences/all-redhat.js # This sed call "replaces" firefox.js with all-redhat.js, newline, and itself (&) # having the net effect of prepending all-redhat.js above firefox.js %{__sed} -i -e\ 's|@BINPATH@/browser/@PREF_DIR@/firefox.js|@BINPATH@/browser/@PREF_DIR@/all-redhat.js\n&|' \ browser/installer/package-manifest.in # set up our default bookmarks %{__cp} -p %{SOURCE13} objdir/dist/bin/browser/defaults/profile/bookmarks.html # Make sure locale works for langpacks %{__cat} > objdir/dist/bin/browser/defaults/preferences/firefox-l10n.js << EOF pref("general.useragent.locale", "chrome://global/locale/intl.properties"); EOF # resolves bug #461880 %{__cat} > objdir/dist/bin/browser/chrome/en-US/locale/branding/browserconfig.properties << EOF browser.startup.homepage=%{homepage} EOF DESTDIR=$RPM_BUILD_ROOT make -C objdir install %{__mkdir_p} $RPM_BUILD_ROOT{%{_libdir},%{_bindir},%{_datadir}/applications} desktop-file-install --vendor mozilla \ --dir $RPM_BUILD_ROOT%{_datadir}/applications \ --add-category WebBrowser \ --add-category Network \ %{SOURCE20} # set up the firefox start script %{__rm} -rf $RPM_BUILD_ROOT%{_bindir}/firefox cp %{SOURCE21} $RPM_BUILD_ROOT%{_bindir}/firefox %{__chmod} 755 $RPM_BUILD_ROOT%{_bindir}/firefox %{__install} -p -D -m 644 %{SOURCE23} $RPM_BUILD_ROOT%{_mandir}/man1/firefox.1 %{__rm} -f $RPM_BUILD_ROOT/%{mozappdir}/firefox-config for s in 16 22 24 32 48 256; do %{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps %{__cp} -p browser/branding/official/default${s}.png \ $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps/firefox.png done echo > ../%{name}.lang %if %{build_langpacks} # Extract langpacks, make any mods needed, repack the langpack, and install it. %{__mkdir_p} $RPM_BUILD_ROOT%{langpackdir} %{__tar} xf %{SOURCE1} for langpack in `ls firefox-langpacks/*.xpi`; do language=`basename $langpack .xpi` extensionID=langpack-$language@firefox.mozilla.org %{__mkdir_p} $extensionID unzip $langpack -d $extensionID find $extensionID -type f | xargs chmod 644 sed -i -e "s|browser.startup.homepage.*$|browser.startup.homepage=%{homepage}|g;" \ $extensionID/browser/chrome/$language/locale/branding/browserconfig.properties cd $extensionID zip -r9mX ../${extensionID}.xpi * cd - %{__install} -m 644 ${extensionID}.xpi $RPM_BUILD_ROOT%{langpackdir} language=`echo $language | sed -e 's/-/_/g'` echo "%%lang($language) %{langpackdir}/${extensionID}.xpi" >> ../%{name}.lang done %{__rm} -rf firefox-langpacks %endif # build_langpacks # Keep compatibility with the old preference location. %{__mkdir_p} $RPM_BUILD_ROOT/%{mozappdir}/defaults/preferences %{__mkdir_p} $RPM_BUILD_ROOT/%{mozappdir}/browser/defaults ln -s %{mozappdir}/defaults/preferences $RPM_BUILD_ROOT/%{mozappdir}/browser/defaults/preferences # System extensions %{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/mozilla/extensions/%{firefox_app_id} %{__mkdir_p} $RPM_BUILD_ROOT%{_libdir}/mozilla/extensions/%{firefox_app_id} # Copy over the LICENSE %{__install} -p -c -m 644 LICENSE $RPM_BUILD_ROOT/%{mozappdir} # Remove tmp files #find $RPM_BUILD_ROOT/%{mozappdir}/modules -name '.mkdir.done' -exec rm -rf {} \; #--------------------------------------------------------------------- %clean %{__rm} -rf $RPM_BUILD_ROOT #--------------------------------------------------------------------- %post update-desktop-database &> /dev/null || : touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : if [ -x %{_bindir}/gtk-update-icon-cache ]; then %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : fi %postun if [ $1 -eq 0 ] ; then touch --no-create %{_datadir}/icons/hicolor &>/dev/null gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : fi update-desktop-database &> /dev/null || : %preun # is it a final removal? if [ $1 -eq 0 ]; then %{__rm} -rf %{mozappdir}/components %{__rm} -rf %{mozappdir}/extensions %{__rm} -rf %{mozappdir}/langpacks %{__rm} -rf %{mozappdir}/plugins fi %posttrans gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %files -f %{name}.lang %defattr(-,root,root,-) %{_bindir}/firefox %doc %{_mandir}/man1/* %dir %{_datadir}/mozilla/extensions/%{firefox_app_id} %dir %{_libdir}/mozilla/extensions/%{firefox_app_id} %{_datadir}/icons/hicolor/16x16/apps/firefox.png %{_datadir}/icons/hicolor/48x48/apps/firefox.png %{_datadir}/icons/hicolor/22x22/apps/firefox.png %{_datadir}/icons/hicolor/24x24/apps/firefox.png %{_datadir}/icons/hicolor/256x256/apps/firefox.png %{_datadir}/icons/hicolor/32x32/apps/firefox.png %{_datadir}/applications/mozilla-%{name}.desktop %dir %{mozappdir} %doc %{mozappdir}/LICENSE %{mozappdir}/browser/chrome %{mozappdir}/browser/chrome.manifest %dir %{mozappdir}/browser/components %{mozappdir}/browser/components/*.so %{mozappdir}/browser/components/*.manifest %attr(644, root, root) %{mozappdir}/browser/blocklist.xml %dir %{mozappdir}/browser/extensions %{mozappdir}/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd} %dir %{mozappdir}/langpacks %{mozappdir}/browser/icons %{mozappdir}/browser/searchplugins %{mozappdir}/browser/omni.ja %{mozappdir}/firefox %{mozappdir}/firefox-bin %{mozappdir}/run-mozilla.sh %{mozappdir}/application.ini %dir %{mozappdir}/defaults/preferences %{mozappdir}/browser/defaults/preferences %exclude %{mozappdir}/removed-files %{mozappdir}/webapprt-stub %dir %{mozappdir}/webapprt %{mozappdir}/webapprt/omni.ja %{mozappdir}/webapprt/webapprt.ini %{mozappdir}/chrome.manifest %dir %{mozappdir}/components %{mozappdir}/components/*.so %{mozappdir}/components/*.manifest %{mozappdir}/dictionaries %{mozappdir}/*.so %{mozappdir}/mozilla-xremote-client %{mozappdir}/omni.ja %{mozappdir}/platform.ini %{mozappdir}/plugin-container %{mozappdir}/dependentlibs.list %exclude %{mozappdir}/defaults/pref/channel-prefs.js #we don't ship firefox-devel package %exclude %{_datadir}/idl/* %exclude %{_includedir}/* %exclude %{_libdir}/%{name}-devel-*/* %if ! %{?system_nss} %{mozappdir}/libfreebl3.chk %{mozappdir}/libnssdbm3.chk %{mozappdir}/libsoftokn3.chk %endif #--------------------------------------------------------------------- %changelog * Tue Apr 22 2014 Martin Stransky <stransky@redhat.com> - 24.5.0-1 - Update to 24.5.0 ESR * Tue Apr 15 2014 Martin Stransky <stransky@redhat.com> - 24.4.0-3 - Added a workaround for Bug 1054242 - RHEVM: Extremely high memory usage in Firefox 24 ESR on RHEL 6.5 * Wed Mar 26 2014 Martin Stransky <stransky@redhat.com> - 24.4.0-2 - fixed rhbz#1067343 - Broken languagepack configuration after firefox update * Sun Mar 16 2014 Jan Horak <jhorak@redhat.com> - 24.4.0-1 - Update to 24.4.0 ESR * Thu Feb 27 2014 Martin Stransky <stransky@redhat.com> - 24.3.0-3 - Fixed rhbz#1054832 - Firefox does not support Camellia cipher * Sat Feb 1 2014 Martin Stransky <stransky@redhat.com> - 24.3.0-2 - Update to 24.3.0 ESR Build 2 * Tue Jan 7 2014 Martin Stransky <stransky@redhat.com> - 24.2.0-3 - Added workaround for rhbz#1044010 - JIT crashes, disabled baseline JIT * Fri Jan 3 2014 Martin Stransky <stransky@redhat.com> - 24.2.0-2 - Added workaround for rhbz#1044010 - JIT crashes * Fri Dec 6 2013 Jan Horak <jhorak@redhat.com> - 24.2.0-1 - Update to 24.2.0 ESR * Wed Nov 27 2013 Jan Horak <jhorak@redhat.com> - 24.1.0-2 - Update to 24.1.0 ESR * Wed Oct 23 2013 Martin Stransky <stransky@redhat.com> - 17.0.10-1 - Update to 17.0.10 ESR * Thu Sep 12 2013 Jan Horak <jhorak@redhat.com> - 17.0.9-1 - Update to 17.0.9 ESR * Tue Sep 3 2013 Martin Stransky <stransky@redhat.com> - 17.0.8-4 - Added fix for mozbz#601442 - Support the extensions.getAddons.showPane pref again in the Add-ons Manager UI, a part of rhbz#818636 fix. * Mon Sep 2 2013 Martin Stransky <stransky@redhat.com> - 17.0.8-3 - Fixed rhbz#818636 - Firefox allows install of addons, disregarding xpinstall.enabled flag set as false. * Wed Jul 31 2013 Martin Stransky <stransky@redhat.com> - 17.0.8-1 - Update to 17.0.8 ESR * Wed Jun 19 2013 Jan Horak <jhorak@redhat.com> - 17.0.7-1 - Update to 17.0.7 ESR * Fri May 10 2013 Martin Stransky <stransky@redhat.com> - 17.0.6-1 - Update to 17.0.6 ESR * Thu Apr 18 2013 Martin Stransky <stransky@redhat.com> - 17.0.5-2 - Updated Xulrunner SDK check * Fri Mar 29 2013 Jan Horak <jhorak@redhat.com> - 17.0.5-1 - Update to 17.0.5 ESR * Sat Feb 16 2013 Jan Horak <jhorak@redhat.com> - 17.0.3-1 - Update to 17.0.3 ESR * Tue Jan 15 2013 Martin Stransky <stransky@redhat.com> - 17.0.2-2 - Added NM preferences * Mon Jan 14 2013 Jan Horak <jhorak@redhat.com> - 17.0.2-1 - Update to 17.0.2 ESR * Tue Dec 4 2012 Jan Horak <jhorak@redhat.com> - 17.0.1-1 - Rebase to 17.0.1 ESR