Usar pbuilder como empaquetador le permite construir el paquete dentro de un entorno chroot. Puede construir paquetes binarios sin necesidad de usar pbuilder, pero antes tiene que tener todas las dependencias instaladas en su sistema. De todas formas, pbuilder permite al empaquetador comprobar las dependencias de construcción porque el paquete es construido dentro de una mínima instalación de Ubuntu, y las dependencias de construcción son descargadas de acuerdo al fichero debian/control
.
The following is a brief guide to installing, using, and updating a pbuilder environment, however, there are many details of pbuilder usage that are outside the realm of this guide. The pbuilder man page has lots of information and should be consulted if you have problems or need more detailed information.
The first, and perhaps most obvious, thing to do is to install pbuilder. If you want to create a pbuilder for a release newer than the one you currently have installed, you will need to manually install the debootstrap .deb (from packages.ubuntu.com) from the newer release. To create a pbuilder execute:
sudo pbuilder create --distribution <distro> \ --othermirror "deb http://archive.ubuntu.com/ubuntu <distro> universe multiverse"
where <distro> is the release you want
(edgy for instance) to create the pbuilder
for. If you would like to create more than one
pbuilder environment you can append the
--basetgz flag with the desired location for
the compressed pbuilder environment.
The default is /var/cache/pbuilder/base.tgz
.
If you do choose to use --basetgz you will
need to use it with the other pbuilder
commands so pbuilder knows which
compressed build environment to use.
Creating a pbuilder environment will take some time as debootstrap essentially downloads a minimal Ubuntu installation.
Now that you have a running pbuilder you can build binary packages from the source package by invoking:
sudo pbuilder build *.dsc
This will build all the source packages in the current directory. The
resulting .debs and source packages can be found in
/var/cache/pbuilder/result/
(which can be
changed with the --buildresult flag).
You should always have a current pbuilder whenever you are testing your source packages, especially when you are building for a development release that is rapidly changing, to ensure that the dependencies are properly found. To update your pbuilder, use:
sudo pbuilder update
If you would like to upgrade you pbuilder to a new release you can use pbuilder update in combination with the --distribution flag:
sudo pbuilder update --distribution <newdistro> --override-config