Fix debian package building mechanism

This comit makes it possible to build debian packages using
dpkg-buildpackage. This fix is a kind of workaround -- it makes
it possible to compile and install the sources using the same
commands as when using autotools, but actually uses cmake build
system. It is still experimental, ie. not tested very well.