Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 122360b96cf140a59d8fde9681ba9945 > files > 24

firefox-38.2.1-1.el5_11.src.rpm

# No longer supported (rhbz#1214863, rhbz#1214865)
ExcludeArch: ppc ia64

# Use system sqlite?
%define system_sqlite           0
%define system_ffi              0

# Use system nss/nspr?
%define system_nss              1

# Disable webm
%define enable_webm             1

# Use system cairo?
%define system_cairo            0

# Build as a debug package?
%define debug_build             0

%define python_version          2.7.8

%define use_bundled_gcc         1
%define gcc_version             4.8.2-16


%define _default_patch_fuzz 2

# Minimal required versions
%if %{?system_nss}
%global nspr_version 4.10.8
%global nss_version 3.18.0
%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.8.4.2
# 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-esr38
%define ext_version esr 
%endif

Summary:        Mozilla Firefox Web browser
Name:           firefox
Version:        38.2.1
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}
Source2:        firefox-langpacks-%{version}%{?ext_version}-20150826.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
Source24:       mozilla-api-key
Source100:      find-external-requires
Source200:      https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz
Source300:      gcc48-%{gcc_version}.el5.src.rpm
Source301:      yasm-1.2.0.tar.gz

# Build patches
Patch0:         firefox-install-dir.patch
Patch5:         xulrunner-24.0-jemalloc-ppc.patch
Patch8:         xulrunner-nspr-version.patch
Patch17:        build-no-format.patch
Patch18:        mozilla-1005535.patch
Patch21:        firefox-nss-build.patch
Patch22:        build-nspr-prbool.patch
Patch23:        build-gtk2-2.10.patch
Patch25:        missing-gnu-build-id.patch
Patch26:        firefox-rt-tgsigqueueinfo.patch
Patch28:        firefox-nss-3.18.0.patch
Patch29:        firefox-debug.patch

# RHEL patches
Patch111:       firefox-default.patch
Patch112:       firefox-enable-addons.patch
Patch113:       rhbz-966424.patch
Patch116:       firefox-enable-plugins.patch
Patch117:       rhbz-1173156.patch
Patch118:       firefox-duckduckgo.patch
Patch119:       rhbz-1150082.patch

