@@ -7,11 +7,12 @@ Group: System Environment/Base
7
7
BuildRoot: %{_tmppath }/%{name }-%{version }-%{release }-root-%(%{__id_u} -n)
8
8
BuildArch: noarch
9
9
Requires: bash coreutils
10
- Requires: upstart
10
+ BuildRequires: systemd-devel
11
+ %{?systemd_requires }
11
12
12
13
Source0: sbin_update-motd
13
14
Source1: cron_update-motd
14
- Source2: upstart_update -motd.conf
15
+ Source2: update -motd.service
15
16
Source3: yum_update-motd.py
16
17
Source4: yum_update-motd.conf
17
18
@@ -24,7 +25,7 @@ rm -rf %{buildroot}
24
25
install -d %{buildroot }/etc/update-motd.d
25
26
install -D -m 0755 %{SOURCE0 } %{buildroot }/usr/sbin/update-motd
26
27
install -D -m 0644 %{SOURCE1 } %{buildroot }/etc/cron.d/update-motd
27
- install -D -m 0644 %{SOURCE2 } %{buildroot }/etc/init/ update-motd.conf
28
+ install -D -m 0644 %{SOURCE2 } %{buildroot }%{ _unitdir }/ update-motd.service
28
29
install -D -m 0644 %{SOURCE3 } %{buildroot }/usr/lib/yum-plugins/update-motd.py
29
30
install -D -m 0644 %{SOURCE4 } %{buildroot }/etc/yum/pluginconf.d/update-motd.conf
30
31
# for %ghost
@@ -51,16 +52,21 @@ elif [ "$1" = "2" ]; then
51
52
ln -snf /var/lib/update-motd/motd /etc/motd
52
53
fi
53
54
fi
54
- # We don't run update-motd on install because the various update-motd.d scripts
55
- # are not installed yet (since their packages will depend on this one).
56
- # This could also be the case in an upgrade situation, so we leave it to cron.
55
+ %systemd_post update-motd.service sshd.socket
56
+
57
+ %preun
58
+ %systemd_preun update-motd.service sshd.socket
59
+
60
+ %postun
61
+ %systemd_postun_with_restart update-motd.service
62
+
57
63
58
64
%files
59
65
%defattr(-,root,root,-)
60
66
%dir /etc/update-motd.d
61
67
%dir /var/lib/update-motd
62
68
%config /etc/cron.d/update-motd
63
- %config /etc/init/ update-motd.conf
69
+ %config %{ _unitdir }/ update-motd.service
64
70
%config /etc/yum/pluginconf.d/update-motd.conf
65
71
/usr/sbin/update-motd
66
72
/usr/lib/yum-plugins/update-motd.py*
0 commit comments