Skip to content

Instantly share code, notes, and snippets.

@gtmanfred
Forked from zendeavor/gist:2896079
Created June 8, 2012 17:53
Show Gist options
  • Save gtmanfred/2897215 to your computer and use it in GitHub Desktop.
Save gtmanfred/2897215 to your computer and use it in GitHub Desktop.
# Maintainer: Yochai Gal <yochaigal@gmail.com>
pkgname=supermeatboy
pkgver=06072012
pkgrel=5
pkgdesc="Super Meat Boy is a tough as nails platformer where you play as an animated cube of meat."
url="http://www.supermeatboy.com/"
license=('custom')
arch=('i686' 'x86_64')
groups=("humble-indie-bundle4" "humble-indie-bundle5" "games")
depends=('openal' 'sdl')
makedepends=('curl')
source=("${pkgname}-linux-${pkgver}-bin" "supermeatboy.desktop")
md5sums=("ceda8cdca2aaff63a9cae2ef7d7cf0d4")
PKGEXT=".pkg.tar"
_humblebundle() {
_archive="${source[0]%%:*}"
_bin="supermeatboy-linux-${pkgver}"
_md5sum="90a563ff103b4610b41af5fd2bccb21a"
# for group in "${groups[@]}"; do
# case "${group}" in
# "humble-indie-bundle"*) _key="_humblebundle${group:19}key" ;;
# *) continue ;;
# esac
if [[ -n $_humblebundle4key ]]; then
_key="_humblebundle4key"
elif [[ -n $_humblebundle5key ]]; then
_key="_humblebundle5key"
fi
if [[ -n "${_key}" ]]; then
_uri="$(curl -s http://www.humblebundle.com/downloads?key=${!_key} \
| grep "${_bin}" | cut -d "'" -f 10)"
source[0]="${_archive}::${_uri}"
else
warning "\"${_key}\" environment variable required for download handling not found."
exit 1
fi
# done
if [[ -z "${!_key}" && -f "${startdir}/${_archive}" ]]; then
error "Failed to download \"${_archive}\"."
exit 1
fi
unset _archive _key _uri
}
build() {
unzip -n "${source[0]%%:*}" -d "${srcdir}" #|| true
}
package() {
mkdir -p ${pkgdir}/opt/ ${pkgdir}/usr/share/applications/ \
${pkgdir}/usr/bin/
cp -Tr ${srcdir}/smb/data ${pkgdir}/opt/supermeatboy/
ln -s /opt/supermeatboy/SuperMeatBoy ${pkgdir}/usr/bin/supermeatboy
cp ${srcdir}/supermeatboy.desktop ${pkgdir}/usr/share/applications/
chmod a+r ${pkgdir}/usr/share/applications/supermeatboy.desktop
# some cleanup
# rm -rf ${srcdir}/smb/
# rm ${srcdir}/smb/data/{amd64,x86}/lib*
# if [[ "$CARCH" == "i686" ]]; then
# rm -rf ${srcdir}/smb/data/amd64
# else
# rm -rf ${srcdir}/smb/data/x86
# fi
}
_humblebundle
# vim: ft=PKGBUILD sts=2 ts=2 sw=2 et
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment