Add a version-regexp option to customize how to extract version

We get versions like "2.1.28.gd935757" from OpenStack tarballs, with
d935757 being a commit id. This has two issues: this means new versions
can increase or decrease (since there's no guarantee the commit id
always go up), and we already put the commit id elsewhere in the rpm
version.

By specifying a custom regexp ('.*-([^-]+)\.g[a-zA-Z0-9]{7}'), we can
avoid this.

Note that the default ('.*-([^-]+)') matches the old behavior.