1 # Maintainer: Naelstrof <naelstrof at gmail dot com>
2 pkgname=defcon-humblebundle
7 url="http://www.humblebundle.com/"
9 groups=('humblebundle')
10 depends=(libgl mesa libvorbis sdl)
11 source=('defcon.desktop')
12 md5sums=('4d2d32e8fd9c7b9746e58afb2b0f1a85')
14 if [ "${CARCH}" = "x86_64" ]; then
16 _archive_md5="aacecb7e05cc9a2cf31fce8f87fb5cb6"
19 _archive_md5="231461515874c1d394e3bec0324ab32d"
23 _packagename="${_realname}_${pkgver}-${pkgrel}_${_carch}.tar.gz"
24 _archive="${srcdir}/${_packagename}"
27 #download archive if key is available
28 if [ ! -f ${_archive} ] && [ -n "${_humbleintbundlekey}" ]; then
29 rm -f index.html\?key\=${_humbleintbundlekey}*
30 wget http://www.humblebundle.com/?key=${_humbleintbundlekey}
31 wget $(cat index.html\?key\=${_humbleintbundlekey} | grep "${_packagename}" | cut -d "'" -f 10)
32 mv ${_packagename}* ${_archive}
36 if [ ! -f ${_archive} ]; then
38 To install this you must own a copy of this game from ${url}."
39 echo "Place ${_realname}_${pkgver}-${pkgrel}_${_carch}.tar.gz into ${srcdir}.
41 echo "Alternatively you can add 'export _humbleintbundlekey=<Your key here>' to ~/.bashrc if you want automated download ability. (You must restart your terminal for this to take effect)
43 echo "Press ENTER to continue."
46 if [ ! -f ${_archive} ]; then
47 echo "${_archive} not found, exiting..."
50 if ! echo "${_archive_md5} ${_archive}" | md5sum -c --quiet; then
51 echo "Invalid checksum for ${_archive}, exiting..."
55 #install all game files to /opt
56 install -d ${pkgdir}/opt
57 tar xvf ${_archive} -C ${pkgdir}/opt
59 #remove arch specific name from binary
60 if [ -d ${pkgdir}/opt/Defcon ]; then
61 mv ${pkgdir}/opt/Defcon ${pkgdir}/opt/defcon
63 if [ ! -f ${pkgdir}/opt/defcon/defcon.bin ]; then
64 mv ${pkgdir}/opt/defcon/defcon.bin* ${pkgdir}/opt/defcon/defcon.bin
68 install -d ${pkgdir}/usr/share/pixmaps/
69 install -D -m644 ${pkgdir}/opt/defcon/defcon.png ${pkgdir}/usr/share/pixmaps/
71 #install application shortcut
72 install -d ${pkgdir}/usr/share/applications
73 cp ${srcdir}/defcon.desktop ${pkgdir}/usr/share/applications/
76 install -d ${pkgdir}/usr/share/licenses/${pkgname}
77 install -D -m644 ${pkgdir}/opt/defcon/license.txt ${pkgdir}/usr/share/licenses/${pkgname}/
79 #remove unneeded files
80 if [ "${CARCH}" = "x86_64" ]; then
81 rm -rf ${pkgdir}/opt/defcon/lib64
83 rm -rf ${pkgdir}/opt/defcon/lib32