updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / supermeatboy / PKGBUILD
blob78ca678f91461e212265f7c9cd573ef4d0bf5520
1 # Maintainer: Yochai Gal <yochaigal@gmail.com>
2 pkgname=supermeatboy
3 pkgver=20111213b
4 _pkgver=12132011b
5 pkgrel=4
6 pkgdesc="Super Meat Boy is a tough as nails platformer where you play as an animated cube of meat."
7 arch=('i686' 'x86_64')
8 url="http://www.supermeatboy.com/"
9 license=('custom')
10 depends=('openal' 'sdl')
11 makedepends=('unzip' 'tar')
12 source=('supermeatboy.desktop')
13 md5sums=('ceda8cdca2aaff63a9cae2ef7d7cf0d4')
14 PKGEXT='.pkg.tar'
16 _archive_md5="e27c7a2506cbf7047f51a2230f7d1b0f"
17 hotfix_md5='65b4b39f961e7de7a4d0e018690e736d'
18 _archive="supermeatboy-linux-${_pkgver}-bin"
20 build() {
21   cd ${srcdir}
23   if [ ! -f ${_smbarchivelocation}${_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     wget http://treefort.icculus.org/smb/smb-linux-mesa-hotfix-test.tar.bz2  
38   fi
41   if [ ! -f ${_smbarchivelocation}${_archive} ]; then
42     echo "${_smbarchivelocation}${_archive} not found!"
43     return 1
44   fi  
46   if ! echo "${_archive_md5}  ${_smbarchivelocation}${_archive}" | md5sum -c --quiet; then
47     echo "Invalid checksum for ${_smbarchivelocation}${_archive}"
48     return 1
49   fi
51   if ! echo "${hotfix_md5}  ${srcdir}/smb-linux-mesa-hotfix-test.tar.bz2" | md5sum -c --quiet; then
52     echo "Invalid checksum for ${srcdir}/smb-linux-mesa-hotfix-test.tar.bz2"
53     return 1
54   fi
56   rm -Rf ${srcdir}/smb/
57   unzip -d ${srcdir}/smb/ ${_smbarchivelocation}${_archive} || true
59   rm ${srcdir}/smb/data/{amd64,x86}/lib*
60   if test "$CARCH" == "i686"; then
61     rm -r ${srcdir}/smb/data/amd64
62   else
63     rm -r ${srcdir}/smb/data/x86
64   fi
66 # Apply hotfix
68   mkdir ${srcdir}/hotfix/
69   tar -xvf ${srcdir}/smb-linux-mesa-hotfix-test.tar.bz2 -C ${srcdir}/hotfix
70   if test "$CARCH" == "i686"; then
71      cp -r ${srcdir}/hotfix/x86   ${srcdir}/smb/data/
72   else
73      cp -r ${srcdir}/hotfix/amd64/ ${srcdir}/smb/data/
74   fi
76   mkdir -p ${pkgdir}/opt/ ${pkgdir}/usr/share/applications/ \
77     ${pkgdir}/usr/bin/
78   cp -Tr ${srcdir}/smb/data ${pkgdir}/opt/supermeatboy/
79   ln -s /opt/supermeatboy/SuperMeatBoy ${pkgdir}/usr/bin/supermeatboy
80   cp ${srcdir}/supermeatboy.desktop ${pkgdir}/usr/share/applications/
81   chmod a+r ${pkgdir}/usr/share/applications/supermeatboy.desktop
84 # vim: sts=2 ts=2 sw=2 et