updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / cavestory+ / PKGBUILD
blobc6fb798f5f6290d6c0408645df61f12d74ae1a66
1 # Maintainer: Yann Kaiser <kaiser.yann@gmail.com>
2 pkgname=cavestory+
3 pkgver=1.0
4 pkgrel=5
5 pkgdesc="A platform-adventure game set in a cave"
6 arch=('i686' 'x86_64')
7 url="http://nicalis.com/games.php?game=cavestory"
8 license=('custom')
9 depends=('libgl' 'mesa' 'glibc' 'gcc-libs'
10          'libxext' 'libx11' 'libxcb' 'libxau')
11 makedepends=()
12 source=('cavestory+.sh' 'cavestory+.desktop' 'icon.png')
13 md5sums=('7d816d606a30ca7ded55489b9951d252'
14          '33f5ade058df392a17f934e6a4de8f00'
15          '2cc33b1b91383109cf1576a28215cdf7')
17 _archive_name="CaveStoryPlus"
18 _archive_md5="946a5a7315933728f9e4d56e8509bfc9"
20 _archive="${_archive_name}-linux.tar.gz"
22 build() {
23   cd ${srcdir}
25   if [ ! -f ${_csparchivelocation}${_archive} ]; then
26           if [ ! -f ${_archive} ] && [ -n "${_humblebundle4key}" ]; then
27                 rm -f ${_archive}* index.html\?key\=${_humblebundle4key}*
28                 wget http://www.humblebundle.com/?key=${_humblebundle4key}
29                 wget $(cat index.html\?key\=${_humblebundle4key} | grep "${_archive}" | cut -d "'" -f 10)
30                 mv ${_archive}* ${_archive}
31           elif [ -z "${_humblebundle4key}" ]; then
32                 echo You can automate the download of the archive using the _humblebundle4key bash variable.
33                 echo Just add \'export _humblebundle4key\=\<Your key here\>\' to \.bashrc
34                 echo
35                 echo Otherwise please just place ${_archive} into $(pwd)/
36                 echo Press Enter to continue
37                 read -a _unused
38           fi
39   fi
40   #'
42   if [ ! -f ${_csparchivelocation}${_archive} ]; then
43     echo "${_csparchivelocation}${_archive} not found!"
44     return 1
45   fi
47   if ! echo "${_archive_md5}  ${_csparchivelocation}${_archive}" | md5sum -c --quiet; then
48     echo "Invalid checksum for ${_csparchivelocation}${_archive}"
49     return 1
50   fi
52   bsdtar -xf ${_csparchivelocation}${_archive}
54   cd ${srcdir}/CaveStory+
56   rm -r lib/ lib64/
57   cp ${srcdir}/${pkgname}.sh ${srcdir}/icon.png .
59   if test "${CARCH}" == "x86_64"; then
60     rm CaveStory+
61     mv CaveStory+_64 CaveStory+
62   else
63     rm CaveStory+_64
64   fi
66   mkdir -p ${pkgdir}/opt/ ${pkgdir}/usr/bin/ \
67     ${pkgdir}/usr/share/applications
68   cp -r . ${pkgdir}/opt/${_archive_name}
69   cp ${srcdir}/${pkgname}.desktop ${pkgdir}/usr/share/applications/
70   ln -s /opt/${_archive_name}/${pkgname}.sh \
71     ${pkgdir}/usr/bin/${pkgname}
72   chmod a+r ${pkgdir}/usr/share/applications/${pkgname}.desktop \
73     ${pkgdir}/opt/${_archive_name}/icon.png
76 # vim: et ts=2 sw=2 sts=2