From eda0def0851b1dee32c26ccad18bb3acb31f6ccb Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Thu, 30 Mar 2023 14:52:29 +0200 Subject: [PATCH] macros: Add macro to automatically install all systemd sysusers files This macros works very similar than the tmpfiles one but handles sysusers files. Signed-off-by: Stefan Schantl Signed-off-by: Michael Tremer --- macros/systemd.macro | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/macros/systemd.macro b/macros/systemd.macro index 9dc74ff0b..1453db95a 100644 --- a/macros/systemd.macro +++ b/macros/systemd.macro @@ -1,5 +1,6 @@ SYSTEMD_TMPFILES_DIR = /usr/lib/tmpfiles.d +SYSTEMD_SYSUSERS_DIR = /usr/lib/sysusers.d MACRO_INSTALL_SYSTEMD_FILES for file in %{DIR_SOURCE}/systemd/*; do @@ -19,3 +20,12 @@ MACRO_INSTALL_SYSTEMD_TMPFILES done unset file end + +MACRO_INSTALL_SYSTEMD_SYSUSERS + for file in %{DIR_SOURCE}/*.sysusers; do + [ -e "${file}" ] || continue + mkdir -p %{BUILDROOT}/%{SYSTEMD_SYSUSERS_DIR} + cp -vf ${file} %{BUILDROOT}/%{SYSTEMD_SYSUSERS_DIR}/$(basename ${file%*.sysusers}).conf + done + unset file +end -- 2.39.5