firefox.spec
author dcarbery
Fri, 24 Nov 2006 16:37:59 +0000
branch217update
changeset 19096 d542fc2c823e
parent 8611 2cb5eddbccd7
child 8634 73d1373b6add
child 18970 47e4675eafa7
permissions -rw-r--r--
Merged trunk changes r9797:9829 into 217update branch.

#
# Copyright (c) Sun Microsystems, Inc.
#
# Owner: davelam
#
#####################################
##   Package Information Section   ##
#####################################

Name:        firefox
%define code_name  none
Summary:     Mozilla Firefox Web browser
Version:     2.0
%define tarball_version 2.0
Release:     1
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
Source6:     firefox-preload.list.in

# owner:davelam date:2005-08-22 type:bug
# change install dir from 'name-version' to 'name'
Patch1:      mozilla-01-change-install-dir.diff

# owner:laca date:2005-10-14 type:bug
# add -lxpcom_core to libs which fixes the build of yelp
Patch2:      firefox-01-mozilla-config.diff

# owner:dcarbery date:2005-12-02 type:bug
# change to link fontconfig and Xft libs
Patch3:      firefox-02-font_Xft.diff

# owner:davelam date:2006-03-31 type:l10n
# change startup script to support multi-language
Patch4:      firefox-06-locale.diff

# owner:davelam date:2006-06-12 type:bug
# bugster:6428445
Patch5:      firefox-07-plugins.diff

# owner:davelam date:2005-09-01 type:bug
# let moz patch checker support S10 and S11
Patch6:      mozilla-02-no-patch-checker.diff

# owner:davelam date:2005-09-05 type:bug
# remove gtar specific options 
Patch7:      mozilla-05-common-tar-option.diff

# owner:davelam date:2006-02-24 type:bug
# enable firefox preload mechanism
Patch8:      firefox-05-preload.diff

# owner:davelam date:2006-01-13 type:bug
# let firefox use system bundled nss,nspr
Patch9:      firefox-08-no-nss-nspr.diff

# owner:davelam date:2006-07-07 type:bug
# comment LD_LIBRARY_PATH setting
Patch10:     mozilla-07-no-ldlibpath.diff

# owner:davelam date:2006-09-07 type:bug
# remove moz patch checker from package
Patch11:     firefox-09-no-pkg-files.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 nss_nspr_dir %{_libdir}/mps

#####################################
##  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
%ifos solaris
%patch6 -p1
%patch7 -p1
%patch8 -p0
%patch9 -p1
%patch10 -p1
%patch11 -p1
%endif

#####################################
##      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-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 --enable-official-branding
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
PKG_SKIP_STRIP=1
export BUILD_OFFICIAL MOZILLA_OFFICIAL MOZ_PKG_FORMAT PKG_SKIP_STRIP CFLAGS CXXFLAGS

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

cd xpinstall/packager
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 -

# Don't deliver nss, nspr header files on Solaris
%ifos linux
# 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/ \;
%else
rm -f  $RPM_BUILD_ROOT%{_datadir}/aclocal/nspr.m4
rmdir  $RPM_BUILD_ROOT%{_datadir}/aclocal
rm -f  $RPM_BUILD_ROOT%{_libdir}/pkgconfig/firefox-nss.pc
rm -f  $RPM_BUILD_ROOT%{_libdir}/pkgconfig/firefox-nspr.pc
rm -rf $RPM_BUILD_ROOT/%{_includedir}/firefox/nss
rm -rf $RPM_BUILD_ROOT/%{_includedir}/firefox/pipnss
rm -rf $RPM_BUILD_ROOT/%{_includedir}/firefox/nspr
%endif

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

/bin/mkdir -p $RPM_BUILD_ROOT%{_ffdir}

%ifos linux
/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
%endif

/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

# install preloaded library list that would be picked up by gdmprefetch 
/usr/bin/sed -e 's,NSS_NSPR_DIR,%{nss_nspr_dir},g' \
             -e 's,FIREFOX_LIB_DIR,%{_ffdir},g' %{SOURCE6} > \
  $RPM_BUILD_ROOT%{_ffdir}/firefox-preload.list
%ifarch sparc
echo "%{nss_nspr_dir}/cpu/sparcv8plus/libnspr_flt4.so" >> \
  $RPM_BUILD_ROOT%{_ffdir}/firefox-preload.list
