My pbuilderrc using qemu-debootstrap

Mar. 25, 2012

Hello everybody.

First, I’m sorry for this late translation. I had a quite bad and busy period of time, so I was unable to take time to perform this translation.

As you are already aware of, Debian packaging takes a lot of my time, as well on the practical side as on the theoretical part of it.

Recently, I became co-maintainer of audacious and audacious-plugins Debian packages. Also, in few weeks, I will become co-maintainer of the NGINX package in Debian (it happened on March 16th).

I’m also working on making the NGINX maintaining team work as an actual team. I try to achieve this by scheduling milestones and managing Wheezy goals for the packaging. I also try to make all co-maintainers speaking when an important decision need to be taken (new upstream release to upload, module adding/removal, etc…). By far, I think it’s working and we are finally working as a team.

But without any building/development environment, Debian packaging would be like playing Russian-roulette with a fully loaded machine-gun.

Why ?

It’s simple.

Before any source package upload in Debian, building a package in a clean environment is highly recommended. You need to be sure of the build-deps and binary dependencies. Building a package on your own PC doesn’t ensure you the well working of a package. Because like every user, you have packages already installed on machine, which some of them may be undeclared build-deps. So the package built well on your machine, but won’t build in a clean environment.

There are a lot of ways to have a clean environment, here is a list :

As you guessed, the following will be about the pbuilder tool.

A pbuilderrc file can be used to configure pbuilder. Often placed in $HOME/.pbuilderrc, this i a shell script which is launched by pbuilder at the beginning of its work.

Like I already explained in the posts The ultimate Debian/Ubuntu package building system and Pbuilder and tmpfs can be friends, the .pbuilderrc file helps setting all aspects of these chroots creation and use.

After a lot of work on this configuration, I wrote a quite complete pbuilderrc now, supporting the use of qemu-debootstrap, which is an evolved debootstrap. It uses QEMU to virtualize the chroot hardware architecture. So now we can build ARM packages on a I386 or AMD64 machine without using a cross-compilation.

Before using this pbuilderrc, you need to install the qemu-debootstrap package. Available on squeeze-backports, wheezy and sid for Debian, and starting natty for Ubuntu.

I also recommend the reading of the post The ultimate Debian/Ubuntu package building system to have all needed tools to use pbuilder with this kind of configuration.

The pbuilderrc is available on my GIT repository named “scriptomaniak” available on github.

Download it in your /root/ folder, under the .pbuilderrc name.

Don’t hesitate to comment this work and submit patches/pull requests.

That’s all folks !