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

278 lines
6.6 KiB
RPMSpec
Raw Normal View History

Name: fcitx
Version: 4.1.1
Release: 1
Summary: Free Chinese Input Toy for X (XIM)
Packager: hillwood <hillwood@linuxfans.org>
URL: http://www.fcitx.org/
Group: System Environment/Libraries
License: GPL
Source: %{name}-%{version}_all.tar.bz2
Source1: xim.d-fcitx
Source2: xinput-fcitx.conf
BuildRequires: cairo-devel
BuildRequires: pango-devel
%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 0%{?suse_version} > 1130
BuildRequires: gtk3-devel
%endif
%if 0%{?fedora} > 14
BuildRequires: gtk3-devel
%endif
BuildRequires: gcc-c++
BuildRequires: libicu-devel
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.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: fcitx = %{version}-%{release}
%description devel
The %{name}-devel package includes the header files for the %{name} package.
%package gtk2
Summary: Gtk2 IM Module for %{name}
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Requires: gtk2-immodule-xim
%description gtk2
This package contains %{name} im module for gtk2
%if 0%{?suse_version} > 1130
%package gtk3
Summary: Gtk3 IM Module for %{name}
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Requires: gtk3-immodule-xim
%description gtk3
This package contains %{name} im module for gtk3
%endif
%if 0%{?fedora} > 14
%package gtk3
Summary: Gtk3 IM Module for %{name}
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Requires: gtk3-immodule-xim
%description gtk3
This package contains %{name} im module for gtk3
%endif
Requires: fcitx
%package qt4
Summary: Qt4 IM Module for %{name}
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
%description qt4
This package contains %{name} im module for qt4
%prep
%setup -q -n %{name}-%{version}
%build
mkdir build
cd build
%if 0%{?suse_version}
%if 0%{?suse_version} < 1140
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%{?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 System SystemSetup
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
%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
%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 > /usr/lib64/gtk-3.0/3.0.0/immodules.cache
%else
gtk-query-immodules-3.0 > /usr/lib/gtk-3.0/3.0.0/immodules.cache
%endif
%endif
%endif
%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING INSTALL README
%{_bindir}/%{name}
%{_bindir}/%{name}-configtool
%{_bindir}/%{name}-remote
%{_bindir}/%{name}4-config
%{_datadir}/%{name}/addon/*
%{_datadir}/%{name}/configdesc/*
%{_datadir}/%{name}/data/*
%{_datadir}/%{name}/pinyin/*
%{_datadir}/%{name}/table/*
#%{_datadir}/doc/%{name}/
%{_datadir}/applications/*.desktop
%{_datadir}/icons/*
%{_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
/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
* Sat Sep 10 2011 hillwood <hillwood@linuxfans.org>
- add gtk2-immodule-xim and gtk3-immodule-xim require
* Fri Sep 9 2011 hillwood <hillwood@linuxfans.org>
- update to 4.1.1
* Mon Sep 5 2011 hillwood <hillwood@linuxfans.org>
- update to 4.1.0.
* Thu May 17 2011 hillwood <hillwood@linuxfans.org>
- add gtk-immodule-xim require
* Mon Mar 14 2011 hillwood <hillwood@linuxfans.org>
- first package for 4.0.1