Skip to content

Instantly share code, notes, and snippets.

@reidmv
Created May 4, 2012 19:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save reidmv/2597027 to your computer and use it in GitHub Desktop.
Save reidmv/2597027 to your computer and use it in GitHub Desktop.
Puppet build define
#
# Depends on: puppetlabs/stdlib
#
define buildsource(
$dir = $title,
$user = 'root',
$path = '/usr/bin:/bin',
$timeout = '0',
$options = ''
) {
$options_real = join([$options], ' ')
Exec {
user => $user,
cwd => $dir,
timeout => $timeout,
path => $path,
}
exec { "./configure in ${dir}":
command => "./configure ${options_real}",
} ->
exec { "make in ${dir}":
command => 'make',
} ->
exec { "make install in ${dir}":
command => 'make install',
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment