]>
Commit | Line | Data |
---|---|---|
3a726fcd | 1 | # SPDX-License-Identifier: LGPL-2.1+ |
3a726fcd | 2 | |
349cc4a5 | 3 | enable_tmpfiles = conf.get('ENABLE_TMPFILES') == 1 |
5c23128d ZJS |
4 | |
5 | tmpfiles = [['home.conf', ''], | |
6 | ['journal-nocow.conf', ''], | |
a45ef507 | 7 | ['systemd-nologin.conf', 'HAVE_PAM'], |
32b8157f | 8 | ['systemd-nspawn.conf', 'ENABLE_MACHINED'], |
63f28cad | 9 | ['systemd-tmp.conf', ''], |
61d0578b | 10 | ['portables.conf', 'ENABLE_PORTABLED'], |
f00c3664 | 11 | ['systemd-pstore.conf', 'ENABLE_PSTORE'], |
5c23128d | 12 | ['tmp.conf', ''], |
5c23128d ZJS |
13 | ['x11.conf', ''], |
14 | ['legacy.conf', 'HAVE_SYSV_COMPAT'], | |
15 | ] | |
16 | ||
17 | foreach pair : tmpfiles | |
37efbbd8 ZJS |
18 | if not enable_tmpfiles |
19 | # do nothing | |
349cc4a5 | 20 | elif pair[1] == '' or conf.get(pair[1]) == 1 |
37efbbd8 ZJS |
21 | install_data(pair[0], install_dir : tmpfilesdir) |
22 | else | |
23 | message('Not installing tmpfiles.d/@0@ because @1@ is @2@' | |
24 | .format(pair[0], pair[1], conf.get(pair[1], 0))) | |
25 | endif | |
5c23128d ZJS |
26 | endforeach |
27 | ||
1f9290fc | 28 | in_files = ['static-nodes-permissions.conf'] |
5c23128d | 29 | |
1f9290fc ZJS |
30 | foreach file : in_files |
31 | gen = configure_file( | |
32 | input : file + '.in', | |
33 | output : file, | |
34 | configuration : substs) | |
35 | if enable_tmpfiles | |
36 | install_data(gen, | |
37 | install_dir : tmpfilesdir) | |
38 | endif | |
39 | endforeach | |
40 | ||
41 | m4_files = ['etc.conf', | |
42 | 'systemd.conf', | |
43 | 'var.conf'] | |
44 | ||
45 | foreach file : m4_files | |
46 | if enable_tmpfiles | |
5e354b22 | 47 | custom_target( |
1f9290fc ZJS |
48 | 'tmpfiles.d_' + file, |
49 | input : file + '.m4', | |
50 | output: file, | |
348b4437 | 51 | command : [meson_apply_m4, config_h, '@INPUT@'], |
5e354b22 FB |
52 | capture : true, |
53 | install : true, | |
54 | install_dir : tmpfilesdir) | |
5e354b22 | 55 | endif |
5c23128d | 56 | endforeach |
94e75a54 ZJS |
57 | |
58 | if enable_tmpfiles | |
37efbbd8 ZJS |
59 | meson.add_install_script( |
60 | 'sh', '-c', | |
61 | mkdir_p.format(join_paths(sysconfdir, 'tmpfiles.d'))) | |
94e75a54 | 62 | endif |