Thunderbird 3.1 on Ubuntu 10.04 Lucid Lynx 64 bit

About a month ago Mozilla released Thunderbird 3.1.

The problem is that Ubuntu 10.04 (Lucid Lynx) ships with Thunderbird 3.0.x. Normally this isn’t an issue because the newest version of something as big as a Mozilla project is usually in a PPA within a few days of the release .

The Personal Package Archive (PPA)

Personal Package Archives are a service Canonical (the creators and custodians of Ubuntu) provide via their Launchpad website. Basically it allows Ubuntu users that know what they’re doing to upload packages (such as applications like Thunderbird or Firefox) which can then be relatively easily installed by other Ubuntu users.

No PPA package for Thunderbird 3.1 existed within the first few days of launch and the “official” Ubuntu Mozilla Daily Build Team PPA hadn’t received a new version of Thunderbird since February.

Ubuntuzilla

People running 32bit versions of Ubuntu can use Ubuntuzilla, which usually has Ubuntu/Debian packaged versions of the latest official binary releases of Firefox, Thunderbird and Seamonkey.

They also have their own repository that you can point your package manager at so you don’t have to manually check for updates. It’s no PPA, but Ubuntuzilla probably has Ubuntu/Debian-compatible packages up before anyone else can (since they don’t try to compile the apps from sources but rather just repackage the binaries Mozilla themselves release).

Without a convenient PPA or being able to use Ubuntuzilla, I decided to try and figure out how to build my own Thunderbird package for Ubuntu which I could then provide to others in my position via Launchpad.

Building Thunderbird from source

If you don’t know anything about compiling software on Linux, don’t worry… Mozilla does things completely differently from the average Linux application.

Two guides that cropped up on forums while searching for information was the Debian New Maintainers’ Guide and the Ubuntu Packaging Guide. I can’t recommend the Debian guide for anyone trying to get anything done on any kind of deadline. It seemed to provide a totally different set of instructions from the Ubuntu Packaging Guide. Another useful guide is Mozilla’s Thunderbird Build Instructions.

First order of business is to grab the Thunderbird 3.1 source and extract it somewhere. You should get a comm-1.9.2 directory from the tarball (archive).

Before you can actually build Thunderbird you need to build the sources from which you’ll build Thunderbird. It sounds complicated, but it’s just one relatively simple extra step.

Before you can do any compiling, however, you’ll need to install the build pre-requisites as laid out in the Ubuntu Packaging and Simple Thunderbird Build Guides.

It should be as simple as running two apt commands on Ubuntu:
$ sudo apt-get build-dep thunderbird
$ sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libiw-dev autoconf2.13

From here you need to set up a mozconfig file before you can generate the source files necessary to build Thunderbird. For a detailed explanation of how to set up a mozconfig file, see the Configuring Build Options guide. There are a number of places mozconfig can be created. I chose the root of the comm-1.9.2 directory as it seemed the most straightforward. The contents of my mozconfig file were as follows:
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/thunderbird-3.1
ac_add_options --enable-application=mail
mk_add_options MOZ_CO_PROJECT=mail
ac_add_options --enable-optimize
ac_add_options --enable-static
ac_add_options --disable-tests

Once you’ve configured the build options you’re ready to Build an Install, for which Mozilla also have a guide. It boils down to a single command:
@ make -f client.mk build

This will produce a Thunderbird build in the subdirectory specified in the first line of the ‘mozconfig’ example given above.

From here you could do a make install, but that isn’t recommended. Mozilla has a tarball package generation feature built into their make system, so after changing into the subdirectory (./thunderbird-3.1 in the example here) you can simply run:
$ make package

This will produce a self-contained package you can extract anywhere and run.

An alternative option I used to test my build came from a thread on the Ubuntu forums which suggested (thanks cYbercOsmOnauT) you run
$ make -j4
$ sudo checkinstall -D --install=no --pkgname='thunderbird' --pkgversion='3.1'

instead of ‘make package’.

Checkinstall is capable of generating binary packages in Debian (.deb), Red Hat (.rpm), or Slackware (.tar.gz) format. In the single test I ran, however, it seemed to produce a sub-optimal package which installed files all over the filesystem (including the root, for some reason).

Trying for the Right Way™

What I really wanted, however, was to make a package I could upload to a PPA for others to use. Following both the Debian and Ubuntu packaging guides, this means the creation of a ‘debian’ directory somewhere which must contain the information necessary to build an Ubuntu package.

This post has grown too long already, however. Suffice it to say that at the time of writing I hadn’t yet succeeded in creating a package I could upload to a PPA yet, but I haven’t hit a wall either.

Expect a post in the near future about using `debuild` to compile a Mozilla application (Thunderbird in this case) for Ubuntu.

Even though I could cop out at this point and just grab Thunderbird 3.1 off Eugene San’s PPA :-) .

This entry was posted in Technoramble. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Connect with Facebook

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>