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@
24 %_udevhwdbdir @udevhwdbdir@
25 %_udevrulesdir @udevrulesdir@
26 %_journalcatalogdir @catalogdir@
27 %_tmpfilesdir @tmpfilesdir@
28 %_sysctldir @sysctldir@
31 Requires(post): systemd \
32 Requires(preun): systemd \
33 Requires(postun): systemd \
37 if [ $1 -eq 1 ] ; then \
38 # Initial installation \
39 @rootbindir@/systemctl preset %{?*} >/dev/null 2>&1 || : \
44 if [ $1 -eq 0 ] ; then \
45 # Package removal, not upgrade \
46 @rootbindir@/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \
47 @rootbindir@/systemctl stop %{?*} > /dev/null 2>&1 || : \
52 @rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \
55 %systemd_postun_with_restart() \
56 @rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \
57 if [ $1 -ge 1 ] ; then \
58 # Package upgrade, not uninstall \
59 @rootbindir@/systemctl try-restart %{?*} >/dev/null 2>&1 || : \
64 @rootbindir@/udevadm hwdb --update >/dev/null 2>&1 || : \
67 %udev_rules_update() \
68 @rootbindir@/udevadm control --reload >/dev/null 2>&1 || : \
71 %journal_catalog_update() \
72 @rootbindir@/journalctl --update-catalog >/dev/null 2>&1 || : \