updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / multiwinia / PKGBUILD
blobad9ce753db68c4a4a35d446b4c801fd597d07021
1 # Maintainer: Gadget30000 <gadget3000 at msn dot com>
2 pkgname=multiwinia
3 pkgver=1.3.1
4 pkgrel=2
5 pkgdesc="Battle to save Darwinias innocent inhabitants, the Darwinians, from an evil viral infection"
6 arch=('i686' 'x86_64')
7 url="http://www.introversion.co.uk/multiwinia/"
8 groups=('humbleintbundle' 'humblebundles')
9 license=('custom')
10 depends=('mesa' 'openal' 'sdl' 'libvorbis' 'libpng12')
11 source=('multiwinia.desktop')
12 md5sums=('8132259414180ad994c27cd2770ffc67')
14 if [ "${CARCH}" = "x86_64" ]; then
15 _carch=amd64
16 _archive_md5="5eaba188f84ad985fe9b5d36e3bf85a3"
17 _bin_postfix="_64"
18 else
19 _carch=i386
20 _archive_md5="bbc7d907431f15065a0f38f6623c4217"
21 _bin_postfix=
24 _archive="multiwinia_${pkgver}-1_${_carch}.tar.gz"
26 build() {
27   cd ${srcdir}
29   if [ ! -f ${_multiwiniaarchivelocation}${_archive} ]; then
30           if [ ! -f ${_archive} ] && [ -n "${_humbleintbundlekey}" ]; then
31                 rm -f ${_archive}* index.html\?key\=${_humbleintbundlekey}*
32                 wget http://www.humblebundle.com/?key=${_humbleintbundlekey}
33                 wget $(cat index.html\?key\=${_humbleintbundlekey} | grep "${_archive}" | cut -d "'" -f 10)
34                 mv ${_archive}* ${_archive}
35           elif [ -z "${_humbleintbundlekey}" ]; then
36                 echo You can automate the download of the archive using the _humbleintbundlekey bash variable.
37                 echo Just add \'export _humbleintbundlekey\=\<Your key here\>\' to \.bashrc
38                 echo
39                 echo Otherwise please just place ${_archive} into $(pwd)/
40                 echo Press Enter to continue
41                 read -a _unused
42           fi
43   fi
45   if [ ! -f ${_multiwiniaarchivelocation}${_archive} ]; then
46     echo "${_multiwiniaarchivelocation}${_archive} not found!"
47     return 1
48   fi  
50   if ! echo "${_archive_md5}  ${_multiwiniaarchivelocation}${_archive}" | md5sum -c --quiet; then
51     echo "Invalid checksum for ${_multiwiniaarchivelocation}${_archive}"
52     return 1
53   fi
55   install -d ${pkgdir}/usr/share/
56   tar xzf ${_multiwiniaarchivelocation}${_archive} -C ${pkgdir}/usr/share/
57   install -d ${pkgdir}/usr/bin
58   ln -s /usr/share/multiwinia/multiwinia.bin.x86${_bin_postfix} ${pkgdir}/usr/bin/multiwinia
60   #Copy Icon
61   install -d ${pkgdir}/usr/share/pixmaps/
62   install -D -m644 ${pkgdir}/usr/share/multiwinia/multiwinia.png ${pkgdir}/usr/share/pixmaps/ || return 1
64   #Copy Desktop File
65   install -d ${pkgdir}/usr/share/applications
66   cp ${srcdir}/multiwinia.desktop ${pkgdir}/usr/share/applications/
68 #  echo Installing the License
69 #  install -d ${pkgdir}/usr/share/licenses/${pkgname}
70 #  install -D -m644 ${pkgdir}/usr/share/multiwinia/license.txt ${pkgdir}/usr/share/licenses/${pkgname}/ || return 1
72   if [ "${CARCH}" = "x86_64" ]; then
73       rm -rf ${pkgdir}/usr/share/multiwinia/lib64
74   else
75       rm -rf ${pkgdir}/usr/share/multiwinia/lib32
76   fi
78   chown -Rh root:root ${pkgdir}/usr/share/multiwinia