1 # -*- Mode: makefile; indent-tabs-mode: t -*- */
3 # This file is part of systemd.
5 # Copyright 2012 Lennart Poettering
7 # systemd is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU Lesser General Public License as published by
9 # the Free Software Foundation; either version 2.1 of the License, or
10 # (at your option) any later version.
12 # systemd is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public License
18 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 # RPM macros for packages installing systemd unit files
22 %_unitdir @systemunitdir@
25 Requires(post): systemd \
26 Requires(preun): systemd \
27 Requires(postun): systemd \
31 if [ $1 -eq 1 ] ; then \
32 # Initial installation \
33 @rootbindir@/systemctl preset %{?*} >/dev/null 2>&1 || : \
38 if [ $1 -eq 0 ] ; then \
39 # Package removal, not upgrade \
40 @rootbindir@/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \
41 @rootbindir@/systemctl stop %{?*} > /dev/null 2>&1 || : \
46 @rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \
49 %systemd_postun_with_restart() \
50 @rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \
51 if [ $1 -ge 1 ] ; then \
52 # Package upgrade, not uninstall \
53 @rootbindir@/systemctl try-restart %{?*} >/dev/null 2>&1 || : \