]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - modules/aur/manifests/aura.pp
Add aura helper
[perso/Immae/Projets/Puppet.git] / modules / aur / manifests / aura.pp
diff --git a/modules/aur/manifests/aura.pp b/modules/aur/manifests/aura.pp
new file mode 100644 (file)
index 0000000..fff988b
--- /dev/null
@@ -0,0 +1,38 @@
+class aur::aura(
+) {
+  user { "aur-builder":
+    name   => "aur-builder",
+    system => true,
+    ensure => "present"
+  }
+
+  exec { 'pacman-base-devel':
+    command   => '/usr/bin/pacman -S base-devel --needed --noconfirm',
+    unless    => '/usr/bin/pacman -Qo aura',
+    logoutput => 'on_failure',
+  }
+
+  ensure_packages(['gmp', 'pcre', 'abs'], { 'install_options' => '--asdeps' })
+
+  exec { 'aur::aura':
+    cwd       => "/tmp",
+    path      => "/usr/bin",
+    command   => 'curl -o /tmp/aur.sh aur.sh && chmod +x /tmp/aur.sh && /tmp/aur.sh aura-bin && mv /tmp/aura-bin/aura-bin-*-x86_64.pkg.tar.xz /tmp/aura-bin-x86_64.pkg.tar.xz && rm /tmp/aur.sh && rm -rf /tmp/aura-bin',
+    user      => "aur-builder",
+    unless    => '/usr/bin/pacman -Qo aura',
+    require   => Exec['pacman-base-devel'],
+    logoutput => 'on_failure',
+  }
+
+  package { 'aura-bin':
+    ensure => "present",
+    source => "/tmp/aura-bin-x86_64.pkg.tar.xz",
+    notify => Exec['aur::aura::cleanup']
+  }
+
+  exec { 'aur::aura::cleanup':
+    path        => "/usr/bin/",
+    command     => "rm -f /tmp/aura-bin-x86_64.pkg.tar.xz",
+    refreshonly => true
+  }
+}