This macros works very similar than the tmpfiles one but handles sysusers files.
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org --- macros/build.macro | 1 + macros/systemd.macro | 9 +++++++++ 2 files changed, 10 insertions(+)
diff --git a/macros/build.macro b/macros/build.macro index 4eedd6a9..c19430a4 100644 --- a/macros/build.macro +++ b/macros/build.macro @@ -12,6 +12,7 @@ end def MACRO_INSTALL_FILES %{MACRO_INSTALL_DEFAULT_FILES} %{MACRO_INSTALL_SYSTEMD_FILES} + %{MACRO_INSTALL_SYSTEMD_SYSUSERS} %{MACRO_INSTALL_SYSTEMD_TMPFILES} %{MACRO_INSTALL_PAM_FILES} end diff --git a/macros/systemd.macro b/macros/systemd.macro index 085fabbd..7a40cff6 100644 --- a/macros/systemd.macro +++ b/macros/systemd.macro @@ -16,3 +16,12 @@ MACRO_INSTALL_SYSTEMD_TMPFILES done unset file end + +MACRO_INSTALL_SYSTEMD_SYSUSERS + for file in %{DIR_SOURCE}/*.sysusers; do + [ -e "${file}" ] || continue + mkdir -pv %{BUILDROOT}/%{sysusersdir} + install -v -m 0644 ${file} %{BUILDROOT}/%{sysusersdir}/$(basename ${file%*.sysusers}).conf + done + unset file +end