Class: Evm::Builder::Dsl

Inherits:
Object
  • Object
show all
Defined in:
lib/evm/builder.rb

Instance Method Summary collapse

Constructor Details

#initializeDsl

Returns a new instance of Dsl.



7
8
9
# File 'lib/evm/builder.rb', line 7

def initialize
  @options = []
end

Instance Method Details

#autogenObject



51
52
53
# File 'lib/evm/builder.rb', line 51

def autogen
  run_command './autogen.sh'
end

#build_pathObject



67
68
69
# File 'lib/evm/builder.rb', line 67

def build_path
  File.join(builds_path, @name)
end

#builds_pathObject



63
64
65
# File 'lib/evm/builder.rb', line 63

def builds_path
  File.join(Evm.config[:path], 'tmp')
end

#configureObject



55
56
57
# File 'lib/evm/builder.rb', line 55

def configure
  run_command './configure', *@options
end

#copy(from, to) ⇒ Object



83
84
85
# File 'lib/evm/builder.rb', line 83

def copy(from, to)
  run_command "cp -a #{from} #{to}"
end

#git(url) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/evm/builder.rb', line 17

def git(url)
  git_repo = Evm::Git.new(build_path)
  if git_repo.exist?
    git_repo.pull
  else
    git_repo.clone(url)
  end
end

#install(&block) ⇒ Object



47
48
49
# File 'lib/evm/builder.rb', line 47

def install(&block)
  yield
end

#installation_pathObject



75
76
77
# File 'lib/evm/builder.rb', line 75

def installation_path
  File.join(installations_path, @name)
end

#installations_pathObject



71
72
73
# File 'lib/evm/builder.rb', line 71

def installations_path
  Evm.config[:path]
end

#linux(&block) ⇒ Object



38
39
40
# File 'lib/evm/builder.rb', line 38

def linux(&block)
  yield if Evm::Os.linux?
end

#make(target) ⇒ Object



59
60
61
# File 'lib/evm/builder.rb', line 59

def make(target)
  run_command 'make', target
end

#option(name, value = nil) ⇒ Object



42
43
44
45
# File 'lib/evm/builder.rb', line 42

def option(name, value = nil)
  @options << name
  @options << value if value
end

#osx(&block) ⇒ Object



34
35
36
# File 'lib/evm/builder.rb', line 34

def osx(&block)
  yield if Evm::Os.osx?
end

#platform_nameObject



79
80
81
# File 'lib/evm/builder.rb', line 79

def platform_name
  Evm::Os.platform_name
end

#recipe(name, &block) ⇒ Object



11
12
13
14
15
# File 'lib/evm/builder.rb', line 11

def recipe(name, &block)
  @name = name

  yield
end

#tar_gz(url) ⇒ Object



30
31
32
# File 'lib/evm/builder.rb', line 30

def tar_gz(url)
  tar_packaged(url, 'gz')
end

#tar_xz(url) ⇒ Object



26
27
28
# File 'lib/evm/builder.rb', line 26

def tar_xz(url)
  tar_packaged(url, 'xz')
end