updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / nightsky-game / PKGBUILD
blobf4bde75338630e71070dda1df47e41228593bfe0
1 # Maintainer: Yann Kaiser <kaiser.yann@gmail.com>
2 pkgname=nightsky-game
3 pkgver=1.0.0
4 _pkgver=1324519044
5 pkgrel=3
6 pkgdesc="A 2D platformer in which you control a ball"
7 arch=('i686' 'x86_64')
8 url="http://www.nicalis.com/nightsky/"
9 license=('custom')
10 depends=('libgl' 'libvorbis' 'mesa' 'zlib')
11 makedepends=()
12 source=('nightsky-game.sh' 'nightsky-game.desktop')
13 md5sums=('6dc6459dbed8d42396320b4560c3605d'
14          'a2abc9a74a21b99574bf51ad5f8b6f1b')
16 _archive_name="NightSky"
17 _archive_md5="73a937ffb5dfd5fc9ba95efacba0a25f"
18 _archive="nightskyhd-linux-${_pkgver}.tar.gz"
20 build() {
21   cd ${srcdir}
23   if [ ! -f ${_nightskyarchivelocation}${_archive} ]; then
24           if [ ! -f ${_archive} ] && [ -n "${_humblebundle4key}" ]; then
25                 rm -f ${_archive}* index.html\?key\=${_humblebundle4key}*
26                 wget http://www.humblebundle.com/?key=${_humblebundle4key}
27                 wget $(cat index.html\?key\=${_humblebundle4key} | grep "${_archive}" | cut -d "'" -f 10)
28                 mv ${_archive}* ${_archive}
29           elif [ -z "${_humblebundle4key}" ]; then
30                 echo You can automate the download of the archive using the _humblebundle4key bash variable.
31                 echo Just add \'export _humblebundle4key\=\<Your key here\>\' to \.bashrc
32                 echo
33                 echo Otherwise please just place ${_archive} into $(pwd)/
34                 echo Press Enter to continue
35                 read -a _unused
36           fi
37   fi
38   #'
40   if [ ! -f ${_nightskyarchivelocation}${_archive} ]; then
41     echo "${_nightskyarchivelocation}${_archive} not found!"
42     return 1
43   fi
45   if ! echo "${_archive_md5}  ${_nightskyarchivelocation}${_archive}" | md5sum -c --quiet; then
46     echo "Invalid checksum for ${_nightskyarchivelocation}${_archive}"
47     return 1
48   fi
50   bsdtar -xf ${_nightskyarchivelocation}${_archive}
52   cd ${srcdir}/${_archive_name}
54   rm lib/lib{vorbis,vorbisfile,ogg}.so*
55   if test "${CARCH}" == "x86_64"; then
56     rm ${_archive_name}HD
57     mv ${_archive_name}HD_64 ${_archive_name}HD
58     rm -R lib
59   else
60     rm ${_archive_name}HD_64
61     rm -R lib64
62   fi
64   cp ${srcdir}/${pkgname}.sh ${srcdir}/${_archive_name}/
66   mkdir -p ${pkgdir}/opt/ ${pkgdir}/usr/bin/ \
67     ${pkgdir}/usr/share/applications
68   cp -r ${srcdir}/${_archive_name} ${pkgdir}/opt/NightSkyHD
69   cp ${srcdir}/${pkgname}.desktop ${pkgdir}/usr/share/applications/
70   ln -s /opt/NightSkyHD/${pkgname}.sh \
71     ${pkgdir}/usr/bin/${pkgname}
72   chmod a+r ${pkgdir}/usr/share/applications/${pkgname}.desktop
73   chmod a+x ${pkgdir}/opt/NightSkyHD/${pkgname}.sh
76 # vim: et ts=2 sw=2 sts=2