11

Often I need to create packages which another package depend on (i.e. build dependencies). Instead of having all those packages first being build in my ppa (which can sometimes take some time), I would like to use the results directory from pbuilder as a source for the pbuilder itself.

How can I do this? Can I do this via a hook?

txwikinger
  • 29,406

2 Answers2

7

This can be done a few ways. As mentioned by adol, the Ubuntu wiki has a nice example of how to do this by creating a local repository with mini-dinstall and adding that to your pbuilder config. Dennis' answer about using dpkg-scanpackages works as well.

I've been doing this recently with apt-ftparchive. I like this approach since I find it very light weight. Here's annotated example of what I do:

# From my ~/.pbuilderrc file

# Location of the dir where you keep pbuilder hook scripts.
HOOKDIR="/home/andrew/.pbuilder-hooks"

# Path to your local repo to be used as a mirror written as apt source line.
OTHERMIRROR="deb file:///home/andrew/pbuilder/local_repo ./"

# Path to your local repo. This tells pbuilder to mount this directory so it is available in the chroot.
BINDMOUNTS="/home/andrew/pbuilder/local_repo"

# As we need to have the apt-ftparchive command, we need to insure this package is installed.
EXTRAPACKAGES="apt-utils"

You also need a pbuilder hook:

# From my ~/.pbuilder-hooks/D5update-local-repo file

# Path to the local repo.
LOCAL_REPO="/home/andrew/pbuilder/local_repo"

# Generate a Packages file.
(cd $LOCAL_REPO ; apt-ftparchive packages . > Packages)

# Update to include any new packages in the local repo.
apt-get update

Now all you have to do is drop the packages into your local repo and they will be available to pbuilder. If you are trying to chain build a string of dependencies you can make you pbuilder results directory as your local repo directory.

You can probably imagine other variations on this. For instance, you could use dput with a post_upload_command to generate the Packages file instead of using the hook.

This Debian wiki page could also be helpful.

5

You can stick them in a simple repo created with dpkg-scanpackages and make that available via apache. Then update pbuilder's apt config to use your repo.