%define  prever  1.5rc3
%define  prerel  .1
%define  pretag  .rc3


Name		: firefox
Version		: 1.5
Release		: 0%{prerel}%{pretag}%{?dist}
#
# For Pre-Release packages, use 0.%{prerel}.%{pretag}
# Ex) alsa-lib-0.9.2-0.1.beta1
# See http://fedoraproject.org/wiki/PackageNamingGuidelines
#
# If %{dist} is defined, insert its value here. If not, do nothing.
# See http://fedoraproject.org/wiki/DistTag
#
License		: MPL
Summary		: Mozilla Firefox Web browser.
Group		: Applications/Internet

URL		: http://www.mozilla.org/products/firefox/
Vendor		: Mozilla Foundation
Packager	: Thomas Chung <tchung@fedoranews.org>

BuildRoot	: %{_tmppath}/%{name}-%{version}-buildroot
Source0		: %{name}-%{prever}.tar.gz
Source1		: firefox.desktop
Source2		: firefox.png

AutoReq     	: No
AutoProv	: No

Requires        : libstdc++.so.5

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

%prep
rm -rf %{buildroot}

#######################################################################
# setup macro
# -a num  : Only unpack source number after changing to the directory
# -b num  : Only unpack source number before changing to the directory
# -c      : Create directory before unpacking.
# -D      : Do not delete the directory before unpacking
# -n name : Name the directory as name
# -q      : Run quiety with minimum output
# -T      : Disable the automatic unpacking of the archives.
#######################################################################
%setup -c -q

#########################################################
# Common Red Hat RPM macros (rpm --showrc for more info)
# {_sourcedir} : /usr/src/redhat/SOURCES
# {_builddir}  : /usr/src/redhat/BUILD
# {_tmppath}   : /var/tmp
# {_libdir}    : /usr/lib
# {_bindir}    : /usr/bin
# {_datadir}   : /usr/share
# {_mandir}    : /usr/share/man
# {_docdir}    : /usr/share/doc
# {buildroot}
# {name}
# {version}
# {release}
#########################################################

%install
%{__install} -d -m 755 %{buildroot}%{_libdir}
cp -a firefox %{buildroot}%{_libdir}
touch %{buildroot}%{_libdir}/firefox/extensions/talkback@mozilla.org/chrome.manifest
%{__install} -D -m 644 %{SOURCE1} %{buildroot}%{_datadir}/applications/firefox.desktop
%{__install} -D -m 644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps/firefox.png
%{__install} -d -m 755 %{buildroot}%{_bindir}
ln -s %{_libdir}/firefox/firefox %{buildroot}%{_bindir}/firefox
ln -s %{_libdir}/firefox/firefox-bin %{buildroot}%{_bindir}/firefox-bin

%post
rm -rf %{_libdir}/firefox/plugins
ln -sf %{_libdir}/mozilla/plugins %{_libdir}/firefox/plugins

%clean
rm -rf %{buildroot}

%files 
#####################################################
# defattr sets the default attributes for all files
#####################################################
%defattr(-, root, root)
%{_libdir}/firefox/*
%{_libdir}/firefox/.autoreg
%{_datadir}/applications/firefox.desktop
%{_datadir}/pixmaps/firefox.png
%{_bindir}/firefox
%{_bindir}/firefox-bin

%changelog
* Fri Nov 18 2005 Thomas Chung <tchung@fedoranews.org> 1.5-0.1.rc3 
- Version 1.5rc3

* Fri Nov 11 2005 Thomas Chung <tchung@fedoranews.org> 1.5-0.1.rc2 
- Version 1.5rc2

* Wed Nov 02 2005 Thomas Chung <tchung@fedoranews.org> 1.5-0.1.rc1 
- Version 1.5rc1

* Fri Oct 07 2005 Thomas Chung <tchung@fedoranews.org> 1.5-0.1.beta2
- Version 1.5b2

* Fri Sep 09 2005 Thomas Chung <tchung@fedoranews.org> 1.5-0.1.beta1
- Version 1.5b1
- Add /usr/lib/firefox/.autoreg
- Use {prever}, {prerel}, {pretag}
- Create chrome.manifest to fix chrome registration failure error
