-
Notifications
You must be signed in to change notification settings - Fork 4
/
macros.systemd
108 lines (88 loc) · 2.81 KB
/
macros.systemd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# -*- Mode: rpm-spec; indent-tabs-mode: nil -*- */
#
# Macros for packages installing systemd unit files
# Fedora-License-Identifier: LGPLv2+
# SPDX-2.0-License-Identifier: LGPL-2.1+
# SPDX-3.0-License-Identifier: LGPL-2.1-or-later
%_unitdir /lib/systemd/system
%_userunitdir /usr/lib/systemd/user
%_presetdir /lib/systemd/system-preset
%_userpresetdir /usr/lib/systemd/user-preset
%_udevhwdbdir /lib/udev/hwdb.d
%_udevrulesdir /lib/udev/rules.d
%_journalcatalogdir /usr/lib/systemd/catalog
%_tmpfilesdir /usr/lib/tmpfiles.d
%_modulesloaddir /usr/lib/modules-load.d
%_modprobedir /lib/modprobe.d
%_sysusersdir /usr/lib/sysusers.d
%_sysctldir /usr/lib/sysctl.d
%_binfmtdir /usr/lib/binfmt.d
# systemd 231
%_systemdgeneratordir /lib/systemd/system-generators
%_systemdusergeneratordir /usr/lib/systemd/user-generators
# systemd 233
%_environmentdir /usr/lib/environment.d
%_systemd_system_env_generator_dir /lib/systemd/system-environment-generators
%_systemd_user_env_generator_dir /usr/lib/systemd/user-environment-generators
%systemd_requires \
Requires: systemd-sysv \
Requires(post): systemd \
Requires(preun): systemd \
Requires(postun): systemd \
%{nil}
%systemd_post() \
if [ "$1" = "configure" ] ; then \
# Initial installation \
systemctl preset %{?*} >/dev/null 2>&1 || : \
fi \
%{nil}
%systemd_user_post() %{systemd_post --user --global %{?*}}
%systemd_preun() \
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then \
# Package removal, not upgrade \
systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \
systemctl stop %{?*} > /dev/null 2>&1 || : \
fi \
%{nil}
%systemd_user_preun() \
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then\
# Package removal, not upgrade \
systemctl --no-reload --user --global disable %{?*} > /dev/null 2>&1 || : \
fi \
%{nil}
%systemd_postun() \
systemctl daemon-reload >/dev/null 2>&1 || : \
%{nil}
%systemd_user_postun() %{nil}
%systemd_postun_with_restart() \
systemctl daemon-reload >/dev/null 2>&1 || : \
if [ "$1" = "upgrade" ] ; then \
# Package upgrade, not uninstall \
systemctl try-restart %{?*} >/dev/null 2>&1 || : \
fi \
%{nil}
%systemd_user_postun_with_restart() %{nil}
%udev_hwdb_update() \
udevadm hwdb --update >/dev/null 2>&1 || : \
%{nil}
%udev_rules_update() \
udevadm control --reload >/dev/null 2>&1 || : \
%{nil}
%journal_catalog_update() \
journalctl --update-catalog >/dev/null 2>&1 || : \
%{nil}
%tmpfiles_create() \
systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \
%{nil}
%sysusers_create() \
systemd-sysusers %{?*} >/dev/null 2>&1 || : \
%{nil}
%sysusers_create_inline() \
echo %{?*} | systemd-sysusers - >/dev/null 2>&1 || : \
%{nil}
%sysctl_apply() \
/lib/systemd/systemd-sysctl %{?*} >/dev/null 2>&1 || : \
%{nil}
%binfmt_apply() \
/lib/systemd/systemd-binfmt %{?*} >/dev/null 2>&1 || : \
%{nil}