1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

Merge pull request #9036 from keszybz/rpm-macro-cleanup

rpm macro cleanup
This commit is contained in:
Yu Watanabe 2018-05-20 23:20:24 +09:00 committed by GitHub
commit 0297f67e7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 15 deletions

View File

@ -241,12 +241,14 @@ substs.set('userpresetdir', userpresetdir)
substs.set('udevhwdbdir', udevhwdbdir)
substs.set('udevrulesdir', udevrulesdir)
substs.set('udevlibexecdir', udevlibexecdir)
substs.set('environmentdir', environmentdir)
substs.set('catalogdir', catalogdir)
substs.set('tmpfilesdir', tmpfilesdir)
substs.set('sysusersdir', sysusersdir)
substs.set('sysctldir', sysctldir)
substs.set('binfmtdir', binfmtdir)
substs.set('modulesloaddir', modulesloaddir)
substs.set('modprobedir', modprobedir)
substs.set('systemgeneratordir', systemgeneratordir)
substs.set('usergeneratordir', usergeneratordir)
substs.set('systemenvgeneratordir', systemenvgeneratordir)

View File

@ -14,10 +14,13 @@
%_udevhwdbdir @udevhwdbdir@
%_udevrulesdir @udevrulesdir@
%_journalcatalogdir @catalogdir@
%_tmpfilesdir @tmpfilesdir@
%_sysusersdir @sysusersdir@
%_sysctldir @sysctldir@
%_binfmtdir @binfmtdir@
%_sysctldir @sysctldir@
%_sysusersdir @sysusersdir@
%_tmpfilesdir @tmpfilesdir@
%_environmnentdir @environmentdir@
%_modulesloaddir @modulesloaddir@
%_modprobedir @modprobedir@
%_systemdgeneratordir @systemgeneratordir@
%_systemdusergeneratordir @usergeneratordir@
%_systemd_system_env_generator_dir @systemenvgeneratordir@
@ -38,23 +41,23 @@ OrderWithRequires(postun): systemd \
%systemd_post() \
if [ $1 -eq 1 ] ; then \
# Initial installation \
systemctl --no-reload preset %{?*} >/dev/null 2>&1 || : \
systemctl --no-reload preset %{?*} &>/dev/null || : \
fi \
%{nil}
%systemd_user_post() %{expand:%systemd_post \\--user \\--global %%{?*}}
%systemd_user_post() %{expand:%systemd_post \\--global %%{?*}}
%systemd_preun() \
if [ $1 -eq 0 ] ; then \
# Package removal, not upgrade \
systemctl --no-reload disable --now %{?*} > /dev/null 2>&1 || : \
systemctl --no-reload disable --now %{?*} &>/dev/null || : \
fi \
%{nil}
%systemd_user_preun() \
if [ $1 -eq 0 ] ; then \
# Package removal, not upgrade \
systemctl --no-reload --user --global disable %{?*} > /dev/null 2>&1 || : \
systemctl --global disable %{?*} &>/dev/null || : \
fi \
%{nil}
@ -65,7 +68,7 @@ fi \
%systemd_postun_with_restart() \
if [ $1 -ge 1 ] ; then \
# Package upgrade, not uninstall \
systemctl try-restart %{?*} >/dev/null 2>&1 || : \
systemctl try-restart %{?*} &>/dev/null || : \
fi \
%{nil}
@ -79,16 +82,16 @@ fi \
# Deprecated. Use %tmpfiles_create_package instead
%tmpfiles_create() \
systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \
systemd-tmpfiles --create %{?*} &>/dev/null || : \
%{nil}
# Deprecated. Use %sysusers_create_package instead
%sysusers_create() \
systemd-sysusers %{?*} >/dev/null 2>&1 || : \
systemd-sysusers %{?*} &>/dev/null || : \
%{nil}
%sysusers_create_inline() \
systemd-sysusers - <<SYSTEMD_INLINE_EOF >/dev/null 2>&1 || : \
systemd-sysusers - <<SYSTEMD_INLINE_EOF &>/dev/null || : \
%{?*} \
SYSTEMD_INLINE_EOF \
%{nil}
@ -107,7 +110,7 @@ SYSTEMD_INLINE_EOF \
# %files
# %{_sysusersdir}/%{name}.conf
%sysusers_create_package() \
systemd-sysusers --replace=%_sysusersdir/%1.conf - <<SYSTEMD_INLINE_EOF >/dev/null 2>&1 || : \
systemd-sysusers --replace=%_sysusersdir/%1.conf - <<SYSTEMD_INLINE_EOF &>/dev/null || : \
%(cat %2) \
SYSTEMD_INLINE_EOF \
%{nil}
@ -126,15 +129,15 @@ SYSTEMD_INLINE_EOF \
# %files
# %{_tmpfilesdir}/%{name}.conf
%tmpfiles_create_package() \
systemd-tmpfiles --replace=%_tmpfilesdir/%1.conf --create - <<SYSTEMD_INLINE_EOF >/dev/null 2>&1 || : \
systemd-tmpfiles --replace=%_tmpfilesdir/%1.conf --create - <<SYSTEMD_INLINE_EOF &>/dev/null || : \
%(cat %2) \
SYSTEMD_INLINE_EOF \
%{nil}
%sysctl_apply() \
@rootlibexecdir@/systemd-sysctl %{?*} >/dev/null 2>&1 || : \
@rootlibexecdir@/systemd-sysctl %{?*} &>/dev/null || : \
%{nil}
%binfmt_apply() \
@rootlibexecdir@/systemd-binfmt %{?*} >/dev/null 2>&1 || : \
@rootlibexecdir@/systemd-binfmt %{?*} &>/dev/null || : \
%{nil}