updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / lua-mongo / PKGBUILD
blob6eb9b599641a8a586542de3e8bc8526b825ab5c0
1 # Contributor: Kun Wang <ifreedom.dot.cn.at.gmail.dot.com>
3 pkgname=lua-mongo
4 pkgver=20111120
5 pkgrel=1
6 pkgdesc="Lua driver for mongodb"
7 arch=('i686' 'x86_64')
8 # groups=('')
9 url="https://github.com/moai/luamongo"
10 license=('MIT')
11 depends=('boost' 'mongodb')
12 makedepends=('git')
13 # conflicts=('')
14 # provides=('')
15 # replaces=('')
16 options=('!libtool')
17 source=(diff.patch)
18 md5sums=('009aa158578ce80c9b88c8aeb97607ef')
20 _gitroot="git://github.com/moai/luamongo.git"
21 _gitname="luamongo"
22 _build_dir="$srcdir/$_gitname-build"
24 prepare_build_dir() {
25   cd "$srcdir"
27   if [ $NOEXTRACT -eq 0 ]; then
28           msg "Connecting to GIT server...."
29           if [ -d $_gitname ] ; then
30                   cd $_gitname && git pull origin
31                   msg "The local files are updated."
32                   cd "$srcdir"
33           else
34                   git clone $_gitroot $_gitname
35           fi
37           msg "GIT checkout done or server timeout"
38   fi
40   rm -rf "$_build_dir"
41   git clone "$_gitname" "$_build_dir"
44 build() {
45   prepare_build_dir
46   cd "$_build_dir"
47   msg "Building..."
49   patch -p1 <../diff.patch
50   make || return 1
53 package(){
54   cd "$_build_dir"
56   mkdir -p "$pkgdir/usr/lib/lua/5.1"
57   cp mongo.so "$pkgdir/usr/lib/lua/5.1/"
59   rm -rf "$_build_dir"