Handle .spec.in files

Codebases often contain a .spec.in file. When ./configure is run, it
expands variables like @PACKAGE_VERSION@ in .spec.in to create the
.spec file.

We have a chicken-and-egg problem here:

* We need to install RPM dependencies before Running ./configure, or
  else it might fail.

* We need to parse the .spec file to get the list of RPM dependencies,
  but this .spec file is generated by ./configure.

So hack around it by extracting known variables (@PACKAGE_NAME@ and
@PACKAGE_VERSION@) from configure.ac using a regex search. Then do
simple string replacement on .spec.in to create .spec. Not perfect,
but should work for most .spec.in files, and we fail if we encounter a
variable we don't recognize and therefore cannot expand.