Commit c08a4306 authored by François Grisez's avatar François Grisez

Add systemd macros to rpmmacros

parent ffccffe9
......@@ -32,3 +32,51 @@
%{?_cmake_lib_suffix64} \\\
%endif \
-DBUILD_SHARED_LIBS:BOOL=ON
#
# Macros for systemd
#
%_unitdir /lib/systemd/system
%systemd_requires \
Requires(post): systemd \
Requires(preun): systemd \
Requires(postun): systemd \
%{nil}
%systemd_post() \
if [ $1 -eq 1 ] ; then \
# Initial installation \
systemctl preset %{?*} >/dev/null 2>&1 || : \
fi \
%{nil}
%systemd_preun() \
if [ $1 -eq 0 ] ; then \
# Package removal, not upgrade \
systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \
systemctl stop %{?*} > /dev/null 2>&1 || : \
fi \
%{nil}
%systemd_postun() \
systemctl daemon-reload >/dev/null 2>&1 || : \
%{nil}
%systemd_postun_with_restart() \
systemctl daemon-reload >/dev/null 2>&1 || : \
if [ $1 -ge 1 ] ; then \
# Package upgrade, not uninstall \
systemctl try-restart %{?*} >/dev/null 2>&1 || : \
fi \
%{nil}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment