chiark / gitweb /
Fix gperf syntax
[elogind.git] / src / core / macros.systemd.in
1 #  -*- Mode: makefile; indent-tabs-mode: t -*- */
2 #
3 #  This file is part of systemd.
4 #
5 #  Copyright 2012 Lennart Poettering
6 #
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.
11 #
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.
16 #
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/>.
19
20 # RPM macros for packages installing systemd unit files
21
22 %_unitdir @systemunitdir@
23 %_userunitdir @userunitdir@
24 %_presetdir @systempresetdir@
25 %_udevhwdbdir @udevhwdbdir@
26 %_udevrulesdir @udevrulesdir@
27 %_journalcatalogdir @catalogdir@
28 %_tmpfilesdir @tmpfilesdir@
29 %_sysctldir @sysctldir@
30
31 %systemd_requires \
32 Requires(post): systemd \
33 Requires(preun): systemd \
34 Requires(postun): systemd \
35 %{nil}
36
37 %systemd_post() \
38 if [ $1 -eq 1 ] ; then \
39         # Initial installation \
40         @rootbindir@/systemctl preset %{?*} >/dev/null 2>&1 || : \
41 fi \
42 %{nil}
43
44 %systemd_preun() \
45 if [ $1 -eq 0 ] ; then \
46         # Package removal, not upgrade \
47         @rootbindir@/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \
48         @rootbindir@/systemctl stop %{?*} > /dev/null 2>&1 || : \
49 fi \
50 %{nil}
51
52 %systemd_postun() \
53 @rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \
54 %{nil}
55
56 %systemd_postun_with_restart() \
57 @rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \
58 if [ $1 -ge 1 ] ; then \
59         # Package upgrade, not uninstall \
60         @rootbindir@/systemctl try-restart %{?*} >/dev/null 2>&1 || : \
61 fi \
62 %{nil}
63
64 %udev_hwdb_update() \
65 @rootbindir@/udevadm hwdb --update >/dev/null 2>&1 || : \
66 %{nil}
67
68 %udev_rules_update() \
69 @rootbindir@/udevadm control --reload >/dev/null 2>&1 || : \
70 %{nil}
71
72 %journal_catalog_update() \
73 @rootbindir@/journalctl --update-catalog >/dev/null 2>&1 || : \
74 %{nil}
75
76 %tmpfiles_create() \
77 @rootbindir@/systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \
78 %{nil}