updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / andyetitmoves / PKGBUILD
blob3fda18d90972ecc7af20937d60dbef65811f002f
1 # Maintainer: jose <jose1711 [at] gmail (dot) com>
3 pkgname=andyetitmoves
4 pkgver=1.2.2
5 pkgrel=2
6 pkgdesc="physics-based platform game (full version)"
7 arch=('i686' 'x86_64')
8 url="http://www.andyetitmoves.net/"
9 license=("custom:shareware")
10 source=("andyetitmoves.desktop")
11 depends=("mesa" "libxft" "sdl_image" "libvorbis" "libpng12")
12 options=('!strip')
13 md5sums=('4f4792260832fe1b52ca8150a03ca176')
15 [ "$CARCH" = "i686"   ] && depends=(${depends[@]} openal libtheora)
16 [ "$CARCH" = "x86_64" ] && depends=(${depends[@]} lib32-openal lib32-libtheora lib32-libpng12 lib32-libvorbis lib32-sdl_image)
18 [ "$CARCH" = "i686"   ] && gamepkg="andyetitmoves-${pkgver}-1_i386.tar.gz"
19 [ "$CARCH" = "x86_64" ] && gamepkg="andyetitmoves-${pkgver}-1_x86_64.tar.gz"
21 [ "$CARCH" = "i686"   ] && gamesum='c530630520f062db1d402d99fb25a725'
22 [ "$CARCH" = "x86_64" ] && gamesum='86544c86a117a653221c38ebfa58c68d'
24 build() {
25    cd ${srcdir}
26   
27    msg "You need a full copy of this game in order to install it"
28    msg "Searching for ${gamepkg} in dir: \"$startdir\""
29          pkgpath=$startdir
30    if [[ ! -f "$startdir/${gamepkg}" ]]; then
31            error "Game package not found, please type absolute path to \"${gamepkg}\" (/home/joe/downloads) or enter HIB key (e. g. abcdefgh1234):"
32        read pkgpath
33        if echo ${pkgpath} | egrep -q "^\s*/"; then
34                if [[ ! -f "${pkgpath}/${gamepkg}" ]]; then
35                    error "Unable to find game package." && return 1
36                fi
37        else
38                key=${pkgpath}
39                echo "your key is: ${key}"
40                pkgpath=$startdir
41                downurl=$(wget -qO - http://www.humblebundle.com/?key=${key} | sed -n '/'${gamepkg}'/s/.* href='\''\(.*\)'\'' data-web=.*/\1/p')
42                 echo $downurl
43                if [ -z "${downurl}" ]; then
44                        error "provided key seems to be invalid or something has changed on hib website"
45                        return 1
46                fi
47                wget -O ${pkgpath}/${gamepkg} "${downurl}" || rm ${pkgpath}/${gamepkg}
48        fi
49     fi
50     if [ "$(/usr/bin/md5sum ${pkgpath}/${gamepkg} | awk '{print $1}')" != ${gamesum} ]; then
51             error  "md5sum does not match"
52             return 1
53     fi
54     msg "Found game package, installing."
55     tar xvf ${pkgpath}/${gamepkg}
58 package() {
59   cd $srcdir
60   cd $srcdir/AndYetItMoves
61   mkdir -p $pkgdir/usr/{share/AndYetItMoves,bin}
62   /bin/tar cf - * | ( cd ../../pkg/usr/share/AndYetItMoves/; tar xfp - )
63   ln -s /usr/share/AndYetItMoves/AndYetItMoves $pkgdir/usr/bin/AndYetItMoves
64   install -D -m644 icons/48x48.png $pkgdir/usr/share/pixmaps/andyetitmoves.png
65   install -D -m644 $srcdir/andyetitmoves.desktop $pkgdir/usr/share/applications/andyetitmoves.desktop