From 633b8afdf89573cb5a657204f433cdbfa81f63f8 Mon Sep 17 00:00:00 2001 From: Andrew Jeddeloh Date: Thu, 25 Jan 2018 13:17:17 -0800 Subject: [PATCH] login/meson.build: require ACL for uaccess rules Don't install udev rules that requires the uaccess builtin if systemd is being built without the uaccess builtin. --- ...73-seat-late.rules.in => 73-seat-late.rules.m4} | 5 ++-- src/login/meson.build | 30 ++++++++++++++-------- 2 files changed, 22 insertions(+), 13 deletions(-) rename src/login/{73-seat-late.rules.in => 73-seat-late.rules.m4} (86%) diff --git a/src/login/73-seat-late.rules.in b/src/login/73-seat-late.rules.m4 similarity index 86% rename from src/login/73-seat-late.rules.in rename to src/login/73-seat-late.rules.m4 index d2546c8..4db8d4d 100644 --- a/src/login/73-seat-late.rules.in +++ b/src/login/73-seat-late.rules.m4 @@ -13,7 +13,8 @@ ENV{ID_SEAT}=="", ENV{ID_AUTOSEAT}=="1", ENV{ID_FOR_SEAT}!="", ENV{ID_SEAT}="sea ENV{ID_SEAT}=="", IMPORT{parent}="ID_SEAT" ENV{ID_SEAT}!="", TAG+="$env{ID_SEAT}" - -TAG=="uaccess", ENV{MAJOR}!="", RUN{builtin}+="uaccess" +m4_ifdef(`HAVE_ACL',`` +TAG=="uaccess", ENV{MAJOR}!="", RUN{builtin}+="uaccess"'' +)m4_dnl LABEL="seat_late_end" diff --git a/src/login/meson.build b/src/login/meson.build index 33f9ed4..e8e4f7b 100644 --- a/src/login/meson.build +++ b/src/login/meson.build @@ -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', -- 2.7.4