<?xml version="1.0"?>
<doc>
	<title>Development - Setting up pbuilder</title>
	<body>
	<p>This is a very quick and brief guide to how I currently set up pbuilder, it works for me, there might be better guides about, I don't know, I haven't looked.</p>
	<p>First, you need to have pbuilder and debootstrap installed... after that create a temporary directory and <code>cd</code> in to it.</p>
	<p>Next step is to debootstrap for the distribution you are going to develop for, so <code>debootstrap --variant=buildd dist . http://some/mirror</code> which will create the basic filesystem, you're almost ready... now, go in to that and edit the etc/apt/sources.list adding in a line for your prefered mirror. Next step is to clean out the cache that's in there, so, remove all the .deb files from var/cache/apt/archives.</p>
	<p>Now you need to make a .tgz of the stuff, so... <code>tar -czf /var/cache/pbuilder/base-dist.tgz .</code> will create you a file suitable for use with pbuilder, you no longer need the files in your temporary directory (assuming that the .tgz file was created nicely). So, you've got this base-dist.tgz file, what next? You'll probably need gnupg in the pbuilder setup (certainly for the more recent debian distributions, and for hoary, it makes it a lot easier if you have this...), so, <code>pbuilder login --basetgz /var/cache/pbuilder/base-dist.tgz --save-after-login</code> once that's 'logged you in' you'll need to run <code>apt-get update</code> and then <code>apt-get install gnupg</code>, then you can exit the chroot and all should be well with the world, it should save the changes in to the .tgz file ready for later use.</p>
	<p>From now on in, you should be fine to just use the usual pbuilder commands with the --basetgz flag pointing to the right base file, and all should be well.</p>
	<p>I use sudo in order to run pbuilder myself, and so I've actually got some simple single line wrapper scripts that I use, I also use the --buildresult flag in order to seperate out the builds from the different pbuilder setups.</p>
	<p>I hope that this quick guide helps, that's about it...</p>
	</body>
</doc>
