]> git.ipfire.org Git - thirdparty/systemd.git/blob - tmpfiles.d/meson.build
tree-wide: beautify remaining copyright statements
[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 ['portables.conf', 'ENABLE_PORTABLED'],
12 ['tmp.conf', ''],
13 ['x11.conf', ''],
14 ['legacy.conf', 'HAVE_SYSV_COMPAT'],
15 ]
16
17 foreach pair : tmpfiles
18 if not enable_tmpfiles
19 # do nothing
20 elif pair[1] == '' or conf.get(pair[1]) == 1
21 install_data(pair[0], install_dir : tmpfilesdir)
22 else
23 message('Not installing tmpfiles.d/@0@ because @1@ is @2@'
24 .format(pair[0], pair[1], conf.get(pair[1], 0)))
25 endif
26 endforeach
27
28 m4_files = [['etc.conf', ''],
29 ['systemd.conf', ''],
30 ['var.conf', ''],
31 ]
32
33 foreach pair : m4_files
34 if not enable_tmpfiles
35 # do nothing
36 elif pair[1] == '' or conf.get(pair[1]) == 1
37 custom_target(
38 'tmpfiles.d_' + pair[0],
39 input : pair[0] + '.m4',
40 output: pair[0],
41 command : [meson_apply_m4, config_h, '@INPUT@'],
42 capture : true,
43 install : true,
44 install_dir : tmpfilesdir)
45 else
46 message('Not installing tmpfiles.d/@0@.m4 because @1@ is @2@'
47 .format(pair[0], pair[1], conf.get(pair[1], 0)))
48 endif
49 endforeach
50
51 if enable_tmpfiles
52 meson.add_install_script(
53 'sh', '-c',
54 mkdir_p.format(join_paths(sysconfdir, 'tmpfiles.d')))
55 endif