]> git.ipfire.org Git - thirdparty/systemd.git/blob - tmpfiles.d/meson.build
Merge pull request #11427 from kragniz/10659-env-file-quotes
[thirdparty/systemd.git] / tmpfiles.d / meson.build
1 # SPDX-License-Identifier: LGPL-2.1+
2
3 enable_tmpfiles = conf.get('ENABLE_TMPFILES') == 1
4
5 tmpfiles = [['home.conf', ''],
6 ['journal-nocow.conf', ''],
7 ['systemd-nologin.conf', ''],
8 ['systemd-nspawn.conf', 'ENABLE_MACHINED'],
9 ['portables.conf', 'ENABLE_PORTABLED'],
10 ['tmp.conf', ''],
11 ['x11.conf', ''],
12 ['legacy.conf', 'HAVE_SYSV_COMPAT'],
13 ]
14
15 foreach pair : tmpfiles
16 if not enable_tmpfiles
17 # do nothing
18 elif pair[1] == '' or conf.get(pair[1]) == 1
19 install_data(pair[0], install_dir : tmpfilesdir)
20 else
21 message('Not installing tmpfiles.d/@0@ because @1@ is @2@'
22 .format(pair[0], pair[1], conf.get(pair[1], 0)))
23 endif
24 endforeach
25
26 m4_files = [['etc.conf', ''],
27 ['systemd.conf', ''],
28 ['var.conf', ''],
29 ]
30
31 foreach pair : m4_files
32 if not enable_tmpfiles
33 # do nothing
34 elif pair[1] == '' or conf.get(pair[1]) == 1
35 custom_target(
36 'tmpfiles.d_' + pair[0],
37 input : pair[0] + '.m4',
38 output: pair[0],
39 command : [meson_apply_m4, config_h, '@INPUT@'],
40 capture : true,
41 install : true,
42 install_dir : tmpfilesdir)
43 else
44 message('Not installing tmpfiles.d/@0@.m4 because @1@ is @2@'
45 .format(pair[0], pair[1], conf.get(pair[1], 0)))
46 endif
47 endforeach
48
49 if enable_tmpfiles
50 meson.add_install_script(
51 'sh', '-c',
52 mkdir_p.format(join_paths(sysconfdir, 'tmpfiles.d')))
53 endif