summaryrefslogtreecommitdiff
path: root/community/ibus-sunpinyin/PKGBUILD
blob: d15c4ae9c976c599b00454dfb9e93ffcbc564a21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# $Id: PKGBUILD 79729 2012-11-11 16:11:46Z fyan $
# Maintainer: Felix Yan <felixonmars@gmail.com>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=ibus-sunpinyin
pkgver=2.0.3.20121107
_commit=cf3fe3d7aa5bb7aa6aa5b870a759af468b6d5b2b
pkgrel=2
pkgdesc="IBus Wrapper for sunpinyin."
arch=('i686' 'x86_64' 'mips64el')
url="http://sunpinyin.googlecode.com"
license=('LGPL')
depends=('sunpinyin>2.0.3' 'ibus')
makedepends=('git' 'scons')

__gitroot=git://github.com/sunpinyin/sunpinyin.git
__gitname=sunpinyin

build() {
  cd "$srcdir"
  msg "Connecting to GIT server...."

  if [ -d $__gitname ] ; then
    cd $__gitname && git pull origin
    msg "The local files are updated."
  else
    git clone $__gitroot
  fi

  msg "GIT checkout done or server timeout"
  msg "Starting make..."

  rm -rf "$srcdir/$__gitname-build"
  git clone "$srcdir/$__gitname" "$srcdir/$__gitname-build"
  cd "$srcdir/$__gitname-build"
  git checkout "$_commit"

  cd "$srcdir/$__gitname-build/wrapper/ibus"
  sed -i -e "s|python|python2|" setup/ibus-setup-sunpinyin.in
  
  scons \
    --prefix=/usr
}

package() {
  cd "$srcdir/$__gitname-build/wrapper/ibus"

  scons \
    --prefix=/usr \
    --install-sandbox="$pkgdir" \
    install
}