updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / frozensynapse / PKGBUILD
blobeda6e4ed2776329455d73a459d5d983223a1ee48
1 #Maintainer: Gadget3000 <gadget3000 at msn dot com>
2 #Contributor: wido <widowild [ta] myopera [tod] com>
4 pkgname=frozensynapse
5 pkgver=1
6 pkgrel=5
7 pkgdesc="A single player and multiplayer simultaneous-turn-based tactical game. (The Humble Frozen Synapse Bundle)"
8 url="http://www.frozensynapse.com/"
9 groups=('humblefsbundle' 'humblebundles')
10 license=('custom: "commercial"')
11 arch=('i686' 'x86_64')
12 makedepends=('unzip')
13 optdepends=('lib32-nvidia-utils: If you have nvidia graphics'
14             'lib32-catalyst-utils: If you have ATI graphics')
15 source=(${pkgname}.desktop)
16 md5sums=('eccdc9f63917fdb761d45c5621853485')
18 if [[ $CARCH == x86_64 ]]; then
19         depends=('lib32-glibc' 'lib32-gcc-libs' 'lib32-openal' 'lib32-sdl' 'lib32-mesa')
20 else
21         depends=('glibc' 'gcc-libs' 'openal' 'sdl' 'mesa')
24 _archive="${pkgname}-${pkgver}-linux-bin"
25 _archive_md5="ef8f7c64af2adac39a35b7b24a54fb37"
27 build() {
28   cd ${srcdir}
30   if [ ! -f ${_fsarchivelocation}${_archive} ]; then
31           if [ ! -f ${_archive} ] && [ -n "${_humblefsbundlekey}" ]; then
32                 rm -f ${_archive}* index.html\?key\=${_humblefsbundlekey}*
33                 wget http://www.humblebundle.com/?key=${_humblefsbundlekey}
34                 wget $(cat index.html\?key\=${_humblefsbundlekey} | grep "${_archive}" | cut -d "'" -f 10)
35                 mv ${_archive}* ${_archive}
36           elif [ -z "${_humblefsbundlekey}" ]; then
37                 echo You can automate the download of the archive using the _humblefsbundlekey bash variable.
38                 echo Just add \'export _humblefsbundlekey\=\<Your key here\>\' to \.bashrc
39                 echo
40                 echo Otherwise please just place ${_archive} into $(pwd)/
41                 echo Press Enter to continue
42                 read -a _unused
43           fi
44   fi
46   if [ ! -f ${_fsarchivelocation}${_archive} ]; then
47     echo "${_fsarchivelocation}${_archive} not found!"
48     return 1
49   fi  
51   if ! echo "${_archive_md5}  ${_fsarchivelocation}${_archive}" | md5sum -c --quiet; then
52     echo "Invalid checksum for ${_fsarchivelocation}${_archive}"
53     return 1
54   fi
57 package(){
59   # directories
60   install -d ${pkgdir}/opt/${pkgname}
61   cd ${srcdir}
62   yes A | unzip -qqo ${_fsarchivelocation}${_archive} -x guis/* meta/* scripts/* -d ${srcdir}/extractedInstaller/ || true
63   mv ${srcdir}/extractedInstaller/data/* ${pkgdir}/opt/${pkgname}/
65   # Clean librairy
66   rm ${pkgdir}/opt/${pkgname}/libgcc_s.so.1
67   rm ${pkgdir}/opt/${pkgname}/libopenal.so
68   rm ${pkgdir}/opt/${pkgname}/libSDL-1.2.so.0
69   rm ${pkgdir}/opt/${pkgname}/libstdc++.so.6
71   #fix permissions
72   find ${pkgdir}/opt/${pkgname} -type d -exec chmod 755 {} \;
73   find ${pkgdir}/opt/${pkgname} -type f -exec chmod 644 {} \;
74   chmod 755 ${pkgdir}/opt/${pkgname}/FrozenSynapse
76   # startup scripts
77   install -Dd ${pkgdir}/usr/bin
78   echo \#\!/bin/bash > ${pkgdir}/usr/bin/frozensynapse
79   echo cd /opt/frozensynapse/ >> ${pkgdir}/usr/bin/frozensynapse
80   echo ./FrozenSynapse \$@ >> ${pkgdir}/usr/bin/frozensynapse
81   chmod +x ${pkgdir}/usr/bin/frozensynapse
83   # desktop entry
84   install -Dm644 ${srcdir}/${pkgname}.desktop ${pkgdir}/usr/share/applications/${pkgname}.desktop