]> git.ipfire.org Git - thirdparty/systemd.git/blob - tmpfiles.d/meson.build
test-network: Remove/replace non-capturing group regex
[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 ['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 in_files = ['static-nodes-permissions.conf']
28
29 foreach file : in_files
30 gen = configure_file(
31 input : file + '.in',
32 output : file,
33 configuration : substs)
34 if enable_tmpfiles
35 install_data(gen,
36 install_dir : tmpfilesdir)
37 endif
38 endforeach
39
40 m4_files = ['etc.conf',
41 'systemd.conf',
42 'var.conf']
43
44 foreach file : m4_files
45 if enable_tmpfiles
46 custom_target(
47 'tmpfiles.d_' + file,
48 input : file + '.m4',
49 output: file,
50 command : [meson_apply_m4, config_h, '@INPUT@'],
51 capture : true,
52 install : true,
53 install_dir : tmpfilesdir)
54 endif
55 endforeach
56
57 if enable_tmpfiles
58 meson.add_install_script(
59 'sh', '-c',
60 mkdir_p.format(join_paths(sysconfdir, 'tmpfiles.d')))
61 endif