@@ -28,8 +28,8 @@ install -D -m 0444 %{SOURCE2} %{buildroot}/etc/init/update-motd.conf
28
28
install -D -m 0444 %{SOURCE3 } %{buildroot }/usr/lib/yum-plugins/update-motd.py
29
29
install -D -m 0444 %{SOURCE4 } %{buildroot }/etc/yum/pluginconf.d/update-motd.conf
30
30
# for %ghost
31
- install -d %{buildroot }/var/run
32
- touch %{buildroot }/var/run /motd
31
+ install -d %{buildroot }/var/lib/update-motd
32
+ touch %{buildroot }/var/lib/update-motd /motd
33
33
34
34
%clean
35
35
rm -rf %{buildroot }
@@ -38,12 +38,12 @@ rm -rf %{buildroot}
38
38
# Only run this on initial install
39
39
if [ " $1 " = " 1" ]; then
40
40
# Backup the current MOTD
41
- if [ -e /etc/motd ] && [ " $( readlink /etc/motd) " != " /var/run /motd" ]; then
42
- cp /etc/motd /etc/motd.rpmsave
41
+ if [ -e /etc/motd ] && [ " $( readlink /etc/motd) " != " /var/lib/update-motd /motd" ]; then
42
+ mv /etc/motd /etc/motd.rpmsave
43
43
# And let it be the MOTD until update-motd gets run
44
- mv /etc/motd /var/run /motd
44
+ cp -L /etc/motd.rpmsave /var/lib/update-motd /motd
45
45
fi
46
- ln -snf /var/run /motd /etc/motd
46
+ ln -snf /var/lib/update-motd /motd /etc/motd
47
47
fi
48
48
# We don't run update-motd on install because the various update-motd.d scripts
49
49
# are not installed yet (since their packages will depend on this one).
52
52
%files
53
53
%defattr(-,root,root,-)
54
54
%dir /etc/update-motd.d
55
+ %dir /var/lib/update-motd
55
56
%config /etc/cron.daily/update-motd
56
57
%config /etc/init/update-motd.conf
57
58
%config /etc/yum/pluginconf.d/update-motd.conf
58
59
/usr/sbin/update-motd
59
60
/usr/lib/yum-plugins/update-motd.py*
60
- %ghost /var/run /motd
61
+ %ghost /var/lib/update-motd /motd
61
62
62
63
%changelog
0 commit comments