2011-12-07 22:59:34 +00:00
|
|
|
Puppet::Type.type(:configure).provide(:action) do
|
|
|
|
desc "Configure a program to install"
|
|
|
|
|
|
|
|
def create
|
2012-01-18 17:29:05 +00:00
|
|
|
system %{bash -c '#{path} cd #{@resource[:build_path]} ; ./configure --prefix=#{@resource[:install_path]} #{@resource[:options]}'}.tap { |o| p o }
|
2011-12-07 22:59:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
File.unlink config_status
|
|
|
|
end
|
|
|
|
|
|
|
|
def exists?
|
|
|
|
File.file? config_status
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
def config_status
|
2012-01-18 17:29:05 +00:00
|
|
|
File.join(@resource[:build_path], @resource[:config_status])
|
2011-12-07 22:59:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def path
|
|
|
|
@resource[:path].empty? ? '' : "export PATH=#{@resource[:path]}:$PATH ; "
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|