]> git.ipfire.org Git - thirdparty/systemd.git/blob - tmpfiles.d/meson.build
Merge pull request #8824 from keszybz/analyze-show-config
[thirdparty/systemd.git] / tmpfiles.d / meson.build
1 # SPDX-License-Identifier: LGPL-2.1+
2 #
3 # Copyright 2017 Zbigniew Jędrzejewski-Szmek
4
5 enable_tmpfiles = conf.get('ENABLE_TMPFILES') == 1
6
7 tmpfiles = [['home.conf', ''],
8 ['journal-nocow.conf', ''],
9 ['systemd-nologin.conf', ''],
10 ['systemd-nspawn.conf', 'ENABLE_MACHINED'],
11 ['tmp.conf', ''],
12 ['x11.conf', ''],
13 ['legacy.conf', 'HAVE_SYSV_COMPAT'],
14 ]
15
16 foreach pair : tmpfiles
17 if not enable_tmpfiles
18 # do nothing
19 elif pair[1] == '' or conf.get(pair[1]) == 1
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
25 endforeach
26
27 m4_files = [['etc.conf', ''],
28 ['systemd.conf', ''],
29 ['var.conf', ''],
30 ]
31
32 foreach pair : m4_files
33 if not enable_tmpfiles
34 # do nothing
35 elif pair[1] == '' or conf.get(pair[1]) == 1
36 custom_target(
37 'tmpfiles.d_' + pair[0],
38 input : pair[0] + '.m4',
39 output: pair[0],
40 command : [meson_apply_m4, config_h, '@INPUT@'],
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
48 endforeach
49
50 if enable_tmpfiles
51 meson.add_install_script(
52 'sh', '-c',
53 mkdir_p.format(join_paths(sysconfdir, 'tmpfiles.d')))
54 endif