Backporting Debian packages (sid -> sarge): experiences with pbuilder
Simple package building
First things first, get puilder:
apt-get installThen build an initial image:
pbuilder create --distribution sarge --mirror http://ftp.ch.debian.org/debianGet package sources (
.dsc,.diff.gzand.orig.tar.gzfiles)Build the package:
pbuilder build <package>.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:
Create an apt repository with newly build packages
dpkg-scanpackages . /dev/null | gzip > Packages.gz (in /var/cache/pbuilder/result) touch Release“Mount” the directory to be visible in the chrooted builder environment:
--bindmounts "/var/cache/pbuilder" (runtime) or BINDMOUNTS="/var/cache/puilder" (config file)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 can be useful.
February 7th, 2006 at 1:37 am
[...] Tadek’s Blog Some random notes about computers, security, cool links and others. « Backporting Debian packages (sid -> sarge): experiences with pbuilder [...]