]> git.ipfire.org Git - thirdparty/systemd.git/blame - 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
CommitLineData
873e4133 1# -*- Mode: rpm-spec; indent-tabs-mode: nil -*- */
590f18a2
LP
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@
ed8086d1 23%_userunitdir @userunitdir@
a1d41e17 24%_presetdir @systempresetdir@
c715e7a9 25%_userpresetdir @userpresetdir@
1b0fcd74
LP
26%_udevhwdbdir @udevhwdbdir@
27%_udevrulesdir @udevrulesdir@
28%_journalcatalogdir @catalogdir@
29%_tmpfilesdir @tmpfilesdir@
b532bdea 30%_sysusersdir @sysusersdir@
1b0fcd74 31%_sysctldir @sysctldir@
b532bdea 32%_binfmtdir @binfmtdir@
1071fd08
ZJS
33%_systemdgeneratordir @systemgeneratordir@
34%_systemdusergeneratordir @usergeneratordir@
64691d20
ZJS
35%_systemd_system_env_generator_dir @systemenvgeneratordir@
36%_systemd_user_env_generator_dir @userenvgeneratordir@
590f18a2
LP
37
38%systemd_requires \
39Requires(post): systemd \
40Requires(preun): systemd \
41Requires(postun): systemd \
42%{nil}
43
2424b6bd
HH
44%systemd_ordering \
45OrderWithRequires(post): systemd \
46OrderWithRequires(preun): systemd \
47OrderWithRequires(postun): systemd \
48%{nil}
49
590f18a2
LP
50%systemd_post() \
51if [ $1 -eq 1 ] ; then \
52 # Initial installation \
873e4133 53 systemctl --no-reload preset %{?*} >/dev/null 2>&1 || : \
590f18a2
LP
54fi \
55%{nil}
56
e67ba783 57%systemd_user_post() %{expand:%systemd_post \\--user \\--global %%{?*}}
7c67f0f7 58
590f18a2
LP
59%systemd_preun() \
60if [ $1 -eq 0 ] ; then \
61 # Package removal, not upgrade \
873e4133 62 systemctl --no-reload disable --now %{?*} > /dev/null 2>&1 || : \
590f18a2
LP
63fi \
64%{nil}
65
7c67f0f7
ZJS
66%systemd_user_preun() \
67if [ $1 -eq 0 ] ; then \
68 # Package removal, not upgrade \
69 systemctl --no-reload --user --global disable %{?*} > /dev/null 2>&1 || : \
70fi \
71%{nil}
72
873e4133 73%systemd_postun() %{nil}
590f18a2 74
7c67f0f7
ZJS
75%systemd_user_postun() %{nil}
76
590f18a2 77%systemd_postun_with_restart() \
590f18a2
LP
78if [ $1 -ge 1 ] ; then \
79 # Package upgrade, not uninstall \
8cf7c965 80 systemctl try-restart %{?*} >/dev/null 2>&1 || : \
590f18a2
LP
81fi \
82%{nil}
1b0fcd74 83
7c67f0f7
ZJS
84%systemd_user_postun_with_restart() %{nil}
85
1b0fcd74 86%udev_hwdb_update() \
331d6a20 87systemd-hwdb update >/dev/null 2>&1 || : \
1b0fcd74
LP
88%{nil}
89
90%udev_rules_update() \
8cf7c965 91udevadm control --reload >/dev/null 2>&1 || : \
1b0fcd74
LP
92%{nil}
93
94%journal_catalog_update() \
8cf7c965 95journalctl --update-catalog >/dev/null 2>&1 || : \
1b0fcd74 96%{nil}
042e33ae
LP
97
98%tmpfiles_create() \
8cf7c965 99systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \
042e33ae 100%{nil}
b532bdea
LP
101
102%sysusers_create() \
103systemd-sysusers %{?*} >/dev/null 2>&1 || : \
104%{nil}
105
0e77023e
LP
106%sysusers_create_inline() \
107echo %{?*} | systemd-sysusers - >/dev/null 2>&1 || : \
108%{nil}
109
b532bdea
LP
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}