Apply the RHEL7 work and merge it into 1.6.x

As per @haus the updates for building Puppetdb packages on RHEL7 have been cherry-picked and applied to the `1.6.x` branch.