# Upstream patches
Patch200:       mozilla-1152515.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 %{?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:  alsa-lib-devel
BuildRequires:  libnotify-devel
BuildRequires:  autoconf213
BuildRequires:  mesa-libGL-devel
BuildRequires:  python-simplejson
BuildRequires:  desktop-file-utils
BuildRequires:  binutils220
BuildRequires:  xorg-x11-proto-devel
BuildRequires:  libXcomposite-devel
BuildRequires:  libXdamage-devel

BuildRequires:  autoconf213
Obsoletes:      mozilla <= 37:1.7.13
Obsoletes:      firefox < 38.0
Conflicts:      firefox < 38.0
Provides:       webclient

# Because of Python 2.7 build
BuildRequires:  openssl-devel


# GCC 4.8 BuildRequires
# ==================================================================================
%if %{use_bundled_gcc}

%ifarch s390x
%global multilib_32_arch s390
%endif
%ifarch sparc64
%global multilib_32_arch sparcv9
%endif
%ifarch ppc64
%global multilib_32_arch ppc
%endif
%ifarch x86_64
%if 0%{?rhel} >= 6
%global multilib_32_arch i686
%else
%global multilib_32_arch i386
%endif
%endif

%global multilib_64_archs sparc64 ppc64 s390x x86_64

%if 0%{?rhel} >= 6
# Need binutils which support --build-id >= 2.17.50.0.17-3
# Need binutils which support %gnu_unique_object >= 2.19.51.0.14
# Need binutils which support .cfi_sections >= 2.19.51.0.14-33
BuildRequires: binutils >= 2.19.51.0.14-33
# While gcc doesn't include statically linked binaries, during testing
# -static is used several times.
BuildRequires: glibc-static
%else
# Don't have binutils which support --build-id >= 2.17.50.0.17-3
# Don't have binutils which support %gnu_unique_object >= 2.19.51.0.14
# Don't have binutils which  support .cfi_sections >= 2.19.51.0.14-33
BuildRequires: binutils >= 2.17.50.0.2-8
%endif
BuildRequires: zlib-devel, gettext, dejagnu, bison, flex, texinfo, sharutils
BuildRequires: /usr/bin/pod2man
%if 0%{?rhel} >= 7
BuildRequires: texinfo-tex
%endif
#BuildRequires: systemtap-sdt-devel >= 1.3
# For VTA guality testing
BuildRequires: gdb
# Make sure pthread.h doesn't contain __thread tokens
# Make sure glibc supports stack protector
# Make sure glibc supports DT_GNU_HASH
BuildRequires: glibc-devel >= 2.4.90-13
%if 0%{?rhel} >= 6
BuildRequires: elfutils-devel >= 0.147
BuildRequires: elfutils-libelf-devel >= 0.147
%else
BuildRequires: elfutils-devel >= 0.72
%endif
%ifarch ppc ppc64 s390 s390x sparc sparcv9 alpha
# Make sure glibc supports TFmode long double
BuildRequires: glibc >= 2.3.90-35
%endif
%ifarch %{multilib_64_archs} sparcv9 ppc
# Ensure glibc{,-devel} is installed for both multilib arches
BuildRequires: /lib/libc.so.6 /usr/lib/libc.so /lib64/libc.so.6 /usr/lib64/libc.so
%endif
%ifarch ia64
BuildRequires: libunwind >= 0.98
%endif
# Need .eh_frame ld optimizations
# Need proper visibility support
# Need -pie support
# Need --as-needed/--no-as-needed support
# On ppc64, need omit dot symbols support and --non-overlapping-opd
# Need binutils that owns /usr/bin/c++filt
# Need binutils that support .weakref
# Need binutils that supports --hash-style=gnu
# Need binutils that support mffgpr/mftgpr
#%if 0%{?rhel} >= 6
## Need binutils which support --build-id >= 2.17.50.0.17-3
## Need binutils which support %gnu_unique_object >= 2.19.51.0.14
## Need binutils which support .cfi_sections >= 2.19.51.0.14-33
#Requires: binutils >= 2.19.51.0.14-33
#%else
## Don't have binutils which support --build-id >= 2.17.50.0.17-3
## Don't have binutils which support %gnu_unique_object >= 2.19.51.0.14
## Don't have binutils which  support .cfi_sections >= 2.19.51.0.14-33
#Requires: binutils >= 2.17.50.0.2-8
#%endif
## Make sure gdb will understand DW_FORM_strp
#Conflicts: gdb < 5.1-2
#Requires: glibc-devel >= 2.2.90-12
#%ifarch ppc ppc64 s390 s390x sparc sparcv9 alpha
## Make sure glibc supports TFmode long double
#Requires: glibc >= 2.3.90-35
#%endif
#Requires: libgcc >= 4.1.2-43
#Requires: libgomp >= 4.4.4-13
#%if 0%{?rhel} == 6
#Requires: libstdc++ >= 4.4.4-13
#%else
#Requires: libstdc++ = 4.1.2
#%endif
##FIXME gcc version
#Requires: libstdc++-devel = %{version}-%{release}
BuildRequires: gmp-devel >= 4.1.2-8
%if 0%{?rhel} >= 6
BuildRequires: mpfr-devel >= 2.2.1
%endif
%if 0%{?rhel} >= 7
BuildRequires: libmpc-devel >= 0.8.1
%endif

%endif # bundled gcc BuildRequires
# ==================================================================================

#---------------------------------------------------------------------
# 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
%patch5 -p1 -b .jemalloc-ppc.patch
sed -e 's/__RH_NSPR_VERSION__/%{nspr_version}/' %{P:%%PATCH8} > version.patch
%{__patch} -p1 -b --suffix .nspr --fuzz=0 < version.patch
%patch17 -p1 -b .no-format
%patch18 -p1 -b .mozilla-1005535
%patch21 -p2 -b .nss-build
%patch22 -p1 -b .prbool
%patch23 -p1 -b .build-gtk2-2.10
%patch25 -p1 -b .missing-build-id
%patch26 -p1 -b .rt-tgsigqueueinfo
%patch28 -p1 -b .nss-3.18.0
%if %{?debug_build}
%ifnarch %{ix86} x86_64
%patch29 -p1 -b .debug
%endif
%endif

# RHEL patches
%patch111 -p1 -b .default
%patch112 -p1 -b .addons
%patch113 -p1 -b .rhbz-966424
%patch116 -p2 -b .plugins
%patch117 -p2 -b .rhbz-1173156
%patch118 -p1 -b .duckduckgo
%patch119 -p1 -b .rhbz-1150082

# For branding specific patches.

# Upstream patches
%patch200 -p1 -b .mozbz-1152515

%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
%endif
%{__cp} %{SOURCE24} mozilla-api-key

%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
echo "ac_add_options --disable-opus" >> .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

# FIXME - still required?? s390(x) and ppc(64) fail to start with jemalloc enabled
%ifarch s390 s390x ppc ppc64
echo "ac_add_options --disable-jemalloc" >> .mozconfig
%endif
# 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
%endif
# FIXME: Still required -Os?
%ifarch ppc
echo 'ac_add_options --enable-optimize="-Os"' >> .mozconfig
%else
echo "ac_add_options --enable-optimize" >> .mozconfig
%endif
%if 0%{?rhel} >= 6
echo "ac_add_options --with-system-jpeg" >> .mozconfig
%endif
%if 0%{?rhel} <= 5
echo "ac_add_options --disable-gio" >> .mozconfig
echo "ac_add_options --disable-pulseaudio" >> .mozconfig
%endif
# Prepare Python 2.7 sources
tar xf %{SOURCE200} 


#---------------------------------------------------------------------

%build
cd %{tarballdir}

# Build Python 2.7 and set environment
BUILD_DIR=`pwd`/python_build
cd Python-%{python_version}
./configure --prefix=$BUILD_DIR --exec-prefix=$BUILD_DIR
make
make install
cd -
PATH=$BUILD_DIR/bin:$PATH
export PATH

#Install local YASM
tar xf %{SOURCE301}
pushd yasm-1.2.0
./configure
make %{?_smp_mflags}
PATH=`pwd`:$PATH
popd

#Install local GCC if needed
%if %{use_bundled_gcc}
GCC_FILE="gcc48-%{gcc_version}*.rpm"
GCC_PATH="%{_rpmdir}"

rpmbuild --nodeps --rebuild %{SOURCE300}
cd %{_rpmdir}
if [ ! -f $GCC_PATH/$GCC_FILE ]; then
    GCC_PATH="$GCC_PATH/%{_arch}"
fi
rpm2cpio $GCC_PATH/$GCC_FILE | cpio -iduv
# Clean gcc48 rpms to avoid including them to package
rm -f gcc48-*.rpm
cd -
PATH=%{_rpmdir}/usr/bin:$PATH
export PATH
export CXX=g++
%endif  # bundled gcc

# Set up binutils220 for new assembler
PATH=/usr/libexec/binutils220/:$PATH
export PATH

%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

# 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 -fpermissive -gdwarf-2" | %{__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
# -Werror=format-security causes build failures when -Wno-format is explicitly given
# for some sources
MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -Wformat-security -Wformat -Werror=format-security"

%ifarch s390
MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g1/')
%endif
MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-O2/-Os/')
%ifarch s390 %{arm} ppc x86_64
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"
MOZ_LINK_FLAGS="-lgcc_s -lgcc $MOZ_LINK_FLAGS"
%endif

export CFLAGS=`echo $MOZ_OPT_FLAGS |sed -e 's/-fpermissive//'`
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}

