updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / voxatron / PKGBUILD
blobbbfea5bdc63f7f22f23ad44c35ddaa0655c034eb
1 # Maintainer: Zachary A. Jones <JazzplayerL9@gmail.com>
3 pkgname=voxatron
4 pkgver=0.1.6
5 pkgrel=2
6 pkgdesc="Voxatron is an action/adventure game set in a world completely made of tiny cubes that can be blasted to smithereens"
7 url="http://www.lexaloffle.com/voxatron.php"
8 license=('custom: "commercial"')
9 groups=('humblevoxatronbundle' 'humblebundles')
10 arch=('i686' 'x86_64')
11 [ "${CARCH}" = "x86_64" ] && depends=('lib32-libgl' 'lib32-sdl')
12 [ "${CARCH}" = "i686" ] && depends=('libgl' 'sdl')
13 [ "${CARCH}" = "x86_64" ] && optdepends=('lib32-alsa-lib: sound support' 'lib32-libpulse: sound suport')
14 [ "${CARCH}" = "i686" ] && optdepends=('alsa-lib: sound support' 'libpulse: sound support')
15 options=(!strip)
16 source=("${pkgname}.desktop" "vox-exec" "voxicon.png")
17 md5sums=('184c021b52d3a9c8ac5f49435b4b93e0'
18          'bb84f6fcd7cdb18eb417173a6f58e00e'
19          '473215a7749bb2268bdc2b654d7e85d5')
21 _gamepkg="${pkgname}_${pkgver}_i386.tar.gz"
23 build() {
24    cd "${srcdir}"
25    msg "You need a full copy of this game in order to install it"
26    msg "Searching for ${_gamepkg} in dir: $(readlink -f `pwd`/..)"
27    if [[ -f "../${_gamepkg}" ]]; then
28        msg "Found game package, installing..."
29        ln -fs "../${_gamepkg}" .
30    elif [ -n "${_humblevoxatronkey}" ]; then
31            msg "Game package not found, trying to download..."
32            rm -f index.html\?key\=${_humblevoxatronkey}*
33            wget http://www.humblebundle.com/?key=${_humblevoxatronkey}
34            wget $(cat index.html\?key\=${_humblevoxatronkey} | grep "${_gamepkg}" | cut -d "'" -f 10)
35            mv ${_gamepkg}* ${_gamepkg}
36    else
37            msg "Game package not found and download failed."
38            msg "You can add \'export _humblevoxatronkey\=\<Your key here\>\' to \.bashrc if you want automated download ability."
39        error "Please type absolute path to ${_gamepkg} (/home/joe):"
40        read pkgpath
41        if [[ -f "${pkgpath}/${_gamepkg}" ]]; then
42            msg "Found game package, installing..."
43                    ln -fs "${pkgpath}/${_gamepkg}" .
44            else
45                error "Unable to find game package."
46                return 1
47        fi
48    fi
49    tar zxvf ${_gamepkg}
50    install -d "${pkgdir}/opt/${pkgname}"
51    rm "${srcdir}/${pkgname}/libSDL-1.2.so.0"
52    cp -R "${srcdir}"/${pkgname}/* "${pkgdir}/opt/${pkgname}/"
55 package(){
56   cd "${srcdir}"
57   # create Launcher
58   install -d "${pkgdir}/usr/bin/"
59   install -D -m755 "${srcdir}/vox-exec" "${pkgdir}/usr/bin/${pkgname}"
60   # Install Desktop File and Icon
61   install -D -m644 "${srcdir}/${pkgname}.desktop" \
62         "${pkgdir}/usr/share/applications/${pkgname}.desktop"
63   install -D -m644 "${srcdir}/voxicon.png" \
64                 "${pkgdir}/usr/share/icons/${pkgname}-icon.png"
65   # Install license
66   install -Dm 644 "${pkgdir}"/opt/${pkgname}/license.txt "${pkgdir}"/usr/share/licenses/${pkgname}/license