Update Debian packaging.

This supersedes #1616 with cleaner changes and shorter commit history.