Pbuilder
Ori.livneh (Talk | contribs) |
Ori.livneh (Talk | contribs) m |
||
| Line 3: | Line 3: | ||
=== Setup === | === Setup === | ||
| − | Start by getting your hands on a Labs instance with a <tt>misc::package-builder</tt> Puppet role (you can add this role if necessary). This will drop a clean install image in <tt>/var/cache/pbuilder/''distribution''.tgz</tt>. If you prefer to do so, you can create a clean install image manually using <tt>pbuilder create<tt>. For example: | + | Start by getting your hands on a Labs instance with a <tt>misc::package-builder</tt> Puppet role (you can add this role if necessary). This will drop a clean install image in <tt>/var/cache/pbuilder/''distribution''.tgz</tt>. If you prefer to do so, you can create a clean install image manually using <tt>pbuilder create</tt>. For example: |
# pbuilder create --distribution feisty | # pbuilder create --distribution feisty | ||
Revision as of 20:23, 16 August 2012
pbuilder is a tool to automatically build packages in a clean chroot of an arbitrary Debian / Ubuntu distribution. By abstracting away the particulars of your environment, it helps ensure that your packages install correctly on other machines.
Contents |
Setup
Start by getting your hands on a Labs instance with a misc::package-builder Puppet role (you can add this role if necessary). This will drop a clean install image in /var/cache/pbuilder/distribution.tgz. If you prefer to do so, you can create a clean install image manually using pbuilder create. For example:
# pbuilder create --distribution feisty
Notably, pbuilder doesn't set up a correct APT /etc/apt/sources.list in the chroot image, so it's best to use pbuilder login --save-after-login once after creating it, and replace its sources.list with an actual correct one.
Building
Then, when you want to build a package using this distribution image, use:
# pbuilder build --basetgz /var/cache/pbuilder/distribution.tgz package.dsc
If all goes well, you'll find the resulting package(s) in /var/cache/pbuilder/result.
Create a new distribution image using another filename:
# pbuilder create --distribution feisty --debootstrapopts --arch --debootstrapopts i386 --basetgz /var/cache/pbuilder/base-i386.tgz
Then to build a 32 bit package:
# linux32 pbuilder build --basetgz /var/cache/pbuilder/base-i386.tgz --debbuildopts "-sa" package.dsc
The debbuildopts argument forces the inclusion of the package source, a requirement for inclusion in the Wikimedia repository.
Modifying the base image
To change something in the base image, for example to add an APT repository, use:
# pbuilder login --save-after-login