HOWTO : Build deb from source on Ubuntu 9.04

Download checkinstall

sudo apt-get install checkinstall

Download the source file, such as foo.tar.gz and extract it.

wget http://www.foo.com/downloads/foo.tar.gz

tar -xzvf foo.tar.gz
cd foo

./configure
make
sudo checkinstall

After that, the package will be installed automatically and a deb is also generated. You can uninstall package as usual.

For checkinstall usage, please man it.