Update Rakefile to make rspec optional

Currently rspec is a hard dependency to using the Rakefile for puppet. This
means that users on platforms without native rspec packages can't use the
Rakefile to do other things, like build packages. This commit moves the require
on rspec and rspec/core/rake_task into a begin/rescue block and wraps the call
to Rspec::Core::RakeTask in an `if defined?` conditional so it is only invoked
if Rspec is loaded and available.
Merge pull request #1245 from haus/make_rspec_optional_in_rakefile

Update Rakefile to make rspec optional
(#17260) Include link to information about deprecation

Previously the deprecation warning did link the user to any additional
information about the warning. This adds a link that can be followed to
get a better explanation of the issue and how to resolve it.
Replace dashes with dots for gem version

When switching out to using git-describe for versioning from
source, gem versioning breaks because dashes are not allowed.
This simple fix replaces the dashes with dots, which are.
Note that in a merge-up to 3.0.x, this commit will conflict.
Default to 'ours' in a merge-up, this file does not even exist
in 3.0.x and shouldn't.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Preserve timestamps when installing files

Without the preserve option, ruby's FileUtils.install method uses the
current time for all installed files.  For backup systems, package
installs, and general pedantic sysadmins, preserving timestamps makes a
small improvement in the world.
Merge pull request #1247 from MosesMendoza/maint/2.7.x/preserve_timestamps_install.rb

Preserve timestamps when installing files
Merge pull request #1254 from MosesMendoza/maint/2.7.x/fixup_gem_task

Replace dashes with dots for gem version
Fix build targets for 2.7.x

This commit revises the lists of cows and mocks to build against to remove
redundant and unnecessary targets given Puppet is noarch.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
rm packaging artifacts in rpm spec, debian rules

The 2.7.x packaging will include misc packaging artifacts we shouldn't
ship. This commit removes them in packaging.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Merge pull request #1255 from MosesMendoza/maint/2.7.x/packaging_fixes

Maint/2.7.x/packaging fixes
(#7422) Support arrow syntax with metaparams

Attempts to combine the arrow syntax with
metaparams lead to the following error message:

Error: undefined method `<<' for {}:Hash

For example, the following code:

  Notify['one'] -> Notify['three']

  notify { 'one':
    before => Notify['two']
  }
  notify { 'two': }

  notify { ['three', 'four']: }

Causes this issue. This is because relationships
appended with the -> syntax assume that the current
list of dependencies are an array.

Given that, it is not surprising that the following
code is valid at the moment:

  Notify['one'] -> Notify['three']

  notify { 'one':
    before => Notify['two', 'four']
  }
  notify { 'two': }

  notify { ['three', 'four']: }

In this case, the dependency resources are already
expressed as an array before the arrow syntax appends
the additional dep.

This commit converts everything to an array before
trying to append additional relationships to that
array. The fact that the second code snippet already
works demonstrates that Puppet already supports
appending additional refs to an array of refs.
Merge branch 'fix/2.7.x/7422_fix_relationship_append' into 2.7.x

* fix/2.7.x/7422_fix_relationship_append:
  (#7422) Support arrow syntax with metaparams