File: meson.build

package info (click to toggle)
systemd-udeb 260-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 114,360 kB
  • sloc: ansic: 741,727; xml: 122,306; python: 35,714; sh: 35,154; cpp: 947; awk: 126; makefile: 89; lisp: 13; sed: 1
file content (130 lines) | stat: -rw-r--r-- 4,533 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# SPDX-License-Identifier: LGPL-2.1-or-later

units = [
        { 'file' : 'app.slice' },
        { 'file' : 'background.slice' },
        { 'file' : 'basic.target' },
        { 'file' : 'bluetooth.target' },
        { 'file' : 'capsule@.target' },
        { 'file' : 'default.target' },
        { 'file' : 'exit.target' },
        { 'file' : 'graphical-session-pre.target' },
        { 'file' : 'graphical-session.target' },
        {
          'file' : 'machine.slice',
          'conditions' : ['ENABLE_MACHINED'],
        },
        {
          'file' : 'machines.target',
          'conditions' : ['ENABLE_MACHINED'],
        },
        {
          'file' : 'systemd-machined.service.in',
          'conditions' : ['ENABLE_MACHINED'],
          'symlinks' : ['dbus-org.freedesktop.machine1.service'],
        },
        {
          'file' : 'systemd-machined.socket',
          'conditions' : ['ENABLE_MACHINED'],
          'symlinks' : ['sockets.target.wants/'],
        },
        {
          'file' : 'systemd-importd.service.in',
          'conditions' : ['ENABLE_IMPORTD'],
          'symlinks' : ['dbus-org.freedesktop.import1.service'],
        },
        {
          'file' : 'systemd-importd.socket',
          'conditions' : ['ENABLE_IMPORTD'],
          'symlinks' : ['sockets.target.wants/'],
        },
        {
          'file' : 'systemd-portabled.service.in',
          'conditions' : ['ENABLE_PORTABLED'],
          'symlinks' : ['dbus-org.freedesktop.portable1.service'],
        },
        { 'file' : 'paths.target' },
        { 'file' : 'printer.target' },
        { 'file' : 'session.slice' },
        { 'file' : 'shutdown.target' },
        { 'file' : 'smartcard.target' },
        { 'file' : 'sockets.target' },
        { 'file' : 'sound.target' },
        {
          'file' : 'systemd-ask-password.socket',
          'symlinks' : ['sockets.target.wants/']
        },
        { 'file' : 'systemd-ask-password@.service' },
        { 'file' : 'systemd-exit.service' },
        { 'file' : 'systemd-journalctl@.service' },
        {
          'file' : 'systemd-journalctl.socket',
          'symlinks' : ['sockets.target.wants/'],
        },
        { 'file' : 'systemd-tmpfiles-clean.service' },
        { 'file' : 'systemd-tmpfiles-clean.timer' },
        { 'file' : 'systemd-tmpfiles-setup.service' },
        {
          'file' : 'systemd-nspawn@.service.in',
          'conditions' : ['ENABLE_NSPAWN'],
        },
        {
          'file' : 'systemd-vmspawn@.service.in',
          'conditions' : ['ENABLE_VMSPAWN'],
        },
        { 'file' : 'timers.target' },
        {
          'file' : 'xdg-desktop-autostart.target',
          'conditions': ['ENABLE_XDG_AUTOSTART'],
        }
]

foreach unit : units
        source = unit.get('file')

        if source.endswith('.in')
                needs_jinja = true
                name = source.substring(0, -3)
                assert(name + '.in' == source)
        else
                needs_jinja = false
                name = source
        endif
        source = files(source)

        install = true
        foreach cond : unit.get('conditions', [])
                if conf.get(cond) != 1
                        install = false
                        break
                endif
        endforeach

        if needs_jinja
                t = custom_target(
                        input : source,
                        output : name,
                        command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
                        install : install,
                        install_dir : userunitdir)
        elif install
                install_data(source,
                             install_dir : userunitdir)
        endif

        if install
                foreach target : unit.get('symlinks', [])
                        if target.endswith('/')
                                # '/' is only allowed at the end of the target
                                assert(target.replace('/', '') + '/' == target)
                                install_symlink(name,
                                                pointing_to : '..' / name,
                                                install_dir : userunitdir / target)
                        else
                                install_symlink(target,
                                                pointing_to : name,
                                                install_dir : userunitdir)
                        endif
                endforeach
        endif
endforeach