%define nspr_version 4.7.1 %define nss_version 3.12.1.1 %define cairo_version 1.6.0 %define lcms_version 1.17 %define freetype_version 2.1.9 %define sqlite_version 3.6.7 %define homepage http://start.fedoraproject.org/ %define default_bookmarks_file %{_datadir}/bookmarks/default-bookmarks.html %define firefox_app_id \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\} %define internal_version 3.1b3 %define mozappdir %{_libdir}/firefox-%{internal_version} %define tarballdir mozilla-1.9.1 %define official_branding 1 %define build_langpacks 1 %if ! %{official_branding} %define cvsdate 20080327 %define nightly .cvs%{cvsdate} %endif Summary: Mozilla Firefox Web browser Name: firefox3 Version: 3.1 Release: 0.1.beta3%{?dist} URL: http://www.mozilla.org/projects/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Group: Applications/Internet %if %{official_branding} %define tarball firefox-%{internal_version}-source.tar.bz2 %else %define tarball firefox-3.1b3-source.tar.bz2 %endif Source0: %{tarball} %if %{build_langpacks} Source2: firefox-langpacks-%{internal_version}-20090423.tar.bz2 %endif Source12: firefox-redhat-default-prefs.js Source20: firefox3.desktop Source21: firefox3.sh.in Source22: firefox.png Source23: firefox.1 Source100: find-external-requires # build patches Patch0: xulrunner-version.patch Patch1: mozilla-build.patch Patch2: mozilla-191-path.patch Patch3: mozilla-jemalloc.patch Patch4: xulrunner-pango.patch Patch5: xulrunner-elif.patch # Fedora specific patches Patch10: mozilla-191-pkgconfig.patch # Upstream patches Patch100: mozilla-ps-pdf-simplify-operators.patch Patch101: mfsa-2009-12.patch Patch102: mfsa-2009-13.patch %if %{official_branding} # Required by Mozilla Corporation %else # Not yet approved by Mozillla Corporation %endif # --------------------------------------------------- BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) # BR from Firefox BuildRequires: zip BuildRequires: libIDL-devel BuildRequires: desktop-file-utils BuildRequires: gtk2-devel BuildRequires: gnome-vfs2-devel BuildRequires: libgnomeui-devel BuildRequires: krb5-devel BuildRequires: pango-devel BuildRequires: freetype-devel >= 2.1.9 BuildRequires: libXt-devel BuildRequires: libXrender-devel BuildRequires: system-bookmarks BuildRequires: startup-notification-devel #BuildRequires: gecko-devel-unstable = %{gecko_version} # BR from Xulrunner BuildRequires: nspr-devel >= %{nspr_version} BuildRequires: nss-devel >= %{nss_version} %if %{fedora} >= 9 BuildRequires: cairo-devel >= %{cairo_version} %endif BuildRequires: libpng-devel BuildRequires: libjpeg-devel BuildRequires: zip BuildRequires: bzip2-devel BuildRequires: zlib-devel BuildRequires: lcms-devel >= %{lcms_version} 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: hunspell-devel BuildRequires: startup-notification-devel BuildRequires: alsa-lib-devel %if %{fedora} >= 11 BuildRequires: sqlite-devel >= %{sqlite_version} %endif Requires: system-bookmarks Obsoletes: mozilla <= 37:1.7.13 Provides: webclient %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 %if %{build_langpacks} [ -f %{SOURCE2} ] || exit 1 %endif %setup -q -c cd %{tarballdir} sed -e 's/__RPM_VERSION_INTERNAL__/%{internal_version}/' %{P:%%PATCH0} \ > version.patch %{__patch} -p1 -b --suffix .version --fuzz=0 < version.patch %patch1 -p1 -b .build %patch2 -p1 -b .path %patch3 -p1 -b .jemalloc %if %{fedora} >= 11 %patch4 -p1 -b .pango %endif %patch5 -p1 -b .elif %patch10 -p1 -b .pk %patch100 -p1 -b .ps-pdf-simplify-operators %patch101 -p1 -b .mfsa-2009-12 %patch102 -p1 -b .mfsa-2009-13 %{__rm} -f .mozconfig cat <= 11 ac_add_options --enable-system-sqlite %endif %if %{fedora} >= 9 ac_add_options --enable-system-cairo %endif ac_add_options --with-pthreads ac_add_options --disable-strip ac_add_options --disable-tests ac_add_options --disable-mochitest ac_add_options --disable-tests ac_add_options --disable-installer ac_add_options --disable-debug ac_add_options --enable-optimize="\$RPM_OPT_FLAGS" ac_add_options --disable-installer ac_add_options --enable-xinerama ac_add_options --enable-default-toolkit=cairo-gtk2 ac_add_options --disable-xprint ac_add_options --disable-strip ac_add_options --enable-pango ac_add_options --enable-svg ac_add_options --enable-canvas ac_add_options --enable-startup-notification ac_add_options --disable-javaxpcom ac_add_options --disable-crashreporter ac_add_options --enable-safe-browsing #ac_add_options --enable-extensions=default,python/xpcom %if %{official_branding} ac_add_options --enable-official-branding %endif export BUILD_OFFICIAL=1 export MOZILLA_OFFICIAL=1 mk_add_options BUILD_OFFICIAL=1 mk_add_options MOZILLA_OFFICIAL=1 EOF_MOZCONFIG #--------------------------------------------------------------------- %build cd %{tarballdir} # Mozilla builds with -Wall with exception of a few warnings which show up # everywhere in the code; so, don't override that. MOZ_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | %{__sed} -e 's/-Wall//') export CFLAGS=$MOZ_OPT_FLAGS export CXXFLAGS=$MOZ_OPT_FLAGS export PREFIX='%{_prefix}' export LIBDIR='%{_libdir}' MOZ_SMP_FLAGS=-j1 %ifnarch ppc ppc64 s390 s390x [ -z "$RPM_BUILD_NCPUS" ] && \ RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" [ "$RPM_BUILD_NCPUS" -gt 1 ] && MOZ_SMP_FLAGS=-j2 %endif INTERNAL_GECKO=%{internal_version} MOZ_APP_DIR=%{_libdir}/%{name}-${INTERNAL_GECKO} export LDFLAGS="-Wl,-rpath,${MOZ_APP_DIR}" make -f client.mk build STRIP="/bin/true" MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS" #--------------------------------------------------------------------- %install %{__rm} -rf $RPM_BUILD_ROOT cd %{tarballdir} DESTDIR=$RPM_BUILD_ROOT make install %{__mkdir_p} $RPM_BUILD_ROOT{%{_libdir},%{_bindir},%{_datadir}/applications,%{_datadir}/pixmaps} %{__install} -p -D -m 644 %{SOURCE22} $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png sed -e "s/^Name=.*/Name=Firefox %{internal_version}/" \ -e "s/firefox/%{name}/" \ %{SOURCE20} | tee %{name}.desktop desktop-file-install --vendor mozilla \ --dir $RPM_BUILD_ROOT%{_datadir}/applications \ --add-category WebBrowser \ --add-category Network \ --delete-original %{name}.desktop # set up the firefox start script %{__rm} -rf $RPM_BUILD_ROOT%{_bindir}/firefox %{__cat} %{SOURCE21} | %{__sed} -e 's,FIREFOX_VERSION,%{internal_version},g' > \ $RPM_BUILD_ROOT%{_bindir}/%{name} %{__chmod} 755 $RPM_BUILD_ROOT%{_bindir}/%{name} # set up our default preferences %{__cat} %{SOURCE12} | %{__sed} \ -e 's,FIREFOX_RPM_VR,fc%{fedora},g' \ -e 's/Fedora/Remi/' > rh-default-prefs # resolves bug #461880 %{__cat} > $RPM_BUILD_ROOT/%{mozappdir}/browserconfig.properties << EOF browser.startup.homepage=%{homepage} EOF # Export correct locale %{__cat} > $RPM_BUILD_ROOT/%{mozappdir}/defaults/pref/firefox-l10n.js << EOF pref("general.useragent.locale", "chrome://global/locale/intl.properties"); EOF %{__chmod} 644 $RPM_BUILD_ROOT/%{mozappdir}/defaults/pref/firefox-l10n.js # place the preferences %{__cp} rh-default-prefs $RPM_BUILD_ROOT/%{mozappdir}/defaults/pref/all-redhat.js %{__rm} rh-default-prefs # set up our default bookmarks %{__rm} -f $RPM_BUILD_ROOT/%{mozappdir}/defaults/profile/bookmarks.html ln -s %{default_bookmarks_file} $RPM_BUILD_ROOT/%{mozappdir}/defaults/profile/bookmarks.html %{__install} -p -D -m 644 %{SOURCE23} $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1 %{__rm} -f $RPM_BUILD_ROOT/%{mozappdir}/firefox-config #cd $RPM_BUILD_ROOT/%{mozappdir}/chrome #find . -name "*" -type d -maxdepth 1 -exec %{__rm} -rf {} \; #cd - #%{__cat} > $RPM_BUILD_ROOT/%{mozappdir}/defaults/pref/firefox-l10n.js << EOF #pref("general.useragent.locale", "chrome://global/locale/intl.properties"); #EOF #%{__chmod} 644 $RPM_BUILD_ROOT/%{mozappdir}/defaults/pref/firefox-l10n.js %{__mkdir_p} $RPM_BUILD_ROOT/%{mozappdir}/chrome/icons/default/ %{__cp} other-licenses/branding/firefox/default16.png \ $RPM_BUILD_ROOT/%{mozappdir}/chrome/icons/default/ %{__cp} other-licenses/branding/firefox/default16.png \ $RPM_BUILD_ROOT/%{mozappdir}/icons/ echo > ../%{name}.lang %if %{build_langpacks} # Install langpacks %{__mkdir_p} $RPM_BUILD_ROOT/%{mozappdir}/extensions %{__tar} xjf %{SOURCE2} for langpack in `ls firefox-langpacks/*.xpi`; do language=`basename $langpack .xpi` extensiondir=$RPM_BUILD_ROOT/%{mozappdir}/extensions/langpack-$language@firefox.mozilla.org %{__mkdir_p} $extensiondir unzip $langpack -d $extensiondir find $extensiondir -type f | xargs chmod 644 tmpdir=`mktemp -d %{name}.XXXXXXXX` langtmp=$tmpdir/%{name}/langpack-$language %{__mkdir_p} $langtmp jarfile=$extensiondir/chrome/$language.jar unzip $jarfile -d $langtmp sed -i -e "s|browser.startup.homepage.*$|browser.startup.homepage=%{homepage}|g;" \ $langtmp/locale/browser-region/region.properties find $langtmp -type f | xargs chmod 644 %{__rm} -rf $jarfile cd $langtmp zip -r -D $jarfile locale cd - %{__rm} -rf $tmpdir language=`echo $language | sed -e 's/-/_/g'` extensiondir=`echo $extensiondir | sed -e "s,^$RPM_BUILD_ROOT,,"` echo "%%lang($language) $extensiondir" >> ../%{name}.lang done %{__rm} -rf firefox-langpacks %endif # build_langpacks # 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} %if 0%{?fedora} >= 7 # Use the system hunspell dictionaries %{__rm} -rf $RPM_BUILD_ROOT/%{mozappdir}/dictionaries ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{mozappdir}/dictionaries %endif # ghost files touch $RPM_BUILD_ROOT/%{mozappdir}/components/compreg.dat touch $RPM_BUILD_ROOT/%{mozappdir}/components/xpti.dat # jemalloc shows up sometimes, but it's not needed here, it's in XR #%{__rm} -f $RPM_BUILD_ROOT/%{mozappdir}/libjemalloc.so #--------------------------------------------------------------------- %clean %{__rm} -rf $RPM_BUILD_ROOT #--------------------------------------------------------------------- %post update-desktop-database &> /dev/null || : touch --no-create %{_datadir}/icons/hicolor if [ -x %{_bindir}/gtk-update-icon-cache ]; then %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : fi %postun update-desktop-database &> /dev/null || : touch --no-create %{_datadir}/icons/hicolor if [ -x %{_bindir}/gtk-update-icon-cache ]; then %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : fi %preun # is it a final removal? if [ $1 -eq 0 ]; then %{__rm} -rf %{mozappdir}/components %{__rm} -rf %{mozappdir}/extensions %{__rm} -rf %{mozappdir}/plugins fi %files -f %{name}.lang %defattr(-,root,root,-) %{_bindir}/%{name} %doc %{_mandir}/man1/%{name}* %dir %{_datadir}/mozilla/extensions/%{firefox_app_id} %dir %{_libdir}/mozilla/extensions/%{firefox_app_id} %{_datadir}/applications/mozilla-%{name}.desktop %{_datadir}/pixmaps/%{name}.png %dir %{mozappdir} %doc %{mozappdir}/LICENSE %doc %{mozappdir}/README.txt %{mozappdir}/*.properties %{mozappdir}/chrome %dir %{mozappdir}/components %ghost %{mozappdir}/components/compreg.dat %ghost %{mozappdir}/components/xpti.dat %{mozappdir}/components/*.so %{mozappdir}/components/*.xpt %attr(644, root, root) %{mozappdir}/blocklist.xml %attr(644, root, root) %{mozappdir}/components/*.js %{mozappdir}/defaults %{mozappdir}/greprefs %{mozappdir}/dictionaries %dir %{mozappdir}/extensions %{mozappdir}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd} %{mozappdir}/icons %{mozappdir}/searchplugins %{mozappdir}/firefox %{mozappdir}/firefox-bin %{mozappdir}/modules %{mozappdir}/plugins %{mozappdir}/res %{mozappdir}/*.so %{mozappdir}/mozilla-xremote-client %{mozappdir}/platform.ini %{mozappdir}/run-mozilla.sh %{mozappdir}/application.ini %{mozappdir}/.autoreg # XXX See if these are needed still %{mozappdir}/updater* %exclude %{mozappdir}/removed-files %exclude %{_includedir}/firefox-sdk-%{internal_version} %exclude %{_libdir}/firefox-sdk-%{internal_version} %exclude %{_datadir}/idl/firefox-sdk-%{internal_version} #--------------------------------------------------------------------- %changelog * Thu Apr 23 2009 Remi Collet - 3.1-0.1.beta3 - First Firefox 3.1 build from rawhide xulrunner + firefox spec