forked from pool/systemd-rpm-macros
- Make upstream %systemd_{pre,post,preun,postun} aliases to their SUSE
counterparts Packagers can now choose to use the upstream or the SUSE variants indifferently. For consistency the SUSE variants should be preferred since almost all SUSE packages already use them but the upstream versions might be usefull in certain cases where packages need to support multiple distros based on RPM. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=60
This commit is contained in:
parent
988d319a8f
commit
a4d73fe809
@ -3,7 +3,8 @@
|
||||
#
|
||||
###
|
||||
#
|
||||
# When a package install systemd unit files, it should use the following macros:
|
||||
# When a package install systemd unit files, it should use the
|
||||
# following macros:
|
||||
#
|
||||
# add %systemd_requires in the specfile
|
||||
#
|
||||
@ -20,6 +21,10 @@
|
||||
# %service_del_postun demo.service
|
||||
# %service_del_postun_without_restart demo.service
|
||||
#
|
||||
# Note: the upstream variants are also available and are aliases to
|
||||
# their SUSE counterparts. However for consistency the SUSE macros
|
||||
# should be preferred unless the package is intended to be portable
|
||||
# across multiple distributions based on RPM.
|
||||
|
||||
%_unitdir /usr/lib/systemd/system
|
||||
%_userunitdir /usr/lib/systemd/user
|
||||
@ -161,22 +166,14 @@ fi \
|
||||
# Upstream variants
|
||||
#
|
||||
|
||||
%systemd_post() \
|
||||
if [ $1 -eq 1 -a -x /usr/bin/systemctl ] ; then \
|
||||
# Initial installation \
|
||||
/usr/bin/systemctl --no-reload preset %{?*} || : \
|
||||
fi \
|
||||
%{nil}
|
||||
%systemd_pre() %{expand::%%service_add_pre %{?**}}
|
||||
%systemd_post() %{expand::%%service_add_post %{?**}}
|
||||
%systemd_preun() %{expand::%%service_del_preun %{?**}}
|
||||
%systemd_postun() %{expand::%%service_del_postun_without_restart %{?**}}
|
||||
%systemd_postun_with_restart() %{expand::%%service_del_postun %{?**}}
|
||||
|
||||
%systemd_user_post() %{expand:%systemd_post \\--global %%{?*}}
|
||||
|
||||
%systemd_preun() \
|
||||
if [ $1 -eq 0 -a -x /usr/bin/systemctl ]; then \
|
||||
# Package removal, not upgrade \
|
||||
/usr/bin/systemctl --no-reload disable --now %{?*} || : \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
%systemd_user_preun() \
|
||||
if [ $1 -eq 0 -a -x /usr/bin/systemctl ]; then \
|
||||
# Package removal, not upgrade \
|
||||
@ -184,25 +181,9 @@ if [ $1 -eq 0 -a -x /usr/bin/systemctl ]; then \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
%systemd_postun() \
|
||||
if [ -x /usr/bin/systemctl ]; then \
|
||||
/usr/bin/systemctl daemon-reload || : \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
%systemd_user_postun() %{nil}
|
||||
%systemd_user_postun_with_restart() %{nil}
|
||||
|
||||
%systemd_postun_with_restart() \
|
||||
if [ -x /usr/bin/systemctl ]; then \
|
||||
/usr/bin/systemctl daemon-reload || : \
|
||||
fi \
|
||||
if [ $1 -ge 1 -a -x /usr/bin/systemctl ]; then \
|
||||
# Package upgrade, not uninstall \
|
||||
/usr/bin/systemctl try-restart %{?*} || : \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
%udev_hwdb_update() \
|
||||
[ -x /usr/bin/udevadm ] && /usr/bin/udevadm hwdb --update || : \
|
||||
%{nil}
|
||||
|
@ -1,3 +1,15 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 12 11:02:57 UTC 2021 - Franck Bui <fbui@suse.com>
|
||||
|
||||
- Make upstream %systemd_{pre,post,preun,postun} aliases to their SUSE
|
||||
counterparts
|
||||
|
||||
Packagers can now choose to use the upstream or the SUSE variants
|
||||
indifferently. For consistency the SUSE variants should be preferred
|
||||
since almost all SUSE packages already use them but the upstream
|
||||
versions might be usefull in certain cases where packages need to
|
||||
support multiple distros based on RPM.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 12 10:23:35 UTC 2021 - Franck Bui <fbui@suse.com>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user