%define _qt4_version %(pkg-config --modversion --silence-errors Qt 2>/dev/null || echo 4.8.0)
%define _qt4_prefix %(pkg-config --variable prefix --silence-errors Qt 2>/dev/null || echo %{_libdir}/qt4)
%define _qt4_plugindir %(pkg-config --variable plugindir --silence-errors Qt 2>/dev/null || echo %{_qt4_prefix}/plugins)

%define	ver	1.3.0
%define	rel	2

Summary: Qt IBus library and Qt input method plugin
Name: ibus-qt
Version: %{ver}
Release: %{rel}%{?_dist_release}
License: GPLv2+
Group: System Environment/Libraries
URL: http://code.google.com/p/ibus/
Source0: http://ibus.googlecode.com/files/%{name}-%{version}-Source.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: cmake
BuildRequires: qt4-devel >= 4.5
BuildRequires: dbus-devel >= 1.2
BuildRequires: libicu-devel >= 4.0
BuildRequires: doxygen >= 1.6
Requires: ibus >= 1.3

Vendor: Project Vine
Distribution: Vine Linux
Packager: iwaim

%description
This includes Qt IBus library and Qt input method plugin.

%package devel
Summary: Development tools for ibus Qt
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
The ibus-qt-devel package contains the header files for ibus Qt library.

%prep
%setup -q -n %{name}-%{version}-Source

%build
%cmake \
    -DCMAKE_INSTALL_PREFIX=%{_usr} \
    -DLIBDIR=%{_libdir}
make \
    VERBOSE=1 \
    C_DEFINES="$RPM_OPT_FLAGS" \
    CXX_DEFINES="$RPM_OPT_FLAGS" \
    %{?_smp_mflags}
make docs

%install
%{__rm} -rf %{buildroot}
make install DESTDIR=%{buildroot}

%clean
%{__rm} -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc AUTHORS README INSTALL
%{_libdir}/libibus-qt.so.*
%{_qt4_plugindir}/inputmethods/libqtim-ibus.so

%files devel
%defattr(-,root,root,-)
%doc docs/html
%dir %{_includedir}/ibus-qt
%{_includedir}/ibus-qt/*.h
%{_libdir}/libibus-qt.so

%changelog
* Sat Jan  7 2012 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.3.0-2
- rebuilt with qt-4.8.0

* Sun Jun  6 2010 IWAI, Masaharu <iwai@alib.jp> 1.3.0-1
- Initial build.

