Mein Haus, meine Stra├če, mein Blob

Okt 03, 2012

Rebuilding debian packages with custom options

Let's assume foo is a package that I want to configure differently than the package maintainer does, but I don't want to go through the hassle of creating my own build scripts. Luckily, Debian (and Ubuntu) provide a way to use the package maintainer's scripts without the need to do anything yourself but enter a few simple lines into your shell.

The following commands will

  1. Download the source code of the latest version available for foo into a subdirectory of the current working directory
  2. Install all the dependencies needed to build foo
  3. Configure foo more to your liking
  4. Create installable deb-files while skipping the signing of those files (since you probably don't have the keys to do that anyway)

Notice that you don't need root for any of those commands!

apt-get source foo
apt-get build-dep foo
cd foo-4.2
./configure --with-more-awesomeness
dpkg-buildpackage -b -us -uc

If you want to, you can increase the version number of foo after configuring it by editing the debian/changelog file. Just copy the previous entry and adjust to reflect your changes.