%define ver 0.1.2
%define rel 2

Summary: Japanese Kana Kanji Engine for Fcitx
Name: fcitx-kkc
Version: %{ver}
Release: %{rel}%{_dist_release}
License: GPLv3
Group: System Environment/Libraries
URL: https://fcitx-im.org
Source0: http://download.fcitx-im.org/fcitx-kkc/%{name}-%{version}.tar.xz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: cmake
BuildRequires: fcitx-devel >= 4.2.8
BuildRequires: libkkc-devel >= 0.2.3
Requires: fcitx

Distribution: Vine Linux
Vendor:       Project Vine
Packager:     iwaim

%description
Japanese Kana Kanji Engine for Fcitx.

%prep
%setup -q

%build
%__mkdir build
pushd build
%cmake ENABLE_QT=On ..
make %{?_smp_mflags}
popd

%install
rm -rf $RPM_BUILD_ROOT
pushd build
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
popd

%find_lang %{name}

%clean
rm -rf $RPM_BUILD_ROOT

%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
  /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
  /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc COPYING
%{_libdir}/fcitx/fcitx-kkc.so
%{_libdir}/fcitx/qt/libfcitx-kkc-config.so
%{_datadir}/fcitx/addon/fcitx-kkc.conf
%{_datadir}/fcitx/configdesc/fcitx-kkc.desc
%{_datadir}/fcitx/imicon/kkc.png
%{_datadir}/fcitx/inputmethod/kkc.conf
%dir %{_datadir}/fcitx/kkc
%{_datadir}/fcitx/kkc/dictionary_list
%{_datadir}/fcitx/kkc/rule
%{_datadir}/icons/hicolor/64x64/apps/fcitx-kkc.png
%dir %{_includedir}/fcitx/module/kkc
%{_includedir}/fcitx/module/kkc/fcitx-kkc.h

%changelog
* Thu Jun 30 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.1.2-2
- rebuilt with new toolchain.

* Mon Jun  1 2015 IWAI, Masaharu <iwaim.sub@gmail.com> 0.1.2-1
- update to 0.1.2
- drop unnecessary patch (Patch0): upstream merged
- drop unnecessary ja.po (Source0): upstream merged

* Sat May  2 2015 IWAI, Masaharu <iwaim.sub@gmail.com> 0.1.1-2
- update ja.po from upstream
- add 'fix the check for the keymap conflict was inverted' patch (Patch0)
- clean up spec file

* Sun Jun 15 2014 IWAI, Masaharu <iwaim.sub@gmail.com> 0.1.1-1
- update to 0.1.1

* Sun Dec 22 2013 IWAI, Masaharu <iwaim.sub@gmail.com> 0.1.0-1.git51112956
- initial relase

