+# NOTE: PLD distributes iceweasel instead
#
# TODO:
-# - with new gcc version (it is possible that)
-# - -fvisibility=hiddenn and ac_cv_visibility_pragma=no can be removed
-# - with new firefox version (it is possible that)
-# - -fno-strict-aliasing can be removed (needs to be tested carefuly,
-# not to be fixed soon, imho)
-# - handle locales differently (runtime, since it's possible to do)
-# - see ftp://ftp.debian.org/debian/pool/main/m/mozilla-firefox/*diff*
-# for hints how to make locales and other stuff like extensions working
-# - rpm upgrade is broken. First you need uninstall Firefox 1.0.x.
+# - (12:22:58) patrys: can you also move _libdir/mozilla-firefox to just _libdir/firefox?
+# (12:23:25) patrys: it's not like we ship official firefox
+# - fix wrapper script to allow playing with profiles (must not use -remote)
#
# Conditional build:
-%bcond_with tests # enable tests (whatever they check)
-%bcond_without gnome # disable all GNOME components (gnomevfs, gnome, gnomeui)
-#
-Summary: Mozilla Firefox web browser
-Summary(pl): Mozilla Firefox - przegl±darka WWW
+%bcond_with tests # enable tests (whatever they check)
+%bcond_with gtk3 # GTK+ 3.x instead of 2.x
+%bcond_without kerberos # disable krb5 support
+%bcond_with xulrunner # system xulrunner [no longer supported]
+# - disabled shared_js - https://bugzilla.mozilla.org/show_bug.cgi?id=1039964
+%bcond_with shared_js # shared libmozjs library [broken]
+
+%if %{without xulrunner}
+# The actual sqlite version (see RHBZ#480989):
+%define sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo ERROR)
+%endif
+
+%define nspr_ver 4.10.6
+%define nss_ver 3.17.1
+
+Summary: Firefox Community Edition web browser
+Summary(pl.UTF-8): Firefox Community Edition - przeglądarka WWW
Name: mozilla-firefox
-Version: 1.5.0.5
+Version: 33.0.2
Release: 1
-License: MPL/LGPL
+License: MPL v2.0
Group: X11/Applications/Networking
-Source0: ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2
-# Source0-md5: 4ef41c8983c47c36efada10a867ffa6f
-Source1: %{name}.desktop
-Source2: %{name}.sh
-Patch0: %{name}-nss.patch
-Patch1: %{name}-lib_path.patch
-Patch2: %{name}-nss-system-nspr.patch
-Patch3: %{name}-nopangoxft.patch
-Patch4: %{name}-name.patch
-Patch5: %{name}-fonts.patch
-# UPDATE or DROP?
-#PatchX: %{name}-searchplugins.patch
+Source0: http://releases.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}.source.tar.bz2
+# Source0-md5: 385ad037451f141b68515c73cad01704
+Source3: %{name}.desktop
+Source4: %{name}.sh
+Source5: vendor.js
+Source6: vendor-ac.js
+Patch0: %{name}-branding.patch
+Patch7: %{name}-prefs.patch
+Patch9: %{name}-no-subshell.patch
+Patch11: %{name}-middle_click_paste.patch
+Patch12: %{name}-packaging.patch
+Patch13: %{name}-system-virtualenv.patch
+Patch15: %{name}-Disable-Firefox-Health-Report.patch
URL: http://www.mozilla.org/projects/firefox/
-%{?with_gnome:BuildRequires: GConf2-devel >= 1.2.1}
+BuildRequires: OpenGL-devel
+BuildRequires: alsa-lib-devel
BuildRequires: automake
-BuildRequires: cairo-devel >= 1.0.0
-%{?with_gnome:BuildRequires: gnome-vfs2-devel >= 2.0}
-BuildRequires: gtk+2-devel >= 1:2.0.0
-BuildRequires: heimdal-devel >= 0.7.1
+BuildRequires: bzip2-devel
+BuildRequires: cairo-devel >= 1.10.2-5
+BuildRequires: dbus-glib-devel >= 0.60
+BuildRequires: freetype-devel >= 1:2.1.8
+BuildRequires: gcc-c++ >= 6:4.4
+BuildRequires: glib2-devel >= 1:2.20
+BuildRequires: gstreamer-devel >= 1.0
+BuildRequires: gstreamer-plugins-base-devel >= 1.0
+%{!?with_gtk3:BuildRequires: gtk+2-devel >= 2:2.14}
+%{?with_gtk3:BuildRequires: gtk+3-devel >= 3.0.0}
+%{?with_kerberos:BuildRequires: heimdal-devel >= 0.7.1}
+BuildRequires: hunspell-devel >= 1.2.3
BuildRequires: libIDL-devel >= 0.8.0
-%{?with_gnome:BuildRequires: libgnome-devel >= 2.0}
-%{?with_gnome:BuildRequires: libgnomeui-devel >= 2.2.0}
+BuildRequires: libdnet-devel
+BuildRequires: libevent-devel >= 1.4.7
+# standalone libffi 3.0.9 or gcc's from 4.5(?)+
+BuildRequires: libffi-devel >= 6:3.0.9
+BuildRequires: libicu-devel >= 50.1
+# requires libjpeg-turbo implementing at least libjpeg 6b API
BuildRequires: libjpeg-devel >= 6b
-BuildRequires: libpng-devel >= 1.2.7
-BuildRequires: libstdc++-devel
-BuildRequires: nspr-devel >= 1:4.6.1-2
-BuildRequires: nss-devel >= 3.10.2
-BuildRequires: pango-devel >= 1:1.6.0
+BuildRequires: libjpeg-turbo-devel
+BuildRequires: libpng(APNG)-devel >= 0.10
+BuildRequires: libpng-devel >= 2:1.6.10
+BuildRequires: libstdc++-devel >= 6:4.4
+BuildRequires: libvpx-devel >= 1.3.0
+BuildRequires: nspr-devel >= 1:%{nspr_ver}
+BuildRequires: nss-devel >= 1:%{nss_ver}
+BuildRequires: pango-devel >= 1:1.22.0
+BuildRequires: pixman-devel >= 0.19.2
BuildRequires: perl-modules >= 5.004
BuildRequires: pkgconfig
+BuildRequires: pkgconfig(libffi) >= 3.0.9
+BuildRequires: pulseaudio-devel
+BuildRequires: python-modules >= 1:2.5
+BuildRequires: python-virtualenv >= 1.9.1-4
+BuildRequires: readline-devel
+BuildRequires: rpm >= 4.4.9-56
+BuildRequires: rpmbuild(macros) >= 1.601
+BuildRequires: sqlite3-devel >= 3.8.5
+BuildRequires: startup-notification-devel >= 0.8
+BuildRequires: xorg-lib-libXScrnSaver-devel
BuildRequires: xorg-lib-libXext-devel
-BuildRequires: xorg-lib-libXft-devel >= 2.1
BuildRequires: xorg-lib-libXinerama-devel
-BuildRequires: xorg-lib-libXp-devel
BuildRequires: xorg-lib-libXt-devel
+%if %{with xulrunner}
+BuildRequires: xulrunner-devel >= 2:%{version}
+%endif
BuildRequires: zip
BuildRequires: zlib-devel >= 1.2.3
-Requires: %{name}-lang-resources = %{version}
-Requires: nspr >= 1:4.6.1-2
-Requires: nss >= 1:3.10.2
+Requires(post): mktemp >= 1.5-18
+Requires: desktop-file-utils
+Requires: hicolor-icon-theme
+%if %{with xulrunner}
+%requires_eq_to xulrunner xulrunner-devel
+%else
+Requires: browser-plugins >= 2.0
+Requires: cairo >= 1.10.2-5
+Requires: dbus-glib >= 0.60
+Requires: glib2 >= 1:2.20
+%{!?with_gtk3:Requires: gtk+2 >= 2:2.14}
+%{?with_gtk3:Requires: gtk+3 >= 3.0.0}
+Requires: libjpeg-turbo
+Requires: libpng >= 2:1.6.10
+Requires: libpng(APNG) >= 0.10
+Requires: libvpx >= 1.3.0
+Requires: myspell-common
+Requires: nspr >= 1:%{nspr_ver}
+Requires: nss >= 1:%{nss_ver}
+Requires: pango >= 1:1.22.0
+Requires: sqlite3 >= %{sqlite_build_version}
+Requires: startup-notification >= 0.8
+%endif
Provides: wwwbrowser
Obsoletes: mozilla-firebird
+Obsoletes: mozilla-firefox-lang-en < 2.0.0.8-3
+Obsoletes: mozilla-firefox-libs
+Conflicts: mozilla-firefox-lang-resources < %{version}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define _firefoxdir %{_libdir}/%{name}
-# mozilla and firefox provide their own versions
-%define _noautoreqdep libgkgfx.so libgtkembedmoz.so libgtkxtbin.so libjsj.so libmozjs.so libxpcom.so libxpcom_compat.so
+%define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
-%define specflags -fno-strict-aliasing
+# don't satisfy other packages (don't use %{name} here)
+%define _noautoprovfiles %{_libdir}/mozilla-firefox
+%if %{without xulrunner}
+# and as we don't provide them, don't require either
+%define _noautoreq libmozalloc.so libmozjs.so libxpcom.so libxul.so
+%endif
%description
-Mozilla Firefox is an open-source web browser, designed for standards
-compliance, performance and portability.
-
-%description -l pl
-Mozilla Firefox jest open sourcow± przegl±dark± sieci WWW, stworzon± z
-my¶l± o zgodno¶ci ze standardami, wydajno¶ci± i przeno¶no¶ci±.
-
-%package devel
-Summary: Headers for developing programs that will use Mozilla Firefox
-Summary(pl): Mozilla Firefox - pliki nag³ówkowe
-Group: X11/Development/Libraries
-Requires: %{name} = %{epoch}:%{version}-%{release}
-Requires: nspr-devel >= 1:4.6.1-2
-Obsoletes: mozilla-devel
-
-%description devel
-Mozilla Firefox development package.
-
-%description devel -l pl
-Pliki nag³ówkowe przegl±darki Mozilla Firefox.
-
-%package lang-en
-Summary: English resources for Mozilla Firefox
-Summary(pl): Anglojêzyczne zasoby dla przegl±darki Mozilla Firefox
-Group: X11/Applications/Networking
-Requires(post,postun): %{name} = %{version}-%{release}
-Requires(post,postun): textutils
-Requires: %{name} = %{version}-%{release}
-Provides: %{name}-lang-resources = %{version}-%{release}
-
-%description lang-en
-English resources for Mozilla Firefox.
+Firefox Community Edition is an open-source web browser, designed for
+standards compliance, performance and portability.
-%description lang-en -l pl
-Anglojêzyczne zasoby dla przegl±darki Mozilla Firefox.
+%description -l pl.UTF-8
+Firefox Community Edition jest przeglądarką WWW rozpowszechnianą
+zgodnie z ideami ruchu otwartego oprogramowania oraz tworzoną z myślą
+o zgodności ze standardami, wydajnością i przenośnością.
%prep
-%setup -q -n mozilla
-%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
+%setup -qc
+mv -f mozilla-release mozilla
+cd mozilla
-sed -i 's/\(-lgss\)\(\W\)/\1disable\2/' configure
+%patch0 -p1
+%patch7 -p1
+%patch9 -p2
+%patch11 -p2
+%patch12 -p2
+%patch13 -p2
+%patch15 -p1
%build
-rm -f .mozconfig
-export CFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
-export CXXFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
-
-cp -f %{_datadir}/automake/config.* build/autoconf
-cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
-cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf
+cd mozilla
+cp -pf %{_datadir}/automake/config.* build/autoconf
-LIBIDL_CONFIG="%{_bindir}/libIDL-config-2"; export LIBIDL_CONFIG
+cat << 'EOF' > .mozconfig
+. $topsrcdir/browser/config/mozconfig
-cat << EOF > .mozconfig
-. \$topsrcdir/browser/config/mozconfig
-
-export BUILD_OFFICIAL=1
-export MOZILLA_OFFICIAL=1
-mk_add_options BUILD_OFFICIAL=1
-mk_add_options MOZILLA_OFFICIAL=1
+mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-%{_target_cpu}
+# Options for 'configure' (same as command-line options).
+ac_add_options --build=%{_target_platform}
+ac_add_options --host=%{_target_platform}
ac_add_options --prefix=%{_prefix}
ac_add_options --exec-prefix=%{_exec_prefix}
ac_add_options --bindir=%{_bindir}
ac_add_options --sharedstatedir=%{_sharedstatedir}
ac_add_options --mandir=%{_mandir}
ac_add_options --infodir=%{_infodir}
-ac_add_options --enable-optimize="%{rpmcflags}"
%if %{?debug:1}0
+ac_add_options --disable-optimize
ac_add_options --enable-debug
ac_add_options --enable-debug-modules
+ac_add_options --enable-debugger-info-modules
+ac_add_options --enable-crash-on-assert
%else
ac_add_options --disable-debug
ac_add_options --disable-debug-modules
+ac_add_options --disable-logging
+ac_add_options --enable-optimize="%{rpmcflags} -Os"
%endif
+ac_add_options --disable-strip
+ac_add_options --disable-strip-libs
+ac_add_options --disable-install-strip
%if %{with tests}
ac_add_options --enable-tests
+ac_add_options --enable-mochitest
%else
ac_add_options --disable-tests
+ac_add_options --disable-mochitest
%endif
-ac_add_options --disable-composer
-ac_add_options --disable-dtd-debug
-ac_add_options --disable-freetype2
+ac_add_options --disable-cpp-exceptions
+ac_add_options --disable-crashreporter
+ac_add_options --disable-elf-dynstr-gc
+ac_add_options --disable-gconf
+ac_add_options --disable-gnomeui
+ac_add_options --disable-gnomevfs
ac_add_options --disable-installer
-ac_add_options --disable-jsd
-ac_add_options --disable-ldap
-ac_add_options --disable-mailnews
-ac_add_options --disable-profilesharing
-ac_add_options --disable-xprint
+ac_add_options --disable-javaxpcom
+ac_add_options --disable-long-long-warning
+ac_add_options --disable-necko-wifi
+ac_add_options --disable-pedantic
+ac_add_options --disable-updater
+ac_add_options --disable-xterm-updates
ac_add_options --enable-canvas
-ac_add_options --enable-crypto
-ac_add_options --enable-default-toolkit=gtk2
+ac_add_options --enable-chrome-format=omni
+ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
+ac_add_options --enable-extensions=default
+ac_add_options --enable-gio
+ac_add_options --enable-gstreamer=1.0
+ac_add_options --enable-libxul
ac_add_options --enable-mathml
ac_add_options --enable-pango
-ac_add_options --enable-reorder
-ac_add_options --enable-single-profile
-ac_add_options --enable-strip
-ac_add_options --enable-strip-libs
+ac_add_options --enable-readline
+ac_add_options --enable-safe-browsing
+%{?with_shared_js:ac_add_options --enable-shared-js}
+ac_add_options --enable-startup-notification
ac_add_options --enable-svg
ac_add_options --enable-system-cairo
-ac_add_options --enable-xft
+ac_add_options --enable-system-ffi
+ac_add_options --enable-system-hunspell
+ac_add_options --enable-system-sqlite
+ac_add_options --enable-url-classifier
ac_add_options --enable-xinerama
-ac_add_options --enable-xpctools
+ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
+ac_add_options --with-distribution-id=org.pld-linux
+%if %{with xulrunner}
+ac_add_options --with-libxul-sdk=$(pkg-config --variable=sdkdir libxul)
+%endif
ac_add_options --with-pthreads
+ac_add_options --with-system-bz2
ac_add_options --with-system-jpeg
+ac_add_options --with-system-libevent
+ac_add_options --with-system-libvpx
ac_add_options --with-system-nspr
+ac_add_options --with-system-nss
+ac_add_options --with-system-ply
ac_add_options --with-system-png
ac_add_options --with-system-zlib
-ac_cv_visibility_pragma=no
+ac_add_options --with-system-icu
+ac_add_options --with-x
EOF
%{__make} -j1 -f client.mk build \
CC="%{__cc}" \
- CXX="%{__cxx}"
+ CXX="%{__cxx}" \
+ MOZ_MAKE_FLAGS="%{_smp_mflags}"
%install
rm -rf $RPM_BUILD_ROOT
+cd mozilla
install -d \
- $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}{,extensions}} \
- $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
- $RPM_BUILD_ROOT{%{_includedir}/%{name}/idl,%{_pkgconfigdir}}
-# extensions dir is needed (it can be empty)
-
-ln -s mozilla-firefox $RPM_BUILD_ROOT%{_bindir}/firefox
-
-%{__make} -C xpinstall/packager \
- MOZ_PKG_APPNAME="mozilla-firefox" \
- MOZILLA_BIN="\$(DIST)/bin/firefox-bin" \
- EXCLUDE_NSPR_LIBS=1
-
-sed 's,@LIBDIR@,%{_libdir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
+ $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}} \
+ $RPM_BUILD_ROOT%{_desktopdir} \
+ $RPM_BUILD_ROOT%{_datadir}/%{name}/browser \
+ $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/plugins
-tar -xvz -C $RPM_BUILD_ROOT%{_libdir} -f dist/mozilla-firefox-*linux*.tar.gz
+%browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/browser/plugins
-install other-licenses/branding/firefox/content/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png
-#install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/
-#install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/US/
+%{__make} -C obj-%{_target_cpu}/browser/installer stage-package \
+ DESTDIR=$RPM_BUILD_ROOT \
+ installdir=%{_libdir}/%{name} \
+ PKG_SKIP_STRIP=1
-install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
+cp -a obj-%{_target_cpu}/dist/firefox/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
-rm -rf US classic comm embed-sample en-{US,mac,unix,win} modern pipnss pippki
-rm -f en-win.jar en-mac.jar embed-sample.jar modern.jar
+%if %{with xulrunner}
+# >= 5.0 seems to require this
+ln -s ../xulrunner $RPM_BUILD_ROOT%{_libdir}/%{name}/xulrunner
+%endif
-# header/developement files
-cp -rfL dist/include/* $RPM_BUILD_ROOT%{_includedir}/%{name}
-cp -rfL dist/idl/* $RPM_BUILD_ROOT%{_includedir}/%{name}/idl
+# move arch independant ones to datadir
+mv $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/chrome
+mv $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/extensions $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/extensions
+mv $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/icons $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/icons
+mv $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/searchplugins $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/searchplugins
+%if %{without xulrunner}
+mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/defaults
+mv $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/defaults/{pref,preferences}
+%else
+mv $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/defaults
+%endif
-install dist/bin/regxpcom $RPM_BUILD_ROOT%{_bindir}
-install dist/bin/xpidl $RPM_BUILD_ROOT%{_bindir}
-install dist/bin/xpt_dump $RPM_BUILD_ROOT%{_bindir}
-install dist/bin/xpt_link $RPM_BUILD_ROOT%{_bindir}
+ln -s ../../../share/%{name}/browser/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/chrome
+ln -s ../../../share/%{name}/browser/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/defaults
+ln -s ../../../share/%{name}/browser/extensions $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/extensions
+ln -s ../../../share/%{name}/browser/icons $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/icons
+ln -s ../../../share/%{name}/browser/searchplugins $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/searchplugins
-ln -sf %{_includedir}/mozilla-firefox/necko/nsIURI.h \
- $RPM_BUILD_ROOT%{_includedir}/mozilla-firefox/nsIURI.h
+%if %{without xulrunner}
+%{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
+ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
+%endif
-# CA certificates
-ln -s %{_libdir}/libnssckbi.so $RPM_BUILD_ROOT%{_firefoxdir}/libnssckbi.so
+sed 's,@LIBDIR@,%{_libdir},' %{SOURCE4} > $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
+chmod 755 $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
+ln -s mozilla-firefox $RPM_BUILD_ROOT%{_bindir}/firefox
-# pkgconfig files
-for f in build/unix/*.pc ; do
- sed -e 's/firefox-%{version}/mozilla-firefox/' $f \
- > $RPM_BUILD_ROOT%{_pkgconfigdir}/$(basename $f)
+# install icons and desktop file
+for i in 48 64; do
+ install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps
+ cp -a browser/branding/unofficial/content/icon${i}.png \
+ $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps/mozilla-firefox.png
done
-# already provided by standalone packages
-rm -f $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-{nss,nspr}.pc
+cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
-sed -i -e 's#firefox-nspr =.*#mozilla-nspr#g' -e 's#irefox-nss =.*#mozilla-nss#g' \
- $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
+# install our settings
+%if "%{pld_release}" == "ac"
+cp -a %{SOURCE6} $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/defaults/preferences/vendor.js
+%else
+cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/%{name}/browser/defaults/preferences/vendor.js
+%endif
-# includedir/dom CFLAGS
-sed -i -e '/Cflags:/{/{includedir}\/dom/!s,$, -I${includedir}/dom,}' \
- $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-plugin.pc
+# files created by firefox -register
+touch $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/components/compreg.dat
+touch $RPM_BUILD_ROOT%{_libdir}/%{name}/browser/components/xpti.dat
-cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/firefox-chrome+xpcom-generate
+cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/%{name}-chrome+xpcom-generate
#!/bin/sh
umask 022
-rm -f %{_firefoxdir}/chrome/{chrome.rdf,overlayinfo/*/*/*.rdf}
-rm -f %{_firefoxdir}/components/{compreg,xpti}.dat
-MOZILLA_FIVE_HOME=%{_firefoxdir}
-export MOZILLA_FIVE_HOME
+rm -f %{_libdir}/%{name}/browser/components/{compreg,xpti}.dat
-# PATH
-PATH=%{_firefoxdir}:$PATH
-export PATH
+# it attempts to touch files in $HOME/.mozilla
+# beware if you run this with sudo!!!
+export HOME=$(mktemp -d)
+# also TMPDIR could be pointing to sudo user's homedir
+unset TMPDIR TMP || :
-# added /usr/lib : don't load your local library
-LD_LIBRARY_PATH=%{_firefoxdir}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
-export LD_LIBRARY_PATH
+%{_libdir}/%{name}/firefox -register
-unset TMPDIR TMP || :
-MOZILLA_FIVE_HOME=%{_firefoxdir} %{_firefoxdir}/regxpcom
-MOZILLA_FIVE_HOME=%{_firefoxdir} %{_firefoxdir}/firefox -register
+rm -rf $HOME
EOF
+chmod 755 $RPM_BUILD_ROOT%{_sbindir}/%{name}-chrome+xpcom-generate
%clean
rm -rf $RPM_BUILD_ROOT
+%pretrans
+if [ -d %{_libdir}/%{name}/browser/extensions ] && [ ! -L %{_libdir}/%{name}/browser/extensions ]; then
+ install -d %{_datadir}/%{name}/browser
+ if [ -e %{_datadir}/%{name}/browser/extensions ]; then
+ mv %{_datadir}/%{name}/browser/extensions{,.rpmsave}
+ fi
+ mv -v %{_libdir}/%{name}/browser/extensions %{_datadir}/%{name}/browser/extensions
+fi
+if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
+ mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
+fi
+exit 0
+
%post
-%{_sbindir}/firefox-chrome+xpcom-generate
+%{_sbindir}/%{name}-chrome+xpcom-generate
+%update_browser_plugins
+%update_icon_cache hicolor
+%update_desktop_database
%postun
-if [ "$1" = "0" ]; then
- rm -rf %{_firefoxdir}/chrome/overlayinfo
- rm -f %{_firefoxdir}/chrome/*.rdf
- rm -rf %{_firefoxdir}/components
- rm -rf %{_firefoxdir}/extensions
+if [ "$1" = 0 ]; then
+ %update_browser_plugins
+ %update_icon_cache hicolor
fi
-%triggerpostun -- %{name} < 1.5
-%banner %{name} -e <<EOF
-NOTICE:
-If you have problem with upgrade from old mozilla-firefox 1.0.x,
-you should remove it first and reinstall %{name}-%{version}
-EOF
-
%files
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/mozilla*
+%attr(755,root,root) %{_bindir}/%{name}
%attr(755,root,root) %{_bindir}/firefox
-%attr(755,root,root) %{_sbindir}/*
-%dir %{_firefoxdir}
-%{_firefoxdir}/res
-%dir %{_firefoxdir}/components
-%attr(755,root,root) %{_firefoxdir}/components/*.so
-%{_firefoxdir}/components/*.js
-%{_firefoxdir}/components/*.xpt
-%dir %{_firefoxdir}/plugins
-%attr(755,root,root) %{_firefoxdir}/plugins/*.so
-%{_firefoxdir}/searchplugins
-%{_firefoxdir}/icons
-%{_firefoxdir}/defaults
-%{_firefoxdir}/greprefs
-%dir %{_firefoxdir}/extensions
-%dir %{_firefoxdir}/init.d
-%attr(755,root,root) %{_firefoxdir}/*.so
-%attr(755,root,root) %{_firefoxdir}/*.sh
-%attr(755,root,root) %{_firefoxdir}/m*
-%attr(755,root,root) %{_firefoxdir}/f*
-%attr(755,root,root) %{_firefoxdir}/reg*
-%attr(755,root,root) %{_firefoxdir}/x*
-%{_pixmapsdir}/*
-%{_desktopdir}/*
-
-%dir %{_firefoxdir}/chrome
-%{_firefoxdir}/chrome/*.jar
-%{_firefoxdir}/chrome/*.manifest
-# -chat subpackage?
-#%{_firefoxdir}/chrome/chatzilla.jar
-#%{_firefoxdir}/chrome/content-packs.jar
-%dir %{_firefoxdir}/chrome/icons
-%{_firefoxdir}/chrome/icons/default
-
-# -dom-inspector subpackage?
-%dir %{_firefoxdir}/extensions/inspector@mozilla.org
-%{_firefoxdir}/extensions/inspector@mozilla.org/*
-
-%files devel
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/regxpcom
-%attr(755,root,root) %{_bindir}/xpidl
-%attr(755,root,root) %{_bindir}/xpt_dump
-%attr(755,root,root) %{_bindir}/xpt_link
-%{_includedir}/%{name}
-%{_pkgconfigdir}/*
-
-%files lang-en
-%defattr(644,root,root,755)
-%{_firefoxdir}/chrome/en-US.jar
-%{_firefoxdir}/chrome/en-US.manifest
+%attr(755,root,root) %{_sbindir}/%{name}-chrome+xpcom-generate
+
+%{_desktopdir}/mozilla-firefox.desktop
+%{_iconsdir}/hicolor/*/apps/mozilla-firefox.png
+
+# browser plugins v2
+%{_browserpluginsconfdir}/browsers.d/%{name}.*
+%config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
+
+%dir %{_libdir}/%{name}
+%dir %{_libdir}/%{name}/browser
+%dir %{_libdir}/%{name}/browser/components
+%dir %{_libdir}/%{name}/browser/plugins
+
+%dir %{_datadir}/%{name}
+%dir %{_datadir}/%{name}/browser
+%dir %{_datadir}/%{name}/browser/extensions
+%{_datadir}/%{name}/browser/chrome
+%{_datadir}/%{name}/browser/defaults
+%{_datadir}/%{name}/browser/icons
+%{_datadir}/%{name}/browser/searchplugins
+
+# symlinks
+%{_libdir}/%{name}/browser/extensions
+%{_libdir}/%{name}/browser/chrome
+%{_libdir}/%{name}/browser/icons
+%{_libdir}/%{name}/browser/searchplugins
+%if %{with xulrunner}
+%{_libdir}/%{name}/xulrunner
+%endif
+%{_libdir}/%{name}/browser/defaults
+
+%attr(755,root,root) %{_libdir}/%{name}/firefox
+%attr(755,root,root) %{_libdir}/%{name}/firefox-bin
+%attr(755,root,root) %{_libdir}/%{name}/run-mozilla.sh
+%{_libdir}/%{name}/application.ini
+%{_libdir}/%{name}/browser/blocklist.xml
+%{_libdir}/%{name}/browser/chrome.manifest
+%{_libdir}/%{name}/browser/components/components.manifest
+%attr(755,root,root) %{_libdir}/%{name}/browser/components/libbrowsercomps.so
+# the signature of the default theme
+%{_datadir}/%{name}/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
+%{_libdir}/%{name}/browser/omni.ja
+%{_libdir}/%{name}/webapprt
+%attr(755,root,root) %{_libdir}/%{name}/webapprt-stub
+
+# files created by firefox -register
+%ghost %{_libdir}/%{name}/browser/components/compreg.dat
+%ghost %{_libdir}/%{name}/browser/components/xpti.dat
+
+%if %{without xulrunner}
+# private xulrunner instance
+%{_libdir}/%{name}/dependentlibs.list
+%{_libdir}/%{name}/platform.ini
+%dir %{_libdir}/%{name}/components
+%{_libdir}/%{name}/components/components.manifest
+%attr(755,root,root) %{_libdir}/%{name}/components/libdbusservice.so
+%attr(755,root,root) %{_libdir}/%{name}/components/libmozgnome.so
+%attr(755,root,root) %{_libdir}/%{name}/libmozalloc.so
+%{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
+%attr(755,root,root) %{_libdir}/%{name}/libxul.so
+%attr(755,root,root) %{_libdir}/%{name}/mozilla-xremote-client
+%attr(755,root,root) %{_libdir}/%{name}/plugin-container
+%{_libdir}/%{name}/dictionaries
+%{_libdir}/%{name}/chrome.manifest
+%{_libdir}/%{name}/omni.ja
+%endif