]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/core/macros.systemd.in
bootspec: fix debug message about default entry
[thirdparty/systemd.git] / src / core / macros.systemd.in
1 # -*- Mode: rpm-spec; indent-tabs-mode: nil -*- */
2 # SPDX-License-Identifier: LGPL-2.1+
3 #
4 # This file is part of systemd.
5 #
6 # Copyright 2012 Lennart Poettering
7 #
8 # systemd is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU Lesser General Public License as published by
10 # the Free Software Foundation; either version 2.1 of the License, or
11 # (at your option) any later version.
12 #
13 # systemd is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Lesser General Public License for more details.
17 #
18 # You should have received a copy of the GNU Lesser General Public License
19 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
20
21 # RPM macros for packages installing systemd unit files
22
23 %_unitdir @systemunitdir@
24 %_userunitdir @userunitdir@
25 %_presetdir @systempresetdir@
26 %_userpresetdir @userpresetdir@
27 %_udevhwdbdir @udevhwdbdir@
28 %_udevrulesdir @udevrulesdir@
29 %_journalcatalogdir @catalogdir@
30 %_tmpfilesdir @tmpfilesdir@
31 %_sysusersdir @sysusersdir@
32 %_sysctldir @sysctldir@
33 %_binfmtdir @binfmtdir@
34 %_systemdgeneratordir @systemgeneratordir@
35 %_systemdusergeneratordir @usergeneratordir@
36 %_systemd_system_env_generator_dir @systemenvgeneratordir@
37 %_systemd_user_env_generator_dir @userenvgeneratordir@
38
39 %systemd_requires \
40 Requires(post): systemd \
41 Requires(preun): systemd \
42 Requires(postun): systemd \
43 %{nil}
44
45 %systemd_ordering \
46 OrderWithRequires(post): systemd \
47 OrderWithRequires(preun): systemd \
48 OrderWithRequires(postun): systemd \
49 %{nil}
50
51 %systemd_post() \
52 if [ $1 -eq 1 ] ; then \
53 # Initial installation \
54 systemctl --no-reload preset %{?*} >/dev/null 2>&1 || : \
55 fi \
56 %{nil}
57
58 %systemd_user_post() %{expand:%systemd_post \\--user \\--global %%{?*}}
59
60 %systemd_preun() \
61 if [ $1 -eq 0 ] ; then \
62 # Package removal, not upgrade \
63 systemctl --no-reload disable --now %{?*} > /dev/null 2>&1 || : \
64 fi \
65 %{nil}
66
67 %systemd_user_preun() \
68 if [ $1 -eq 0 ] ; then \
69 # Package removal, not upgrade \
70 systemctl --no-reload --user --global disable %{?*} > /dev/null 2>&1 || : \
71 fi \
72 %{nil}
73
74 %systemd_postun() %{nil}
75
76 %systemd_user_postun() %{nil}
77
78 %systemd_postun_with_restart() \
79 if [ $1 -ge 1 ] ; then \
80 # Package upgrade, not uninstall \
81 systemctl try-restart %{?*} >/dev/null 2>&1 || : \
82 fi \
83 %{nil}
84
85 %systemd_user_postun_with_restart() %{nil}
86
87 %udev_hwdb_update() \
88 systemd-hwdb update >/dev/null 2>&1 || : \
89 %{nil}
90
91 %udev_rules_update() \
92 udevadm control --reload >/dev/null 2>&1 || : \
93 %{nil}
94
95 %journal_catalog_update() \
96 journalctl --update-catalog >/dev/null 2>&1 || : \
97 %{nil}
98
99 %tmpfiles_create() \
100 systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \
101 %{nil}
102
103 %sysusers_create() \
104 systemd-sysusers %{?*} >/dev/null 2>&1 || : \
105 %{nil}
106
107 %sysusers_create_inline() \
108 echo %{?*} | systemd-sysusers - >/dev/null 2>&1 || : \
109 %{nil}
110
111 %sysctl_apply() \
112 @rootlibexecdir@/systemd-sysctl %{?*} >/dev/null 2>&1 || : \
113 %{nil}
114
115 %binfmt_apply() \
116 @rootlibexecdir@/systemd-binfmt %{?*} >/dev/null 2>&1 || : \
117 %{nil}