]> git.pld-linux.org Git - packages/systemd.git/blame - rpm-macros.patch
up to 254.12
[packages/systemd.git] / rpm-macros.patch
CommitLineData
b03765d5
JR
1--- systemd-stable-250/src/rpm/macros.systemd.in.orig 2021-12-23 21:09:35.000000000 +0100
2+++ systemd-stable-250/src/rpm/macros.systemd.in 2022-01-04 22:15:56.292914548 +0100
3@@ -4,6 +4,54 @@
4 # This file is part of systemd.
5
6 # RPM macros for packages installing systemd unit files
7+#
8+# Requirements:
9+# BuildRequires: rpmbuild(macros) >= 1.671
10+# Requires: systemd-units >= 38
11+#
12+# Usage:
13+# %systemd_reload
14+# %systemd_service_enable service_name1.service service_name2.service
15+# %systemd_service_disable service_name1.service service_name2.service
16+# %systemd_service_start service_name1.service service_name2.service
17+# %systemd_service_stop service_name1.service service_name2.service
18+# %systemd_service_restart service_name1.service service_name2.service
19+# %systemd_service_reload service_name1.service service_name2.service
20+#
21+# %systemd_post service_name1.service service_name2.service
22+# %systemd_preun service_name1.service service_name2.service
23+# %systemd_postun service_name1.service service_name2.service
24+#
25+# Sample:
26+#
27+# %post
28+# %systemd_post %{name}.service
29+#
30+# %preun
31+# %systemd_preun %name}.service
32+#
33+# %postun
34+# %systemd_postun_with_restart %{name}.service
35+#
36+# Some services do not support being restarted (e.g. D-Bus and various storage
37+# daemons). If your service should not be restarted upon upgrade, then use the
38+# following %postun scriptlet instead of the one shown above:
39+#
40+# %postun
41+# %systemd_postun %{name}.service
42+#
43+# User units
44+#
45+# There are additional macros for user units (those installed under
46+# %_userunitdir) that should be used similarly to those for system units. These
47+# enable and disable user units according to presets, and are %systemd_user_post
48+# (to be used in %post) and %systemd_user_preun (to be used in %preun).
49+#
50+# %post
51+# %systemd_user_post %{name}.service
52+#
53+# %preun
54+# %systemd_user_preun %{name}.service
55
56 %_systemd_util_dir {{ROOTLIBEXECDIR}}
57 %_unitdir {{SYSTEM_DATA_UNIT_DIR}}
58@@ -173,3 +221,34 @@
59 %{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# binfmt_apply}} \
60 [ -x {{ROOTLIBEXECDIR}}/systemd-binfmt ] && {{ROOTLIBEXECDIR}}/systemd-binfmt %{?*} || : \
61 %{nil}
62+
63+# PLD macros
64+%systemd_reload() \
0bddef71
JP
65+ [ -x "{{SYSTEMD_UPDATE_HELPER_PATH}}" ] && \
66+ {{SYSTEMD_UPDATE_HELPER_PATH}} system-reload || : \
b03765d5
JR
67+%{nil}
68+
1820298a
JP
69+%systemd_service_enable() %systemd_post $*
70+%systemd_service_disable() %systemd_preun $*
b03765d5
JR
71+
72+%systemd_service_start() \
73+ [ -d /run/systemd/system ] && /bin/systemctl start %{*} || : \
74+%{nil}
75+
76+%systemd_service_stop() \
77+ [ -d /run/systemd/system ] && /bin/systemctl stop %{*} || : \
78+%{nil}
79+
80+%systemd_service_restart() \
81+ [ -d /run/systemd/system ] && /bin/systemctl try-restart %{*} || : \
82+%{nil}
83+
84+%systemd_service_reload() \
85+ [ -d /run/systemd/system ] && /bin/systemctl reload %{*} || : \
86+%{nil}
87+
9216904e 88+%systemd_trigger() %systemd_post %*
b03765d5
JR
89+
90+%systemdunitdir %_unitdir
91+%systemduserunitdir %_userunitdir
92+%systemdtmpfilesdir %_tmpfilesdir
93--- systemd-stable-250/src/rpm/systemd-update-helper.in.orig 2022-01-02 21:34:43.000000000 +0100
94+++ systemd-stable-250/src/rpm/systemd-update-helper.in 2022-01-04 22:16:19.035914008 +0100
95@@ -11,6 +11,7 @@
96 case "$command" in
97 install-system-units)
98 systemctl --no-reload preset "$@"
99+ echo "Run \"/bin/systemctl restart "$@"\" to restart "$@""
100 ;;
101
102 install-user-units)
This page took 0.602743 seconds and 4 git commands to generate.