forked from trofimander/python.pp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpre.pp
More file actions
57 lines (50 loc) · 1.37 KB
/
Copy pathpre.pp
File metadata and controls
57 lines (50 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
class pre($prefix="/usr/local") {
package {["build-essential",
"libncursesw5-dev",
"libncurses5-dev",
"libreadline-gplv2-dev",
"libssl-dev",
"libsasl2-dev",
"libgdbm-dev",
"libbz2-dev",
"libc6-dev",
"libsqlite3-dev",
"tk-dev",
"zlibc",
"zlib1g",
"zlib1g-dev"]:
ensure => installed,
provider => apt
}
file {"$prefix":
ensure => directory
}
}
define source_install($tarball, $tmpdir, $flags) {
file { "$tmpdir": ensure => directory }
exec { "retrieve-$name":
command => "wget $tarball",
cwd => "$tmpdir",
before => Exec["extract-$name"],
notify => Exec["extract-$name"],
creates => "$tmpdir/$name.tgz",
}
exec { "extract-$name":
command => "tar -zxf $name.tgz",
cwd => $tmpdir,
creates => "$tmpdir/$name/README",
require => Exec["retrieve-$name"],
before => Exec["configure-$name"],
}
exec { "configure-$name":
cwd => "$tmpdir/$name",
command => "$tmpdir/$name/configure $flags --prefix=$prefix",
require => Exec["extract-$name"],
before => Exec["make-$name"],
}
exec { "make-$name":
cwd => "$tmpdir/$name",
command => "make && make install",
require => Exec["configure-$name"],
}
}