macros.systemd.in revision ed8086d119d8a996a0ad13d33eeb99b4d16d9492
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann# -*- Mode: makefile; indent-tabs-mode: t -*- */
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann# This file is part of systemd.
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann# Copyright 2012 Lennart Poettering
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann# systemd is free software; you can redistribute it and/or modify it
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann# under the terms of the GNU Lesser General Public License as published by
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann# the Free Software Foundation; either version 2.1 of the License, or
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann# (at your option) any later version.
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann# systemd is distributed in the hope that it will be useful, but
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann# WITHOUT ANY WARRANTY; without even the implied warranty of
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann# Lesser General Public License for more details.
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann# You should have received a copy of the GNU Lesser General Public License
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann# along with systemd; If not, see <http://www.gnu.org/licenses/>.
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann# RPM macros for packages installing systemd unit files
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%_unitdir @systemunitdir@
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%_userunitdir @userunitdir@
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%_presetdir @systempresetdir@
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%_udevhwdbdir @udevhwdbdir@
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%_udevrulesdir @udevrulesdir@
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%_journalcatalogdir @catalogdir@
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%_tmpfilesdir @tmpfilesdir@
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%_sysctldir @sysctldir@
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%systemd_requires \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel HoltmannRequires(post): systemd \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel HoltmannRequires(preun): systemd \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel HoltmannRequires(postun): systemd \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%systemd_post() \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmannif [ $1 -eq 1 ] ; then \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann # Initial installation \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann @rootbindir@/systemctl preset %{?*} >/dev/null 2>&1 || : \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%systemd_preun() \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmannif [ $1 -eq 0 ] ; then \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann # Package removal, not upgrade \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann @rootbindir@/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann @rootbindir@/systemctl stop %{?*} > /dev/null 2>&1 || : \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%systemd_postun() \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann@rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%systemd_postun_with_restart() \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann@rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \
5476ad087c0f2d45ab0dab1bab9ef3e9d70418bcMarcel Holtmannif [ $1 -ge 1 ] ; then \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann # Package upgrade, not uninstall \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann @rootbindir@/systemctl try-restart %{?*} >/dev/null 2>&1 || : \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%udev_hwdb_update() \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann@rootbindir@/udevadm hwdb --update >/dev/null 2>&1 || : \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%udev_rules_update() \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann@rootbindir@/udevadm control --reload >/dev/null 2>&1 || : \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann%journal_catalog_update() \
94f5bbc626f2a4102debd9b17c964170a887cb49Marcel Holtmann@rootbindir@/journalctl --update-catalog >/dev/null 2>&1 || : \