Name:       @PACKAGE_NAME@
Version:    @PACKAGE_VERSION@
Release:    1%{?dist}
Summary:    The Table engine for IBus platform
License:    LGPLv2+
Group:      System Environment/Libraries
URL:        http://mike-fabian.github.io/ibus-table/
Source0:    https://github.com/mike-fabian/ibus-table/releases/download/%{version}/ibus-table-%{version}.tar.gz

BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:  noarch

BuildRequires:  gettext-devel

Requires:   ibus

%description
The package contains general Table engine for IBus platform.

%package additional
Summary:    Additional tables for general table engine of IBus.
Group:      System Environment/Libraries
Requires:   %{name} = %{version}-%{release}

%description additional
This package contains additional tables.

%prep
%setup -q

%build
%configure \
	--disable-static \
	--enable-additional

make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=${RPM_BUILD_ROOT} NO_INDEX=true install

%find_lang %{name}

%clean
rm -rf $RPM_BUILD_ROOT

%post additional
ibus-table-createdb -i -n %{_datadir}/ibus-table/tables/additional/compose.db
ibus-table-createdb -i -n %{_datadir}/ibus-table/tables/additional/latex.db

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING README
%{_libdir}/pkgconfig/ibus-table.pc
%{_datadir}/ibus-table/engine
%{_datadir}/ibus-table/data
%{_datadir}/ibus-table/setup
%{_datadir}/ibus-table/tables/template.txt
%dir %{_datadir}/ibus-table/tables
%{_datadir}/ibus-table/icons/ibus-table.svg
%{_datadir}/ibus-table/icons/full-letter.svg
%{_datadir}/ibus-table/icons/full-punct.svg
%{_datadir}/ibus-table/icons/half-letter.svg
%{_datadir}/ibus-table/icons/half-punct.svg
%{_datadir}/ibus-table/icons/onechar.svg
%{_datadir}/ibus-table/icons/phrase.svg
%{_datadir}/ibus-table/icons/py-mode.svg
%{_datadir}/ibus-table/icons/tab-mode.svg
%{_datadir}/ibus-table/icons/chinese.svg
%{_datadir}/ibus-table/icons/dcommit.svg
%{_datadir}/ibus-table/icons/english.svg
%{_datadir}/ibus-table/icons/ncommit.svg
%{_datadir}/ibus-table/icons/cb-mode.svg
%{_datadir}/ibus-table/icons/sc-mode.svg
%{_datadir}/ibus-table/icons/scb-mode.svg
%{_datadir}/ibus-table/icons/tc-mode.svg
%{_datadir}/ibus-table/icons/tcb-mode.svg
%dir %{_datadir}/ibus-table/icons
%{_bindir}/ibus-engine-table
%{_bindir}/ibus-table-createdb
%{_bindir}/ibus-setup-table

%files additional
%defattr(-,root,root,-)
%{_datadir}/ibus-table/tables/compose.db
%{_datadir}/ibus-table/tables/latex.db
%{_datadir}/ibus-table/icons/compose.svg
%{_datadir}/ibus-table/icons/latex.svg
%{_datadir}/ibus/engine/compose.engine
%{_datadir}/ibus/engine/latex.engine

%changelog
* Wed Aug 19 2008 Yu Yuwei <acevery@gmail.com> - @VERSION@-1
- The first version.
