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