# Set PYTHON PATH to directory which contains libraries used for backport to Python 2.6
export PYTHONPATH=`pwd`/rebase

%{__rm} -rf $RPM_BUILD_ROOT

# 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 %{SOURCE2}
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

  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

# Install langpack workaround (see #707100, #821169)
function create_default_langpack() {
language_long=$1
language_short=$2
cd $RPM_BUILD_ROOT%{langpackdir}
ln -s langpack-$language_long@firefox.mozilla.org.xpi langpack-$language_short@firefox.mozilla.org.xpi
cd -
echo "%%lang($language_short) %{langpackdir}/langpack-$language_short@firefox.mozilla.org.xpi" >> ../%{name}.lang
}

# Table of fallbacks for each language
# please file a bug at bugzilla.redhat.com if the assignment is incorrect
create_default_langpack "bn-IN" "bn"
create_default_langpack "es-AR" "es"
create_default_langpack "fy-NL" "fy"
create_default_langpack "ga-IE" "ga"
create_default_langpack "gu-IN" "gu"
create_default_langpack "hi-IN" "hi"
create_default_langpack "hy-AM" "hy"
create_default_langpack "nb-NO" "nb"
create_default_langpack "nn-NO" "nn"
create_default_langpack "pa-IN" "pa"
create_default_langpack "pt-PT" "pt"
create_default_langpack "sv-SE" "sv"
create_default_langpack "zh-TW" "zh"
%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

