updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / ibus-pinyin-libpinyin-git / PKGBUILD
blob0c9a30c653e0361c6c26a32f295ac34504ff161d
1 # Maintainer:  Yangtse Su<yangtsesu@gmail.com>
2 # Contributor:  Jekyll Wu<adaptee [at] gmail [dot] com>
3 # Contributor: riverscn<riverscn at gmail.com>
4 # Contributor: rainy<rainylau at gmail.com>
5 # Contributor: Lee.MaRS<leemars at gmail.com>
7 pkgname=ibus-pinyin-libpinyin-git
8 pkgver=20111230
9 pkgrel=1
10 pkgdesc="The PinYin Engine for IBus Input Framework"
11 arch=('i686' 'x86_64')
12 license=('LGPL')
13 url="http://ibus.googlecode.com"
14 depends=('ibus' 'libsigc++2.0' 'python2' 'libpinyin')
15 makedepends=('git' 'intltool' 'gnome-common')
16 provides=('ibus-pinyin')
17 conflicts=('ibus-pinyin' 'ibus-pinyin-git')
18 install=ibus-pinyin.install
19 source=(http://ibus.googlecode.com/files/pinyin-database-1.2.99.tar.bz2)
20 noextract=(pinyin-database-1.2.99.tar.bz2)
21 md5sums=('d0951b8daa7f56a2cbd3b6b4e42532e0')
23 _gitname="ibus-pinyin"
24 _gitroot="git://github.com/ibus/ibus-pinyin.git"
25 _patchname="libpinyinpatch"
26 _patchroot="git://pkgs.fedoraproject.org/ibus-pinyin.git"
28 build() {
29   cd ${srcdir}
31   msg "Connecting to ${_gitname} GIT server..."
32   if [ -d ${_gitname} ]; then
33       cd ${_gitname} && git pull origin master
34       msg "The local files are updated."
35   else
36       git clone ${_gitroot}
37   fi
39   cd ${srcdir}
40   msg "Connecting to Patch GIT server..."
41   if [ -d ${_patchname} ]; then
42     cd ${_patchname} && git pull origin master
43     msg "The local files are updated."
44   else
45     git clone ${_patchroot} ${_patchname}
46   fi
48   msg "GIT checkout done or server timeout. Preparing sources..."
49   rm -rf "${srcdir}/${_gitname}-build"
50   cp -r "${srcdir}/${_gitname}" "${srcdir}/${_gitname}-build"
51   ln -s "${srcdir}/pinyin-database-1.2.99.tar.bz2" "${srcdir}/${_gitname}-build/data/db/open-phrase"
53   msg "Starting make..."
54   cd "${srcdir}/${_gitname}-build"
56   patch -Np1 -i ${srcdir}/${_patchname}/ibus-pinyin-libpinyin-integration.patch
57   patch -Np1 -i ${srcdir}/${_patchname}/ibus-pinyin-xx-icon-symbol.patch
58   # python2 fix
59   for file in $(find . -name '*.py' -print); do
60     sed -i 's_^#!.*/usr/bin/python_#!/usr/bin/python2_' $file
61     sed -i 's_^#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' $file
62   done
64   for file in setup/ibus-setup-pinyin.in; do
65     sed -i 's_exec python_exec python2_' $file
66   done
68   ./autogen.sh --break-configure || :
69   ./configure \
70     PYTHON=/usr/bin/python2 \
71     --prefix=/usr \
72     --libexecdir=/usr/lib/ibus \
73     --disable-boost \
74     --enable-db-open-phrase || return 1
76   make || return 1
79 package() {
80   cd "${srcdir}/${_gitname}-build"
81   make NO_INDEX=true DESTDIR=${pkgdir} install || return 1