Thursday, November 12, 2009

Building .deb package from source

Here's how to easily build a .deb package for ubuntu (or debian). You could build a .deb package using checkinstall, but that wouldn't include all the debian/ubuntu specifics you need. I used the following to build the ubuntu package for my next release of News notification.

First off, let's install the necessary tools:
# apt-get install autotools-dev fakeroot dh-make build-essential

Then copy your source tree into a directory in /tmp:
# cp -r news-notification-0.3 /tmp
# cd /tmp/news-notification-0.3


Now let's make the debian control files:
# dh_make
and pick Single for single binary, or whatever is appropriate for your project.

Edit the debian/control file and at least change the Maintainer and Description fields. There are a few other files you will probably want to edit.

Then run the following: (this has to be done as root)
# dpkg-buildpackage -rfakeroot

No comments:

Post a Comment