# $Id: PKGBUILD 107366 2014-03-17 08:38:37Z fyan $
# Maintainer: Felix Yan <felixonmars@gmail.com>
# Contributor: coderoar <coderoar@gmail.com>
# Contributor: leemars <leemars@gmail.com>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=ibus-table
pkgver=1.5.0
pkgrel=3
pkgdesc='IM Engine framework for table-based input methods, such as ZhengMa, WuBi, ErBi, CangJie and so on'
arch=('any')
url="http://code.google.com/p/ibus/"
license=('LGPL')
makedepends=('git')
depends=('python2-pyenchant' 'ibus' 'aspell-en')
source=("git+https://github.com/kaio/ibus-table.git#tag=$pkgver"
        fix-self-update_property.patch)
sha512sums=('SKIP'
            'ecb1f89ff946309314789aee4b5eb0749a18e881700482df64d1da30ddd438bb115c814fbd67c6c063c6cfdd28a3882aaf6dfdd291e651315ff6f7b58ce5f3ad')

build() {
  cd ${pkgname}

  # python2 fix
  find -type f -exec sed -i -e 's_exec python_exec python2_' -e 's_^#!.*/usr/bin/python_#!/usr/bin/python2_' -e 's_^#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' {} \;

  patch -p1 -i "$srcdir/fix-self-update_property.patch"

  PYTHON=/usr/bin/python2 ./autogen.sh \
    --prefix=/usr \
    --libexecdir=/usr/lib/ibus

  make
}

package() {
  cd ${pkgname}

  make DESTDIR="${pkgdir}" install
}

