]>
Commit | Line | Data |
---|---|---|
349cc4a5 | 1 | enable_tmpfiles = conf.get('ENABLE_TMPFILES') == 1 |
5c23128d ZJS |
2 | |
3 | tmpfiles = [['home.conf', ''], | |
4 | ['journal-nocow.conf', ''], | |
5 | ['systemd-nologin.conf', ''], | |
6 | ['systemd-nspawn.conf', ''], | |
5c23128d | 7 | ['tmp.conf', ''], |
5c23128d ZJS |
8 | ['x11.conf', ''], |
9 | ['legacy.conf', 'HAVE_SYSV_COMPAT'], | |
10 | ] | |
11 | ||
12 | foreach pair : tmpfiles | |
37efbbd8 ZJS |
13 | if not enable_tmpfiles |
14 | # do nothing | |
349cc4a5 | 15 | elif pair[1] == '' or conf.get(pair[1]) == 1 |
37efbbd8 ZJS |
16 | install_data(pair[0], install_dir : tmpfilesdir) |
17 | else | |
18 | message('Not installing tmpfiles.d/@0@ because @1@ is @2@' | |
19 | .format(pair[0], pair[1], conf.get(pair[1], 0))) | |
20 | endif | |
5c23128d ZJS |
21 | endforeach |
22 | ||
5e354b22 FB |
23 | m4_files = [['etc.conf', ''], |
24 | ['systemd.conf', ''], | |
5e354b22 FB |
25 | ['var.conf', ''], |
26 | ] | |
5c23128d | 27 | |
5e354b22 FB |
28 | foreach pair : m4_files |
29 | if not enable_tmpfiles | |
30 | # do nothing | |
349cc4a5 | 31 | elif pair[1] == '' or conf.get(pair[1]) == 1 |
5e354b22 | 32 | custom_target( |
525e9db3 | 33 | 'tmpfiles.d_' + pair[0], |
5e354b22 FB |
34 | input : pair[0] + '.m4', |
35 | output: pair[0], | |
36 | command : [m4, '-P'] + m4_defines + ['@INPUT@'], | |
37 | capture : true, | |
38 | install : true, | |
39 | install_dir : tmpfilesdir) | |
40 | else | |
41 | message('Not installing tmpfiles.d/@0@.m4 because @1@ is @2@' | |
42 | .format(pair[0], pair[1], conf.get(pair[1], 0))) | |
43 | endif | |
5c23128d | 44 | endforeach |
94e75a54 ZJS |
45 | |
46 | if enable_tmpfiles | |
37efbbd8 ZJS |
47 | meson.add_install_script( |
48 | 'sh', '-c', | |
49 | mkdir_p.format(join_paths(sysconfdir, 'tmpfiles.d'))) | |
94e75a54 | 50 | endif |