(packaging) Update top-level Rakefile's version and pe determination

Prior to the commit, the versioning in puppetdb would fail from a rake
perspective if the packaging repo wasn't present. This commit updates it to
fall back to git describe and if that fails to a hardcoded string, so that we
always have a version. We also set the @version variable to
Pkg::Config.version, which is how we access data provided by the packaging repo
in the new library-format.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
(packaging) Update template task for new erb_file method

The packaging repo will have all utilities split out into different classes for
sanity's sake, and one of the tools that got an overhaul is erb. This commit
updates puppetdb to use the new utility.
(packaging) Fully qualify variables supplied by the packaging repo in templates

Part of the variable scoping overhaul within the packaging repo was ensuring
the data about builds lives inside module Pkg::Config. In other projects, we
only use variables set by the packaging repo in templates, which means we can
pass the binding of the packaging repo Pkg::Config class into the template
engine and keep using "@" variables like we always have. But in puppetdb, we
mix data supplied by the packaging repo and data supplied by puppetdb itself in
the same template, which means we can't use just the Pkg::Config scope. Since
there are far more variables supplied by puppetdb in the templates than the
packaging repo, we opt to use the puppetdb scope and fully qualify access to
the variables supplied by the packaging repo, by referencing them as
Pkg::Config wherever we use them.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
(packaging) set project to pe-puppetdb when building pe-puppetdb

Until we split out the packaging of pe-puppetdb from puppetdb, with the new
packaging system we need to explicitly tell the automation that the project
we're building is called 'pe-puppetdb' instead of 'puppetdb.'

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
(packaging) Evaluate rpm spec file just like debian templates

Prior to this commit, we evaluated all of the debian templates when creating a
tarball, resulting in a 'ext/debian' directory containing usable debian
artifacts. On the other hand, we didn't bother creating the redhat spec from
the corresponding template, leaving that as an exercise left to the reader.
This seems odd. All of our other projects have fully usable spec files in their
tarball, and puppetdb should to. This also has the added benefit of allowing us
to control the binding context like we do on debian, instead of letting the
packaging repo do it. This means we can still mix puppetdb-defined '@'
variables with 'Pkg::Config' accessors supplied by the packaging repo.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
(packaging) Replace non-portable shell calls in spec and changelog with ruby

Prior to this commit, we shelled out to `hostname` and `date` in the redhat
spec template and the debian changelog, which is poor practice if we expect to
template that file anywhere else. This commit updates these calls to use their
most simpl ruby equivalents, though we risk that we may not get a FQDN for
hostname. This doesn't really matter a ton by rpm standards, so I'm fine with
it.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Merge pull request #835 from MosesMendoza/packaging/1.5.x/update

Update packaging for new tooling (To be merged Monday 2/10)
Merge branch '1.5.x' into 1.6.x

* 1.5.x:
  (packaging) Replace non-portable shell calls in spec and changelog with ruby
  (packaging) Evaluate rpm spec file just like debian templates
  (packaging) set project to pe-puppetdb when building pe-puppetdb
  (packaging) Fully qualify variables supplied by the packaging repo in templates
  (packaging) Update template task for new erb_file method
  (packaging) Update top-level Rakefile's version and pe determination

Conflicts:
	Rakefile
	tasks/template.rake