|
1 | 1 | # -*- Mode: rpm-spec; indent-tabs-mode: nil -*- */ |
2 | | -# SPDX-License-Identifier: LGPL-2.1+ |
| 2 | +# SPDX-License-Identifier: LGPL-2.1-or-later |
3 | 3 | # |
4 | 4 | # This file is part of systemd. |
5 | 5 | # |
6 | | -# Copyright 2015 Zbigniew Jędrzejewski-Szmek |
7 | 6 | # Copyright 2018 Neal Gompa |
8 | | -# |
9 | | -# systemd is free software; you can redistribute it and/or modify it |
10 | | -# under the terms of the GNU Lesser General Public License as published by |
11 | | -# the Free Software Foundation; either version 2.1 of the License, or |
12 | | -# (at your option) any later version. |
13 | | -# |
14 | | -# systemd is distributed in the hope that it will be useful, but |
15 | | -# WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 | | -# Lesser General Public License for more details. |
18 | | -# |
19 | | -# You should have received a copy of the GNU Lesser General Public License |
20 | | -# along with systemd; If not, see <http://www.gnu.org/licenses/>. |
21 | 7 |
|
22 | 8 | # The contents of this are an example to be copied into systemd.spec. |
23 | 9 | # |
24 | 10 | # Minimum rpm version supported: 4.13.0 |
25 | 11 |
|
26 | | -%transfiletriggerin -P 900900 -- /usr/lib/systemd/system /etc/systemd/system |
| 12 | +%transfiletriggerin -P 900900 -- @systemunitdir@ /etc/systemd/system |
27 | 13 | # This script will run after any package is initially installed or |
28 | 14 | # upgraded. We care about the case where a package is initially |
29 | 15 | # installed, because other cases are covered by the *un scriptlets, |
30 | 16 | # so sometimes we will reload needlessly. |
31 | | -if test -d /run/systemd/system; then |
32 | | - %{_bindir}/systemctl daemon-reload |
| 17 | +if test -d "/run/systemd/system"; then |
| 18 | + %{_bindir}/systemctl daemon-reload || : |
33 | 19 | fi |
34 | 20 |
|
35 | | -%transfiletriggerun -- /usr/lib/systemd/system /etc/systemd/system |
| 21 | +%transfiletriggerun -- @systemunitdir@ /etc/systemd/system |
36 | 22 | # On removal, we need to run daemon-reload after any units have been |
37 | 23 | # removed. %transfiletriggerpostun would be ideal, but it does not get |
38 | 24 | # executed for some reason. |
|
47 | 33 | # the first %filetriggerpostun. |
48 | 34 |
|
49 | 35 | if test -d "/run/systemd/system"; then |
50 | | - mkdir -p "%{_localstatedir}/lib/rpm-state/systemd" |
51 | | - touch "%{_localstatedir}/lib/rpm-state/systemd/needs-reload" |
| 36 | + mkdir -p "%{_localstatedir}/lib/rpm-state/systemd" |
| 37 | + touch "%{_localstatedir}/lib/rpm-state/systemd/needs-reload" |
52 | 38 | fi |
53 | 39 |
|
54 | | -%filetriggerpostun -P 1000100 -- /usr/lib/systemd/system /etc/systemd/system |
| 40 | +%filetriggerpostun -P 1000100 -- @systemunitdir@ /etc/systemd/system |
55 | 41 | if test -f "%{_localstatedir}/lib/rpm-state/systemd/needs-reload"; then |
56 | | - rm -rf "%{_localstatedir}/lib/rpm-state/systemd" |
57 | | - %{_bindir}/systemctl daemon-reload |
| 42 | + rm -rf "%{_localstatedir}/lib/rpm-state/systemd" |
| 43 | + %{_bindir}/systemctl daemon-reload || : |
58 | 44 | fi |
59 | 45 |
|
60 | | -%transfiletriggerin -P 100700 -- /usr/lib/sysusers.d |
61 | | -# This script will process files installed in /usr/lib/sysusers.d to create |
| 46 | +%transfiletriggerin -P 100700 -- @sysusersdir@ |
| 47 | +# This script will process files installed in @sysusersdir@ to create |
62 | 48 | # specified users automatically. The priority is set such that it |
63 | 49 | # will run before the tmpfiles file trigger. |
64 | | -if test -d /run/systemd/system; then |
| 50 | +if test -d "/run/systemd/system"; then |
65 | 51 | %{_bindir}/systemd-sysusers || : |
66 | 52 | fi |
67 | 53 |
|
68 | | -%transfiletriggerin -P 100500 -- /usr/lib/tmpfiles.d |
69 | | -# This script will process files installed in /usr/lib/tmpfiles.d to create |
| 54 | +%transfiletriggerin -P 100500 -- @tmpfilesdir@ |
| 55 | +# This script will process files installed in @tmpfilesdir@ to create |
70 | 56 | # tmpfiles automatically. The priority is set such that it will run |
71 | 57 | # after the sysusers file trigger, but before any other triggers. |
72 | | -if test -d /run/systemd/system; then |
| 58 | +if test -d "/run/systemd/system"; then |
73 | 59 | %{_bindir}/systemd-tmpfiles --create || : |
74 | 60 | fi |
75 | 61 |
|
76 | | -%transfiletriggerin udev -- /usr/lib/udev/hwdb.d |
| 62 | +%transfiletriggerin udev -- @udevhwdbdir@ |
77 | 63 | # This script will automatically invoke hwdb update if files have been |
78 | | -# installed or updated in /usr/lib/udev/hwdb.d. |
79 | | -if test -d /run/systemd/system; then |
| 64 | +# installed or updated in @udevhwdbdir@. |
| 65 | +if test -d "/run/systemd/system"; then |
80 | 66 | %{_bindir}/systemd-hwdb update || : |
81 | 67 | fi |
82 | 68 |
|
83 | | -%transfiletriggerin -- /usr/lib/systemd/catalog |
| 69 | +%transfiletriggerin -- @catalogdir@ |
84 | 70 | # This script will automatically invoke journal catalog update if files |
85 | | -# have been installed or updated in /usr/lib/systemd/catalog. |
86 | | -if test -d /run/systemd/system; then |
| 71 | +# have been installed or updated in @catalogdir@. |
| 72 | +if test -d "/run/systemd/system"; then |
87 | 73 | %{_bindir}/journalctl --update-catalog || : |
88 | 74 | fi |
89 | 75 |
|
90 | | -%transfiletriggerin udev -- /usr/lib/udev/rules.d |
| 76 | +%transfiletriggerin udev -- @udevrulesdir@ |
91 | 77 | # This script will automatically update udev with new rules if files |
92 | | -# have been installed or updated in /usr/lib/udev/rules.d. |
| 78 | +# have been installed or updated in @udevrulesdir@. |
93 | 79 | if test -e /run/udev/control; then |
94 | 80 | %{_bindir}/udevadm control --reload || : |
95 | 81 | fi |
96 | 82 |
|
97 | | -%transfiletriggerin -- /usr/lib/sysctl.d |
| 83 | +%transfiletriggerin -- @sysctldir@ |
98 | 84 | # This script will automatically apply sysctl rules if files have been |
99 | | -# installed or updated in /usr/lib/sysctl.d. |
100 | | -if test -d /run/systemd/system; then |
101 | | - /usr/lib/systemd/systemd-sysctl || : |
| 85 | +# installed or updated in @sysctldir@. |
| 86 | +if test -d "/run/systemd/system"; then |
| 87 | + @rootlibexecdir@/systemd-sysctl || : |
102 | 88 | fi |
103 | 89 |
|
104 | | -%transfiletriggerin -- /usr/lib/binfmt.d |
| 90 | +%transfiletriggerin -- @binfmtdir@ |
105 | 91 | # This script will automatically apply binfmt rules if files have been |
106 | | -# installed or updated in /usr/lib/binfmt.d. |
107 | | -if test -d /run/systemd/system; then |
| 92 | +# installed or updated in @binfmtdir@. |
| 93 | +if test -d "/run/systemd/system"; then |
108 | 94 | # systemd-binfmt might fail if binfmt_misc kernel module is not loaded |
109 | 95 | # during install |
110 | | - /usr/lib/systemd/systemd-binfmt || : |
| 96 | + @rootlibexecdir@/systemd-binfmt || : |
111 | 97 | fi |
0 commit comments