Building Debian Packages from Source

This is already well documented in the Debian FAQ, but here goes…

To get the source to the current directory:

$ apt-get source PACKAGE
$ cd PACKAGE_DIR

To change the build rules. For example, if you simply want to change a configure option:

$ vi debian/rules

To change the version number, you must add a record to the changelog. This is important if you want apt to keep your version installed, rather than continually ‘upgrading’ it:

$ vi debian/changelog

To rebuild the package:

$ sudo apt-get build-dep PACKAGE
$ dpkg-buildpackage -rfakeroot -b

This creates the package in the parent of the current directory. You can install it from there:

$ cd ..
$ sudo dpkg -i PACKAGE.DEB

Comment · Comments Feed · TrackBack

  1. Chris said,

    28 May, 2006 @ 23:01

    Tried apt-build?

Leave a Comment

Sponsors