summaryrefslogtreecommitdiffstats
path: root/modules/package/manifests/makepkg.pp
blob: ff590f2e95aa7facd66c90f2f29757ce6998b7c3 (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
define package::makepkg($asdeps=false) {
  if $asdeps {
    $extra_cmdline = " --asdeps"
  }
  else {
    $extra_cmdline = ""
  }

  exec { "install $name":
    command => "
      mkdir -p /tmp/makepkg
      cd /tmp/makepkg
      rm -rf '$name'
      su doy -c 'git clone https://aur.archlinux.org/$name.git'
      cd '$name'
      su doy -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["doy"],
      Package["git"],
      Package["pkg-config"],
    ];
  }
}