Packaging your application for Debian and derivatives: First .deb step by step
How to package an application into a .deb package for Debian, Ubuntu, and derivatives. Covers the role of dpkg and apt, the internal structure of a .deb, creating the installation tree, the DEBIAN/control file, building with dpkg-deb, installation/uninstallation testing, and advanced options such as command-line scripts