updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / bittriprunner / PKGBUILD
blobaf7511ccc3d283fa0fa1b310e9a86a972704bb32
1 # Maintainer: Yann Kaiser <kaiser.yann@gmail.com>
2 pkgname=bittriprunner
3 pkgver=1.0
4 pkgrel=1
5 pkgdesc="Rhythm-based action platformer"
6 arch=('i686' 'x86_64')
7 url="http://bittripgame.com/bittrip-runner.html"
8 license=('custom')
9 depends=('sdl' 'libgl' 'openal' 'libvorbis' 'libogg' 'zlib')
10 makedepends=()
11 source=('bittriprunner.desktop' 'bittriprunner.sh')
12 md5sums=('a3b58d3afad9b24f29c1e49e0c649a36'
13          '3f4cf7688a32a688fb1b9ce9fb4fc8f8')
15 _archive_name="bit.trip.runner"
16 if test "${CARCH}" == "x86_64"; then
17   _archive_arch="amd64"
18   _archive_md5="ba315db4752f1397d0577b63aea7cb34"
19 else
20   _archive_arch="i386"
21   _archive_md5="62bb8c0b411a0edba9f5d6d7ddc50962"
24 _archive="${_archive_name}_${_archive_arch}.tar.gz"
26 build() {
27   cd ${srcdir}
29   if [ ! -f ${_btrarchivelocation}${_archive} ]; then
30           if [ ! -f ${_archive} ] && [ -n "${_humblebundle4key}" ]; then
31                 rm -f ${_archive}* index.html\?key\=${_humblebundle4key}*
32                 wget http://www.humblebundle.com/?key=${_humblebundle4key}
33                 wget $(cat index.html\?key\=${_humblebundle4key} | grep "${_archive}" | cut -d "'" -f 10)
34                 mv ${_archive}* ${_archive}
35           elif [ -z "${_humblebundle4key}" ]; then
36                 echo You can automate the download of the archive using the _humblebundle4key bash variable.
37                 echo Just add \'export _humblebundle4key\=\<Your key here\>\' to \.bashrc
38                 echo
39                 echo Otherwise please just place ${_archive} into $(pwd)/
40                 echo Press Enter to continue
41                 read -a _unused
42           fi
43   fi
45   if [ ! -f ${_btrarchivelocation}${_archive} ]; then
46     echo "${_btrarchivelocation}${_archive} not found!"
47     return 1
48   fi
50   if ! echo "${_archive_md5}  ${_btrarchivelocation}${_archive}" | md5sum -c --quiet; then
51     echo "Invalid checksum for ${_btrarchivelocation}${_archive}"
52     return 1
53   fi
55   bsdtar -xf ${_btrarchivelocation}${_archive}
57   mkdir -p ${pkgdir}/opt/ ${pkgdir}/usr/bin/ \
58     ${pkgdir}/usr/share/applications
59   cp -r ${srcdir}/${_archive_name}-${pkgver}/${_archive_name}/ ${pkgdir}/opt/
60   cp ${srcdir}/${pkgname}.desktop ${pkgdir}/usr/share/applications/
61   cp ${srcdir}/${pkgname}.sh ${pkgdir}/opt/${_archive_name}/
62   ln -s /opt/${_archive_name}/${pkgname}.sh \
63     ${pkgdir}/usr/bin/${pkgname}
64   chmod a+rx ${pkgdir}/opt/${_archive_name}/${pkgname}.sh
65   chmod a+r ${pkgdir}/usr/share/applications/${pkgname}.desktop
68 # vim: et ts=2 sw=2 sts=2