@@ -7,11 +7,12 @@ Group: System Environment/Base
77BuildRoot: %{_tmppath }/%{name }-%{version }-%{release }-root-%(%{__id_u} -n)
88BuildArch: noarch
99Requires: bash coreutils
10- Requires: upstart
10+ BuildRequires: systemd-devel
11+ %{?systemd_requires }
1112
1213Source0: sbin_update-motd
1314Source1: cron_update-motd
14- Source2: upstart_update -motd.conf
15+ Source2: update -motd.service
1516Source3: yum_update-motd.py
1617Source4: yum_update-motd.conf
1718
@@ -24,7 +25,7 @@ rm -rf %{buildroot}
2425install -d %{buildroot }/etc/update-motd.d
2526install -D -m 0755 %{SOURCE0 } %{buildroot }/usr/sbin/update-motd
2627install -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
2829install -D -m 0644 %{SOURCE3 } %{buildroot }/usr/lib/yum-plugins/update-motd.py
2930install -D -m 0644 %{SOURCE4 } %{buildroot }/etc/yum/pluginconf.d/update-motd.conf
3031# for %ghost
@@ -51,16 +52,21 @@ elif [ "$1" = "2" ]; then
5152 ln -snf /var/lib/update-motd/motd /etc/motd
5253 fi
5354fi
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+
5763
5864%files
5965%defattr(-,root,root,-)
6066%dir /etc/update-motd.d
6167%dir /var/lib/update-motd
6268%config /etc/cron.d/update-motd
63- %config /etc/init/ update-motd.conf
69+ %config %{ _unitdir }/ update-motd.service
6470%config /etc/yum/pluginconf.d/update-motd.conf
6571/usr/sbin/update-motd
6672/usr/lib/yum-plugins/update-motd.py*
0 commit comments