chiark / gitweb /
Merge nss-myhostname
[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 %_presetdir @systempresetdir@
24 %_udevhwdbdir @udevhwdbdir@
25 %_udevrulesdir @udevrulesdir@
26 %_journalcatalogdir @catalogdir@
27 %_tmpfilesdir @tmpfilesdir@
28 %_sysctldir @sysctldir@
29
30 %systemd_requires \
31 Requires(post): systemd \
32 Requires(preun): systemd \
33 Requires(postun): systemd \
34 %{nil}
35
36 %systemd_post() \
37 if [ $1 -eq 1 ] ; then \
38         # Initial installation \
39         @rootbindir@/systemctl preset %{?*} >/dev/null 2>&1 || : \
40 fi \
41 %{nil}
42
43 %systemd_preun() \
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 || : \
48 fi \
49 %{nil}
50
51 %systemd_postun() \
52 @rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \
53 %{nil}
54
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 || : \
60 fi \
61 %{nil}
62
63 %udev_hwdb_update() \
64 @bindir@/udevadm hwdb --update >/dev/null 2>&1 || : \
65 %{nil}
66
67 %udev_rules_update() \
68 @bindir@/udevadm control --reload >/dev/null 2>&1 || : \
69 %{nil}
70
71 %journal_catalog_update() \
72 @rootbindir@/journalctl --update-catalog >/dev/null 2>&1 || : \
73 %{nil}