1 # Maintainer: Gadget3000 <gadget3000 at msn dot com>
6 pkgdesc="A 2D physics-based video game in which you swing large melee weapons to destroy enemies"
8 url="http://www.koshutin.com/"
10 groups=('humblebundle3' 'humblebundle4' 'humblebundles')
11 makedepends=('unzip' 'imagemagick')
12 source=(hammerfight.desktop)
13 md5sums=('e23ba95fa5623d37bdd0f3b520e36343')
14 install=('hammerfight.install')
15 depends=('openal' 'gcc-libs' 'sdl' 'hicolor-icon-theme')
17 _archive="hf-linux-08122011-bin"
18 _archive_md5="73b3824c3a199a646f19d5a952fc1c44"
21 install -Dd ${srcdir}/extractedInstaller
24 if [ ! -f ${_hammerfightarchivelocation}${_archive} ]; then
25 if [ -n "${_hammerfightarchivelocation}" ] && [ $(echo ${_hammerfightarchivelocation} | rev | cut -c 1) != "/" ]; then
26 echo _hammerfightarchivelocation must end in /
29 if [ ! -f ${_archive} ] && [ -n "${_humblebundle3key}" ]; then
30 rm -f ${_archive}* index.html\?key\=${_humblebundle3key}*
31 wget http://www.humblebundle.com/?key=${_humblebundle3key}
32 wget $(cat index.html\?key\=${_humblebundle3key} | grep "${_archive}" | cut -d "'" -f 10)
33 mv ${_archive}* ${_archive}
34 elif [ ! -f ${_archive} ] && [ -n "${_humblebundle4key}" ]; then
35 rm -f ${_archive}* index.html\?key\=${_humblebundle4key}*
36 wget http://www.humblebundle.com/?key=${_humblebundle4key}
37 wget $(cat index.html\?key\=${_humblebundle4key} | grep "${_archive}" | cut -d "'" -f 10)
38 mv ${_archive}* ${_archive}
39 elif [ -z "${_humblebundle3key}" ] && [ -z "${_humblebundle4key}" ]; then
40 echo You can now automate the download of the archive using the _humblebundle3key or _humblebundle4key bash variables.
41 echo Just add \'export _humblebundle3key\=\<Your key here\>\' and/or
42 echo \'export _humblebundle4key\=\<Your key here\>\' to \.bashrc
44 echo Otherwise please just place ${_archive} into $(pwd)/
45 echo Press Enter to continue
50 if [ ! -f ${_hammerfightarchivelocation}${_archive} ]; then
51 echo "${_hammerfightarchivelocation}${_archive} not found!"
55 if ! echo "${_archive_md5} ${_hammerfightarchivelocation}${_archive}" | md5sum -c --quiet; then
56 echo "Invalid checksum for ${_hammerfightarchivelocation}${_archive}"
60 install -Dd ${pkgdir}/opt/
61 unzip -qqo ${_hammerfightarchivelocation}${_archive} -x guis/* meta/* scripts/* -d ${srcdir}/extractedInstaller/ && msg Finished Extracting
62 install -Dd ${pkgdir}/opt/hammerfight
63 mv ${srcdir}/extractedInstaller/data/* ${pkgdir}/opt/hammerfight/
65 rm -rf ${pkgdir}/opt/hammerfight/{amd64,x86}
67 install -Dd ${pkgdir}/usr/bin
68 echo \#\!/bin/bash > ${pkgdir}/usr/bin/hammerfight
69 echo /opt/hammerfight/Hammerfight >> ${pkgdir}/usr/bin/hammerfight
70 chmod +x ${pkgdir}/usr/bin/hammerfight
72 if [ "$CARCH" = "x86_64" ]; then
73 rm -rf ${pkgdir}/opt/hammerfight/Hammerfight-x86
75 rm -rf ${pkgdir}/opt/hammerfight/Hammerfight-amd64
78 for i in 16x16 22x22 32x32 48x48 64x64 128x128; do
79 mkdir -p ${pkgdir}/usr/share/icons/hicolor/${i}/apps
80 convert -resize ${i} \
81 ${pkgdir}/opt/hammerfight/hammerfight.png \
82 ${pkgdir}/usr/share/icons/hicolor/${i}/apps/hammerfight.png
85 install -D ${srcdir}/hammerfight.desktop ${pkgdir}/usr/share/applications/hammerfight.desktop