Google Site SearchFN Site Search FN Blog Login FN Blog Login
Site Navigation:
 
 

HOWTO build Thunderbird RPM package for Fedora Core

by Thomas Chung on Aug 26, 2004 (UPDATED 2006-01-16)

UPDATE 2006-01-16
Thanks to Gediminas Bytautas, here is updated spec for 1.5.

UPDATE 2005-12-13
Thanks to Sean Carlos, here is updated spec for 1.5rc2.

UPDATE 2005-07-19
Thunderbird 1.0.6 has been released. Here is updated spec file.

UPDATE 2005-07-13
Thunderbird 1.0.5 has been released.

UPDATE 2005-03-23
Thunderbird 1.0.2 has been released.

UPDATE 2004-12-07
Thunderbird 1.0 has been released. Here is updated spec file.

UPDATE 2004-12-01
Thunderbird 1.0RC1 has been released. Here is updated spec file.

UPDATE 2004-11-04
Thunderbird 0.9 has been released. Here is updated spec file.

UPDATE 2004-09-14
Thunderbird 0.8 has been released. Here is updated spec file.
Noticeable changes include:
- You don't have to run it as root first any more in order to run it as a user.
- It now asks for Do you want to use Mozilla Thunderbird as the default mail application?


Since my last article for HOWTO build Firefox RPM package, people's been asking for HOWTO build Thunderbird RPM package as well so here we go per your request.

Thunderbird is a free, open-source and cross-platform mail client for most operating systems including, but not limited to, Windows, Linux and Macintosh. It is based on the Mozilla codebase. It is a robust and easy to use client, similar to competing products like Outlook Express, but with some major advantages such as junk mail classification. Visit Thunderbird FAQ for the most frequently asked questions about the mail client.

In this article, I'll be using Thunderbird 0.7.3 tarball on Fedora Core 1 as an example so please modify the spec file for your environment as necessary.

To build RPM, you'll need:
Tarball - thunderbird-0.7.3-i686-linux-gtk2+xft.tar.gz
Spec File - thunderbird.spec
Desktop File - thunderbird.desktop
Image File - thunderbird.png

Let's begin:
(Make sure you have created rpmbuild directory in your own home.)

[tchung@localhost thunderbird]$ ls
thunderbird-0.7.3-i686-linux-gtk2+xft.tar.gz  thunderbird.desktop  thunderbird.png  thunderbird.spec
[tchung@localhost thunderbird]$ cp *.gz *.desktop *.png ~/rpmbuild/SOURCES/
[tchung@localhost thunderbird]$ cp *.spec ~/rpmbuild/SPECS/
[tchung@localhost thunderbird]$ rpmbuild -ba ~/rpmbuild/SPECS/thunderbird.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.13760
+ umask 022
+ cd /home/tchung/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ rm -rf /var/tmp/thunderbird-0.7.3-buildroot
+ cd /home/tchung/rpmbuild/BUILD
+ rm -rf thunderbird-0.7.3
+ /bin/mkdir -p thunderbird-0.7.3
+ cd thunderbird-0.7.3
+ /usr/bin/gzip -dc /home/tchung/rpmbuild/SOURCES/thunderbird-0.7.3-i686-linux-gtk2+xft.tar.gz
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
++ /usr/bin/id -u
+ '[' 500 = 0 ']'
++ /usr/bin/id -u
+ '[' 500 = 0 ']'
+ /bin/chmod -Rf a+rX,g-w,o-w .
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.56084
+ umask 022
+ cd /home/tchung/rpmbuild/BUILD
+ cd thunderbird-0.7.3
+ LANG=C
+ export LANG
+ unset DISPLAY
+ mkdir -p /var/tmp/thunderbird-0.7.3-buildroot/usr/lib
+ cp -a thunderbird /var/tmp/thunderbird-0.7.3-buildroot/usr/lib
+ mkdir -p /var/tmp/thunderbird-0.7.3-buildroot/usr/share/applications /var/tmp/thunderbird-0.7.3-buildroot/usr/share/pixmaps
+ cp -a /home/tchung/rpmbuild/SOURCES/thunderbird.desktop /var/tmp/thunderbird-0.7.3-buildroot/usr/share/applications
+ cp -a /home/tchung/rpmbuild/SOURCES/thunderbird.png /var/tmp/thunderbird-0.7.3-buildroot/usr/share/pixmaps
+ mkdir -p /var/tmp/thunderbird-0.7.3-buildroot/usr/bin
+ ln -s /usr/lib/thunderbird/thunderbird /var/tmp/thunderbird-0.7.3-buildroot/usr/bin/thunderbird
+ ln -s /usr/lib/thunderbird/thunderbird-bin /var/tmp/thunderbird-0.7.3-buildroot/usr/bin/thunderbird-bin
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
Processing files: thunderbird-0.7.3-1.fc1
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/thunderbird-0.7.3-buildroot
Wrote: /home/tchung/rpmbuild/SRPMS/thunderbird-0.7.3-1.fc1.src.rpm
Wrote: /home/tchung/rpmbuild/RPMS/i386/thunderbird-0.7.3-1.fc1.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.8824
+ umask 022
+ cd /home/tchung/rpmbuild/BUILD
+ cd thunderbird-0.7.3
+ rm -rf /var/tmp/thunderbird-0.7.3-buildroot
+ exit 0
[tchung@localhost thunderbird]$

