1# SPDX-License-Identifier: LGPL-2.1-or-later
2
3files = [['README',                ''],
4         ['systemd-coredump.conf', 'ENABLE_COREDUMP'],
5         ['systemd-oom.conf',      'ENABLE_OOMD']]
6
7foreach pair : files
8        if not enable_sysusers
9                # do nothing
10        elif pair[1] == '' or conf.get(pair[1]) == 1
11                install_data(pair[0], install_dir : sysusersdir)
12        else
13                message('Not installing sysusers.d/@0@ because @1@ is @2@'
14                        .format(pair[0], pair[1], conf.get(pair[1], 0)))
15        endif
16endforeach
17
18
19if enable_sysusers and conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
20        install_data('systemd-remote.conf', install_dir : sysusersdir)
21endif
22
23
24in_files = [['basic.conf',            enable_sysusers],
25            ['systemd-journal.conf',  enable_sysusers],
26            ['systemd-network.conf',  enable_sysusers and conf.get('ENABLE_NETWORKD') == 1],
27            ['systemd-resolve.conf',  enable_sysusers and conf.get('ENABLE_RESOLVE') == 1],
28            ['systemd-timesync.conf', enable_sysusers and conf.get('ENABLE_TIMESYNCD') == 1]]
29
30foreach tuple : in_files
31        file = tuple[0]
32        custom_target(
33                file,
34                input : file + '.in',
35                output: file,
36                command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
37                install : tuple[1],
38                install_dir : sysusersdir)
39endforeach
40