rpm macros: add %tmpfiles_create_package
I expect that this will be mostly obsoleted by transfiletriggers that (I hope) we will soon add. But let's do this for completeness anyway. I'm keeping the description of the macro a bit vague, since I expect that it'll be changed when transfiletriggers are added.
This commit is contained in:
parent
a6d8474f39
commit
0f78fee8d0
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue