checkinstall

Track the local installation of a software package, and produce a binary package which can be used with a system's native package manager. More information: http://checkinstall.izto.org.

sudo checkinstall --default

sudo checkinstall --install=no

sudo checkinstall --nodoc

sudo checkinstall --pkgname package

sudo checkinstall --pakdir path/to/directory