[PATCHv2] macros: Add macro to automatically install any systemd sysusers files
Commit Message
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(+)
@@ -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
@@ -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