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@
23 %_presetdir @systempresetdir@
26 Requires(post): systemd \
27 Requires(preun): systemd \
28 Requires(postun): systemd \
32 if [ $1 -eq 1 ] ; then \
33 # Initial installation \
34 @rootbindir@/systemctl preset %{?*} >/dev/null 2>&1 || : \
39 if [ $1 -eq 0 ] ; then \
40 # Package removal, not upgrade \
41 @rootbindir@/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \
42 @rootbindir@/systemctl stop %{?*} > /dev/null 2>&1 || : \
47 @rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \
50 %systemd_postun_with_restart() \
51 @rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \
52 if [ $1 -ge 1 ] ; then \
53 # Package upgrade, not uninstall \
54 @rootbindir@/systemctl try-restart %{?*} >/dev/null 2>&1 || : \