]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/core/macros.systemd.in
macros.systemd.in: add %systemd_ordering (#3776)
[thirdparty/systemd.git] / src / core / macros.systemd.in
1 # -*- Mode: rpm-spec; indent-tabs-mode: nil -*- */
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 %_sysusersdir @sysusersdir@
30 %_sysctldir @sysctldir@
31 %_binfmtdir @binfmtdir@
32 %_systemdgeneratordir @systemgeneratordir@
33 %_systemdusergeneratordir @usergeneratordir@
34
35 %systemd_requires \
36 Requires(post): systemd \
37 Requires(preun): systemd \
38 Requires(postun): systemd \
39 %{nil}
40
41 %systemd_ordering \
42 OrderWithRequires(post): systemd \
43 OrderWithRequires(preun): systemd \
44 OrderWithRequires(postun): systemd \
45 %{nil}
46
47 %systemd_post() \
48 if [ $1 -eq 1 ] ; then \
49 # Initial installation \
50 systemctl --no-reload preset %{?*} >/dev/null 2>&1 || : \
51 fi \
52 %{nil}
53
54 %systemd_user_post() %{expand:%systemd_post \\--user \\--global %%{?*}}
55
56 %systemd_preun() \
57 if [ $1 -eq 0 ] ; then \
58 # Package removal, not upgrade \
59 systemctl --no-reload disable --now %{?*} > /dev/null 2>&1 || : \
60 fi \
61 %{nil}
62
63 %systemd_user_preun() \
64 if [ $1 -eq 0 ] ; then \
65 # Package removal, not upgrade \
66 systemctl --no-reload --user --global disable %{?*} > /dev/null 2>&1 || : \
67 fi \
68 %{nil}
69
70 %systemd_postun() %{nil}
71
72 %systemd_user_postun() %{nil}
73
74 %systemd_postun_with_restart() \
75 if [ $1 -ge 1 ] ; then \
76 # Package upgrade, not uninstall \
77 systemctl try-restart %{?*} >/dev/null 2>&1 || : \
78 fi \
79 %{nil}
80
81 %systemd_user_postun_with_restart() %{nil}
82
83 %udev_hwdb_update() \
84 udevadm hwdb --update >/dev/null 2>&1 || : \
85 %{nil}
86
87 %udev_rules_update() \
88 udevadm control --reload >/dev/null 2>&1 || : \
89 %{nil}
90
91 %journal_catalog_update() \
92 journalctl --update-catalog >/dev/null 2>&1 || : \
93 %{nil}
94
95 %tmpfiles_create() \
96 systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \
97 %{nil}
98
99 %sysusers_create() \
100 systemd-sysusers %{?*} >/dev/null 2>&1 || : \
101 %{nil}
102
103 %sysusers_create_inline() \
104 echo %{?*} | systemd-sysusers - >/dev/null 2>&1 || : \
105 %{nil}
106
107 %sysctl_apply() \
108 @rootlibexecdir@/systemd-sysctl %{?*} >/dev/null 2>&1 || : \
109 %{nil}
110
111 %binfmt_apply() \
112 @rootlibexecdir@/systemd-binfmt %{?*} >/dev/null 2>&1 || : \
113 %{nil}