To install,

[tchung@localhost thunderbird]$ sudo rpm -Uvh /home/tchung/rpmbuild/RPMS/i386/thunderbird-0.7.3-1.fc1.i386.rpm
Preparing...                ########################################### [100%]
   1:thunderbird            ########################################### [100%]
[tchung@localhost thunderbird]$

Known Issue:
http://www.mozilla.org/products/thunderbird/releases/#issues
"If Thunderbird 0.7 is placed in a location with limited access privileges, it should be run by a user with access to that location first, so that all initial startup files are generated. There may be issues still where if a restricted-access user is the first to run the app, these files may not be generated properly and Thunderbird may enter an infinite restart loop. This will be fixed in a future release."

Base on above known issue, run it as root first before running as a user.

[tchung@localhost thunderbird]$ su -
Password:
[root@localhost root]# thunderbird
*** loading the extensions datasource
*** loading the extensions datasource

Press on Cancel and Exit button.

Now you should be able to run it as a user.

[tchung@localhost thunderbird]$ thunderbird

OR, you can launch it from 'Main Menu' > 'Internet' > 'Mozilla Thunderbird Mail Client'

Here is the screenshot for Thunderbird Main Window.


TIPS
1) How to kill Thunderbird manually?
$ killall thunderbird-bin

2) How to make Firefox as a default browser and Thunderbird as a default mail client?

Open "Preferred Applications" (Main Menu > Preferences) and type it in the custom field.

Alternatively, you can install MozEX an extension to link Mozilla or Firefox to external programs such as Thunderbird, Evolution and etc.

To install MozEX, go to http://update.mozilla.org/extensions/moreinfo.php?id=40&vid=42 and click on "( Install Now )".

To configure MozEX, open MozEX Extension from Firefox's menu Tools > Extensions and click on check mark to open MozEX Preferences.

First, make sure to check "Intercept mailto: clicks" and type in "/tmp/mozex" for the directory for temporary files.

Now, you can change default mailer for Firefox to Thunderbird or any email program you wish.

For Thunderbird, use "/usr/bin/thunderbird mailto:%a?subject=%s"
For Evolution, use "/usr/bin/evolution mailto:%a?subject=%s"

Have fun with Thunderbird!


UPDATE 2004-09-09
Here is a wrapper script for thunderbird to fix the issue with mailto when thunderbird is already running in the background.

#!/bin/sh
# run-thunderbird.sh
#
# 1) Download this script to /usr/local/bin
# 2) chmod 755 run-thunderbird.sh
# 3) Set Mail Reader in Preferred Applications as "run-thunderbird.sh %s"
#
 
export MOZILLA_FIVE_HOME=/usr/lib/thunderbird
 
url=`echo "$1" | sed -e's/^mailto://'`
 
# thunderbird is already running
if [ $(ps aux | grep thunderbird | wc -l) -gt 4 ]; then
        $MOZILLA_FIVE_HOME/thunderbird -remote "mailto($url)"
 
# thunderbird is NOT running
else
        $MOZILLA_FIVE_HOME/thunderbird -P default -compose $1;
fi