Build: Add CPack scripting to build DEB and RPM packages

We found it convenient to use CMake and CPack as the target build system for the project instead of autotools and regular makefiles, as it seems to provide more coherent, portable and compact scripting. Despite of these benefits we had some problems with CPack support for building packages, that leads us to develop some patches to this tool to have the things work as intended with no extra complication of scripting.