packaging: fix deb and tgz packaging

This patch addresses two issues: Debian building fails for tagged versions
and tar packages are missing a '-1' in their name.

The Debian packaging takes care that the '-SNAPSHOT' in the project version
becomes '~SNAPSHOT' in the debian version; however, for a tagged version,
there is no "-SNAPSHOT" in the project version, so the regex substitution
fails.  This patch makes this optional.

Currently, tar.gz releases are built like dcache-2.7.0.tar.gz.  We publish
tgz release with filenames like 'dcache-2.7.0-1.tar.gz'.  This patch alters
the build so the resulting file may be used directly.

Target: master
Request: 2.7
Patch: http://rb.dcache.org/r/6046/
Acked-by: Tigran Mkrtchyan
Requires-notes: no
Requires-book: no