diff --git a/ibus.spec b/ibus.spec index 45925a7..b121349 100644 --- a/ibus.spec +++ b/ibus.spec @@ -450,21 +450,24 @@ make check \ VERBOSE=1 \ %{nil} -%post +%post xinit %{_sbindir}/alternatives --install %{_sysconfdir}/X11/xinit/xinputrc xinputrc %{_xinputconf} 83 || : %postun if [ "$1" -eq 0 ]; then - %{_sbindir}/alternatives --remove xinputrc %{_xinputconf} || : - # if alternative was set to manual, reset to auto - [ -L %{_sysconfdir}/alternatives/xinputrc -a "`readlink %{_sysconfdir}/alternatives/xinputrc`" = "%{_xinputconf}" ] && %{_sbindir}/alternatives --auto xinputrc || : - # 'dconf update' sometimes does not update the db... dconf update || : [ -f %{_sysconfdir}/dconf/db/ibus ] && \ rm %{_sysconfdir}/dconf/db/ibus || : fi +%postun xinit +if [ "$1" -eq 0 ]; then + %{_sbindir}/alternatives --remove xinputrc %{_xinputconf} || : + # if alternative was set to manual, reset to auto + [ -L %{_sysconfdir}/alternatives/xinputrc -a "`readlink %{_sysconfdir}/alternatives/xinputrc`" = "%{_xinputconf}" ] && %{_sbindir}/alternatives --auto xinputrc || : +fi + %posttrans dconf update || :