login/meson.build: require ACL for uaccess rules
authorAndrew Jeddeloh <andrew.jeddeloh@coreos.com>
Thu, 25 Jan 2018 21:17:17 +0000 (13:17 -0800)
committerLennart Poettering <lennart@poettering.net>
Sat, 27 Jan 2018 09:55:32 +0000 (10:55 +0100)
Don't install udev rules that requires the uaccess builtin if systemd is
being built without the uaccess builtin.

src/login/73-seat-late.rules.in [deleted file]
src/login/73-seat-late.rules.m4 [new file with mode: 0644]
src/login/meson.build

diff --git a/src/login/73-seat-late.rules.in b/src/login/73-seat-late.rules.in
deleted file mode 100644 (file)
index d2546c8..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#  SPDX-License-Identifier: LGPL-2.1+
-#
-#  This file is part of systemd.
-#
-#  systemd is free software; you can redistribute it and/or modify it
-#  under the terms of the GNU Lesser General Public License as published by
-#  the Free Software Foundation; either version 2.1 of the License, or
-#  (at your option) any later version.
-
-ACTION=="remove", GOTO="seat_late_end"
-
-ENV{ID_SEAT}=="", ENV{ID_AUTOSEAT}=="1", ENV{ID_FOR_SEAT}!="", ENV{ID_SEAT}="seat-$env{ID_FOR_SEAT}"
-ENV{ID_SEAT}=="", IMPORT{parent}="ID_SEAT"
-
-ENV{ID_SEAT}!="", TAG+="$env{ID_SEAT}"
-
-TAG=="uaccess", ENV{MAJOR}!="", RUN{builtin}+="uaccess"
-
-LABEL="seat_late_end"
diff --git a/src/login/73-seat-late.rules.m4 b/src/login/73-seat-late.rules.m4
new file mode 100644 (file)
index 0000000..4db8d4d
--- /dev/null
@@ -0,0 +1,20 @@
+#  SPDX-License-Identifier: LGPL-2.1+
+#
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+ACTION=="remove", GOTO="seat_late_end"
+
+ENV{ID_SEAT}=="", ENV{ID_AUTOSEAT}=="1", ENV{ID_FOR_SEAT}!="", ENV{ID_SEAT}="seat-$env{ID_FOR_SEAT}"
+ENV{ID_SEAT}=="", IMPORT{parent}="ID_SEAT"
+
+ENV{ID_SEAT}!="", TAG+="$env{ID_SEAT}"
+m4_ifdef(`HAVE_ACL',``
+TAG=="uaccess", ENV{MAJOR}!="", RUN{builtin}+="uaccess"''
+)m4_dnl
+
+LABEL="seat_late_end"
index 33f9ed48cc2497b77e2179d67e362c42c05f8017..e8e4f7bd7dc3b9976777b569ef7b5781243cee80 100644 (file)
@@ -97,19 +97,27 @@ if conf.get('ENABLE_LOGIND') == 1
                 install : install_polkit,
                 install_dir : polkitpolicydir)
 
-        install_data('70-power-switch.rules',
-                     '70-uaccess.rules',
+        install_data('70-power-switch.rules', install_dir : udevrulesdir)
+
+        if conf.get('HAVE_ACL') == 1
+                install_data('70-uaccess.rules', install_dir : udevrulesdir)
+        endif
+
+        seat_rules = configure_file(
+                input : '71-seat.rules.in',
+                output : '71-seat.rules',
+                configuration : substs)
+        install_data(seat_rules,
                      install_dir : udevrulesdir)
 
-        foreach file : ['71-seat.rules',
-                        '73-seat-late.rules']
-                gen = configure_file(
-                        input : file + '.in',
-                        output : file,
-                        configuration : substs)
-                install_data(gen,
-                             install_dir : udevrulesdir)
-        endforeach
+        custom_target(
+                '73-seat-late.rules',
+                input : '73-seat-late.rules.m4',
+                output: '73-seat-late.rules',
+                command : [m4, '-P'] + m4_defines + ['@INPUT@'],
+                capture : true,
+                install : true,
+                install_dir : udevrulesdir)
 
         custom_target(
                 'systemd-user',