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