]>
Commit | Line | Data |
---|---|---|
590f18a2 LP |
1 | # -*- Mode: makefile; indent-tabs-mode: t -*- */ |
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@ |
1b0fcd74 LP |
25 | %_udevhwdbdir @udevhwdbdir@ |
26 | %_udevrulesdir @udevrulesdir@ | |
27 | %_journalcatalogdir @catalogdir@ | |
28 | %_tmpfilesdir @tmpfilesdir@ | |
b532bdea | 29 | %_sysusersdir @sysusersdir@ |
1b0fcd74 | 30 | %_sysctldir @sysctldir@ |
b532bdea | 31 | %_binfmtdir @binfmtdir@ |
590f18a2 LP |
32 | |
33 | %systemd_requires \ | |
34 | Requires(post): systemd \ | |
35 | Requires(preun): systemd \ | |
36 | Requires(postun): systemd \ | |
37 | %{nil} | |
38 | ||
39 | %systemd_post() \ | |
40 | if [ $1 -eq 1 ] ; then \ | |
41 | # Initial installation \ | |
8cf7c965 | 42 | systemctl preset %{?*} >/dev/null 2>&1 || : \ |
590f18a2 LP |
43 | fi \ |
44 | %{nil} | |
45 | ||
7c67f0f7 ZJS |
46 | %systemd_user_post() %systemd_post --user --global %{?*} |
47 | ||
590f18a2 LP |
48 | %systemd_preun() \ |
49 | if [ $1 -eq 0 ] ; then \ | |
50 | # Package removal, not upgrade \ | |
8cf7c965 LP |
51 | systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \ |
52 | systemctl stop %{?*} > /dev/null 2>&1 || : \ | |
590f18a2 LP |
53 | fi \ |
54 | %{nil} | |
55 | ||
7c67f0f7 ZJS |
56 | %systemd_user_preun() \ |
57 | if [ $1 -eq 0 ] ; then \ | |
58 | # Package removal, not upgrade \ | |
59 | systemctl --no-reload --user --global disable %{?*} > /dev/null 2>&1 || : \ | |
60 | fi \ | |
61 | %{nil} | |
62 | ||
590f18a2 | 63 | %systemd_postun() \ |
8cf7c965 | 64 | systemctl daemon-reload >/dev/null 2>&1 || : \ |
590f18a2 LP |
65 | %{nil} |
66 | ||
7c67f0f7 ZJS |
67 | %systemd_user_postun() %{nil} |
68 | ||
590f18a2 | 69 | %systemd_postun_with_restart() \ |
8cf7c965 | 70 | systemctl daemon-reload >/dev/null 2>&1 || : \ |
590f18a2 LP |
71 | if [ $1 -ge 1 ] ; then \ |
72 | # Package upgrade, not uninstall \ | |
8cf7c965 | 73 | systemctl try-restart %{?*} >/dev/null 2>&1 || : \ |
590f18a2 LP |
74 | fi \ |
75 | %{nil} | |
1b0fcd74 | 76 | |
7c67f0f7 ZJS |
77 | %systemd_user_postun_with_restart() %{nil} |
78 | ||
1b0fcd74 | 79 | %udev_hwdb_update() \ |
8cf7c965 | 80 | udevadm hwdb --update >/dev/null 2>&1 || : \ |
1b0fcd74 LP |
81 | %{nil} |
82 | ||
83 | %udev_rules_update() \ | |
8cf7c965 | 84 | udevadm control --reload >/dev/null 2>&1 || : \ |
1b0fcd74 LP |
85 | %{nil} |
86 | ||
87 | %journal_catalog_update() \ | |
8cf7c965 | 88 | journalctl --update-catalog >/dev/null 2>&1 || : \ |
1b0fcd74 | 89 | %{nil} |
042e33ae LP |
90 | |
91 | %tmpfiles_create() \ | |
8cf7c965 | 92 | systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \ |
042e33ae | 93 | %{nil} |
b532bdea LP |
94 | |
95 | %sysusers_create() \ | |
96 | systemd-sysusers %{?*} >/dev/null 2>&1 || : \ | |
97 | %{nil} | |
98 | ||
0e77023e LP |
99 | %sysusers_create_inline() \ |
100 | echo %{?*} | systemd-sysusers - >/dev/null 2>&1 || : \ | |
101 | %{nil} | |
102 | ||
b532bdea LP |
103 | %sysctl_apply() \ |
104 | @rootlibexecdir@/systemd-sysctl %{?*} >/dev/null 2>&1 || : \ | |
105 | %{nil} | |
106 | ||
107 | %binfmt_apply() \ | |
108 | @rootlibexecdir@/systemd-binfmt %{?*} >/dev/null 2>&1 || : \ | |
109 | %{nil} |