]>
Commit | Line | Data |
---|---|---|
3a726fcd ZJS |
1 | # SPDX-License-Identifier: LGPL-2.1+ |
2 | # | |
3 | # Copyright 2017 Zbigniew Jędrzejewski-Szmek | |
4 | # | |
5 | # systemd is free software; you can redistribute it and/or modify it | |
6 | # under the terms of the GNU Lesser General Public License as published by | |
7 | # the Free Software Foundation; either version 2.1 of the License, or | |
8 | # (at your option) any later version. | |
9 | # | |
10 | # systemd is distributed in the hope that it will be useful, but | |
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | # Lesser General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU Lesser General Public License | |
16 | # along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
17 | ||
349cc4a5 | 18 | enable_tmpfiles = conf.get('ENABLE_TMPFILES') == 1 |
5c23128d ZJS |
19 | |
20 | tmpfiles = [['home.conf', ''], | |
21 | ['journal-nocow.conf', ''], | |
22 | ['systemd-nologin.conf', ''], | |
23 | ['systemd-nspawn.conf', ''], | |
5c23128d | 24 | ['tmp.conf', ''], |
5c23128d ZJS |
25 | ['x11.conf', ''], |
26 | ['legacy.conf', 'HAVE_SYSV_COMPAT'], | |
27 | ] | |
28 | ||
29 | foreach pair : tmpfiles | |
37efbbd8 ZJS |
30 | if not enable_tmpfiles |
31 | # do nothing | |
349cc4a5 | 32 | elif pair[1] == '' or conf.get(pair[1]) == 1 |
37efbbd8 ZJS |
33 | install_data(pair[0], install_dir : tmpfilesdir) |
34 | else | |
35 | message('Not installing tmpfiles.d/@0@ because @1@ is @2@' | |
36 | .format(pair[0], pair[1], conf.get(pair[1], 0))) | |
37 | endif | |
5c23128d ZJS |
38 | endforeach |
39 | ||
5e354b22 FB |
40 | m4_files = [['etc.conf', ''], |
41 | ['systemd.conf', ''], | |
5e354b22 FB |
42 | ['var.conf', ''], |
43 | ] | |
5c23128d | 44 | |
5e354b22 FB |
45 | foreach pair : m4_files |
46 | if not enable_tmpfiles | |
47 | # do nothing | |
349cc4a5 | 48 | elif pair[1] == '' or conf.get(pair[1]) == 1 |
5e354b22 | 49 | custom_target( |
525e9db3 | 50 | 'tmpfiles.d_' + pair[0], |
5e354b22 FB |
51 | input : pair[0] + '.m4', |
52 | output: pair[0], | |
53 | command : [m4, '-P'] + m4_defines + ['@INPUT@'], | |
54 | capture : true, | |
55 | install : true, | |
56 | install_dir : tmpfilesdir) | |
57 | else | |
58 | message('Not installing tmpfiles.d/@0@.m4 because @1@ is @2@' | |
59 | .format(pair[0], pair[1], conf.get(pair[1], 0))) | |
60 | endif | |
5c23128d | 61 | endforeach |
94e75a54 ZJS |
62 | |
63 | if enable_tmpfiles | |
37efbbd8 ZJS |
64 | meson.add_install_script( |
65 | 'sh', '-c', | |
66 | mkdir_p.format(join_paths(sysconfdir, 'tmpfiles.d'))) | |
94e75a54 | 67 | endif |