support for more complex configures

This commit is contained in:
John Bintz 2012-05-04 16:49:17 -04:00
parent 70eb194615
commit ee91e03935
5 changed files with 9 additions and 4 deletions

View File

@ -9,7 +9,7 @@ class ruby($version, $configure = "--disable-install-doc", $build_path = '') {
path => "${base::path}:${path}:${build_path}" path => "${base::path}:${path}:${build_path}"
} }
gem { [ 'bundler', 'penchant', 'thor' ]: gem { [ 'bundler', 'penchant' ]:
require => Build_and_install[$name], require => Build_and_install[$name],
path => $with_ruby_path, path => $with_ruby_path,
ensure => present ensure => present

View File

@ -2,7 +2,7 @@ Puppet::Type.type(:configure).provide(:action) do
desc "Configure a program to install" desc "Configure a program to install"
def create 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 end
def destroy def destroy

View File

@ -2,7 +2,7 @@ Puppet::Type.type(:download_and_unpack).provide(:action) do
desc "Download an unpack a remote repository" desc "Download an unpack a remote repository"
def create 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 raise StandardError.new("Could not download") if $?.exitstatus != 0
if original_name if original_name

View File

@ -19,6 +19,10 @@ Puppet::Type.newtype(:configure) do
desc "Options to build the software" desc "Options to build the software"
end end
newparam(:preconfigure) do
desc "Options to go before the configure command, like environment variables"
end
newparam(:config_status) do newparam(:config_status) do
desc "Relative location of config.status" desc "Relative location of config.status"
end end

View File

@ -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) $full_source = inline_template($source)
$build_path = build_path($name, $version) $build_path = build_path($name, $version)
@ -17,6 +17,7 @@ define build_and_install($version, $original_name = '', $source, $path = '', $co
build_path => $build_path, build_path => $build_path,
install_path => $install_path, install_path => $install_path,
options => $configure, options => $configure,
preconfigure => $preconfigure,
path => $path, path => $path,
require => Download_and_unpack[$name], require => Download_and_unpack[$name],
config_status => $config_status, config_status => $config_status,