configure: Split git tag searching from tarball downloading

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Have git archive generate tar.gz directly

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Factor out specfile preprocessing into a separate function

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Add version to tarball name and result directory

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Remove the @PREFIX@ substitution

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Copy spec files before rewriting

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Use urlparse to process git:// URLs

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Separate repository version query from archive download

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Rewrite spec files using Python, not sed

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Download git source after rewriting spec file

Use the rewritten URL in the spec file.    This makes the
flow of control for git-based packages more simlilar to
the flow for tarball-based packages.

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Fix most pylint warnings

Also tidy up whitespace

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Remove globals, fixing last pylint warnings

Signed-off-by: Euan Harris <euan.harris@citrix.com>