]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blob - modules/aur/manifests/aura.pp
Fix aura bootstrap script
[perso/Immae/Projets/Puppet.git] / modules / aur / manifests / aura.pp
1 class aur::aura(
2 ) {
3 user { "aur-builder":
4 name => "aur-builder",
5 system => true,
6 ensure => "present"
7 }
8
9 sudo::conf { 'aur-builder':
10 content => "aur-builder ALL=(root) NOPASSWD: /usr/bin/aura *"
11 }
12
13 ensure_packages(['base-devel'], { 'install_options' => '--needed' })
14 ensure_packages(['gmp', 'pcre'], { 'install_options' => '--asdeps' })
15
16 # aur.sh seems down
17 #$aur_url = "https://aur.sh"
18 #$aur_url = "https://raw.githubusercontent.com/stuartpb/aur.sh/dc2f3fcaa90a4d3d1e8d746160559b5d3123a425/aur.sh"
19
20 exec { 'aur::aura':
21 cwd => "/tmp",
22 path => "/usr/bin",
23 command => "curl https://aur.archlinux.org/cgit/aur.git/snapshot/aura-bin.tar.gz | tar xz && cd aura-bin && makepkg aura-bin && mv /tmp/aura-bin/aura-bin-*-x86_64.pkg.tar.xz /tmp/aura-bin-x86_64.pkg.tar.xz && rm -rf /tmp/aura-bin",
24 user => "aur-builder",
25 unless => '/usr/bin/pacman -Qo aura',
26 require => Package['base-devel'],
27 logoutput => 'on_failure',
28 }
29
30 package { 'aura-bin':
31 ensure => "present",
32 source => "/tmp/aura-bin-x86_64.pkg.tar.xz",
33 require => Exec['aur::aura'],
34 notify => Exec['aur::aura::cleanup']
35 }
36
37 exec { 'aur::aura::cleanup':
38 path => "/usr/bin/",
39 command => "rm -f /tmp/aura-bin-x86_64.pkg.tar.xz",
40 refreshonly => true
41 }
42 }