updated on Thu Jan 19 00:16:31 UTC 2012
[aur-mirror.git] / chunkymonkey-git / PKGBUILD
blob77cb2b582e37fc0aaf947091e58a290b56227079
1 # Maintainer: tang0th <tang0th@gmx.com>
2 pkgname=chunkymonkey-git
3 pkgver=20111024
4 pkgrel=1
5 pkgdesc="A Minecraft Server written in Google Go"
6 arch=(any)
7 url="http://github.com/huin/chunkymonkey"
8 license=('MIT')
9 depends=('go')
10 makedepends=('git' 'godag-hg')
12 _gitroot="git://github.com/huin/chunkymonkey.git"
13 _gitname="chunkymonkey"
15 build() {
16   cd "$srcdir"
17   msg "Connecting to GIT server...."
19   if [[ -d "$_gitname" ]]; then
20     cd "$_gitname" && git pull origin
21     msg "The local files are updated."
22   else
23     git clone "$_gitroot" "$_gitname"
24   fi
26   msg "GIT checkout done or server timeout"
27   msg "Starting build..."
29   if [[ "$CARCH" == "i686" ]]; then
30       export GOARCH=386
31   else
32       export GOARCH=amd64
33   fi
35   cd "$srcdir/chunkymonkey"
37   make
40 package() {
41   msg "Let's pack up this crate :)"
42   cd "$srcdir/$_gitname"
43   mkdir -p $pkgdir/usr/bin/
44   mkdir -p $pkgdir/usr/share/chunkymonkey/
45   mkdir -p $pkgdir/usr/share/chunkymonkey/bin/
46   install -m 554 bin/{chunkymonkey,datatests,inspectlevel,intercept,noise,replay,style,readme.md} $pkgdir/usr/share/chunkymonkey/bin/
47   install -m 664 {blocks.json,CREDITS.md,DESIGN.md,furnace.json,groups.json,items.json,LICENSE,README.md,recipes.json,users.json} $pkgdir/usr/share/chunkymonkey/
48   echo "#!/bin/bash" >> $pkgdir/usr/bin/chunkymonkey
49   echo "cd /usr/share/chunkymonkey/" >> $pkgdir/usr/bin/chunkymonkey
50   echo "exec bin/chunkymonkey $1 $2 $3 $4 $5 $6 $7 $8 $9" >> $pkgdir/usr/bin/chunkymonkey
51   chmod +x $pkgdir/usr/bin/chunkymonkey