#!/usr/bin/ruby

require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rubygems/package_task'

task :default => [:package]

# Create the gem specification for packaging
spec = Gem::Specification.new do |s|
    s.name = %q{rhc}
    s.version = /(Version: )(.*)/.match(File.read("client.spec"))[2]
    s.author = "Red Hat"
    s.email = %q{openshift@redhat.com}
    s.summary = %q{OpenShift Express Client Tools}
    s.homepage = %q{https://openshift.redhat.com/app/express}
    s.description = %q{The client tools for the OpenShift Express platform that allow for application management.}
    s.files = FileList['lib/**/*.rb', 'bin/*', 'conf/*'].to_a
    s.files += %w(LICENSE README Rakefile)
    s.executables = ['rhc-create-app', 'rhc-create-domain', 'rhc-ctl-app', 'rhc-snapshot', 'rhc-user-info', 'rhc-tail-files']
    begin
    # Use Ruby version to target F13, RHEL5, Windows and OSX (assume no Xcode)
    if ENV['JSON_PURE'] or (RUBY_VERSION == "1.8.6" or RUBY_PLATFORM =~ /mswin/ or RUBY_PLATFORM =~ /darwin/)
        s.add_dependency('json_pure')
    else
        s.add_dependency('json')
    end
    end
    s.add_dependency('parseconfig')
end

# Define a :package task that bundles the gem
Gem::PackageTask.new(spec) do |pkg, args|
  pkg.need_tar = false
end

# Add the 'pkg' directory to the clean task
CLEAN.include("pkg")
