Replace erb conditional with rpm macro conditional.
[packaging] Add initial packaging yaml files to './ext'

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
[packaging] Add a Rake file with a task for cloning the packaging repo

This rakefile provides the basic cloning and removal of the packaging repo in
ext/packaging.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
[packaging] Update the project.clj file to use `rake version`

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
[packaging] Rewrite Rakefile for packaging repo, split out separate tasks

This commit rewrites the top-level Rakefile in puppetdb to use the packaging
repo. All debian/redhat methods and tasks supplied by the packaging repo are
removed. Because of the fairly specialized logic in the tarball composition
phase of puppetdb packaging, we take an approach similar to the one used in PE
live-managment packaging, which is to selectively undefine tasks loaded from
the packaging repo that we would rather override with ones specialized for this
project, e.g. everything up to tarball creation, and clean/clobber. This commit
also moves the remaining tasks out into their own files under tasks/ for
readability/organization and to make the Rakefile a little more sane.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
[packaging] Move redhat spec erb into ext/redhat

Per packaging repo standard

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
[packaging] We need the new Rake task files in our tarball as well

Otherwise `rake install` in the spec/rules won't work.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
[packaging] redhat spec fixups to remove erb os-based conditionals

The problem with evaluating os-based conditionals in the erb templating
is that it forces us to use different srpms for different OS's etc. This
becomes less sustainable as we try to automate more of this with the
packaging repo, which expects the specfile to take care of itself
regarding such things. This commit replaces some of the conditionals
with actual redhat spec conditionals. The biggest change is that of
changing the puppet_libdir assignment when building for pe to the
ruby sitelibdir, instead of a conditional on ruby version. Additionally,
on the redhat side, we support ruby 1.9 for fedora >= 17, so this commit
changes that conditional from an os_family fact check to a spec file
conditional, to avoid having to build different FOSS rpms for different
ruby versions.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
[packaging] replace hardcoded references to puppetdb in tar.rake
[packaging] Redhat specfile changes to update source based on name

The packaging repo creates tarballs based on project name, which varies
based on if this is PE vs not PE. This commit updates the templating as
such.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
[packaging] Whitespace fixes in redhat specfile
[packaging] Move debian into ext, not top level

per packaging repo expectations, which wants ext/{redhat,debian}

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
[packaging] Remove @plibdir from terminus install and name files explicitly

The terminus package shouldn't own the puppet lib dir, but rather just its own
files therein. This commit makes it so. It also removes the @plibdir
conditional in favor of a @pe conditional to help us move toward getting rid of
the OS-specific path templating in build artifacts.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
[packaging] Explicitly chown files in the terminus postinst

Rather than a wholesale chown -R of the entire puppet libdir. Also, replace the
@plibdir with actual paths.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
[packaging] symlink pe-puppetdb redhat specfile to puppetdb

The packaging repo expects a specfile named after the project. A
dual-purpose one like puppetdb's isn't supported yet, so we need to one,
even it is just a symlink. However, there's a drawback. Ruby 1.9.3 won't
let us copy the symlink before the target and preserve attributes when
the target of the symlink doesn't exist yet, since it tries to set the
symlink metadata using a file that doesn't exist yet. This means we have
to use the system cp to create the dangling symlink in the workdir.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
[packaging] Rework acceptance package build for packaging repo

This commit replaces much of the shell work to build packages with packaging
repo rake task invocations (though still via the acceptance package build shell
scripts). The packaging repo can do ssh remote building for us, so we don't
have to ssh out quite as much as we used to. One significant change, which we
may decide to undo later, is that the acceptance package builds for debian now
build puppetdb in every cow we ship.  This is technically the appropriate way
to accomplish this, as opposed to the single squeeze-based build we currently
ship for FOSS puppetdb to all dists. However, the downside is a dramatically
increased time to build all packages, with the current infrastructure setup.
However, the improvement in build times is actually a current project for
release, so the pain may be shortlived.
[packaging] list terminus files in redhat spec
[packaging] Don't force terminal allocation since freight revert
[packaging] Don't attempt to use params file inside build root

When ENV['PARAMS_FILE'] has a value, as it does with remote builds, the next
iteration of the packaging repo will attempt to read packaging data from the
path supplied. This environment variable remains set inside the buildroot, but
the path is no longer accessible/correct inside the buildroot. Luckily, since
we don't use anything other than defaults and the env vars passed in the rake
calls inside the buildroots, we don't need PARAMS_FILE anyway. This commit
ensures it is not set for this case.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Remove space between DESTDIR and value

The space between DESTDIR= and $RPM_BUILD_ROOT in the rake call in the rpm spec
file means that DESTDIR gets set to nothing, which later means that puppetdb
and the terminus are installed at top level, which does not work in mock when
building as a non-root user (as it shouldn't). This commit removes the space so
that the DESTDIR is correctly set.