This simple quide shows you how to recompile binary source files on Debian/Ubuntu
Read it here
To build a Debian package, you need the following packages / software installed on system
[a] fakeroot : fakeroot package – runs a command in an environment wherein it appears to have root privileges for file manipulation. This is useful for allowing users to create archives (tar, ar, .deb etc.) with files in them with root permissions/ownership.
[b] dpkg-dev : package building tools for Debian
[c] Development environment – You need gcc, make and all other compiler collection installed on system. Under Debian / Ubuntu package build-essential takes care of everything.