Setting up your own PPA - Part 1


Setting up your machine



Let’s get the initial bunch of development packages installed. Not all of those are strictly necessary (vim for example), but this is what I’m using currently. I’m using LVM in order to create the necessary schroots for local builds, even though this is not strictly necessary I found it to be a good way of separating stuff. If you intend to use it as well, remember to leave some free space on your disk (unpartitioned) for it.

sudo apt-get install screen build-essential ssh git-core subversion cvs devscripts cdbs vim gnupg-agent pinentry-curses lvm2 ubuntu-dev-tools

The gnupg-agent and pinentry-curses packages are there to help with the whole signing process, in order to use them you also have to:
  • Put eval $(gpg-agent --daemon) in your .profile;
  • Change your .gnupg/gpg-agent.conf file to look like this:

pinentry-program /usr/bin/pinentry-curses
default-cache-ttl 86400
max-cache-ttl 86400

I’m assuming here that you have already created an user and a PPA for yourself on Launchpad, if you haven’t go and do that now. Make sure your gpg key is configured correctly otherwise this whole thing won’t work.

Setting up sbuild


Just getting it out of the way, the reason I went with sbuild instead of pbuild is that sbuild is what Launchpad uses to actually build your packages. Some people prefer to use pbuild, so be aware of that in case you find the whole sbuild process a pain (which it is, let’s be honest).

Though we do not strictly need sbuild in order to have our own PPA, it will greatly enhance our build-failure debugging process so thats why it’s recommended to set it up.

The ubuntu-dev-tools package provides us with some really good helpers to configure this whole thing, given we already have a LVM volume group created and with free space for us (here this vg group is called ubuntu). The mk-sbuild script will setup a schroot on the specified Ubuntu release, so for Ubuntu 12.04 (Precise Pangolin) just run mk-sbuild --vg=ubuntu precise and wait until it finishes.

After your schroot is configured, there is a quick change you should do to its configuration in order to actually be able to use it. No idea why but access to the source schroot is no longer enabled by default, so just edit the specific configuration under /etc/schroot/chroot.d/ and uncomment the specific lines mentioned there. This will allow you to enter the source schroot and make permanent changes to it. For those not familiar with the terms here, sbuild works by creating a bare bones chroot environment using schroot and then using this stripped down chroot to install your build dependencies and build your packages. This way it guarantees that your package has the correct build dependencies listed, otherwise your package would not be building properly. The source schroot is this bare bones chroot environment.

One thing that you’ll need to do to your schroot (and which can be done in other ways but this is the one I found out first so it’s the one I’m using) is to enable your own PPA there so it can properly find dependencies whenever you start having them there. Just enter your source schroot by running schroot -c precise-i386-source -u root and from inside run add-apt-repository ppa:efl/trunk and be happy. One thing you’ll want to do from time to time is to enter the schroot and update && dist-upgrade, this will speed up future builds.

Next steps


In the next post (this one is already quite long as it is) I will explain about the package building process. This will involve going over a few scripts which I’m preparing to put on a public git so they can actually be reused afterwards. If you’ve any questions about the procedure thus far please feel free to comment and I’ll try to help you out.

References



  1. Sbuild LVM Howto
  2. Ubuntu Security Team Build Environment Guidelines
  3. mk-sbuild guide from Debian
blog comments powered by Disqus