firefox.spec
author hh150184
Tue, 24 Jan 2006 11:56:37 +0000
branchgnome-2-12
changeset 19207 b59a653a3329
parent 19199 075af3ff828e
child 6522 2070b37d0bfc
permissions -rw-r--r--
* evolution-jescs.spec: Bump to 2.4.4, Remove unused define evolution_imagesdir and evolution_libsdir, Remove hard code 1.2, 2.4. * Solaris/SUNWevolution-jescs.spec: Remove *.la under /usr/lib when install, s/evolution-data-server-1.2/evolution-data-server-*/g.

#
# Copyright (c) Sun Microsystems, Inc.
#

#####################################
##   Package Information Section   ##
#####################################

Name:        firefox
Summary:     Mozilla Firefox Web browser
Version:     1.5
%define tarball_version 1.5
Release:     0
Copyright:   MPL/LGPL
Group:       Applications/Internet
Distribution:Java Desktop System
Vendor:      Sun Microsystems, Inc.
Source:      http://ftp.mozilla.org/pub/mozilla.org/%{name}/releases/%{tarball_version}/source/%{name}-%{tarball_version}-source.tar.bz2
Source1:     firefox-icon.png
Source2:     firefox.desktop
Source3:     firefox-rebuild-databases.in
Source4:     firefox.1
Source5:     firefox-chrome-lang.txt
#Source7:     firefox.sh.in
#Source8:    firefox.xpm
Patch1:      mozilla-01-change-install-dir.diff
Patch2:      mozilla-02-no-patch-checker.diff
Patch3:      mozilla-03-s11s-smkfl.diff
Patch4:      mozilla-04-s11x-smkfl.diff
Patch5:      mozilla-05-common-tar-option.diff
Patch6:      firefox-06-mozilla-config.diff
#Patch7:      mozilla-07-bz307041.diff
Patch8:      firefox-08-font_Xft.diff
Patch9:      firefox-09-yelp-hang.diff

URL:         http://www.sun.com/software/javadesktopsystem/

BuildRoot:   %{_tmppath}/%{name}-%{tarball_version}-build
Prefix:      /usr
Provides:    webclient
Autoreqprov: on

#####################################
##     Package Defines Section     ##
#####################################

%define _unpackaged_files_terminate_build 0
%define _ffdir %{_libdir}/%{name}
%define _gmdatadir %{_datadir}
%ifos solaris
  %define _gmdatadir %{_basedir}/share
%endif

#####################################
##  Package Requirements Section   ##
#####################################

BuildRequires: libpng-devel
BuildRequires: libjpeg
BuildRequires: zlib-devel
BuildRequires: zip
BuildRequires: perl
BuildRequires: autoconf
BuildRequires: libIDL-devel
BuildRequires: glib2-devel
BuildRequires: gtk2-devel
Prereq: fileutils perl
Prereq: /usr/bin/killall

#####################################
##   Package Description Section   ##
#####################################

%description
Mozilla Firefox is an open-source web browser, designed for standards
compliance, performance and portability.

#####################################
##   Package Preparation Section   ##
#####################################

%prep

%setup -q -c -n %{name}
cd ..
/bin/mv %{name} %{name}.tmp.$$
/bin/mv %{name}.tmp.$$/mozilla %{name}
rm -rf %{name}.tmp.$$
cd %{name}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
#%patch7 -p1
%patch8 -p1
%patch9 -p0

#####################################
##      Package Build Section      ##
#####################################

%build

%ifos linux
if [ -x /usr/bin/getconf ]; then
  CPUS=`getconf _NPROCESSORS_ONLN`
fi
%else
  CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
%endif
if test "x$CPUS" = "x" -o $CPUS = 0; then
  CPUS=1
fi

cat << "EOF" > .mozconfig
. $topsrcdir/browser/config/mozconfig
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1
ac_add_options --prefix=%{_prefix}
ac_add_options --libdir=%{_libdir}
ac_add_options --mandir=%{_mandir} 
ac_add_options --enable-xft
#ac_add_options --enable-crypto
ac_add_options --enable-default-toolkit=gtk2
ac_add_options --enable-svg
ac_add_options --enable-canvas
ac_add_options --disable-static
ac_add_options --enable-shared
ac_add_options --disable-tests
ac_add_options --disable-freetype2
ac_add_options --disable-auto-deps
ac_add_options --disable-debug
EOF

# Enable timeline (profiling) features in nightly builds, per Brian Lu.
%{?nightly:echo "ac_add_options --enable-timeline" >> .mozconfig}

BUILD_OFFICIAL=1 
MOZILLA_OFFICIAL=1
MOZ_PKG_FORMAT=BZ2
#CFLAGS=
#CXXFLAGS=
export BUILD_OFFICIAL MOZILLA_OFFICIAL MOZ_PKG_FORMAT CFLAGS CXXFLAGS

./configure
make export
# FIXME: disabled parallel build as it seems to break the build sometimes
make libs

cd browser/installer
make
cd -
make

%install
/bin/rm -rf $RPM_BUILD_ROOT

DESTDIR=$RPM_BUILD_ROOT \
    make install
/bin/rm -rf $RPM_BUILD_ROOT%{_ffdir}
BUILDDIR=`pwd`
cd $RPM_BUILD_ROOT%{_libdir}
bzip2 -dc $BUILDDIR/dist/firefox-*.tar.bz2 | tar -xf -

