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