SHA256
1
0
forked from pool/fcitx
fcitx/fcitx.spec

295 lines
7.2 KiB
RPMSpec

Name: fcitx
Version: 4.1.2
Release: 1
Summary: Free Chinese Input Toy for X
URL: http://code.google.com/p/fcitx/
Group: System/I18n/Chinese
License: GPL
Source: %{name}-%{version}_all.tar.bz2
Source1: xim.d-fcitx
Source2: xinput-fcitx.conf
Source3: fcitx-README.suse
Source4: xim.fcitx.suse.template
BuildRequires: cairo-devel
BuildRequires: pango-devel
BuildRequires: fdupes
%if 0%{?suse_version}
BuildRequires: dbus-1-devel
BuildRequires: dbus-1-glib-devel
BuildRequires: update-desktop-files
BuildRequires: libqt4-devel
%else
BuildRequires: dbus-devel
BuildRequires: dbus-glib-devel
BuildRequires: qt-devel
%endif
BuildRequires: intltool
BuildRequires: cmake
BuildRequires: gtk2-devel
#If you do not use immodule-fcitx, you have to use immodule-xim
%if 0%{?suse_version} > 1130
Requires: gtk2-immodule-xim, gtk3-immodule-xim
BuildRequires: gtk3-devel
%endif
%if 0%{?fedora} > 14
BuildRequires: gtk3-devel
%endif
BuildRequires: gcc-c++
BuildRequires: libicu-devel
Patch0: firefox-facebook.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
%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.
Authors
-------
Yuking
CSSlayer
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/Other
Requires: fcitx = %{version}-%{release}
%description devel
This devel package includes the header files and other develop files for FCITX.
%package gtk2
Summary: Gtk2 IM Module for %{name}
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
#XIM is not necessary if using immodule-fcitx.
#Requires: gtk2-immodule-xim
%description gtk2
This package contains the optional but native im module for gtk2. Note the xim support is already installed by default.
%if 0%{?suse_version} > 1130
%package gtk3
Summary: Gtk3 IM Module for %{name}
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
#XIM is not necessary if using immodule-fcitx.
#Requires: gtk3-immodule-xim
%description gtk3
This package contains the optional but native im module for gtk3. Note the xim support is already installed by default.
%endif
%if 0%{?fedora} > 14
%package gtk3
Summary: Gtk3 IM Module for %{name}
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
Requires: gtk3-immodule-xim
%description gtk3
This package contains the optional but native im module for gtk3.
%endif
Requires: fcitx
%package qt4
Summary: Qt4 IM Module for %{name}
Group: System/Libraries
Requires: %{name} = %{version}-%{release}
%description qt4
This package contains the optional but native im module for qt4. Note the xim support is already installed by default.
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%build
mkdir build
cd build
%if 0%{?suse_version}
%if 0%{?suse_version} < 1140
cmake .. -DENABLE_GTK2_IM_MODULE=On \
-DENABLE_GTK3_IM_MODULE=Off \
-DENABLE_QT_IM_MODULE=On \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DLIB_INSTALL_DIR=%{_libdir}
%else
cmake .. -DENABLE_GTK2_IM_MODULE=On \
-DENABLE_GTK3_IM_MODULE=On \
-DENABLE_QT_IM_MODULE=On \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DLIB_INSTALL_DIR=%{_libdir}
%endif
%endif
%if 0%{?fedora}
%if 0%{?fedora} < 15
cmake .. -DENABLE_GTK3_IM_MODULE=off \
-DENABLE_QT_IM_MODULE=On \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DLIB_INSTALL_DIR=%{_libdir}
%else
cmake .. -DENABLE_GTK3_IM_MODULE=On \
-DENABLE_QT_IM_MODULE=On \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DLIB_INSTALL_DIR=%{_libdir}
%endif
%endif
%if 0%{?centos_version}
cmake .. -DENABLE_GTK3_IM_MODULE=off \
-DENABLE_QT_IM_MODULE=On \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DLIB_INSTALL_DIR=%{_libdir}
%endif
%if 0%{?rhel_version}
cmake .. -DENABLE_GTK3_IM_MODULE=off \
-DENABLE_QT_IM_MODULE=On \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DLIB_INSTALL_DIR=%{_libdir}
%endif
make
%install
#rm -rf $RPM_BUILD_ROOT
cd build
make DESTDIR=$RPM_BUILD_ROOT install
cd ..
#rm $RPM_BUILD_ROOT/usr/share/doc/ -r
%if 0%{?suse_version}
%suse_update_desktop_file fcitx Utility DesktopUtility
%suse_update_desktop_file fcitx-kimpanel Utility DesktopUtility
%suse_update_desktop_file fcitx-configtool Utility DesktopUtility
%suse_update_desktop_file -G "Installer Script for Fcitx Skin" fcitx-skin-installer Utility DesktopUtility
mkdir -p $RPM_BUILD_ROOT/etc/X11/xim.d/
install -m 644 $RPM_SOURCE_DIR/xim.d-fcitx $RPM_BUILD_ROOT/etc/X11/xim.d/fcitx
rm -f $RPM_BUILD_ROOT%{_libdir}/libfcitx-config.la
pushd $RPM_BUILD_ROOT/etc/X11/xim.d/
for lang in en zh_CN ; do
mkdir $lang
pushd $lang
ln -s ../fcitx 30-fcitx
popd
done
popd
%else
mkdir -p $RPM_BUILD_ROOT/etc/X11/xinit/xinput.d/
install -m 644 $RPM_SOURCE_DIR/xinput-fcitx.conf $RPM_BUILD_ROOT/etc/X11/xinit/xinput.d/fcitx.conf
%endif
%fdupes -s %{buildroot}
%find_lang %{name}
%clean
[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}
%if 0%{?suse_version}
%post gtk2
touch var/adm/SuSEconfig/run-gtk
/sbin/SuSEconfig --module gtk2
%postun gtk2
touch var/adm/SuSEconfig/run-gtk
/sbin/SuSEconfig --module gtk2
%if 0%{?suse_version} > 1130
%post gtk3
/sbin/ldconfig
%ifarch x86_64
gtk-query-immodules-3.0-64 --update-cache
%else
gtk-query-immodules-3.0 --update-cache
%endif
%endif
%endif
%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS README $RPM_SOURCE_DIR/xim.fcitx.suse.template
%{_bindir}/*
%{_datadir}/%{name}/addon/*
%{_datadir}/%{name}/configdesc/*
%{_datadir}/%{name}/data/*
%{_datadir}/%{name}/pinyin/*
%{_datadir}/%{name}/table/*
%{_datadir}/doc/%{name}/
%{_datadir}/applications/*.desktop
%{_datadir}/icons/*
%{_datadir}/mime/packages/*
%{_mandir}/man1/*.gz
%dir %{_datadir}/fcitx/addon
%dir %{_datadir}/fcitx/configdesc
%dir %{_datadir}/fcitx/data
%dir %{_datadir}/fcitx/pinyin
%dir %{_datadir}/fcitx/table
%dir %{_libdir}/fcitx
%dir %{_datadir}/fcitx
%{_libdir}/fcitx/*.so
%{_libdir}/libfcitx*.so.*
%{_bindir}/createPYMB
%{_bindir}/mb2org
%{_bindir}/mb2txt
%{_bindir}/readPYBase
%{_bindir}/readPYMB
%{_bindir}/scel2org
%{_bindir}/txt2mb
%dir %{_datadir}/%{name}/skin
%{_datadir}/%{name}/skin/default
%{_datadir}/%{name}/skin/dark
%{_datadir}/%{name}/skin/classic
%if 0%{?suse_version}
%dir /etc/X11/xim.d
%dir /etc/X11/xim.d/en
%dir /etc/X11/xim.d/zh_CN
%config /etc/X11/xim.d/*
%else
%dir /etc/X11/xinit/xinput.d
/etc/X11/xinit/xinput.d/fcitx.conf
%endif
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files gtk2
%defattr(-,root,root,-)
%{_libdir}/gtk-2.0/*
%if 0%{?suse_version} > 1130
%files gtk3
%defattr(-,root,root,-)
%{_libdir}/gtk-3.0/*
%endif
%if 0%{?fedora} > 14
%files gtk3
%defattr(-,root,root,-)
%{_libdir}/gtk-3.0/*
%endif
%files devel
%defattr(-,root,root,-)
%{_libdir}/libfcitx*.so
%{_libdir}/pkgconfig/*.pc
%{_datadir}/cmake/
%{_includedir}/*
%files qt4
%defattr(-,root,root,-)
%{_libdir}/qt4/*
%changelog