Take a read of https://wiki.debian.org/Packaging
- it has all the resources you need, you need a debian machine to start with though!
in a nutshell a .deb file is a compressed archive file that does some cool stuff when extracted (a but like an MSI file on windows)
when you build a deb file you create a set of rules that define whats to happen to the files inside the .deb archive, this can be anything from just copying the files to destination or running more complex setup commands that takes user input
for python modules/eggs - theres a specific debian wiki page that recommends how to handle this specifically: https://wiki.debian.org/Python/Packaging
obviously this only applies to debian based systems (debian, ubuntu, mint etc)
for redhat (RPM) based systems (Fedora, RedHat, CentOS) then look here: http://fedoraproject.org/wiki/How_to_create_an_RPM_package
or here: http://docs.python.org/2.0/dist/creating-rpms.html