This macro can be called inside a build file and easily allows to apply any kind of users/groups specified in a sysusers file.
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org --- macros/systemd.macro | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/macros/systemd.macro b/macros/systemd.macro index 1453db95..27231094 100644 --- a/macros/systemd.macro +++ b/macros/systemd.macro @@ -2,6 +2,17 @@ SYSTEMD_TMPFILES_DIR = /usr/lib/tmpfiles.d SYSTEMD_SYSUSERS_DIR = /usr/lib/sysusers.d
+MACRO_APPLY_SYSTEMD_SYSUSERS + mkdir -pv %{SYSTEMD_SYSUSERS_DIR} + + for file in %{DIR_SOURCE}/*.sysusers; do + [ -e "${file}" ] || continue + cat ${file} | \ + systemd-sysusers --replace=%{SYSTEMD_SYSUSERS_DIR}/$(basename ${file%*.sysusers}).conf - + done + unset file +end + MACRO_INSTALL_SYSTEMD_FILES for file in %{DIR_SOURCE}/systemd/*; do [ -e "${file}" ] || continue