implement automatic cpack versioning

Previously, DEB packages generated with CPack had useless version information, meaning that the higher-versioned official packages would try to overwrite ones from the git repository. This patch does some regexp magic to automatically version the resultant DEB.

I don't have an RPM system to test results there with, but it should either work straight out, or with trivial patching (I am not versed in RPM's versioning strictness)