Remove pvm script no longer needed
Add xfade-run script to setup environment

Without this patch there isn't an easy way to install Gem dependencies
into the crossfader runtime environment itself.  This is a problem
because we need a way to easily run commands inside of an environment
that has all of the libraries we need.

We can't simply install to the system gem location since we need to keep
that gem path clean for other uses.

This patch addresses the problem by initializing the gem home at
/opt/crossfader/runtime/gemsets/crossfader.  In addition the global
gemset is initialized.

This should help packaging tasks that can produce an updated tools
package by simply packaging up the
/opt/crossfader/runtime/gemsets/crossfader directory.
Package crossfader runtime gemset

This gemset will contain all of the libraries required to run the
crossfader gem command itself.  This is expected to be minimal, but in
the event it grows it will be nice to have this out of the way and not
polluting the interpreter's gem library path.
Add crossfader gem scaffold from bundler

This gem scaffold was produced using bundler:

    bundle gem --bin crossfader
Update crossfader gemspec summary and description

This patch simply fills out a basic summary and description.
Fix backline package name

Without this patch the existing backline packages are missing encoding
translators which is a problem because it's interfering with pry's
ability to display interactive prompts.  This in turn is making it
really difficult to build crossfader since there's a problem I'm having
difficult debugging because pry doesn't work right.

This patch addresses the problem by updating the backline configuration
to use the new build names.  This should result in a backline package
with bundler installed and all of the encodings properly generated.
Fix rake task unable to execute commands

Without this patch we're seeing failures we weren't previously seeing in
the Jenkins builds.  The failures look like:

    $ bundle exec rake crossfader --trace
    ** Invoke crossfader (first_time)
    ** Execute crossfader
    rm -rf pkg
    rm -rf destroot
    rm -rf artifacts
    git clean -fdx src/
    git checkout HEAD src/
    rm -rf /opt/crossfader/runtime
    bundle exec rake PVM_CONFIG=crossfaderuntime build
    rake aborted!
    Command failed with status (127): [bundle exec rake PVM_CONFIG=crossfaderunti...]
    /Users/jenkins/workspace/Crossfader-Package-MacOSX-10.8/.bundle/gems/ruby/1.9.1/gems/rake-10.1.0/lib/rake/file_utils.rb:55:in `block in create_shell_runner'
    /Users/jenkins/workspace/Crossfader-Package-MacOSX-10.8/.bundle/gems/ruby/1.9.1/gems/rake-10.1.0/lib/rake/file_utils.rb:45:in `call'
    /Users/jenkins/workspace/Crossfader-Package-MacOSX-10.8/.bundle/gems/ruby/1.9.1/gems/rake-10.1.0/lib/rake/file_utils.rb:45:in `sh'
    /Users/jenkins/workspace/Crossfader-Package-MacOSX-10.8/.bundle/gems/ruby/1.9.1/gems/rake-10.1.0/lib/rake/file_utils_ext.rb:37:in `sh'

I believe this is caused by a change in behavior where by the shell command
being executed is passed as a single string and as such the environment
variables for GEM_HOME and GEM_PATH are not being exported correctly.  This
patch addresses the problem by passing the command to execute as an array,
thereby avoiding the shell since the sh command follows the same semantics as
Kernel.exec()
Install crossfader script and package in the gems

Without this patch we don't actually have the crossfader command line
utility to manage GEM_HOME and GEM_PATH.  This patch addresses the
problem by installing the script from the crossfader gem directory.
Add minimally functional crossfader command
Stop using bundler because it interferes with gem installation

Without this patch it's difficult to use the parent rake task to build
all of the packages because Bundler starts off and pollutes the
environment.  This environment pollution prevents the gem install
command from installing the bundler gem into the correct location.
Instead it installs into the bundle directory for the build.

This patch fixes the problem by removing all situations where bundler is
used during the build process.  The CI job is expected to use rake
directly.  Bundler may still be used to install dependencies, but the
job is expected to do something like this:

    #!/bin/bash
    set -x
    set -e

    sudo rm -rf /opt/crossfader
    sudo mkdir /opt/crossfader
    sudo chown $USER:0 /opt/crossfader
    sudo chmod 755 /opt/crossfader

    # NOTE: This job specifically avoids using bundler since it interferes with the rake
    # tasks that installs gems into the target directory that is meant to be packaged.
    eval "$(/opt/backline/bin/backline shellinit)"
    bundle install --path .bundle/gems/
    bundle clean

    # Don't use bundle exec, it pollutes the shell environment
    export GEM_PATH="$(pwd)/.bundle/gems/ruby/1.9.1:${GEM_PATH}"
    export PATH="$(pwd)/.bundle/gems/ruby/1.9.1/bin:{$PATH}"

    echo "Building crossfader packages..."
    rake crossfader
Install trollop to crossfader gemset

Without this patch the `/opt/crossfader/bin/crossfader` executable fails
to start because it cannot load trollop.  This patch addresses the
problem by installing trollop into the crossfader runtime gemset at
`/opt/crossfader/runtime/gemsets/crossfader`.
Install base gemset for each config that has a gemfile

Without this patch gems are not automatically installed for each of the
Ruby runtimes that need certain gems installs.  In particular, each
runtime should at least start with `bundler` installed in the default
gemset named `crossfader`.

Users will be expected to install their own gems using something like:

    crossfader --gemset foo exec gem install bar --no-ri --no-rdoc
Refactor crossfader into a full gem

Without this patch it's difficult to install the crossfader command line
utility without doing so with a hacked together rake task or what have
you.  This is a problem because it needs to be relatively easy to update
the user facing command line utility itself.

This patch addresses the problem by transforming the crossfader command
into a full fledged Gem.  Installation of the utility into the runtime
environment is now a simple `gem install` and everything goes into the
right place with the right dependencies.

The only additional task required is to link
/opt/crossfader/bin/crossfader to the installed gem executable at
/opt/crossfader/runtime/bin/crossfader.  This is necessary to keep the
runtime ruby environment out of the general PATH but still easily
accessible from a self contained prefix installation location.

It's important to note this design and layout only apply to the Ruby
runtime for crossfader itself.  The ruby versions that are activated by
the crossfader tool are still independent and will have unpolluted
system gem repositories.
Fixup crossfader gem installation
Merge branch 'crossfader'

* crossfader:
  Fixup crossfader gem installation
  Refactor crossfader into a full gem
  Install base gemset for each config that has a gemfile
  Install trollop to crossfader gemset
  Stop using bundler because it interferes with gem installation
  Add minimally functional crossfader command
  Install crossfader script and package in the gems
  Fix rake task unable to execute commands
  Fix backline package name
  Update crossfader gemspec summary and description
  Add crossfader gem scaffold from bundler
  Package crossfader runtime gemset
  Add xfade-run script to setup environment
  Remove pvm script no longer needed