chsmack %{_bindir}/systemd-detect-virt -a "System::Tools"
%endif
+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 || :
+
%postun
if [ $1 -ge 1 ] ; then
/usr/bin/systemctl daemon-reload > /dev/null 2>&1 || :
/usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
fi
+if [$1 -eq 0 ] ; then
+ 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
%preun
if [ $1 -eq 0 ] ; then
remote-fs.target \
systemd-readahead-replay.service \
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
-# Update alternatives after the whole transaction is completed - this is
-# necessary due to RPM ordering, which removes files from old package not
-# provided by new package after regular post scripts are run. Please refer
-# 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 %{_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