1 # SPDX-License-Identifier: LGPL-2.1+
3 # Copyright 2017 Zbigniew Jędrzejewski-Szmek
5 # systemd is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation; either version 2.1 of the License, or
8 # (at your option) any later version.
10 # systemd is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
18 enable_tmpfiles = conf.get('ENABLE_TMPFILES') == 1
20 tmpfiles = [['home.conf', ''],
21 ['journal-nocow.conf', ''],
22 ['systemd-nologin.conf', ''],
23 ['systemd-nspawn.conf', ''],
26 ['legacy.conf', 'HAVE_SYSV_COMPAT'],
29 foreach pair : tmpfiles
30 if not enable_tmpfiles
32 elif pair[1] == '' or conf.get(pair[1]) == 1
33 install_data(pair[0], install_dir : tmpfilesdir)
35 message('Not installing tmpfiles.d/@0@ because @1@ is @2@'
36 .format(pair[0], pair[1], conf.get(pair[1], 0)))
40 m4_files = [['etc.conf', ''],
45 foreach pair : m4_files
46 if not enable_tmpfiles
48 elif pair[1] == '' or conf.get(pair[1]) == 1
50 'tmpfiles.d_' + pair[0],
51 input : pair[0] + '.m4',
53 command : [m4, '-P'] + m4_defines + ['@INPUT@'],
56 install_dir : tmpfilesdir)
58 message('Not installing tmpfiles.d/@0@.m4 because @1@ is @2@'
59 .format(pair[0], pair[1], conf.get(pair[1], 0)))
64 meson.add_install_script(
66 mkdir_p.format(join_paths(sysconfdir, 'tmpfiles.d')))