# copy the nss files to the right place
mkdir $RPM_BUILD_ROOT%{_includedir}/firefox/nss/
cd ${BUILDDIR}
/usr/bin/find security/nss/lib/ -name '*.h' -type f -exec /bin/cp {} \
 $RPM_BUILD_ROOT/%{_includedir}/firefox/nss/ \;

/bin/mkdir -p $RPM_BUILD_ROOT%{_gmdatadir}/applications
/bin/mkdir -p $RPM_BUILD_ROOT%{_gmdatadir}/pixmaps
/bin/mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
install -c -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_gmdatadir}/pixmaps/firefox-icon.png
install -c -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_gmdatadir}/applications/firefox.desktop

/bin/mkdir -p $RPM_BUILD_ROOT%{_ffdir}
/bin/cat %{SOURCE3} | /usr/bin/sed -e 's,FFDIR,%{_ffdir},g' > \
  $RPM_BUILD_ROOT%{_ffdir}/firefox-rebuild-databases
/bin/chmod 755 $RPM_BUILD_ROOT%{_ffdir}/firefox-rebuild-databases

/bin/rm -f $RPM_BUILD_ROOT%{_bindir}/firefox
/bin/ln -s ../lib/firefox/firefox $RPM_BUILD_ROOT%{_bindir}/firefox

# install the man page
install -c -m 644  %{SOURCE4} $RPM_BUILD_ROOT%{_mandir}/man1/firefox.1

# upgrade installed-chrome.txt
/bin/mkdir -p $RPM_BUILD_ROOT%{_ffdir}/chrome
/bin/cat %{SOURCE5} >>  $RPM_BUILD_ROOT%{_ffdir}/chrome/installed-chrome.txt


%clean
#/bin/rm -rf $RPM_BUILD_ROOT

#########################################
##  Package Post[Un] Install Section   ##
#########################################

%post
# run ldconfig before regxpcom
/sbin/ldconfig >/dev/null 2>/dev/null

if [ -f %{_ffdir}/firefox-rebuild-databases ]; then
  %{_ffdir}/firefox-rebuild-databases
fi

%postun
/sbin/ldconfig >/dev/null 2>/dev/null

# was this an upgrade?
if [ $1 -gt 0 ]; then
  if [ -f %{_ffdir}/firefox-rebuild-databases ]; then
    %{_ffdir}/firefox-rebuild-databases
  fi
fi

%preun
if [ $1 -eq 0 ]; then
  /bin/rm -rf %{_ffdir}/chrome/overlayinfo
  /bin/rm -f  %{_ffdir}/chrome/*.rdf
  /bin/rm -f  %{_ffdir}/components/*.dat
  /bin/rm -f  %{_ffdir}/component.reg
  /bin/rm -rf %{_ffdir}/extensions
  /bin/rm -f  %{_ffdir}/components.ini
  /bin/rm -f  %{_ffdir}/defaults.ini
fi

#####################################
##      Package Files Section      ##
#####################################

%files
%defattr(-,root,root)
%dir %{_ffdir}
%{_ffdir}/*
%{_bindir}/firefox
%{_mandir}/man1/*
%{_gmdatadir}/applications/%{name}.desktop
%{_gmdatadir}/pixmaps/%{name}-icon.png

%changelog
* Thu Dec 15 2005 - [email protected]
- Add patch firefox-09-yelp-hang.diff to fix yelp hang problem.

* Fri Dec 02 2005 - [email protected]
- Add Makefile.in patch to link fontconfig and Xft libraries.
- make from top directory to build nsIconChannel.o.

* Fri Dec 02 2005 - [email protected]
- Bump tarball version to 1.5.
- Modify the configuration options

* Fri Nov 11 2005 - [email protected]
- Bump tarball version to 1.5rc3.

* Fri Nov 11 2005 - [email protected]
- Bump tarball version to 1.5rc2.

* Tue Nov 08 2005 - [email protected]
- Bump tarball version to 1.5rc1
- Remove the patch mozilla-07-bz307041.diff since it's upstreamed in 1.5rc1 already
- Enalbe '--enalbe-timeline' in nightly builds

* Thu Nov  1 2005 - [email protected]
- change version to numeric and introduce %tarball_version

* Fri Oct 21 2005 - [email protected]
- Update version from 1.5b1 to 1.5b2 and add patch 307041 from bugzilla
- Change configure option per Leo Sha from developer team
- Add nss header file in development package

* Mon Sep 26 2005 - <[email protected]>
- Bump to 1.5b1.
- Move dir mozilla to firefox after tarball unpacking.

* Mon Sep 12 2005 - <[email protected]>
- get rid of %builddir as it would be different on Solaris

* Thu Sep 08 2005 - [email protected]
- Change BuildPrereq to BuildRequires, a format that build-gnome2 understands.

* Mon Sep 05 2005 - Dave Lin <[email protected]>
- Add patches to remove the specific gtar options 
- Set MOZ_PKG_FORMAT=BZ2 to keep consistent of tarball
  format between linux and solaris

* Fri Sep 01 2005 - [email protected]
- Change gtar to tar; add two necessary mkdir's.
 
* Mon Aug 22 2005 Dave Lin <[email protected]>
- initial version of the spec file created