Puppet Class: archlinux_workstation::makepkg

Defined in:
manifests/makepkg.pp

Overview

Sets up makepkg configuration for Arch Linux (/etc/makepkg.conf) for system-optimized compiling and compiling in /tmp tmpfs, and configures systemd to create tmpfs compile directories on boot.

Parameters:

  • make_flags (String) (defaults to: "-j${facts['processors']['count']}")

    additional flags to pass to make via makepkg.conf. Defaults to setting -j (number of available processors for parallelization) to the system's number of processors.



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
58
59
60
61
62
63
64
65
66
67
68
69
# File 'manifests/makepkg.pp', line 11

class archlinux_workstation::makepkg (
  String $make_flags = "-j${facts['processors']['count']}",
){

  if ! defined(Class['archlinux_workstation']) {
    fail('You must include the base archlinux_workstation class before using any subclasses')
  }

  # variable access
  include archlinux_workstation

  $makepkg_user = $::archlinux_workstation::username
  $makepkg_packager = $::archlinux_workstation::makepkg_packager

  # base config files
  # Template Uses:
  # - $make_flags
  file {'/etc/makepkg.conf':
    ensure  => present,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template('archlinux_workstation/makepkg.conf.erb'),
  }

  # these are needed for compiling packages under /tmp using makepkg
  file {'/tmp/sources':
    ensure => directory,
    owner  => $archlinux_workstation::username,
    group  => 'wheel',
    mode   => '0775',
  }

  file {'/tmp/makepkg':
    ensure => directory,
    owner  => $archlinux_workstation::username,
    group  => 'wheel',
    mode   => '0775',
  }

  file {'/tmp/makepkglogs':
    ensure => directory,
    owner  => $archlinux_workstation::username,
    group  => 'wheel',
    mode   => '0775',
  }

  file {'/etc/tmpfiles.d/makepkg_puppet.conf':
    ensure  => present,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => "# managed by archlinux_workstation::makepkg puppet class
D /tmp/sources 0775 ${archlinux_workstation::username} wheel
D /tmp/makepkg 0775 ${archlinux_workstation::username} wheel
D /tmp/makepkglogs 0775 ${archlinux_workstation::username} wheel",
  }

}