summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/macros.systemd.in31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/core/macros.systemd.in b/src/core/macros.systemd.in
index cee9b89870..1235a7e15a 100644
--- a/src/core/macros.systemd.in
+++ b/src/core/macros.systemd.in
@@ -96,6 +96,7 @@ udevadm control --reload >/dev/null 2>&1 || : \
journalctl --update-catalog >/dev/null 2>&1 || : \
%{nil}
+# Deprecated. Use %tmpfiles_create_package instead
%tmpfiles_create() \
systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \
%{nil}
@@ -109,24 +110,40 @@ systemd-sysusers %{?*} >/dev/null 2>&1 || : \
echo %{?*} | systemd-sysusers - >/dev/null 2>&1 || : \
%{nil}
-# This should be used by package installation scripts which
-# require users or groups to be present before the files installed
-# by the package are present on disk (for example because some files
-# are owned by those users or groups).
+# This should be used by package installation scripts which require users or
+# groups to be present before the files installed by the package are present on
+# disk (for example because some files are owned by those users or groups).
#
# Example:
-# Source1: %{name}.conf
+# Source1: %{name}-sysusers.conf
# ...
# %install
-# install -Dt %{buildroot}%{sysusersdir} %SOURCE1
+# install -D %SOURCE1 %{buildroot}%{_sysusersdir}/%{name}.conf
# %pre
# %sysusers_create_package %{name} %SOURCE1
# %files
-# %{sysusersdir}/%{name}.conf
+# %{_sysusersdir}/%{name}.conf
%sysusers_create_package() \
echo "%(cat %2)" | systemd-sysusers --replace=%_sysusersdir/%1.conf - >/dev/null 2>&1 || : \
%{nil}
+# This may be used by package installation scripts to create files according to
+# their tmpfiles configuration from a package installation script, even before
+# the files of that package are installed on disk.
+#
+# Example:
+# Source1: %{name}-tmpfiles.conf
+# ...
+# %install
+# install -D %SOURCE1 %{buildroot}%{_tmpfilesdir}/%{name}.conf
+# %pre
+# %tmpfiles_create_package %{name} %SOURCE1
+# %files
+# %{_tmpfilesdir}/%{name}.conf
+%tmpfiles_create_package() \
+echo "%(cat %2)" | systemd-tmpfiles --replace=%_tmpfilesdir/%1.conf --create - >/dev/null 2>&1 || : \
+%{nil}
+
%sysctl_apply() \
@rootlibexecdir@/systemd-sysctl %{?*} >/dev/null 2>&1 || : \
%{nil}