
Package the source code into a deb package
I have 118 daily versions of the source code now. I want to package the source code into a deb package. What should I do?
All Replies (1)
Why do you want to build Thunderbird 118 specifically? If you're looking for a bleeding edge version, consider 119 (because it will be easier to package) or sticking with the 115 ESR (this is already packaged for you).
If you really want to package 118 as a deb, I suggest starting from the most recent deb package available for debian experimental. Once you can build the available 117 deb, you can make the changes necessary for 118.
How to build 117 (on a Debian system)
First off, make a working directory
$ mkdir thunderbird-deb-build && cd thunderbird-deb-build
As with any debian packaging, you'll need the orig tarball. For reasons I'll explain in a bit, you should just download this tarball from the thunderbird package in experimental on packages.debian.org . You should also download the l10.tar.xz tarball since it is needed for the thunderbird build. Either click the links from the website or wget them.
~/thunderbird-deb-build$ wget http://deb.debian.org/debian/pool/main/t/thunderbird/thunderbird_117.0~b5.orig.tar.xz ~/thunderbird-deb-build$ wget http://deb.debian.org/debian/pool/main/t/thunderbird/thunderbird_117.0~b5.orig-thunderbird-l10n.tar.xz
Since this package is built with git-buildpackage (gbp), you'll want to go clone the debian source repository. And since the repository is so large you'll need to increase the git postBuffers (I set mine to the max git clone size of 10Gb) before cloning:
~/thunderbird-deb-build$ git config --global http.postBuffer 10737418240 ~/thunderbird-deb-build$ git config --global https.postBuffer 10737418240 ~/thunderbird-deb-build$ git clone https://salsa.debian.org/mozilla-team/thunderbird.git
Note that the tarballs need to be one level up from the cloned source. I've set it up this way but it's worth being explicit about the placement.
Also note that there is a script that generated the tarballs you downloaded, debian/create-upstream-tarballs.py (you see in your cloned repo). This script can generate the latest released ESR tag or the latest beta so I assume this script was run when 117 was the latest beta. Since the latest beta has moved onto 119, this script will no longer generate the 117 tarballs. That is why I have directed you to just download them from the packages.debian.org site.
Since we'll be using gbp, there's some local clone structure needed in preparation so checkout a few branches and make sure you have local branches tracking the remote ones:
~/thunderbird-deb-build$ cd thunderbird ~/thunderbird-deb-build/thunderbird$ git checkout debian/upstream ~/thunderbird-deb-build/thunderbird$ git checkout debian/experimental
If the branch isn't automatically tracking the upstream repo's branch do that with “git branch -u”
gbp uses a pristine-tar branch but since I think the maintainers forgot to push the pristine tarball that is provided on the packages.debian.org site, you need to make that local commit (it takes a while, maybe 20 min):
~/thunderbird-deb-build/thunderbird$ gbp pristine-tar commit ../thunderbird_117.0~b5.orig.tar.xz
Since we are going to use pbuilder as their README recommends, we need to setup pbuilder:
~/thunderbird-deb-build/thunderbird$ DIST=sid git-pbuilder create
Now just make sure you have all of the build dependencies installed and you are ready to build the thunderbird 117.0~b5 package: ~/thunderbird-deb-build/thunderbird$ sudo apt-get build-dep thunderbird ~/thunderbird-deb-build/thunderbird$ gbp buildpackage --git-pbuilder
How to build 118.0b6 (on a Debian system)
Now that you have the general steps for building and setup with the cloned repo and pbuilder environment, you'll need to use it to build a newer 118 tarball. Since you've chose a version that is not supported by the script that makes the tarballs (debian/create-upstream-tarballs.py), you'll need to recreate that logic to generate a thunderbird_118.0~b6.orig.tar.xz and thunderbird_118.0~b6.orig-thunderbird-l10n.tar.xz. Perhaps you can just hack on this script to allow the 118.0b6 version.
You can find the original sources published by Thunderbird for this version here:
https://archive.mozilla.org/pub/thunderbird/releases/118.0b6/linux-x86_64/
Once you have the two tarballs, one level up from the git cloned source, then you can proceed with the same building steps to ideally build a 118 deb.
How to build 119 (on a Debian system)
Use the debian/create-upstream-tarballs.py and choose the 119 option to generate your tarballs. Once you have the two tarballs, you can proceed with the same building steps to build a 119 deb.
I hope that this helps you achieve your goal :)
Modified