Add release ENV var to puppetdb packaging

This commit modifies the packaging of puppetdb
to allow the user to specify a tag release, e.g.
0.9.2-1puppetlabs2 vs 0.9.2-1puppetlabs1.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Merge pull request #223 from MosesMendoza/maint/master/add_release_option_to_puppetdb_packaging

Add release ENV var to puppetdb packaging
Add SRPMS directory creation to rake:SRPM task

Some configurations of rpmbuild won't make the SRPMS directory automatically
when building an RPM, so this commit adds a mkdir_p to the rake task to make
the directory before running rpmbuild. Otherwise, the rpmbuild call fails when
rpmbuild can't write the src rpm to the SRPMS directory (because it doesn't
exist).
Merge pull request #224 from haus/add_srpm_dir_creation_to_rake_task

Add SRPMS directory creation to rake:SRPM task
Fix resource terminus specs to pass against Puppet master branch
Add a `rake version` task to print the version

This is useful for CI, where we need to determine what version of the
code is being tested, for building packages, etc.
Merge pull request #225 from nicklewis/add-version-task

Add a `rake version` task to print the version
Setup maven to use squid proxy during acceptance
Add acceptance setup support for RPM-based systems

This supports running the acceptance tests against the development yum
repo on neptune.
Merge pull request #230 from nicklewis/support-rpm-tests

Add acceptance setup support for RPM-based systems
Merge branch 'feature/master/maven-use-squid-proxy-during-acceptance'
Add some sanity checks to verify database communication

This commit adds some sanity checks to run after the
acceptance run completes, to try to ensure that
puppetdb was actually talking to the database that we
intended for it to be talking to (rather than giving
us false positives running against a different database.)
Merge pull request #227 from cprice-puppet/maint/master/add-db-sanity-checksto-acceptance

Add some sanity checks to verify database communication
Add support for a --debug flag, and a startup script

This commit adds support for a new command-line flag:
--debug.  For now, this flag only affects logging;
it forces a console logger and ensures that the
log level is set to DEBUG.  The option is also
added to the main config hash so that it can potentially
be used for other purposes in the future.

This commit also adds a shell script, "puppetdb-services",
which can be used to launch the services from the
command line.  This script will be packaged (in /usr/sbin)
along with the puppetdb-ssl-setup script, and will
hopefully be useful in helping users troubleshoot
problems on their systems.
Correctly detect absence of postgresql package

When using yum, `puppet resource package postgresql` returns "ensure =>
absent" rather than "ensure => purged" when the package isn't installed.
We need to handle this case correctly.
(#15536) Fix several bugs with packaging

This commit provides several fixes and some cleanup
in our packaging scripts:

* Move most of the work of populating jetty.ini out of
  the shell scripts and into the erb template.
* Move all of the directory permissioning into a common
  erb template to be shared for both debs and rpms
* Move the logic for populating the jetty.ini file with
  the facter FQDN into the ssl-setup script, since that
  is the main place where we're manipulating that file.
* Fix "@lib_dir" in the Rakefile to point to the libdir,
  /var/lib/puppetdb etc., rather than to /usr/share/puppetdb.
* Add an "@etc_dir" in the Rakefile to simplify directory
  permissioning.
* Change the "package" task in the Rakefile to use a
  system tmpdir for it's staging area, rather than a
  local subdir.  This allows devs to build debs on
  a local VM that has a shared filesystem with the
  host VM, so you only need one copy of the source
  and can edit it in your normal dev environment.
Support running acceptance from source on redhat-based systems
Configure yum and apt to use a proxy during acceptance

This commit adds a setup step to our acceptance testing
which configures yum or apt (depending on the puppetdb
host's OS) to use a proxy server.  Hopefully this
will shorten the run time of our acceptance runs and
make us less susceptible to problems related to
packet loss between the office and the outside world
when our network gets shaky.
Make utility functions more general, rename puppetdb-services

This commit does the following:

* Cleans up the new logging utility functions to make them more
  general-purpose
* Pulls the "initial-config" map back out of the inis-to-map
  function, to keep that function clean
* Renames puppetdb-services to puppetdb-foreground
Merge pull request #226 from cprice-puppet/bug/master/15536-packaging-bugs

(#15536) Fix several bugs with packaging