]> git.ipfire.org Git - thirdparty/systemd.git/blob - tmpfiles.d/meson.build
Merge pull request #7376 from keszybz/simplify-root-options
[thirdparty/systemd.git] / tmpfiles.d / meson.build
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
18 enable_tmpfiles = conf.get('ENABLE_TMPFILES') == 1
19
20 tmpfiles = [['home.conf', ''],
21 ['journal-nocow.conf', ''],
22 ['systemd-nologin.conf', ''],
23 ['systemd-nspawn.conf', ''],
24 ['tmp.conf', ''],
25 ['x11.conf', ''],
26 ['legacy.conf', 'HAVE_SYSV_COMPAT'],
27 ]
28
29 foreach pair : tmpfiles
30 if not enable_tmpfiles
31 # do nothing
32 elif pair[1] == '' or conf.get(pair[1]) == 1
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
38 endforeach
39
40 m4_files = [['etc.conf', ''],
41 ['systemd.conf', ''],
42 ['var.conf', ''],
43 ]
44
45 foreach pair : m4_files
46 if not enable_tmpfiles
47 # do nothing
48 elif pair[1] == '' or conf.get(pair[1]) == 1
49 custom_target(
50 'tmpfiles.d_' + pair[0],
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
61 endforeach
62
63 if enable_tmpfiles
64 meson.add_install_script(
65 'sh', '-c',
66 mkdir_p.format(join_paths(sysconfdir, 'tmpfiles.d')))
67 endif