Thursday, October 11, 2007

CowBuilder + CCache

I'm a GetDeb contributor, building Ubuntu packages of new applications. The build system I use is CowBuilder (pbuilder/cowdancer) plus CCache to speedup the process.

Following is a simple guide to setup such an environment on an Ubuntu system.

  1. Install packages:
    sudo apt-get install cowdancer ccache
  2. Edit ~/.pbuilderrc :
    ## Overrides /etc/pbuilderrc

    # Default distribution
    DISTRIBUTION=feisty
    COMPONENTS="main restricted universe multiverse"

    # Repositories
    MIRRORSITE=http://br.archive.ubuntu.com/ubuntu

    # Bash prompt inside pbuilder
    export debian_chroot="pbuild$$"

    # Faster dependency resolution
    PBUILDERSATISFYDEPENDSCMD="/usr/lib/pbuilder/pbuilder-satisfydepends-gdebi"

    # CCache setup
    export CCACHE_DIR="/var/cache/pbuilder/ccache"
    export PATH="/usr/lib/ccache:${PATH}"

    EXTRAPACKAGES=ccache
    BINDMOUNTS="${CCACHE_DIR}"
  3. Create CCache directory (user 1234 is default inside cowbuilder):
    sudo mkdir /var/cache/pbuilder/ccache
    sudo chown 1234 /var/cache/pbuilder/ccache
  4. Create the build environment:
    sudo cowbuilder --create --distribution feisty
After the (rather long) download and install procedure you can start compiling your own packages like this:
sudo cowbuilder --build flv2mpeg4_0+svn3-1~getdeb1.dsc

The resulting package can be found in /var/cache/pbuilder/result/

Labels: