Module: Reap::Utilities::SetupUtils

Defined in:
lib/reap/utilities/setuputils.rb

Overview

Setup DSL

Setup utilities provides a convenient way to install a ruby project via setup.rb.

Instance Method Summary collapse

Instance Method Details

#prefix_install(prefix) ⇒ Object

Installation to a prefix destination using setup.rb. Some package types may need this.



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/reap/utilities/setuputils.rb', line 42

def prefix_install(prefix)
  mkdir_p(prefix)

  unless setup_rb
    raise "Setup.rb is missing. Forced to abort."
  end
  # mock install
  cmd = ''
  cmd << 'ruby setup.rb '
  cmd << '-q ' unless project.verbose?
  cmd << 'config --installdirs=std ; '
  cmd << 'ruby setup.rb '
  cmd << '-q ' unless project.verbose?
  cmd << "install --prefix=#{prefix}"
  sh cmd
end

#setup_rbObject

If setup.rb is not found add a copy to the project. FIXME



62
63
64
65
66
67
68
69
70
71
72
# File 'lib/reap/utilities/setuputils.rb', line 62

def setup_rb
  unless File.exist?('setup.rb')
    f = File.join(libdir,'vendor','setup.rb')
    if File.exist?(f)
      cp(f,'.')
    else
      raise "setup.rb is not avaialble"
    end
  end
  true
end