diff --git a/_service b/_service
index 2a7e733..a2dc5da 100644
--- a/_service
+++ b/_service
@@ -4,7 +4,7 @@
- allhttp://code.google.com/p/fcitx/4.2gitfcitxgit
+ allhttps://github.com/fcitx/fcitx.git4.2gitfcitxgit
*.tar
bz2
diff --git a/fcitx.changes b/fcitx.changes
index 9c3f98f..5545671 100644
--- a/fcitx.changes
+++ b/fcitx.changes
@@ -1,3 +1,11 @@
+-------------------------------------------------------------------
+Sat Jun 16 14:32:39 UTC 2012 - i@marguerite.su
+
+- fix memory overflow, thanks to reporter dieter.
+ * http://lists.opensuse.org/opensuse-factory/2012-06/msg00359.html
+- support fedora builds.
+- further split packages by input engines and tables, no longer a big mess.
+
-------------------------------------------------------------------
Tue Jun 12 07:22:31 UTC 2012 - i@marguerite.su
diff --git a/fcitx.spec b/fcitx.spec
index e9959a8..8aa97b0 100644
--- a/fcitx.spec
+++ b/fcitx.spec
@@ -21,7 +21,7 @@
Name: fcitx
Version: 4.2.4.1
Release: 0
-Summary: A Flexible Input Method Framework for CJK
+Summary: Flexible Context-aware Input Tool with eXtension
License: GPL-2.0+
Group: System/I18n/Chinese
Url: http://code.google.com/p/fcitx
@@ -33,22 +33,34 @@ Source2: fcitx-README.suse
Source3: xim.fcitx.suse.template
Source5: pinyin.tar.gz
Source6: table.tar.gz
+# for fedora auto-start
+Source7: xinput-fcitx
#FIX-FOR-UPSTREAM i@marguerite.su - dont download online
Patch1: fix_fcitx_googlecode_resolv_error.patch
+#FIX-FOR-UPSTREAM wengxuetian@gmail.com - fix memeory overflow
+Patch2: fix-fcitx-4.2.4.1-memory-overflow.patch
BuildRequires: cairo-devel
+%if 0%{?suse_version}
BuildRequires: dbus-1-devel
BuildRequires: dbus-1-glib-devel
+BuildRequires: update-desktop-files
+%endif
+%if 0%{?fedora_version}
+BuildRequires: dbus-devel
+BuildRequires: dbus-glib-devel
+BuildRequires: desktop-file-utils
+BuildRequires: libxkbfile-devel
+%endif
BuildRequires: enchant-devel
BuildRequires: iso-codes-devel
BuildRequires: pango-devel
-BuildRequires: update-desktop-files
-%if 0%{?suse_version} >= 1110
+%if 0%{?suse_version} >= 1110 || 0%{?fedora_version}
BuildRequires: fdupes
%endif
-%if 0%{?suse_version} > 1110
+%if 0%{?suse_version} > 1110 || 0%{?fedora_version}
BuildRequires: libqt4-devel
%endif
-%if 0%{?suse_version} <= 1210
+%if 0%{?suse_version} <= 1210 || 0%{?fedora_version}
BuildRequires: lua-devel
%else
BuildRequires: lua51-devel
@@ -57,7 +69,7 @@ BuildRequires: cmake
BuildRequires: gtk2-devel
BuildRequires: intltool
BuildRequires: opencc-devel
-%if 0%{?suse_version} >= 1140
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
BuildRequires: gtk3-devel
BuildRequires: gobject-introspection-devel
%endif
@@ -66,28 +78,33 @@ BuildRequires: libicu-devel
BuildRequires: libxml2-devel
Requires: %{name}-gtk2 = %{version}-%{release}
Requires: lib%{name}%{libver} = %{version}-%{release}
-%if 0%{?suse_version} >= 1140
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
Requires: %{name}-gtk3 = %{version}-%{release}
%endif
-%if 0%{?suse_version} > 1110
+%if 0%{?suse_version} > 1110 || 0%{?fedora_version}
Requires: %{name}-qt4 = %{version}-%{release}
%endif
+%if 0%{?suse_version}
+Recommends: %{name}-pinyin = %{version}-%{release}
+Recommends: %{name}-table = %{version}-%{release}
+%endif
+%if 0%{?fedora_version}
+Requires(post): %{_sbindir}/alternatives
+Requires(postun): %{_sbindir}/alternatives
+%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: locale(ko;zh_CN;zh_SG)
%description
-FCITX is a simplified Chinese input server. It supports Tables,
-Pinyin and QuWei input method. It's small and fast.
-
-Since version 4.1, FCITX itself can be use as an im-module. XIM
-can still be used but not necessary.
+Fcitx is a CJK input method framework. It supports Table,
+Pinyin and QuWei input methods. It's flexible and fast.
%package -n lib%{name}%{libver}
-Summary: Shared Libraries for %{name}
+Summary: Shared libraries for %{name}
Group: System/I18n/Chinese
%description -n lib%{name}%{libver}
-The libfcitx4_2_0 package includes the shared libraries for the fictx package.
+Shared libraries for Fcitx input method framework.
%package devel
Summary: Development files for %{name}
@@ -95,54 +112,231 @@ Group: Development/Libraries/C and C++
Requires: %{name} = %{version}-%{release}
%description devel
-The fcitx-devel package includes the header files for the fcitx package.
+Development header files for Fcitx input method framework.
%package gtk2
-Summary: Gtk2 IM Module for %{name}
+Summary: Gtk2 IM module for %{name}
Group: System/I18n/Chinese
Requires: %{name} = %{version}-%{release}
+%if 0%{?suse_version} >= 1140
%gtk2_immodule_requires
+%else
+Requires(post): gtk2
+Requires(postun): gtk2
+%endif
%description gtk2
-This package contains fcitx im module for gtk2
+GTK+ version 2 input module for Fcitx input method rfamework.
-%if 0%{?suse_version} >= 1140
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
%package gtk3
-Summary: Gtk3 IM Module for %{name}
+Summary: Gtk3 IM module for %{name}
Group: System/I18n/Chinese
Requires: %{name} = %{version}-%{release}
+%if 0%{?suse_version}
%gtk3_immodule_requires
+%else
+Requires(post): gtk3
+Requires(postun): gtk3
+%endif
%description gtk3
-This package contains fcitx im module for gtk3
+GTK+ version 3 input module for Fcitx input method framework.
%endif
-%if 0%{?suse_version} > 1110
+%if 0%{?suse_version} > 1110 || 0%{?fedora_version}
%package qt4
-Summary: Qt4 IM Module for %{name}
+Summary: Qt4 IM module for %{name}
Group: System/I18n/Chinese
Requires: %{name} = %{version}-%{release}
%description qt4
-This package contains fcitx im module for qt4
+QT4 input module for Fcitx input method framework.
%endif
+%package quwei
+Summary: Chinese Zone-bit(QuWei) engine for %{name}
+Group: System/I18n/Chinese
+Requires: %{name} = %{version}-%{release}
+
+%description quwei
+Chinese Zone-bit(QuWei) engine for Fcitx input method framework.
+
+%package pinyin
+Summary: Chinese Pinyin engine for %{name}
+Group: System/I18n/Chinese
+Requires: %{name} = %{version}-%{release}
+
+%description pinyin
+Chinese Pinyin engine for Fcitx input method framework.
+
+%package table
+Summary: Table engine for %{name}
+Group: System/I18n/Chinese
+Requires: %{name} = %{version}-%{release}
+
+%description table
+Table engine for Fcitx input method framework.
+
+It's the basic component for other users except some Chinese.
+
+%package table-cn-cangjie
+Summary: Simplified Chinese Tsang-Jei(Cangjie) table for %{name}
+Group: System/I18n/Chinese
+Requires: %{name}-table = %{version}-%{release}
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
+BuildArch: noarch
+%endif
+
+%description table-cn-cangjie
+Fcitx Tsang Jei (Cang Jie) input tables for Simplified Chinese.
+
+%package table-cn-dianbao
+Summary: Telegram(Dianbao) table for %{name}
+Group: System/I18n/Chinese
+Requires: %{name}-table = %{version}-%{release}
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
+BuildArch: noarch
+%endif
+
+%description table-cn-dianbao
+Fcitx Telegram (Dian Bao) input tables for Simplified Chinese.
+
+%package table-cn-erbi
+Summary: Two stroke(Erbi) table for %{name}
+Group: System/I18n/Chinese
+Requires: %{name}-table = %{version}-%{release}
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
+BuildArch: noarch
+%endif
+
+%description table-cn-erbi
+Fcitx Two Stroke (Er Bi) input tables for Simplified Chinese.
+
+%package table-cn-bingchan
+Summary: Icefrog Holography(QXM) table for %{name}
+Group: System/I18n/Chinese
+Requires: %{name}-table = %{version}-%{release}
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
+BuildArch: noarch
+%endif
+
+%description table-cn-bingchan
+Fcitx Icefrog Holography (Bing Chan Quan Xi, or QXM) input tables for Simplified Chinese.
+
+%package table-cn-wanfeng
+Summary: Evening Breeze(Wanfeng) table for %{name}
+Group: System/I18n/Chinese
+Requires: %{name}-table = %{version}-%{release}
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
+BuildArch: noarch
+%endif
+
+%description table-cn-wanfeng
+Fcitx Evening Breeze (Wan feng) input tables for Simplified Chinese.
+
+%package table-cn-wubi-pinyin
+Summary: Wubi and pinyin(wubi-pinyin) table for %{name}
+Group: System/I18n/Chinese
+Provides: locale(fcitx-table:zh-cn;)
+Requires: %{name}-table = %{version}-%{release}
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
+BuildArch: noarch
+%endif
+
+%description table-cn-wubi-pinyin
+Fcitx Wubi (Wu Bi Zi Xing) and Pinyin mixed input tables for Simplified Chinese.
+
+Wubi in Fcitx is based on wubi x86.
+
+%package table-cn-wubi
+Summary: Wubi table for %{name}
+Group: System/I18n/Chinese
+Provides: locale(fcitx-table:zh-cn;)
+Requires: %{name}-table = %{version}-%{release}
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
+BuildArch: noarch
+%endif
+
+%description table-cn-wubi
+Fcitx Wubi (Wu Bi Zi Xing) input tables for Simplified Chinese.
+
+Wubi in Fcitx is based on wubi x86.
+
+%package table-cn-ziran
+Summary: Nature(Ziran) table for %{name}
+Group: System/I18n/Chinese
+Requires: %{name}-table = %{version}-%{release}
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
+BuildArch: noarch
+%endif
+
+%description table-cn-ziran
+Fcitx Nature (Zi Ran Ma) input tables for Simplified Chinese.
+
+%package table-tools
+Summary: Fcitx tools to make tables
+Group: System/I18n/Chinese
+Requires: lib%{name}%{libver} = %{version}-%{release}
+
+%description table-tools
+Tools to convert txt word sheets to fcitx tables.
+
+see manpage for details
+
+%package pinyin-tools
+Summary: Fcitx tools to make pinyin match list
+Group: System/I18n/Chinese
+Requires: lib%{name}%{libver} = %{version}-%{release}
+
+%description pinyin-tools
+Tools to convert txt or scel(sougou pinyin data format) pinyin sheets to fcitx match lists.
+
+%package skin-classic
+Summary: Fcitx Classic Skin
+Group: System/I18n/Chinese
+Requires: %{name} = %{version}-%{release}
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
+BuildArch: noarch
+%endif
+
+%description skin-classic
+Fcitx classic skin.
+
+You can either use this package or download from kde-look.org using knewstaff in fcitx-config-kde4.
+
+%package skin-dark
+Summary: Fcitx Dark Skin
+Group: System/I18n/Chinese
+Requires: %{name} = %{version}-%release}
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
+BuildArch: noarch
+%endif
+
+%description skin-dark
+Fcitx dark skin.
+
+You can either use this package for download from kde-look.org using knewstaff in fcitx-config-kde4.
+
+
%prep
%setup -q -n %{name}-%{version}
%patch1 -p1
+# remove when next release
+%patch2 -p1
%build
mkdir build
cd build
cmake .. -DENABLE_GTK2_IM_MODULE=On \
-%if 0%{?suse_version} >= 1140
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
-DENABLE_GTK3_IM_MODULE=On \
%endif
-%if 0%{?suse_version} > 1110
+%if 0%{?suse_version} > 1110 || 0%{?fedora_version}
-DENABLE_QT_IM_MODULE=On \
%endif
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
@@ -151,7 +345,7 @@ cmake .. -DENABLE_GTK2_IM_MODULE=On \
-DENABLE_OPENCC=On \
-DENABLE_LUA=On
-#copy external data
+# copy external data
pushd ../data
cp -r %{S:5} ./
popd
@@ -159,28 +353,51 @@ pushd ../data/table
cp -r %{S:6} ./
popd
-#fix gobject-introspection build
+# fix gobject-introspection build
export SUSE_ASNEEDED=0
make
%install
cd build
-%makeinstall
+# support fedora 17
+make DESTDIR=%{buildroot} install
cd ..
-#fix desktop file
-sed -i "2d" %{buildroot}%{_datadir}/applications/fcitx-skin-installer.desktop
-sed -i "2iMimeType=applicatio\/x-fskin;" %{buildroot}%{_datadir}/applications/fcitx-skin-installer.desktop
+# fix desktop file
+sed -i "s/x-fskin/x-fskin;/" %{buildroot}%{_datadir}/applications/fcitx-skin-installer.desktop
+%if 0%{?suse_version}
%suse_update_desktop_file fcitx Utility DesktopUtility
%suse_update_desktop_file fcitx-skin-installer Utility DesktopUtility
%suse_update_desktop_file fcitx-configtool System X-SuSE-SystemSetup
+%endif
-#fix doc
-%{__rm} -rf %{buildroot}%{_datadir}/doc/%{name}/
+%if 0%{?fedora_version}
+desktop-file-install --add-category="Utility" --delete-original --dir=%{buildroot}%{_datadir}/applications \
+%{buildroot}/%{_datadir}/applications/fcitx.desktop
+desktop-file-install --add-category="Utility" --delete-original --dir=%{buildroot}%{_datadir}/applications \
+%{buildroot}/%{_datadir}/applications/fcitx-skin-installer.desktop
+desktop-file-install --add-category="System" --delete-original --dir=%{buildroot}%{_datadir}/applications \
+%{buildroot}/%{_datadir}/applications/fcitx-configtool.desktop
+%endif
-#create autostart
+# fix doc
+%if 0%{?suse_version}
+mkdir %{buildroot}%{_docdir}
+mv %{buildroot}%{_datadir}/doc/%{name}/ %{buildroot}%{_docdir}
+cp -r AUTHORS %{buildroot}%{_docdir}/%{name}/
+cp -r ChangeLog %{buildroot}%{_docdir}/%{name}/
+%endif
+%if 0%{?fedora_version}
+mkdir %{buildroot}%{_docdir}/packages/
+mv %{buildroot}%{_datadir}/doc/%{name}/ %{buildroot}%{_docdir}/packages/
+cp -r AUTHORS %{buildroot}%{_docdir}/packages/%{name}/
+cp -r ChangeLog %{buildroot}%{_docdir}/packages/%{name}/
+%endif
+
+# create autostart
+%if 0%{?suse_version}
mkdir -p %{buildroot}%{_sysconfdir}/X11/xim.d/
install -m 644 %{S:1} %{buildroot}%{_sysconfdir}/X11/xim.d/fcitx
@@ -193,28 +410,38 @@ pushd %{buildroot}%{_sysconfdir}/X11/xim.d/
popd
done
popd
+%endif
-#remove *.la
+%if 0%{?fedora_version}
+mkdir -pv %{buildroot}%{_sysconfdir}/X11/xinit/xinput.d/
+install -pm 644 -D %{SOURCE7} %{buildroot}%{_sysconfdir}/X11/xinit/xinput.d/fcitx.conf
+%endif
+
+# remove *.la
%{__rm} -rf %{buildroot}%{_libdir}/lib%{name}-config.la
%find_lang %{name}
%if 0%{?suse_version} >= 1110
%fdupes %{buildroot}
+%else
+%if 0%{?fedora_version}
+fdupes -n -q -r %{buildroot}
+%endif
%endif
-#strip libraries
+# strip unnessary libraries
%{__strip} %{buildroot}%{_libdir}/%{name}/*.so
%{__strip} %{buildroot}%{_libdir}/libfcitx*.so.*
%{__strip} %{buildroot}%{_libdir}/gtk-2.0/*/immodules/im-%{name}.so
-%if 0%{?suse_version} >= 1140
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
%{__strip} %{buildroot}%{_libdir}/gtk-3.0/*/immodules/im-%{name}.so
%endif
-%if 0%{?suse_version} > 1110
+%if 0%{?suse_version} > 1110 || 0%{?fedora_version}
%{__strip} %{buildroot}%{_libdir}/qt4/plugins/inputmethods/qtim-%{name}.so
%endif
-#Convenient define for the scriplets
+# Convenient define for the scriplets
%if %{_lib} == lib64
%define _gtk2_query_immodules %{_bindir}/gtk-query-immodules-2.0-64
%define _gtk2_query_immodules_update_cache %{_gtk2_query_immodules} > %{_sysconfdir}/gtk-2.0/gtk64.immodules
@@ -229,7 +456,7 @@ popd
%postun gtk2
%{_gtk2_query_immodules_update_cache}
-%if 0%{?suse_version} >= 1140
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
%if %{_lib} == lib64
%define _gtk3_query_immodules %{_bindir}/gtk-query-immodules-3.0-64
@@ -241,7 +468,7 @@ popd
%post gtk3
%{_gtk3_query_immodules_update_cache}
-#Add fcitx icons to gnome3 panel
+# Add fcitx icons to gnome3 panel
TARGET="/usr/share/gnome-shell/js/ui/statusIconDispatcher.js"
if [ -f $TARGET ] && [ ! -f $TARGET-fcitx ] ; then
mv $TARGET $TARGET-fcitx
@@ -253,25 +480,72 @@ fi
%endif
+# fedora autostart
+%if 0%{?fedora_version}
+%post
+/sbin/ldconfig
+%{_sbindir}/alternatives --install %{_sysconfdir}/X11/xinit/xinputrc xinputrc %{_sysconfdir}/X11/xinit/xinput.d/fcitx.conf 55 || :
+update-desktop-database %{_datadir}/applications &>/dev/null || :
+
+%postun
+/sbin/ldconfig
+if [ "$1" = "0" ]; then
+ %{_sbindir}/alternatives --remove xinputrc %{_sysconfdir}/X11/xinit/xinput.d/fcitx.conf || :
+ # if alternative was set to manual, reset to auto
+ [ -L %{_sysconfdir}/alternatives/xinputrc -a "`readlink %{_sysconfdir}/alternatives/xinputrc`" = "%{_sysconfdir}/X11/xinit/xinput.d/fcitx.conf" ] && %{_sbindir}/alternatives --auto xinputrc || :
+fi
+update-desktop-database %{_datadir}/applications &>/dev/null ||
+
+%endif
+
+%if 0%{?suse_version}
%post -p /sbin/ldconfig
-%post -n lib%{name}%{libver} -p /sbin/ldconfig
-
%postun -p /sbin/ldconfig
+%endif
+
+%post -n lib%{name}%{libver} -p /sbin/ldconfig
%postun -n lib%{name}%{libver} -p /sbin/ldconfig
%files -f %{name}.lang
%defattr(-,root,root)
-%doc AUTHORS ChangeLog
-%{_bindir}/*
+%{_bindir}/%{name}
+%{_bindir}/%{name}4-config
+%{_bindir}/%{name}-configtool
+%{_bindir}/%{name}-remote
+%{_bindir}/%{name}-skin-installer
%{_datadir}/%{name}/
%{_datadir}/applications/*.desktop
%{_datadir}/icons/*
%{_datadir}/mime/packages/*
-%{_mandir}/man1/*.gz
-%{_libdir}/fcitx/
-%config /etc/X11/xim.d/
+%{_mandir}/man1/fcitx.1.gz
+%{_mandir}/man1/fcitx-remote.1.gz
+%{_libdir}/%{name}/
+%if 0%{?suse_version}
+%config %{_sysconfdir}/X11/xim.d/
+%{_docdir}/%{name}/
+%endif
+%if 0%{?fedora_version}
+%config %{_sysconfdir}/X11/xinit/xinput.d/
+%{_docdir}/packages/%{name}/
+%endif
+
+# excludes
+%exclude %{_datadir}/%{name}/pinyin
+%exclude %{_datadir}/%{name}/table
+%exclude %{_datadir}/%{name}/imicon
+%exclude %{_datadir}/%{name}/inputmethod
+%exclude %{_datadir}/%{name}/addon/%{name}-pinyin.conf
+%exclude %{_datadir}/%{name}/addon/%{name}-table.conf
+%exclude %{_datadir}/%{name}/addon/%{name}-qw.conf
+%exclude %{_datadir}/%{name}/configdesc/%{name}-pinyin.desc
+%exclude %{_datadir}/%{name}/configdesc/table.desc
+%exclude %{_libdir}/%{name}/fcitx-pinyin.so
+%exclude %{_libdir}/%{name}/fcitx-table.so
+%exclude %{_libdir}/%{name}/fcitx-qw.so
+%exclude %{_datadir}/%{name}/skin/classic
+%exclude %{_datadir}/%{name}/skin/dark
%files -n lib%{name}%{libver}
%defattr(-,root,root)
@@ -282,7 +556,7 @@ fi
%defattr(-,root,root)
%{_libdir}/gtk-2.0/*
-%if 0%{?suse_version} >= 1140
+%if 0%{?suse_version} >= 1140 || 0%{?fedora_version}
%files gtk3
%defattr(-,root,root)
@@ -292,13 +566,110 @@ fi
%endif
+%files quwei
+%defattr(-,root,root)
+%dir %{_datadir}/%{name}/inputmethod
+%{_libdir}/%{name}/%{name}-qw.so
+%{_datadir}/%{name}/inputmethod/qw.conf
+%{_datadir}/%{name}/addon/%{name}-qw.conf
+
+%files pinyin
+%defattr(-,root,root)
+%dir %{_datadir}/%{name}/imicon
+%dir %{_datadir}/%{name}/inputmethod
+%{_libdir}/%{name}/%{name}-pinyin.so
+%{_datadir}/%{name}/pinyin/
+%{_datadir}/%{name}/inputmethod/pinyin.conf
+%{_datadir}/%{name}/inputmethod/shuangpin.conf
+%{_datadir}/%{name}/addon/%{name}-pinyin.conf
+%{_datadir}/%{name}/imicon/pinyin.png
+%{_datadir}/%{name}/imicon/shuangpin.png
+%{_datadir}/%{name}/configdesc/%{name}-pinyin.desc
+
+%files table
+%defattr(-,root,root)
+%dir %{_datadir}/%{name}/table/
+%{_libdir}/%{name}/%{name}-table.so
+%{_datadir}/%{name}/addon/%{name}-table.conf
+%{_datadir}/%{name}/configdesc/table.desc
+
+%files table-cn-cangjie
+%defattr(-,root,root)
+%dir %{_datadir}/%{name}/imicon
+%{_datadir}/%{name}/table/cangjie.*
+%{_datadir}/%{name}/imicon/cangjie.png
+
+%files table-cn-dianbao
+%defattr(-,root,root)
+%{_datadir}/%{name}/table/db.*
+
+%files table-cn-erbi
+%defattr(-,root,root)
+%dir %{_datadir}/%{name}/imicon
+%{_datadir}/%{name}/table/erbi.*
+%{_datadir}/%{name}/imicon/erbi.png
+
+%files table-cn-bingchan
+%defattr(-,root,root)
+%{_datadir}/%{name}/table/qxm.*
+
+%files table-cn-wanfeng
+%defattr(-,root,root)
+%{_datadir}/%{name}/table/wanfeng.*
+
+%files table-cn-wubi-pinyin
+%defattr(-,root,root)
+%dir %{_datadir}/%{name}/imicon
+%{_datadir}/%{name}/table/wbpy.*
+%{_datadir}/%{name}/imicon/wbpy.png
+
+%files table-cn-wubi
+%defattr(-,root,root)
+%dir %{_datadir}/%{name}/imicon
+%{_datadir}/%{name}/table/wbx.*
+%{_datadir}/%{name}/imicon/wubi.png
+
+%files table-cn-ziran
+%defattr(-,root,root)
+%dir %{_datadir}/%{name}/imicon
+%{_datadir}/%{name}/table/zrm.*
+%{_datadir}/%{name}/imicon/ziranma.png
+
+%files table-tools
+%defattr(-,root,root)
+%{_bindir}/mb2txt
+%{_bindir}/txt2mb
+%{_mandir}/man1/mb2txt.1.gz
+%{_mandir}/man1/txt2mb.1.gz
+
+%files pinyin-tools
+%defattr(-,root,root)
+%{_bindir}/createPYMB
+%{_bindir}/readPYMB
+%{_bindir}/readPYBase
+%{_bindir}/mb2org
+%{_bindir}/scel2org
+%{_mandir}/man1/createPYMB.1.gz
+%{_mandir}/man1/readPYMB.1.gz
+%{_mandir}/man1/readPYBase.1.gz
+%{_mandir}/man1/mb2org.1.gz
+%{_mandir}/man1/scel2org.1.gz
+
+%files skin-classic
+%defattr(-,root,root)
+%{_datadir}/%{name}/skin/classic
+
+%files skin-dark
+%defattr(-,root,root)
+%{_datadir}/%{name}/skin/dark
+
%files devel
%defattr(-,root,root)
%{_libdir}/pkgconfig/*.pc
%{_datadir}/cmake/
%{_includedir}/*
-%if 0%{?suse_version} > 1110
+%if 0%{?suse_version} > 1110 || 0%{?fedora_version}
%files qt4
%defattr(-,root,root)
diff --git a/fix-fcitx-4.2.4.1-memory-overflow.patch b/fix-fcitx-4.2.4.1-memory-overflow.patch
new file mode 100644
index 0000000..7f2a092
--- /dev/null
+++ b/fix-fcitx-4.2.4.1-memory-overflow.patch
@@ -0,0 +1,25 @@
+diff -urN fcitx-4.2.4.1.orig/src/module/xkb/xkb.c fcitx-4.2.4.1/src/module/xkb/xkb.c
+--- fcitx-4.2.4.1.orig/src/module/xkb/xkb.c 2012-06-16 22:27:00.087029656 +0800
++++ fcitx-4.2.4.1/src/module/xkb/xkb.c 2012-06-16 22:29:18.941293740 +0800
+@@ -197,8 +197,7 @@
+ xkbParentDir = strdup("/usr/share/X11");
+ }
+
+- rulesFile = fcitx_utils_malloc0(sizeof(char) * (1 + strlen(xkbParentDir) + strlen(rulesName) + strlen("/xkb/rules/")));
+- sprintf(rulesFile, "%s/xkb/rules/%s.xml", xkbParentDir, rulesName);
++ asprintf(&rulesFile, "%s/xkb/rules/%s.xml", xkbParentDir, rulesName);
+ fcitx_utils_free(xkbParentDir);
+ }
+
+diff -urN fcitx-4.2.4.1.orig/src/ui/classic/skin.c fcitx-4.2.4.1/src/ui/classic/skin.c
+--- fcitx-4.2.4.1.orig/src/ui/classic/skin.c 2012-06-16 22:27:00.090029620 +0800
++++ fcitx-4.2.4.1/src/ui/classic/skin.c 2012-06-16 22:30:39.775283176 +0800
+@@ -216,7 +216,7 @@
+ const char* fallbackChainNoFallback[] = { buf };
+ const char* fallbackChainPanel[] = { buf, "skin/default" };
+ const char* fallbackChainTray[] = { "imicon" };
+- const char* fallbackChainPanelIMIcon[] = { buf, "imicon" };
++ const char* fallbackChainPanelIMIcon[] = { buf, "imicon", "skin/default" };
+
+ HASH_FIND_STR(*imageTable, name, image);
+ if (image != NULL) {
diff --git a/xinput-fcitx b/xinput-fcitx
new file mode 100644
index 0000000..9ad4017
--- /dev/null
+++ b/xinput-fcitx
@@ -0,0 +1,15 @@
+XIM=fcitx
+XIM_PROGRAM=/usr/bin/fcitx
+ICON="/usr/share/pixmaps/fcitx.png"
+XIM_ARGS="-D"
+PREFERENCE_PROGRAM=/usr/bin/fcitx-configtool
+SHORT_DESC="FCITX"
+GTK_IM_MODULE=fcitx
+if test -f /usr/lib/qt4/plugins/inputmethods/qtim-fcitx.so || \
+ test -f /usr/lib64/qt4/plugins/inputmethods/qtim-fcitx.so;
+then
+ QT_IM_MODULE=fcitx
+else
+ QT_IM_MODULE=xim
+fi
+