wiki:Linux/Ubuntu/Packages/CreatingPbuilderVariations

Version 6 (modified by tj, 9 years ago) (diff)

--

Creating Pbuilder Variations

Instead of using the various debootstrap options and other pbuilder options on the command line I use an amalgamation of the  Ubuntu Wiki Pbuilder Howto and my own modifications to ~/.pbuilderrc to ease the package build testing for different distributions and architectures before uploading to PPA.

My biggest modification is to look for the environment variable BASE and use it to set BASETGZ - the location and name of the pbuilder archive file. This allows the setting to over-ride the enforced value in /etc/pbuilderrc (BASETGZ=/var/cache/pbuilder/base.tgz).

Note: The value assigned to BASE is processed by dirname so the last segment beginning with a forward-slash is stripped off. This means that to specify the build location /home/all/pbuilder it needs BASE=/home/all/pbuilder/base. The final /base will be stripped off before the calculated name of the TGZ is added.

The file is attached to this article and can be directly downloaded.

By setting the environment variables BASE, DIST and ARCH the options are calculated by ~/.pbuilderrc so, for example, all the following become possible:

# Create an environment for Ubuntu gutsy in the current directory
sudo BASE="$(pwd)/base" DIST=gutsy pbuilder create

# Create an environment for Debian sid
sudo DIST=sid pbuilder create

# Create an environment for Ubuntu gutsy with the i386 architecture in a defined directory
sudo BASE="/home/all/pbuilder/base" DIST=gutsy ARCH=i386 pbuilder create

# Update an environment for Ubuntu gutsy in the current directory
sudo BASE="$(pwd)/base" DIST=gutsy pbuilder update

# Build a package using Ubuntu gutsy (same architecture as is running)
cd ${PACKAGE}-${VERSION}
BASE="$(pwd)/base" DIST=gutsy pdebuild

# Build a package using Ubuntu gutsy with i386 architecture in a defined directory
cd ${PACKAGE}-${VERSION}
BASE="/home/all/pbuilder/base" DIST=gutsy ARCH=i386 pdebuild

I also modified my original PPA Publish Multiple Releases? script to be able to test-build the same package for multiple releases (e.g. gutsy hardy intrepid) in one automated process. The script is attached.

Attachments