thunderbird.spec
author dermotm
Mon, 24 Jul 2006 12:30:39 +0000
branchgnome-2-10
changeset 19949 94f49bf19351
parent 19896 6facde7db2f6
permissions -rw-r--r--
access control test #4

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

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

%define t_suffix -build01
%{?nightly:%define t_suffix -%(TZ=GMT date +%Y%m%d)}

Name:        thunderbird
Summary:     Mozilla Thunderbird Standalone E-mail and Newsgroup Client
Version:     1.5b1
Release:     0
Copyright:   MPL/LGPL
Group:       Applications/Internet
Distribution:Java Desktop System
Vendor:      Sun Microsystems, Inc.
Source0:     http://ftp.mozilla.org/pub/mozilla.org/%{name}/releases/%{version}/source/%{name}-%{version}-source.tar.bz2
Source1:     thunderbird-icon.png
Source2:     thunderbird.desktop
#Source3:     thunderbird-rebuild-databases.in
#Source4:     thunderbird.1
#Source5:     thunderbird.sh.in
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

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

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

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

%define _unpackaged_files_terminate_build 0
%define _tbdir %{_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 Thunderbird is a standalone e-mail and newsgroup client 
that can be used as a companion to Mozilla Firefox or by itself. 

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

#####################################
##      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/mail/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 --disable-tests
ac_add_options --disable-freetype2
ac_add_options --disable-auto-deps
ac_add_options --disable-debug
EOF

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
make -j$CPUS libs

cd mail/installer
make
cd -

%install
/bin/rm -rf $RPM_BUILD_ROOT

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

/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/thunderbird-icon.png
install -c -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_gmdatadir}/applications/thunderbird.desktop

#/bin/cat %{SOURCE3} | /usr/bin/sed -e 's,FFDIR,%{_tbdir},g' > \
#  $RPM_BUILD_ROOT%{_tbdir}/thunderbird-rebuild-databases
#/bin/chmod 755 $RPM_BUILD_ROOT%{_tbdir}/thunderbird-rebuild-databases

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

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

# upgrade installed-chrome.txt
#/bin/cat %{SOURCE5} >>  $RPM_BUILD_ROOT%{_tbdir}/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

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

%preun

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

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

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

* 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 02 2005 - [email protected]
- Change gtar to tar and rework tar command.

* Mon Aug 22 2005 - Dave Lin <[email protected]>
- initial version of the spec file created