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