rm -rf %{buildroot}/%{_docdir}/%{name}
-# Allow replacing systemd-shutdown with tizen-specific variant
+# Allow replacing systemd-shutdown and some scripts with tizen-specific variant
mv %{buildroot}%{_prefix}/lib/systemd/systemd-shutdown %{buildroot}%{_prefix}/lib/systemd/systemd-shutdown-original
+mv %{buildroot}%{_sbindir}/reboot %{buildroot}%{_sbindir}/reboot-original
+mv %{buildroot}%{_sbindir}/halt %{buildroot}%{_sbindir}/halt-original
+mv %{buildroot}%{_sbindir}/poweroff %{buildroot}%{_sbindir}/poweroff-original
+mv %{buildroot}%{_sbindir}/shutdown %{buildroot}%{_sbindir}/shutdown-original
+touch %{buildroot}%{_sbindir}/reboot
+touch %{buildroot}%{_sbindir}/halt
+touch %{buildroot}%{_sbindir}/poweroff
+touch %{buildroot}%{_sbindir}/shutdown
# Disable some useless services in Tizen
rm -rf %{buildroot}/%{_prefix}/lib/systemd/system/sysinit.target.wants/dev-hugepages.mount
systemd-readahead-collect.service >/dev/null 2>&1 || :
update-alternatives --remove systemd-shutdown %{_prefix}/lib/systemd/systemd-shutdown-original
+ update-alternatives --remove reboot %{_sbindir}/reboot-original
+ update-alternatives --remove halt %{_sbindir}/halt-original
+ update-alternatives --remove poweroff %{_sbindir}/poweroff-original
+ update-alternatives --remove shutdown %{_sbindir}/shutdown-original
fi
%posttrans
# to following guideliness for explanation:
# https://fedoraproject.org/wiki/Packaging:Scriptlets#Ordering
if [ $1 -eq 0 ]; then
- update-alternatives --install %{_prefix}/lib/systemd/systemd-shutdown systemd-shutdown %{_prefix}/lib/systemd/systemd-shutdown-original 100 || :
+ update-alternatives --install %{_prefix}/lib/systemd/systemd-shutdown systemd-shutdown %{_prefix}/lib/systemd/systemd-shutdown-original 100 || :
+ update-alternatives --install %{_sbindir}/reboot reboot %{_sbindir}/reboot-original 100 || :
+ update-alternatives --install %{_sbindir}/halt halt %{_sbindir}/halt-original 100 || :
+ update-alternatives --install %{_sbindir}/poweroff poweroff %{_sbindir}/poweroff-original 100 || :
+ update-alternatives --install %{_sbindir}/shutdown shutdown %{_sbindir}/shutdown-original 100 || :
fi
%post -n libsystemd -p /sbin/ldconfig
%{_prefix}/lib/tmpfiles.d/static-nodes-permissions.conf
%{_prefix}/lib/tmpfiles.d/systemd-tmp.conf
%{_sbindir}/init
-%{_sbindir}/reboot
-%{_sbindir}/halt
-%{_sbindir}/poweroff
-%{_sbindir}/shutdown
+%ghost %{_sbindir}/reboot
+%ghost %{_sbindir}/halt
+%ghost %{_sbindir}/poweroff
+%ghost %{_sbindir}/shutdown
+%{_sbindir}/reboot-original
+%{_sbindir}/halt-original
+%{_sbindir}/poweroff-original
+%{_sbindir}/shutdown-original
%{_sbindir}/telinit
%{_sbindir}/runlevel
%{_sbindir}/udevadm