# Maintainer: ZDragon pkgname=blocks-that-matter pkgver=1.0.0.8 pkgrel=1 pkgdesc="Platformer with puzzle elements that form a mix of Tetris and Minecraft." url="http://www.swingswingsubmarine.com/games/blocks-that-matter/" license=('custom: "commercial"') groups=('humblevoxatronbundle' 'humblebundles') arch=('i686' 'x86_64') depends=('java-runtime' 'bash') [ "${CARCH}" = "x86_64" ] && depends=("${depends[@]}" 'lib32-libxcursor' 'lib32-libxrandr') [ "${CARCH}" = "i686" ] && depends=("${depends[@]}" 'libxcursor' 'libxrandr') [ "${CARCH}" = "x86_64" ] && optdepends=('lib32-alsa-lib: sound support' 'lib32-openal: sound support') [ "${CARCH}" = "i686" ] && optdepends=('alsa-lib: sound support' 'openal: sound support') options=(!strip) PKGEXT='.pkg.tar' source=("${pkgname}.desktop" "btm-exec" "${pkgname}-icon.png") sha256sums=('b3f9934c39624d7ac31f7de8fa660f0f150d383339fa3cea269f33442c006439' 'a5245828006404ebb4f324727fa98deb149a84b076bd24bf5b1e49443bb9c2a5' 'd6f8b24e1545009c7598be0bb0b36c40123a14210f4654813c85fbccd174c0f2') [ "${CARCH}" = "x86_64" ] && ext="x64" [ "${CARCH}" = "i686" ] && ext="x86" _gamepkg="blocks-matter_${pkgver}_${ext}.tar.gz" build() { cd "${srcdir}" msg "You need a full copy of this game in order to install it" msg "Searching for ${_gamepkg} in dir: $(readlink -f `pwd`/..)" if [[ -f "../${_gamepkg}" ]]; then msg "Found game package, installing..." ln -fs "../${_gamepkg}" . elif [ -n "${_humblevoxatronkey}" ]; then msg "Game package not found, trying to download..." rm -f index.html\?key\=${_humblevoxatronkey}* wget http://www.humblebundle.com/?key=${_humblevoxatronkey} wget $(cat index.html\?key\=${_humblevoxatronkey} | grep "${_gamepkg}" | cut -d "'" -f 10) mv ${_gamepkg}* ${_gamepkg} else msg "Game package not found and download failed." msg "You can add \'export _humblevoxatronkey\=\\' to \.bashrc if you want automated download ability." error "Please type absolute path to ${_gamepkg} (/home/joe):" read pkgpath if [[ -f "${pkgpath}/${_gamepkg}" ]]; then msg "Found game package, installing..." ln -fs "${pkgpath}/${_gamepkg}" . else error "Unable to find game package." return 1 fi fi tar zxvf ${_gamepkg} install -d "${pkgdir}/opt/${pkgname}" cp -R "${srcdir}"/blocks-matter_${pkgver}_${ext}/* "${pkgdir}/opt/${pkgname}/" #Use system-wide OpenAL library instead of the provided lib versions rm "${pkgdir}/opt/${pkgname}/libopenal64.so" rm "${pkgdir}/opt/${pkgname}/libopenal.so" chmod +rx ${pkgdir}/opt/${pkgname}/*.sh chmod +rx ${pkgdir}/opt/${pkgname}/*.so chmod +rx ${pkgdir}/opt/${pkgname}/*.jar chmod -R +rx "${pkgdir}/opt/${pkgname}/BTM_lib" chmod -R +rx "${pkgdir}/opt/${pkgname}/lib" chmod -R +rx "${pkgdir}/opt/${pkgname}/README" chmod -R +rx "${pkgdir}/opt/${pkgname}/Community" chmod -R +wrx "${pkgdir}/opt/${pkgname}/config" chmod -R +wrx "${pkgdir}/opt/${pkgname}/Blocks That Matter Save" } package(){ cd "${srcdir}" # create Launcher install -d "${pkgdir}/usr/bin/" install -D -m755 "${srcdir}/btm-exec" "${pkgdir}/usr/bin/${pkgname}" # Install Desktop File and Icon install -D -m644 "${srcdir}/${pkgname}.desktop" \ "${pkgdir}/usr/share/applications/${pkgname}.desktop" install -D -m644 "${srcdir}/${pkgname}-icon.png" \ "${pkgdir}/usr/share/icons/${pkgname}-icon.png" }