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.
Первая и наиболее очевидная вещь которую необходимо сделать - установить pbuilder. Если вы желаете создать pbuilder более нового релиза, чем тот который у вас установлен, вам понадобится вручную установить debootstrap .deb (на packages.ubuntu.com) из нового релиза. Чтобы создать pbuilder выполните:
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).
Для обеспечения правильного нахождения зависимостей, у вас всегда должна быть текущая версия pbuilder всякий раз когда вы тестируете ваши пакеты с исходными кодами, особенно если вы создаете часто изменяемый релиз для разработки.
sudo pbuilder update
Если вы хотите обновить ваш pbuilder, вы можете использовать pbuilder update в комбинации с флагом --distribution:
sudo pbuilder update --distribution <newdistro> --override-config