diff --git a/fcitx.spec b/fcitx.spec index 8ece67c..68f68dd 100644 --- a/fcitx.spec +++ b/fcitx.spec @@ -15,7 +15,8 @@ BuildRequires: pango-devel, dbus-devel, opencc-devel BuildRequires: wget, intltool, chrpath, sysconftool, opencc BuildRequires: cmake, libtool, doxygen, libicu-devel BuildRequires: qt-devel, gtk3-devel, gtk2-devel, libicu -BuildRequires: libX11-devel, qt-x11 +BuildRequires: libX11-devel, qt-x11, dbus-glib-devel, dbus-x11 +BuildRequires: desktop-file-utils Requires: %{name}-data = %{version}-%{release} Requires: imsettings Requires(post): %{_sbindir}/alternatives @@ -117,11 +118,24 @@ install -pm 644 -D %{SOURCE1} %{buildroot}%{_xinputconf} %find_lang %{name} +desktop-file-install --delete-original \ + --dir ${RPM_BUILD_ROOT}%{_datadir}/applications \ + ${RPM_BUILD_ROOT}%{_datadir}/applications/%{name}-kimpanel.desktop + +desktop-file-install --delete-original \ + --dir ${RPM_BUILD_ROOT}%{_datadir}/applications \ + ${RPM_BUILD_ROOT}%{_datadir}/applications/%{name}-configtool.desktop + +desktop-file-install --delete-original \ + --dir ${RPM_BUILD_ROOT}%{_datadir}/applications \ + ${RPM_BUILD_ROOT}%{_datadir}/applications/%{name}.desktop + %clean rm -rf %{buildroot} %post %{_sbindir}/alternatives --install %{_sysconfdir}/X11/xinit/xinputrc xinputrc %{_xinputconf} 55 || : +update-desktop-database %{_datadir}/applications &>/dev/null || : %postun if [ "$1" = "0" ]; then @@ -129,6 +143,7 @@ if [ "$1" = "0" ]; then # if alternative was set to manual, reset to auto [ -L %{_sysconfdir}/alternatives/xinputrc -a "`readlink %{_sysconfdir}/alternatives/xinputrc`" = "%{_xinputconf}" ] && %{_sbindir}/alternatives --auto xinputrc || : fi +update-desktop-database %{_datadir}/applications &>/dev/null || : %post libs -p /sbin/ldconfig