2012-01-16 21:48:41 +01:00
|
|
|
#
|
|
|
|
# spec file for package fcitx
|
|
|
|
#
|
|
|
|
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2012-06-03 11:36:32 +02:00
|
|
|
|
2012-05-07 04:29:00 +02:00
|
|
|
%define libver -4_2_3
|
2012-02-04 17:14:33 +01:00
|
|
|
|
|
|
|
Name: fcitx
|
2012-05-07 04:29:00 +02:00
|
|
|
Version: 4.2.3
|
2012-06-03 11:36:32 +02:00
|
|
|
Release: 0
|
2012-02-04 17:14:33 +01:00
|
|
|
Summary: A Flexible Input Method Framework for CJK
|
|
|
|
License: GPL-2.0+
|
2012-06-03 11:36:32 +02:00
|
|
|
Group: System/I18n/Chinese
|
|
|
|
Url: http://code.google.com/p/fcitx
|
|
|
|
Source: http://fcitx.googlecode.com/files/%{name}-%{version}.tar.bz2
|
2011-09-13 05:44:06 +02:00
|
|
|
Source1: xim.d-fcitx
|
2012-02-04 17:14:33 +01:00
|
|
|
Source2: fcitx-README.suse
|
|
|
|
Source3: xim.fcitx.suse.template
|
2012-06-03 11:36:32 +02:00
|
|
|
Source5: pinyin.tar.gz
|
|
|
|
Source6: table.tar.gz
|
2012-05-07 10:08:06 +02:00
|
|
|
#FIX-FOR-UPSTREAM i@marguerite.su - dont download online
|
2012-06-03 11:36:32 +02:00
|
|
|
Patch1: fix_fcitx_googlecode_resolv_error.patch
|
2012-05-07 10:08:06 +02:00
|
|
|
#FIX-FOR-UPSTREAM i@marguerite.su - fix lua51 builds on 11.4
|
2012-06-03 11:36:32 +02:00
|
|
|
Patch2: fcitx-4.2.3-openSUSE-11.4-lua51.patch
|
|
|
|
#FIX-FOR-SLES i@marguerite.su - downgrade gio version from 2.6 to 2.26
|
|
|
|
Patch3: fix-for-sles-downgrade-gio-version.patch
|
2011-09-13 05:44:06 +02:00
|
|
|
BuildRequires: cairo-devel
|
|
|
|
BuildRequires: dbus-1-devel
|
|
|
|
BuildRequires: dbus-1-glib-devel
|
2012-06-03 11:36:32 +02:00
|
|
|
BuildRequires: pango-devel
|
2011-09-13 05:44:06 +02:00
|
|
|
BuildRequires: update-desktop-files
|
2012-06-03 11:36:32 +02:00
|
|
|
%if 0%{?suse_version} >= 1110
|
|
|
|
BuildRequires: fdupes
|
|
|
|
%endif
|
|
|
|
%if 0%{?suse_version} > 1110
|
2011-09-13 05:44:06 +02:00
|
|
|
BuildRequires: libqt4-devel
|
2012-06-03 11:36:32 +02:00
|
|
|
%endif
|
2012-05-07 10:08:06 +02:00
|
|
|
%if 0%{?suse_version} <= 1210
|
2012-06-03 11:36:32 +02:00
|
|
|
BuildRequires: lua-devel
|
2012-05-07 10:08:06 +02:00
|
|
|
%else
|
|
|
|
BuildRequires: lua51-devel
|
|
|
|
%endif
|
2011-09-13 05:44:06 +02:00
|
|
|
BuildRequires: cmake
|
|
|
|
BuildRequires: gtk2-devel
|
2012-06-03 11:36:32 +02:00
|
|
|
BuildRequires: intltool
|
|
|
|
BuildRequires: opencc-devel
|
|
|
|
%if 0%{?suse_version} >= 1140
|
2011-09-13 05:44:06 +02:00
|
|
|
BuildRequires: gtk3-devel
|
2012-06-03 11:36:32 +02:00
|
|
|
%endif
|
2011-09-13 05:44:06 +02:00
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: libicu-devel
|
2012-06-03 11:36:32 +02:00
|
|
|
Requires: %{name}-gtk2 = %{version}-%{release}
|
|
|
|
Requires: lib%{name}%{libver} = %{version}-%{release}
|
|
|
|
%if 0%{?suse_version} >= 1140
|
|
|
|
Requires: %{name}-gtk3 = %{version}-%{release}
|
|
|
|
%endif
|
|
|
|
%if 0%{?suse_version} > 1110
|
|
|
|
Requires: %{name}-qt4 = %{version}-%{release}
|
|
|
|
%endif
|
2012-02-04 17:14:33 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2012-06-03 11:36:32 +02:00
|
|
|
Provides: locale(ko;zh_CN;zh_SG)
|
2012-02-04 17:14:33 +01:00
|
|
|
|
2011-06-02 07:40:09 +02:00
|
|
|
%description
|
|
|
|
FCITX is a simplified Chinese input server. It supports Tables,
|
|
|
|
Pinyin and QuWei input method. It's small and fast.
|
2011-09-13 05:44:06 +02:00
|
|
|
|
2011-09-13 07:16:43 +02:00
|
|
|
Since version 4.1, FCITX itself can be use as an im-module. XIM
|
|
|
|
can still be used but not necessary.
|
|
|
|
|
2012-02-04 17:14:33 +01:00
|
|
|
%package -n lib%{name}%{libver}
|
2012-06-03 11:36:32 +02:00
|
|
|
Summary: Shared Libraries for %{name}
|
|
|
|
Group: System/I18n/Chinese
|
2012-02-04 17:14:33 +01:00
|
|
|
|
|
|
|
%description -n lib%{name}%{libver}
|
|
|
|
The libfcitx4_2_0 package includes the shared libraries for the fictx package.
|
2011-10-05 23:09:33 +02:00
|
|
|
|
2011-06-02 07:40:09 +02:00
|
|
|
%package devel
|
2012-02-04 17:14:33 +01:00
|
|
|
Summary: Development files for %{name}
|
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
2011-06-02 07:40:09 +02:00
|
|
|
%description devel
|
2012-02-04 17:14:33 +01:00
|
|
|
The fcitx-devel package includes the header files for the fcitx package.
|
2011-09-13 05:44:06 +02:00
|
|
|
|
|
|
|
%package gtk2
|
|
|
|
Summary: Gtk2 IM Module for %{name}
|
2012-02-04 17:14:33 +01:00
|
|
|
Group: System/I18n/Chinese
|
2011-09-13 05:44:06 +02:00
|
|
|
Requires: %{name} = %{version}-%{release}
|
2012-02-04 17:14:33 +01:00
|
|
|
%gtk2_immodule_requires
|
|
|
|
|
2011-09-13 05:44:06 +02:00
|
|
|
%description gtk2
|
2012-02-04 17:14:33 +01:00
|
|
|
This package contains fcitx im module for gtk2
|
|
|
|
|
2012-06-03 11:36:32 +02:00
|
|
|
%if 0%{?suse_version} >= 1140
|
|
|
|
|
2011-09-13 05:44:06 +02:00
|
|
|
%package gtk3
|
|
|
|
Summary: Gtk3 IM Module for %{name}
|
2012-02-04 17:14:33 +01:00
|
|
|
Group: System/I18n/Chinese
|
2011-09-13 05:44:06 +02:00
|
|
|
Requires: %{name} = %{version}-%{release}
|
2012-02-04 17:14:33 +01:00
|
|
|
%gtk3_immodule_requires
|
|
|
|
|
2011-09-13 05:44:06 +02:00
|
|
|
%description gtk3
|
2012-02-04 17:14:33 +01:00
|
|
|
This package contains fcitx im module for gtk3
|
2011-06-02 07:40:09 +02:00
|
|
|
|
2012-06-03 11:36:32 +02:00
|
|
|
%endif
|
|
|
|
%if 0%{?suse_version} > 1110
|
|
|
|
|
2011-09-13 05:44:06 +02:00
|
|
|
%package qt4
|
|
|
|
Summary: Qt4 IM Module for %{name}
|
2012-02-04 17:14:33 +01:00
|
|
|
Group: System/I18n/Chinese
|
2011-09-13 05:44:06 +02:00
|
|
|
Requires: %{name} = %{version}-%{release}
|
2012-02-04 17:14:33 +01:00
|
|
|
|
2011-09-13 05:44:06 +02:00
|
|
|
%description qt4
|
2012-02-04 17:14:33 +01:00
|
|
|
This package contains fcitx im module for qt4
|
2012-06-03 11:36:32 +02:00
|
|
|
|
|
|
|
%endif
|
|
|
|
|
2011-06-02 07:40:09 +02:00
|
|
|
%prep
|
2011-09-13 05:44:06 +02:00
|
|
|
%setup -q -n %{name}-%{version}
|
2012-02-04 17:14:33 +01:00
|
|
|
%patch1 -p1
|
2012-05-07 10:08:06 +02:00
|
|
|
%patch2 -p1
|
2012-06-03 11:36:32 +02:00
|
|
|
%patch3 -p1
|
2012-02-04 17:14:33 +01:00
|
|
|
|
2011-06-02 07:40:09 +02:00
|
|
|
%build
|
2011-09-09 20:59:47 +02:00
|
|
|
mkdir build
|
|
|
|
cd build
|
2011-06-02 07:40:09 +02:00
|
|
|
|
2011-09-13 07:16:43 +02:00
|
|
|
cmake .. -DENABLE_GTK2_IM_MODULE=On \
|
2012-06-03 11:36:32 +02:00
|
|
|
%if 0%{?suse_version} >= 1140
|
2011-09-13 07:16:43 +02:00
|
|
|
-DENABLE_GTK3_IM_MODULE=On \
|
2012-06-03 11:36:32 +02:00
|
|
|
%endif
|
|
|
|
%if 0%{?suse_version} > 1110
|
2011-09-13 05:44:06 +02:00
|
|
|
-DENABLE_QT_IM_MODULE=On \
|
2012-06-03 11:36:32 +02:00
|
|
|
%endif
|
2011-09-13 05:44:06 +02:00
|
|
|
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
|
2012-02-04 17:14:33 +01:00
|
|
|
-DLIB_INSTALL_DIR=%{_libdir} \
|
|
|
|
-DENABLE_DEBUG=On \
|
2012-05-07 10:08:06 +02:00
|
|
|
-DENABLE_OPENCC=On \
|
|
|
|
-DENABLE_LUA=On
|
2012-02-04 17:14:33 +01:00
|
|
|
|
|
|
|
#copy external data
|
|
|
|
pushd ../data
|
|
|
|
cp -r %{S:5} ./
|
|
|
|
popd
|
|
|
|
pushd ../data/table
|
|
|
|
cp -r %{S:6} ./
|
|
|
|
popd
|
2011-09-13 05:44:06 +02:00
|
|
|
|
|
|
|
make
|
2012-02-04 17:14:33 +01:00
|
|
|
|
2011-06-02 07:40:09 +02:00
|
|
|
%install
|
2011-09-09 20:59:47 +02:00
|
|
|
cd build
|
2012-06-03 11:36:32 +02:00
|
|
|
%makeinstall
|
2012-02-04 17:14:33 +01:00
|
|
|
|
2011-09-13 05:44:06 +02:00
|
|
|
cd ..
|
2012-02-04 17:14:33 +01:00
|
|
|
|
|
|
|
#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
|
|
|
|
|
2011-09-13 05:44:06 +02:00
|
|
|
%suse_update_desktop_file fcitx Utility DesktopUtility
|
2012-02-04 17:14:33 +01:00
|
|
|
%suse_update_desktop_file fcitx-skin-installer Utility DesktopUtility
|
|
|
|
%suse_update_desktop_file fcitx-configtool System X-SuSE-SystemSetup
|
|
|
|
|
|
|
|
#fix doc
|
|
|
|
%{__rm} -rf %{buildroot}%{_datadir}/doc/%{name}/
|
2011-09-13 07:16:43 +02:00
|
|
|
|
2012-02-04 17:14:33 +01:00
|
|
|
#create autostart
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/X11/xim.d/
|
|
|
|
install -m 644 %{S:1} %{buildroot}%{_sysconfdir}/X11/xim.d/fcitx
|
2011-09-13 07:16:43 +02:00
|
|
|
|
2012-05-16 21:17:48 +02:00
|
|
|
priority=30
|
2012-02-04 17:14:33 +01:00
|
|
|
pushd %{buildroot}%{_sysconfdir}/X11/xim.d/
|
2012-05-16 21:17:48 +02:00
|
|
|
for lang in en ko zh_CN zh_SG ; do
|
2011-09-13 07:16:43 +02:00
|
|
|
mkdir $lang
|
|
|
|
pushd $lang
|
2012-05-16 21:17:48 +02:00
|
|
|
ln -s ../fcitx $priority-fcitx
|
2011-09-13 07:16:43 +02:00
|
|
|
popd
|
|
|
|
done
|
|
|
|
popd
|
|
|
|
|
2012-02-04 17:14:33 +01:00
|
|
|
#remove *.la
|
|
|
|
%{__rm} -rf %{buildroot}%{_libdir}/lib%{name}-config.la
|
2011-10-05 23:09:33 +02:00
|
|
|
|
2011-06-02 07:40:09 +02:00
|
|
|
%find_lang %{name}
|
2011-09-13 07:16:43 +02:00
|
|
|
|
2012-06-03 11:36:32 +02:00
|
|
|
%if 0%{?suse_version} >= 1110
|
2012-02-04 17:14:33 +01:00
|
|
|
%fdupes %{buildroot}
|
2012-06-03 11:36:32 +02:00
|
|
|
%endif
|
2011-09-13 07:16:43 +02:00
|
|
|
|
2012-02-04 17:14:33 +01:00
|
|
|
#strip libraries
|
|
|
|
%{__strip} %{buildroot}%{_libdir}/%{name}/*.so
|
|
|
|
%{__strip} %{buildroot}%{_libdir}/libfcitx*.so.*
|
|
|
|
%{__strip} %{buildroot}%{_libdir}/gtk-2.0/*/immodules/im-%{name}.so
|
2012-06-03 11:36:32 +02:00
|
|
|
%if 0%{?suse_version} >= 1140
|
2012-02-04 17:14:33 +01:00
|
|
|
%{__strip} %{buildroot}%{_libdir}/gtk-3.0/*/immodules/im-%{name}.so
|
2012-06-03 11:36:32 +02:00
|
|
|
%endif
|
|
|
|
%if 0%{?suse_version} > 1110
|
2012-02-04 17:14:33 +01:00
|
|
|
%{__strip} %{buildroot}%{_libdir}/qt4/plugins/inputmethods/qtim-%{name}.so
|
2012-06-03 11:36:32 +02:00
|
|
|
%endif
|
2012-02-04 17:14:33 +01:00
|
|
|
|
|
|
|
#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
|
|
|
|
%else
|
|
|
|
%define _gtk2_query_immodules %{_bindir}/gtk-query-immodules-2.0
|
|
|
|
%define _gtk2_query_immodules_update_cache %{_gtk2_query_immodules} > %{_sysconfdir}/gtk-2.0/gtk.immodules
|
|
|
|
%endif
|
|
|
|
|
2012-06-03 11:36:32 +02:00
|
|
|
%post gtk2
|
|
|
|
%{_gtk2_query_immodules_update_cache}
|
|
|
|
|
|
|
|
%postun gtk2
|
|
|
|
%{_gtk2_query_immodules_update_cache}
|
|
|
|
|
|
|
|
%if 0%{?suse_version} >= 1140
|
|
|
|
|
2012-02-04 17:14:33 +01:00
|
|
|
%if %{_lib} == lib64
|
|
|
|
%define _gtk3_query_immodules %{_bindir}/gtk-query-immodules-3.0-64
|
|
|
|
%else
|
|
|
|
%define _gtk3_query_immodules %{_bindir}/gtk-query-immodules-3.0
|
|
|
|
%endif
|
|
|
|
%define _gtk3_query_immodules_update_cache %{_gtk3_query_immodules} --update-cache
|
2011-09-13 05:44:06 +02:00
|
|
|
|
|
|
|
%post gtk3
|
2012-02-04 17:14:33 +01:00
|
|
|
%{_gtk3_query_immodules_update_cache}
|
2011-09-13 05:44:06 +02:00
|
|
|
|
2012-02-04 17:14:33 +01:00
|
|
|
#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
|
|
|
|
sed "/^const STANDARD_TRAY_ICON_IMPLEMENTATIONS/a \ 'fcitx': 'input-method'," $TARGET-fcitx > $TARGET
|
|
|
|
fi
|
|
|
|
|
|
|
|
%postun gtk3
|
|
|
|
%{_gtk3_query_immodules_update_cache}
|
|
|
|
|
2012-06-03 11:36:32 +02:00
|
|
|
%endif
|
|
|
|
|
2012-02-04 17:14:33 +01:00
|
|
|
%post -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%post -n lib%{name}%{libver} -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%postun -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%postun -n lib%{name}%{libver} -p /sbin/ldconfig
|
2011-09-13 05:44:06 +02:00
|
|
|
|
|
|
|
%files -f %{name}.lang
|
2012-02-04 17:14:33 +01:00
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc AUTHORS ChangeLog
|
2011-10-02 22:57:27 +02:00
|
|
|
%{_bindir}/*
|
2012-02-04 17:14:33 +01:00
|
|
|
%{_datadir}/%{name}/
|
2011-09-13 05:44:06 +02:00
|
|
|
%{_datadir}/applications/*.desktop
|
|
|
|
%{_datadir}/icons/*
|
2011-10-02 22:57:27 +02:00
|
|
|
%{_datadir}/mime/packages/*
|
2011-09-13 05:44:06 +02:00
|
|
|
%{_mandir}/man1/*.gz
|
2012-02-04 17:14:33 +01:00
|
|
|
%{_libdir}/fcitx/
|
|
|
|
%config /etc/X11/xim.d/
|
2011-06-02 07:40:09 +02:00
|
|
|
|
2012-02-04 17:14:33 +01:00
|
|
|
%files -n lib%{name}%{libver}
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/libfcitx*.so.*
|
|
|
|
%{_libdir}/libfcitx*.so
|
2011-06-02 07:40:09 +02:00
|
|
|
|
2011-09-13 05:44:06 +02:00
|
|
|
%files gtk2
|
2012-02-04 17:14:33 +01:00
|
|
|
%defattr(-,root,root)
|
2011-09-13 05:44:06 +02:00
|
|
|
%{_libdir}/gtk-2.0/*
|
|
|
|
|
2012-06-03 11:36:32 +02:00
|
|
|
%if 0%{?suse_version} >= 1140
|
|
|
|
|
2011-09-13 05:44:06 +02:00
|
|
|
%files gtk3
|
2012-02-04 17:14:33 +01:00
|
|
|
%defattr(-,root,root)
|
2011-09-13 05:44:06 +02:00
|
|
|
%{_libdir}/gtk-3.0/*
|
|
|
|
|
2012-06-03 11:36:32 +02:00
|
|
|
%endif
|
|
|
|
|
2011-06-02 07:40:09 +02:00
|
|
|
%files devel
|
2012-02-04 17:14:33 +01:00
|
|
|
%defattr(-,root,root)
|
2011-09-09 20:59:47 +02:00
|
|
|
%{_libdir}/pkgconfig/*.pc
|
2011-09-13 05:44:06 +02:00
|
|
|
%{_datadir}/cmake/
|
|
|
|
%{_includedir}/*
|
|
|
|
|
2012-06-03 11:36:32 +02:00
|
|
|
%if 0%{?suse_version} > 1110
|
|
|
|
|
2011-09-13 05:44:06 +02:00
|
|
|
%files qt4
|
2012-02-04 17:14:33 +01:00
|
|
|
%defattr(-,root,root)
|
2011-09-13 05:44:06 +02:00
|
|
|
%{_libdir}/qt4/*
|
2011-06-02 07:40:09 +02:00
|
|
|
|
2012-06-03 11:36:32 +02:00
|
|
|
%endif
|
|
|
|
|
2011-06-02 07:40:09 +02:00
|
|
|
%changelog
|