blob: f9236c30fe43e8cc41048ab1698aabdfb69f11cd (
plain) (
blame)
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
|
define package::makepkg($ensure, $build_user, $asdeps=false) {
if $asdeps {
$extra_cmdline = " --asdeps"
}
else {
$extra_cmdline = ""
}
include c_toolchain
include git
case $ensure {
'installed': {
exec { "makepkg install $name":
provider => "shell",
command => "
cd /tmp
rm -rf 'makepkg-$name'
su $build_user -c 'git clone https://aur.archlinux.org/$name.git makepkg-$name'
cd 'makepkg-$name'
su $build_user -c makepkg
pacman -U --noconfirm --needed $extra_cmdline $name-*.pkg.tar.xz
",
unless => "pacman -Q $name > /dev/null 2>&1",
path => "/usr/bin",
require => [
Tozt::User[$build_user],
Class["git"],
Class["c_toolchain"],
];
}
}
'absent': {
exec { "makepkg uninstall $name":
provider => "shell",
command => "pacman --noconfirm -Rsn $name",
onlyif => "pacman -Q $name > /dev/null 2>&1",
path => "/usr/bin";
}
}
}
}
|