Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 11th, 2011  |  syntax: Bash  |  size: 2.79 KB  |  views: 115  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Maintainer: Gadget3000 <gadget3000 at msn dot com>
  2.  
  3. pkgname=hammerfight
  4. pkgver=20111707
  5. pkgrel=6
  6. pkgdesc="A 2D physics-based video game in which you swing large melee weapons to destroy enemies"
  7. arch=('i686' 'x86_64')
  8. url="http://www.koshutin.com/"
  9. license=('unknown')
  10. groups=('humblebundle3' 'humblebundles')
  11. makedepends=('unzip' 'imagemagick')
  12. source=(hammerfight.desktop)
  13. md5sums=('e23ba95fa5623d37bdd0f3b520e36343')
  14. install=('hammerfight.install')
  15. if [ "$CARCH" = "x86_64" ]; then
  16.         depends=('lib32-openal' 'lib32-gcc-libs' 'lib32-sdl' 'hicolor-icon-theme')
  17. else
  18.         depends=('openal' 'gcc-libs' 'sdl' 'hicolor-icon-theme')
  19. fi
  20.  
  21. _archive_file="hf-linux-07172011-bin"
  22. if [ ! -d ${_humblebundle3dir} ] || [ ! -f ${_humblebundle3dir}/${_archive_file} ]; then
  23.   _humblebundle3dir=${srcdir}
  24. fi
  25. _archive=${_humblebundle3dir}/${_archive_file}
  26. _archive_md5="4b979c6d0741aa0626018cf451309c25"
  27.  
  28. build() {
  29.   install -Dd ${srcdir}/extractedInstaller
  30.   cd $srcdir
  31.  
  32.   if [ ! -f ${_archive} ]; then
  33.     if [ -n "${_humblebundle3key}" ]; then
  34.       rm -f ${_archive}* index.html\?key\=${_humblebundle3key}*
  35.       wget http://www.humblebundle.com/?key=${_humblebundle3key}
  36.       wget $(cat index.html\?key\=${_humblebundle3key} | grep "${_archive_file}" | cut -d "'" -f 10)
  37.       mv ${_archive}* ${_archive}
  38.     else
  39.       echo You can now automate the download of the archive using the _humblebundle3key bash variable.
  40.       echo Just add \'export _humblebundle3key\=\<Your key here\>\' to \.bashrc
  41.       echo
  42.       echo Otherwise please just place ${_archive_file} into ${srcdir}/ or
  43.       echo "export _humblebundledir3=<Your dir here> and place ${_archive_file} there"
  44.       echo Press Enter to continue
  45.       read -a _unused
  46.         fi
  47.   fi
  48.  
  49.   if [ ! -f ${_archive} ]; then
  50.     echo "${_archive} not found!"
  51.     return 1
  52.   fi
  53.  
  54.   if ! echo "${_archive_md5}  ${_archive}" | md5sum -c --quiet; then
  55.     echo "Invalid checksum for ${_archive}"
  56.     return 1
  57.   fi
  58.  
  59.   install -Dd ${pkgdir}/opt/
  60.   unzip -qqo ${_archive} -x guis/* meta/* scripts/* -d ${srcdir}/extractedInstaller/ && msg Finished Extracting
  61.   install -Dd ${pkgdir}/opt/hammerfight
  62.   mv ${srcdir}/extractedInstaller/data/* ${pkgdir}/opt/hammerfight/
  63.  
  64.   rm -r ${pkgdir}/opt/hammerfight/lib*
  65.  
  66.   install -Dd ${pkgdir}/usr/bin
  67.   echo \#\!/bin/bash > ${pkgdir}/usr/bin/hammerfight
  68.   echo /opt/hammerfight/Hammerfight >> ${pkgdir}/usr/bin/hammerfight
  69.   chmod +x ${pkgdir}/usr/bin/hammerfight
  70.  
  71.   for i in 16x16 22x22 32x32 48x48 64x64 128x128; do
  72.     mkdir -p ${pkgdir}/usr/share/icons/hicolor/${i}/apps
  73.     convert -resize ${i} \
  74.         ${pkgdir}/opt/hammerfight/hammerfight.png \
  75.         ${pkgdir}/usr/share/icons/hicolor/${i}/apps/hammerfight.png
  76.   done
  77.  
  78.   install -D ${srcdir}/hammerfight.desktop ${pkgdir}/usr/share/applications/hammerfight.desktop
  79. }