The Personal Builder: pbuilder
Zurück
Weiter

The Personal Builder: pbuilder

Using pbuilder as a package builder allows you to build the package from within a chroot environment. You can build binary packages without using pbuilder, but you must have all the build dependencies installed on your system first. However, pbuilder allows the packager to check the build dependencies because the package is built within a minimal Ubuntu installation, and the build dependencies are downloaded according to the debian/control file.

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.

Installation und Konfiguration einer pbuilder Umgebung

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.

Anmerkung

Creating a pbuilder environment will take some time as debootstrap essentially downloads a minimal Ubuntu installation.

Benutzung des pbuilder

Nun da Sie einen pbuilder laufen haben, können Sie folgendermaßen Binärpakete aus dem Quellpaket kompilieren:

sudo pbuilder build *.dsc

Das wird alle Quellüakete in dem aktuellen Verzeichnis kompilieren. Die daraus hervorgehenden .debs und Quellpakete können in /var/cache/pbuilder/result/ gefunden werden (was mit dem --buildresult Parameter geändert werden kann).

Den pbuilder aktualisieren

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
Zurück
Weiter
Zum Anfang