1 # Maintainer: Wido <widowild at myopera dot com>
3 # a PKGBUILD is now compatible with:
5 # Official Store http://store.zachtronicsindustries.com/product/spacechem
6 # Store Gameolith http://www.gameolith.com/game/spacechem/
7 # The Humble Idie Bundle http://www.humblebundle.com/
12 _pkgver=1012-1 # Just for HIB
14 pkgdesc="an obscenely addictive, design-based puzzle game about building machines and fighting monsters in the name of science!"
15 url="http://www.gameolith.com/game/spacechem/"
16 license=('custom: "commercial"')
17 arch=('i686' 'x86_64')
19 groups=('humblefsbundle' 'humblebundles')
21 source=('spacechem.sh'
23 md5sums=('dff2d4a980e324c46198fb9193a23099'
24 'b458899c445a8baa8238b9594ebee6c1')
26 if [[ $CARCH == x86_64 ]]; then
27 _gamepkg="${pkgname}_${pkgver}_amd64.tar.gz"
28 _gamepkg2="${_pkgname}-${pkgver}.tar.gz"
29 _gamepkg3="${_pkgname}-${_pkgver}-hib.tar.gz"
31 _gamepkg="${pkgname}_${pkgver}_i386.tar.gz"
32 _gamepkg2="${_pkgname}-${pkgver}.tar.gz"
33 _gamepkg3="${_pkgname}-${_pkgver}-hib.tar.gz"
36 depends=('mono' 'sdl' 'sdl_image' 'sdl_mixer' 'xclip')
40 msg "You need a full copy of this game in order to install it"
41 msg "Searching for ${_gamepkg} or ${_gamepkg2} or ${_gamepkg3} in dir: \"$srcdir\""
44 if [ ! -f ${_gamepkg3} ] && [ -n "${_humblefsbundlekey}" ]; then
45 rm -f ${_archive}* index.html\?key\=${_humblefsbundlekey}*
46 wget http://www.humblebundle.com/?key=${_humblefsbundlekey}
47 wget $(cat index.html\?key\=${_humblefsbundlekey} | grep "${_gamepkg3}" | cut -d "'" -f 10)
48 mv ${_gamepkg3}* ${_gamepkg3}
51 if [[ ! -f "$srcdir/${_gamepkg}" ]] && [[ ! -f "$srcdir/${_gamepkg2}" ]] && [[ ! -f "$srcdir/${_gamepkg3}" ]]; then
52 error "Game package not found, please type absolute path to ${_gamepkg} or ${_gamepkg2} or ${_gamepkg3} (/home/joe):"
54 if [[ ! -f "${pkgpath}/${_gamepkg}" ]] && [[ ! -f "${pkgpath}/${_gamepkg2}" ]] && [[ ! -f "${pkgpath}/${_gamepkg3}" ]] ; then
55 error "Unable to find game package." && return 1
58 msg "Found game package, installing..."
62 if [[ -f ${pkgpath}/${_gamepkg} ]] ; then
63 tar xvf ${pkgpath}/${_gamepkg} -C ${srcdir} || return 1
64 install -d ${pkgdir}/opt/${pkgname}
65 cp -R ${srcdir}/* ${pkgdir}/opt/${pkgname}/
68 rm ${pkgdir}/opt/${pkgname}/${_gamepkg}
69 rm ${pkgdir}/opt/${pkgname}/${pkgname}.desktop
70 rm ${pkgdir}/opt/${pkgname}/${pkgname}.sh
76 if [[ -f ${pkgpath}/${_gamepkg2} ]] ; then
77 tar xvf ${pkgpath}/${_gamepkg2} -C ${srcdir} || return 1
78 ar x ${srcdir}/${_pkgname}-i386.deb
79 tar -zxf ${srcdir}/data.tar.gz
81 install -d ${pkgdir}/opt/${pkgname}
82 cp -R ${srcdir}/opt/zachtronicsindustries/${pkgname}/* ${pkgdir}/opt/${pkgname}/
85 ## Humble Indie Bundle
87 if [[ -f ${pkgpath}/${_gamepkg3} ]] ; then
88 tar xvf ${pkgpath}/${_gamepkg3} -C $srcdir|| return 1
89 ar x ${srcdir}/${_pkgname}-i386.deb
90 tar -zxf ${srcdir}/data.tar.gz
92 install -d ${pkgdir}/opt/${pkgname}
93 cp -R ${srcdir}/opt/zachtronicsindustries/${pkgname}/* ${pkgdir}/opt/${pkgname}/
101 install -Dm 755 ${srcdir}/${pkgname}.sh ${pkgdir}/usr/bin/${pkgname}
104 install -D -m644 ${srcdir}/${pkgname}.desktop \
105 ${pkgdir}/usr/share/applications/${pkgname}.desktop
108 install -Dm 644 ${pkgdir}/opt/${pkgname}/readme/LICENSE.txt ${pkgdir}/usr/share/licenses/${pkgname}/license