%endif
/bin/chmod 644 $RPM_BUILD_ROOT%{_ffdir}/firefox-preload.list

# create symbol link libnssckbi.so -> /usr/lib/mps/libnssckbi.so
# to fix bug CR#6459752
ln -s ../mps/libnssckbi.so $RPM_BUILD_ROOT%{_ffdir}/libnssckbi.so

%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/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}-icon.png

%changelog
* Fri Nov 17 2006 - [email protected]
- add patch comments
* Wed Oct 25 2006 - [email protected]
- bump verion to 2.0(official release)
* Fri Oct 20 2006 - [email protected]
- bump version to 2.0rc3
* Mon Oct 09 2006 - [email protected]
- bump version to 2.0rc2
* Thu Sep 07 2006 - [email protected]
- add patch firefox-09-no-pkg-files.diff to remove patch checker scripts 
  since it's unnecessary to deliver them with the bundled version
- change the version 2.0bx to 2.0 to comply WOS integration rules
- re-organize the patch list 
* Mon Sep 04 2006 - [email protected]
- bump version to 2.0 beta 2
* Mon Aug 28 2006 - [email protected]
- create symbol link libnssckbi.so -> /usr/lib/mps/libnssckbi.so
  to fix bug CR#6459752
* Tue Aug 08 2006 - [email protected]
- bump version to 2.0b1
- remove the patch mozilla-03-s11s-smkfl.diff, mozilla-04-s11x-smkfl.diff,
  firefox-03-yelp-hang.diff which have been fixed in 2.0b1
- change to xpinstall/packager to run make to make the binary tarball
* Tue Aug 08 2006 - [email protected]
- fixed the preload list problem
* Thu Jul 27 2006 - [email protected]
- Remove 'aclocal' dir from %files as it is now empty.
* Wed Jul 26 2006 - [email protected]
- Remove firefox-10-gecko.m4.diff : yelp uses local copy now, and re-shuffled
  the rest of the firefox-* patches to be in sequence.
* Fri Jul 07 2006 - [email protected]
- add patch mozilla-07-no-ldlibpath.diff to remove the LD_LIBRARY_PATH in
  the startup script
* Tue Jun 13 2006 - [email protected]
- add patch firefox-15-no-nss-nspr.diff to let firefox use nss, nspr in 
  /usr/lib/mps required by ARC
- remove all nss, nspr header files in development package
* Mon Jun 12 2006 - [email protected]
- add patch firefox-14-plugins.diff to add Mozilla plugins direcotry
  (/usr/sfw/lib/mozilla/plugins) in Firefox plugin searching path(CR#6428445)
* Fri Jun 02 2006 - [email protected]
- bump src version to 1.5.0.4
* Mon May 08 2006 - [email protected]
- bump src version to 1.5.0.3
* Fri Apr 28 2006 - [email protected]
- remove patch mozilla-06-skip-strip.diff, use another simple way to skip
  strip instead, setting PKG_SKIP_STRIP=1
* Fri Apr 21 2006 - [email protected]
- switch back to 1.5.0.2 since we're not get ARC approved yet
* Fri Apr 14 2006 - [email protected]
- removed firefox-chrome-lang.txt per l10n team's request, firefox uses new
  strategy to register chrome entries, so this file is useless
* Thu Apr 13 2006 - [email protected]
- Changed the installation location from "/usr/sfw/lib" to "/usr/lib"
  on Solaris

* Tue Apr 04 2006 - [email protected]
- Bump version to 2.0 alpha1
- Remove Patch3,4,11 which have been upstreamed into this version
- Add patch mozilla-06-skip-strip.diff to make no stripped libraries 

* Fri Mar 31 2006 - [email protected]
- Add patch firefox-13-locale.diff to make firefox automatically
  pick up locale setting from user environment and start up in
  that locale

* Fri Feb 24 2006 - [email protected]
- Add patch firefox-11-new-tab.diff to fix CR6368789
- Add patch firefox-12-preload.diff and extra source file 
  firefox-preload.list.in to enable firefox preload mechanism
- Remove useless file firefox-rebuild-databases since it's only
  for Linux
- Remove useless sources and patch

* 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