support for more complex configures
This commit is contained in:
parent
70eb194615
commit
ee91e03935
@ -9,7 +9,7 @@ class ruby($version, $configure = "--disable-install-doc", $build_path = '') {
|
||||
path => "${base::path}:${path}:${build_path}"
|
||||
}
|
||||
|
||||
gem { [ 'bundler', 'penchant', 'thor' ]:
|
||||
gem { [ 'bundler', 'penchant' ]:
|
||||
require => Build_and_install[$name],
|
||||
path => $with_ruby_path,
|
||||
ensure => present
|
||||
|
@ -2,7 +2,7 @@ Puppet::Type.type(:configure).provide(:action) do
|
||||
desc "Configure a program to install"
|
||||
|
||||
def create
|
||||
system %{bash -c '#{path} cd #{@resource[:build_path]} ; ./configure --prefix=#{@resource[:install_path]} #{@resource[:options]}'}.tap { |o| p o }
|
||||
system %{bash -c '#{path} cd #{@resource[:build_path]} ; #{@resource[:preconfigure]} ./configure --prefix=#{@resource[:install_path]} #{@resource[:options]}'}.tap { |o| p o }
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
@ -2,7 +2,7 @@ Puppet::Type.type(:download_and_unpack).provide(:action) do
|
||||
desc "Download an unpack a remote repository"
|
||||
|
||||
def create
|
||||
system %{bash -c 'cd #{@resource[:src_path]} ; (curl #{@resource[:url]} | tar #{tar_command} -)'}
|
||||
system %{bash -c 'mkdir -p #{@resource[:src_path]} ; cd #{@resource[:src_path]} ; (curl -L #{@resource[:url]} | tar #{tar_command} -)'}
|
||||
raise StandardError.new("Could not download") if $?.exitstatus != 0
|
||||
|
||||
if original_name
|
||||
|
@ -19,6 +19,10 @@ Puppet::Type.newtype(:configure) do
|
||||
desc "Options to build the software"
|
||||
end
|
||||
|
||||
newparam(:preconfigure) do
|
||||
desc "Options to go before the configure command, like environment variables"
|
||||
end
|
||||
|
||||
newparam(:config_status) do
|
||||
desc "Relative location of config.status"
|
||||
end
|
||||
|
@ -1,4 +1,4 @@
|
||||
define build_and_install($version, $original_name = '', $source, $path = '', $configure = '', $config_status = 'config.status') {
|
||||
define build_and_install($version, $preconfigure = '', $original_name = '', $source, $path = '', $configure = '', $config_status = 'config.status') {
|
||||
$full_source = inline_template($source)
|
||||
|
||||
$build_path = build_path($name, $version)
|
||||
@ -17,6 +17,7 @@ define build_and_install($version, $original_name = '', $source, $path = '', $co
|
||||
build_path => $build_path,
|
||||
install_path => $install_path,
|
||||
options => $configure,
|
||||
preconfigure => $preconfigure,
|
||||
path => $path,
|
||||
require => Download_and_unpack[$name],
|
||||
config_status => $config_status,
|
||||
|
Loading…
Reference in New Issue
Block a user