# Install default ones
%{__cp} %{SOURCE12} ${RPM_BUILD_ROOT}%{mozappdir}/defaults/preferences/all-redhat.js

# 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}

#---------------------------------------------------------------------

%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
%{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
%{mozappdir}/components/*.so
%{mozappdir}/components/*.manifest
%{mozappdir}/dictionaries
%{mozappdir}/*.so
%{mozappdir}/omni.ja
%{mozappdir}/platform.ini
%{mozappdir}/plugin-container
%{mozappdir}/dependentlibs.list
%{mozappdir}/gmp-clearkey
%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
* Wed Aug 26 2015 Martin Stransky <stransky@redhat.com> - 38.2.1-1
- Update to 38.2.1 ESR

* Fri Aug  7 2015 Jan Horak <jhorak@redhat.com> - 38.2.0-4
- Update to 38.2.0 ESR

* Thu Aug  6 2015 Jan Horak <jhorak@redhat.com> - 38.1.1-1
- Update to 38.1.1 ESR

* Fri Jun 26 2015 Jan Horak <jhorak@redhat.com> - 38.1.0-1
- Update to 38.1.0 ESR

* Mon May 18 2015 Martin Stransky <stransky@redhat.com> - 38.0.1-2
- Added fix for rhbz#1221368 - splice patch

* Fri May 15 2015 Martin Stransky <stransky@redhat.com> - 38.0.1-1
- Update to 38.0.1 ESR

* Thu May 14 2015 Martin Stransky <stransky@redhat.com> - 38.0-6
- Fixed rhbz#1221600 - After update to Firefox 38 ESR
  all RH preferences are gone

* Mon May 11 2015 Martin Stransky <stransky@redhat.com> - 38.0-5
- Added debug build patch for second arches

* Mon May 11 2015 Martin Stransky <stransky@redhat.com> - 38.0-4
- Obsolete Firefox 31

* Thu May  7 2015 Martin Stransky <stransky@redhat.com> - 38.0-3
- Removed unused patches

* Mon May  4 2015 Jan Horak <jhorak@redhat.com>- 38.0-2
- Update to 38.0 ESR

* Thu Apr 30 2015 Martin Stransky <stransky@redhat.com> - 38.0b8-0.13
- New gcc version, should fix s390x build failures

* Tue Apr 28 2015 Martin Stransky <stransky@redhat.com> - 38.0b8-0.12
- Update to 38 Beta 8

* Wed Apr 22 2015 Martin Stransky <stransky@redhat.com> - 38.0b6-0.11
- No longer supported ppc ia64 arches (rhbz#1214863, rhbz#1214865)
- s390x build fix

* Wed Apr 22 2015 Martin Stransky <stransky@redhat.com> - 38.0b6-0.10
- Update to 38 Beta 6
- Added patch for mozbz#1152515

* Mon Apr 20 2015 Martin Stransky <stransky@redhat.com> - 38.0b5-0.9
- Update to 38 Beta 5
- More build fixes
- Removed preference security.tls.version.fallback-limit

* Mon Apr 13 2015 Martin Stransky <stransky@redhat.com> - 38.0b3-0.8
- Update to 38 Beta 3
- Added Yasm assembler

* Thu Apr  9 2015 Jan Horak <jhorak@redhat.com> - 38.0b2-0.7
- Set default preference security.tls.version.fallback-limit to 1

* Tue Apr 7 2015 Martin Stransky <stransky@redhat.com> - 38.0b2-0.6
- Enabled debug build

* Tue Apr  7 2015 Jan Horak <jhorak@redhat.com> - 38.0b2-1
- Update to 38.0b2

* Wed Apr  1 2015 Jan Horak <jhorak@redhat.com> - 38.0b1-1
- Update to 38.0b1

* Wed Mar 25 2015 Jan Horak <jhorak@redhat.com> - 31.6.0-1
- Update to 31.6.0 ESR

* Sat Mar 21 2015 Martin Stransky <stransky@redhat.com> - 31.5.3-1
- Update to 31.5.3 ESR

* Fri Mar 20 2015 Martin Stransky <stransky@redhat.com> - 31.5.2-1
- Update to 31.5.2 ESR

* Fri Mar 20 2015 Jan Horak <jhorak@redhat.com> - 31.5.1-1
- Update to 31.5.1 ESR

* Wed Feb 18 2015 Martin Stransky <stransky@redhat.com> - 31.5.0-1
- Update to 31.5.0 ESR Build 2

* Tue Jan  6 2015 Jan Horak <jhorak@redhat.com> - 31.4.0-1
- Update to 31.4.0 ESR

* Tue Dec 23 2014 Martin Stransky <stransky@redhat.com> - 31.3.0-7
- Added fix for rhbz#1173156 - Native NTLM authentication
  on Linux unsupported

* Tue Dec 16 2014 Jan Horak <jhorak@redhat.com> - 31.3.0-6
- Fixed rhbz#1164855 - firefox.desktop is missing
  x-scheme-handler MimeType entries
- Fixed problems with dictionaries (mozbz#1097550)

* Tue Dec 16 2014 Jan Horak <jhorak@redhat.com> - 31.3.0-4
- Use Python 2.7 to build the package

* Sat Nov 29 2014 Martin Stransky <stransky@redhat.com> - 31.3.0-3
- Fixed geolocation key location

* Fri Nov 28 2014 Martin Stransky <stransky@redhat.com> - 31.3.0-2
- Disable exact rooting for JS

* Wed Nov 26 2014 Martin Stransky <stransky@redhat.com> - 31.3.0-1
- Update to 31.3.0 ESR Build 2
- Fix for geolocation API (rhbz#1063739)

* Thu Oct 23 2014 Martin Stransky <stransky@redhat.com> - 31.2.0-5
- Require gtk2-2.24 to avoid missing gdk_window_get_visual() symbol

* Tue Oct 14 2014 Martin Stransky <stransky@redhat.com> - 31.2.0-4
- Enabled jemalloc on ppc(64), fixes rhbz#1152004

* Tue Oct  7 2014 Jan Horak <jhorak@redhat.com> - 31.2.0-3
- Update to 31.2.0 ESR
- Fix for mozbz#1042889

* Wed Oct 1 2014 Martin Stransky <stransky@redhat.com> - 31.1.0-6
- Enable WebM on all arches

* Thu Sep 11 2014 Martin Stransky <stransky@redhat.com> - 31.1.0-5
- Enable all NPAPI plugins by default to keep compatibility
  with the FF24 line

* Wed Sep 10 2014 Martin Stransky <stransky@redhat.com> - 31.1.0-4
- Added workaround for rhbz#1134876

* Mon Sep 8 2014 Martin Stransky <stransky@redhat.com> - 31.1.0-3
- Disable mozilla::pkix (mozbz#1063315)
- Enable image cache

* Mon Sep 8 2014 Martin Stransky <stransky@redhat.com> - 31.1.0-2
- A workaround for rhbz#1110291

* Fri Sep 5 2014 Martin Stransky <stransky@redhat.com> - 31.1.0-1
- Update to 31.1.0 ESR

* Mon Aug 4 2014 Martin Stransky <stransky@redhat.com> - 31.0-4
- Build with system libvpx

* Tue Jul 29 2014 Martin Stransky <stransky@redhat.com> - 31.0-3
- Built with system nss/nspr

* Thu Jul 24 2014 Martin Stransky <stransky@redhat.com> - 31.0-2
- Added WebM support

* Mon Jul 21 2014 Martin Stransky <stransky@redhat.com> - 31.0-1
- Update to 31.0 ESR Build 2

* Wed Jun  4 2014 Jan Horak <jhorak@redhat.com> - 31.0-0.1
- Update to next ESR - aurora

* Wed Apr 23 2014 Martin Stransky <stransky@redhat.com> - 24.5.0-2
- Disabled unused patches

* 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 Mar 6 2014 Martin Stransky <stransky@redhat.com> - 24.3.0-4
- Fixed rhbz#1070467 - Enable Add Ons by default in Firefox

* 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

* Thu Jan 30 2014 Martin Stransky <stransky@redhat.com> - 24.3.0-1
- Update to 24.3.0 ESR

* Tue Jan 7 2014 Martin Stransky <stransky@redhat.com> - 24.2.0-6
- Added workaround for rhbz#1044010 - disabled baseline JIT

* Fri Jan 3 2014 Martin Stransky <stransky@redhat.com> - 24.2.0-5
- Added workaround for rhbz#1044010 - JIT crashes

* Fri Dec 20 2013 Martin Stransky <stransky@redhat.com> - 24.2.0-4
- Added fix for mozbz#906754

* Mon Dec 16 2013 Martin Stransky <stransky@redhat.com> - 24.2.0-3
- Fixed nspr/nss versions

* Tue Dec 10 2013 Martin Stransky <stransky@redhat.com> - 24.2.0-2
- Enabled jemalloc on s390(x) - rhbz#1039732

* Fri Dec  6 2013 Jan Horak <jhorak@redhat.com> - 24.2.0-1
- Update to 24.2.0 ESR

* Mon Dec 2 2013 Martin Stransky <stransky@redhat.com> - 24.1.0-4
- Fixed mozbz#938730 - avoid mix of memory allocators (crashes)
  when using system sqlite

* Tue Nov 26 2013 Martin Stransky <stransky@redhat.com> - 24.1.0-3
- Fixed locale pickup (rhbz#1034541)

* Fri Nov 8 2013 Martin Stransky <stransky@redhat.com> - 24.1.0-2
- Fixed package reinstall issue

* Wed Nov 6 2013 Martin Stransky <stransky@redhat.com> - 24.1.0-1
- Update to 24.1.0 ESR

* Fri Nov 1 2013 Martin Stransky <stransky@redhat.com> - 24.0-0.1
- Update to 24.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 Jan Horak <jhorak@redhat.com> - 17.0.8-2
- Updated manual page

* 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 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-4
- Added NM preferences

* Thu Jan 10 2013 Jan Horak <jhorak@redhat.com> - 17.0.2-3
- Update to 17.0.2 ESR

* Fri Nov 30 2012 Jan Horak <jhorak@redhat.com> - 17.0.1-2
- Update to 17.0.1 ESR

* Mon Nov 19 2012 Martin Stransky <stransky@redhat.com> - 17.0-1
- Update to 17.0 ESR

* Thu Nov 1 2012 Martin Stransky <stransky@redhat.com> - 17.0-0.2.b4
- Update to 17 Beta 4

* Wed Oct 17 2012 Martin Stransky <stransky@redhat.com> - 17.0-0.1.beta1
- Update to 17 Beta 1

* Thu Oct 11 2012 Martin Stransky <stransky@redhat.com> - 10.0.8-2
- Fixed rhbz#865284 - add the storage.nfs_filesystem
  config key to property list
- disable OOP for wrapped plugins (nspluginwrapper)

* Sat Oct  6 2012 Jan Horak <jhorak@redhat.com> - 10.0.8-1
- Update to 10.0.8 ESR

* Sat Aug 25 2012 Jan Horak <jhorak@redhat.com> - 10.0.7-1
- Update to 10.0.7 ESR

* Mon Jul 16 2012 Martin Stransky <stransky@redhat.com> - 10.0.6-1
- Update to 10.0.6 ESR

* Mon Jun 25 2012 Martin Stransky <stransky@redhat.com> - 10.0.5-3
- Enabled WebM

* Mon Jun 25 2012 Martin Stransky <stransky@redhat.com> - 10.0.5-2
- Added fix for mozbz#703633, rhbz#818341

* Fri Jun 1 2012 Martin Stransky <stransky@redhat.com> - 10.0.5-1
- Update to 10.0.5 ESR

* Sun Apr 22 2012 Martin Stransky <stransky@redhat.com> - 10.0.4-1
- Update to 10.0.4 ESR

* Tue Mar 6 2012 Martin Stransky <stransky@redhat.com> - 10.0.3-1
- Update to 10.0.3 ESR

* Thu Feb  9 2012 Jan Horak <jhorak@redhat.com> - 10.0.1-1
- Update to 10.0.1 ESR

* Tue Feb 7 2012 Martin Stransky <stransky@redhat.com> - 10.0-3
- Update to 10.0 ESR

* Mon Jan 30 2012 Martin Stransky <stransky@redhat.com> - 10.0-1
- Update to 10.0

* Mon Sep 26 2011 Martin Stransky <stransky@redhat.com> - 7.0-5
- Update to 7.0

* Tue Sep 20 2011 Jan Horak <jhorak@redhat.com> - 7.0-4
- Update to 7.0 Beta 6

* Tue Sep 13 2011 Martin Stransky <stransky@redhat.com> - 7.0-2
- Update to 7.0 Beta 4

* Mon Jul 11 2011 Martin Stransky <stransky@redhat.com> - 5.0-1
- Update to 5.0

* Mon Jun 13 2011 Jan Horak <jhorak@redhat.com> - 3.6.18-1
- Fixed #698313 - "background-repeat" css property isn't rendered well
- Update to 3.6.18

* Mon Apr 18 2011 Jan Horak <jhorak@redhat.com> - 3.6.17-1
- Update to 3.6.17

* Tue Mar  8 2011 Jan Horak <jhorak@redhat.com> - 3.6.15-1
- Update to 3.6.15

* Mon Feb 21 2011 Jan Horak <jhorak@redhat.com> - 3.6.14-4
- Update to build3

* Tue Feb  8 2011 Jan Horak <jhorak@redhat.com> - 3.6.14-3
- Update to build2

* Wed Jan 26 2011 Jan Horak <jhorak@redhat.com> - 3.6.14-2
- Update to 3.6.14

* Mon Dec  6 2010 Jan Horak <jhorak@redhat.com> - 3.6.13-2
- Update to 3.6.13 build 3

* Wed Nov 24 2010 Jan Horak <jhorak@redhat.com> - 3.6.13-1
- Update to 3.6.13

* Mon Oct 4 2010 Martin Stransky <stransky@redhat.com> - 3.6.11-2
- Update to 3.6.11 Build 2

* Mon Oct 4 2010 Martin Stransky <stransky@redhat.com> - 3.6.11-1
- Update to 3.6.11

* Tue Aug 31 2010 Jan Horak <jhorak@redhat.com> - 3.6.9-2
- Fixed xulrunner version

* Mon Aug 30 2010 Jan Horak <jhorak@redhat.com> - 3.6.9-1
- Update to 3.6.9

* Fri Jul 23 2010 Christopher Aillon <caillon@redhat.com> - 3.6.7-3
- Rebuild

* Wed Jul 14 2010 Jan Horak <jhorak@redhat.com> - 3.6.7-2
- Update to 3.6.7 beta2

* Thu Jul  1 2010 Jan Horak <jhorak@redhat.com> - 3.6.7-1
- Update to 3.6.7

* Thu Jun 24 2010 Martin Stransky <stransky@redhat.com> - 3.6.4-9
- Fixed rhbz#531159 - default browser check

* Mon Jun 14 2010 Jan Horak <jhorak@redhat.com> - 3.6.4-8
- Fixing NVR

* Mon Jun 14 2010 Jan Horak <jhorak@redhat.com> - 3.6.4-7
- Update to 3.6.4 build7
- Disable checking for updates since they can't be applied

* Tue Jun 1 2010 Martin Stransky <stransky@redhat.com> - 3.6.4-6
- Update to 3.6.4 build6

* Tue May 25 2010 Martin Stransky <stransky@redhat.com> - 3.6.4-5
- Update to 3.6.4 build5

* Mon May 17 2010 Martin Stransky <stransky@redhat.com> - 3.6.4-4
- Update to 3.6.4 build4

* Thu May  6 2010 Jan Horak <jhorak@redhat.com> - 3.6.4-3
- Update to 3.6.4 build 3

* Mon May 3 2010 Martin Stransky <stransky@redhat.com> - 3.6.4-2
- Update to 3.6.4 build 2

* Fri Apr 23 2010 Martin Stransky <stransky@redhat.com> - 3.6.4-1
- Update to 3.6.4

* Tue Apr 13 2010 Martin Stransky <stransky@redhat.com> - 3.6.3-3
- Fixed language packs (#581392)

* Mon Apr 12 2010 Martin Stransky <stransky@redhat.com> - 3.6.3-2
- Fixed multilib conflict

* Tue Apr 6 2010 Martin Stransky <stransky@redhat.com> - 3.6.3-1
- Rebase to 3.6.3

* Thu Apr 23 2009 Christopher Aillon <caillon@redhat.com> - 3.0.10-1
- Update to 3.0.10

* Fri Apr 10 2009 Jan Horak <jhorak@redhat.com> - 3.0.9-1
- Update to Firefox 3.0.9
- Gnome crash dialog disabled (#493455)

* Thu Feb 19 2009 Jan Horak <jhorak@redhat.com> - 3.0.7-1
- Update to Firefox 3.0.7

* Wed Jan 28 2009 Jan Horak <jhorak@redhat.com> - 3.0.6-2
- Fixed #481805 (Unowned directory /usr/lib/firefox-*/modules)

* Wed Jan 21 2009 Jan Horak <jhorak@redhat.com> - 3.0.6-1
- Update to Firefox 3.0.6
- Fixed #447390 (wrong size of icons)

* Tue Dec  9 2008 Martin Stransky <stransky@redhat.com> - 3.0.5-1
- Update to Firefox 3.0.5

* Wed Nov  5 2008 Martin Stransky <stransky@redhat.com> - 3.0.4-5
- Update to Firefox 3.0.4
- Removed firefox-2.0-getstartpage.patch (#454283)