]> git.ipfire.org Git - thirdparty/systemd.git/blob - tmpfiles.d/meson.build
Explain how to determine hierarchy type from shell
[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', 'HAVE_PAM'],
8 ['systemd-nspawn.conf', 'ENABLE_MACHINED'],
9 ['systemd-tmp.conf', ''],
10 ['portables.conf', 'ENABLE_PORTABLED'],
11 ['systemd-pstore.conf', 'ENABLE_PSTORE'],
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 in_files = ['static-nodes-permissions.conf']
29
30 foreach file : in_files
31 gen = configure_file(
32 input : file + '.in',
33 output : file,
34 configuration : substs)
35 if enable_tmpfiles
36 install_data(gen,
37 install_dir : tmpfilesdir)
38 endif
39 endforeach
40
41 m4_files = ['etc.conf',
42 'systemd.conf',
43 'var.conf']
44
45 foreach file : m4_files
46 if enable_tmpfiles
47 custom_target(
48 'tmpfiles.d_' + file,
49 input : file + '.m4',
50 output: file,
51 command : [meson_apply_m4, config_h, '@INPUT@'],
52 capture : true,
53 install : true,
54 install_dir : tmpfilesdir)
55 endif
56 endforeach
57
58 if enable_tmpfiles
59 meson.add_install_script(
60 'sh', '-c',
61 mkdir_p.format(join_paths(sysconfdir, 'tmpfiles.d')))
62 endif