Backporting Debian packages (sid -> sarge): experiences with pbuilder

Simple package building
———————-

1. First things first, get puilder:

apt-get install

2. Then build an initial image:

pbuilder create –distribution sarge –mirror http://ftp.ch.debian.org/debian

3. Get package sources (`.dsc`, `.diff.gz` and `.orig.tar.gz` files)
4. Build the package:

pbuilder build .dsc

Complex package building (with dependencies)
——————————————–

While playing with packages, I had the following problem: `packageA` build a few packages, one of them `packageA-dev`. The next package I was trying to build `package-B` had a build dependency on `packageA-dev`. However, as `packageA` was not in sarge, pbuilder couldn’t satisfy the dependencies and failed.

Trying to solve this problem, I found the following workaround:

1. Create an apt repository with newly build packages

dpkg-scanpackages . /dev/null | gzip > Packages.gz (in /var/cache/pbuilder/result)
touch Release

2. “Mount” the directory to be visible in the chrooted builder environment:

–bindmounts “/var/cache/pbuilder” (runtime)
or
BINDMOUNTS=”/var/cache/puilder” (config file)

3. Add the appropriate apt sources:

–othermirror “deb file:/var/cache/pbuilder/result ./” (runtime)
or
OTHERMIRROR=”deb file:/var/cache/pbuilder/result ./” (config file)

BTW: If you’re changing the config file after you’ve build the image, you should update base.tgz file using the following command:

pbuilder update –override-config –distribution sarge

BTW: [pbuilder manual](http://www.netfort.gr.jp/~dancer/software/pbuilder-doc/pbuilder-doc.html) can be useful.

One Response to “Backporting Debian packages (sid -> sarge): experiences with pbuilder”

  1. Tadek’s Blog » Blog Archive » Anti-virus and anti-spam measures on my server Says:

    [...] Tadek’s Blog Some random notes about computers, security, cool links and others. « Backporting Debian packages (sid -> sarge): experiences with pbuilder [...]

Leave a Reply