chiark / gitweb /
login/meson.build: require ACL for uaccess rules
[elogind.git] / src / login / meson.build
1 # SPDX-License-Identifier: LGPL-2.1+
2 #
3 # Copyright 2017 Zbigniew JÄ™drzejewski-Szmek
4 #
5 # elogind 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.
9 #
10 # elogind 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.
14 #
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/>.
17 #if 0 /// rename to elogind
18
19 # systemd_logind_sources = files('''
20 #         logind.c
21 #         logind.h
22 # '''.split())
23 #else
24 elogind_sources = files('''
25         elogind.c
26         elogind.h
27         logind.c
28         logind.h
29 '''.split())
30 #endif // 0
31
32 logind_gperf_c = custom_target(
33         'logind_gperf.c',
34         input : 'logind-gperf.gperf',
35         output : 'logind-gperf.c',
36         command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
37
38 #if 0 /// rename to elogind
39 # systemd_logind_sources += [logind_gperf_c]
40 #else
41 elogind_sources += [logind_gperf_c]
42 #endif // 0
43
44
45 liblogind_core_sources = files('''
46         logind-core.c
47         logind-device.c
48         logind-device.h
49         logind-button.c
50         logind-button.h
51         logind-action.c
52         logind-action.h
53         logind-seat.c
54         logind-seat.h
55         logind-session.c
56         logind-session.h
57         logind-session-device.c
58         logind-session-device.h
59         logind-user.c
60         logind-user.h
61         logind-inhibit.c
62         logind-inhibit.h
63         logind-dbus.c
64         logind-session-dbus.c
65         logind-seat-dbus.c
66         logind-user-dbus.c
67         logind-utmp.c
68         logind-acl.h
69 '''.split())
70
71 #if 1 /// elogind has some additional files:
72 liblogind_core_sources += [files('''
73         elogind-dbus.c
74         elogind-dbus.h
75 '''.split()),
76         libcore_la_sources,
77         sleep_files,
78         update_utmp_files]
79 #endif // 1
80 logind_acl_c = files('logind-acl.c')
81 if conf.get('HAVE_ACL') == 1
82         liblogind_core_sources += logind_acl_c
83 endif
84
85 liblogind_core = static_library(
86         'logind-core',
87         liblogind_core_sources,
88         include_directories : includes,
89 #if 0 /// elogind needs audit support for utmp inclusion
90 #         dependencies : [libacl])
91 #else
92         dependencies : [libacl,
93                         libaudit])
94 #endif // 0
95
96 loginctl_sources = files('''
97         loginctl.c
98         sysfs-show.h
99         sysfs-show.c
100 '''.split())
101
102 #if 1 /// elogind has some additional files:
103 loginctl_sources += files('''
104         eloginctl.c
105         eloginctl.h
106 '''.split())
107 #endif // 1
108 #if 0 /// elogind builds itself unconditionally and with some adaptations
109 # if conf.get('ENABLE_LOGIND') == 1
110 #         logind_conf = configure_file(
111 #                 input : 'logind.conf.in',
112 #                 output : 'logind.conf',
113 #                 configuration : substs)
114 #         install_data(logind_conf,
115 #                      install_dir : pkgsysconfdir)
116
117 #         pam_systemd_sym = 'src/login/pam_systemd.sym'
118 #         pam_systemd_c = files('pam_systemd.c')
119
120 #         install_data('org.freedesktop.login1.conf',
121 #                      install_dir : dbuspolicydir)
122 #         install_data('org.freedesktop.login1.service',
123 #                      install_dir : dbussystemservicedir)
124
125 #         i18n.merge_file(
126 #                 'org.freedesktop.login1.policy',
127 #                 input : 'org.freedesktop.login1.policy.in',
128 #                 output : 'org.freedesktop.login1.policy',
129 #                 po_dir : po_dir,
130 #                 data_dirs : po_dir,
131 #                 install : install_polkit,
132 #                 install_dir : polkitpolicydir)
133
134 #         install_data('70-power-switch.rules', install_dir : udevrulesdir)
135
136 #         if conf.get('HAVE_ACL') == 1
137 #                 install_data('70-uaccess.rules', install_dir : udevrulesdir)
138 #         endif
139
140 #         seat_rules = configure_file(
141 #                 input : '71-seat.rules.in',
142 #                 output : '71-seat.rules',
143 #                 configuration : substs)
144 #         install_data(seat_rules,
145 #                      install_dir : udevrulesdir)
146
147 #         custom_target(
148 #                 '73-seat-late.rules',
149 #                 input : '73-seat-late.rules.m4',
150 #                 output: '73-seat-late.rules',
151 #                 command : [m4, '-P'] + m4_defines + ['@INPUT@'],
152 #                 capture : true,
153 #                 install : true,
154 #                 install_dir : udevrulesdir)
155
156 #         custom_target(
157 #                 'systemd-user',
158 #                 input : 'systemd-user.m4',
159 #                 output: 'systemd-user',
160 #                 command : [m4, '-P'] + m4_defines + ['@INPUT@'],
161 #                 capture : true,
162 #                 install : pamconfdir != 'no',
163 #                 install_dir : pamconfdir)
164 # endif
165 #else
166 logind_conf = configure_file(
167         input : 'logind.conf.in',
168         output : 'logind.conf',
169         configuration : substs)
170 install_data(logind_conf,
171                 install_dir : pkgsysconfdir)
172
173 pam_elogind_sym = 'src/login/pam_elogind.sym'
174 pam_elogind_c = files('pam_elogind.c')
175
176 install_data('org.freedesktop.login1.conf',
177                 install_dir : dbuspolicydir)
178 logind_service = configure_file(
179         input : 'org.freedesktop.login1.service.in',
180         output : 'org.freedesktop.login1.service',
181         configuration : substs)
182 install_data(logind_service,
183                 install_dir : dbussystemservicedir)
184
185 i18n.merge_file(
186         'org.freedesktop.login1.policy',
187         input : 'org.freedesktop.login1.policy.in',
188         output : 'org.freedesktop.login1.policy',
189         po_dir : po_dir,
190         data_dirs : po_dir,
191         install : install_polkit,
192         install_dir : polkitpolicydir)
193
194 install_data('70-power-switch.rules',
195                 '70-uaccess.rules',
196                 install_dir : udevrulesdir)
197
198 foreach file : ['71-seat.rules',
199                 '73-seat-late.rules']
200         gen = configure_file(
201                 input : file + '.in',
202                 output : file,
203                 configuration : substs)
204         install_data(gen,
205                         install_dir : udevrulesdir)
206 endforeach
207
208 custom_target(
209         'elogind-user',
210         input : 'elogind-user.m4',
211         output: 'elogind-user',
212         command : [m4, '-P'] + m4_defines + ['@INPUT@'],
213         capture : true,
214         install : pamconfdir != 'no',
215         install_dir : pamconfdir)
216 #endif //0