From: Stefan Schantl Date: Thu, 30 Mar 2023 12:52:29 +0000 (+0200) Subject: macros: Add macro to automatically install all systemd sysusers files X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eda0def0851b1dee32c26ccad18bb3acb31f6ccb;p=people%2Fstevee%2Fpakfire.git 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 --- diff --git a/macros/systemd.macro b/macros/systemd.macro index 9dc74ff0..1453db95 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