updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / darwinia / PKGBUILD
blob94e1848cb33132518a9bca216bf46c1bf8263ac5
1 # Maintainer: Gadget30000 <gadget3000 at msn dot com>
2 pkgname=darwinia
3 pkgver=1.43
4 pkgrel=1
5 pkgdesc="A virtual themepark, running entirely inside a computer network and populated by a sentient evolving life form called the Darwinians"
6 arch=('i686' 'x86_64')
7 url="http://www.introversion.co.uk/darwinia/"
8 license=('custom')
9 depends=('mesa' 'sdl' 'libvorbis')
10 source=('darwinia.desktop')
11 md5sums=('6bb7df553937b8d94f842d4ba1994ffe')
13 if [ "${CARCH}" = "x86_64" ]; then
14 _carch=amd64
15 _archive_md5="3e6f7a3a8e1131334d2e0371dd9f7258"
16 _bin_postfix="_64"
17 else
18 _carch=i386
19 _archive_md5="b29633364637e9ac0079068c7b57a861"
20 _bin_postfix=
23 _archive="darwinia_${pkgver}_${_carch}.tar.gz"
25 build() {
26   cd ${srcdir}
28   if [ ! -f ${_darwiniaarchivelocation}${_archive} ]; then
29           if [ ! -f ${_archive} ] && [ -n "${_humbleintbundlekey}" ]; then
30                 rm -f ${_archive}* index.html\?key\=${_humbleintbundlekey}*
31                 wget http://www.humblebundle.com/?key=${_humbleintbundlekey}
32                 wget $(cat index.html\?key\=${_humbleintbundlekey} | grep "${_archive}" | cut -d "'" -f 10)
33                 mv ${_archive}* ${_archive}
34           elif [ -z "${_humbleintbundlekey}" ]; then
35                 echo You can automate the download of the archive using the _humbleintbundlekey bash variable.
36                 echo Just add \'export _humbleintbundlekey\=\<Your key here\>\' to \.bashrc
37                 echo
38                 echo Otherwise please just place ${_archive} into $(pwd)/
39                 echo Press Enter to continue
40                 read -a _unused
41           fi
42   fi
44   if [ ! -f ${_darwiniaarchivelocation}${_archive} ]; then
45     echo "${_darwiniaarchivelocation}${_archive} not found!"
46     return 1
47   fi  
49   if ! echo "${_archive_md5}  ${_darwiniaarchivelocation}${_archive}" | md5sum -c --quiet; then
50     echo "Invalid checksum for ${_darwiniaarchivelocation}${_archive}"
51     return 1
52   fi
54   install -d ${pkgdir}/usr/share/
55   tar xzf ${_darwiniaarchivelocation}${_archive} -C ${pkgdir}/usr/share/
56   if [ "${CARCH}" = "i686" ]; then
57     mv ${pkgdir}/usr/share/Darwinia ${pkgdir}/usr/share/darwinia
58   fi
59   install -d ${pkgdir}/usr/bin
60   ln -s /usr/share/darwinia/darwinia.bin.x86${_bin_postfix} ${pkgdir}/usr/bin/darwinia
62   #Copy Icon
63   install -d ${pkgdir}/usr/share/pixmaps/
64   install -D -m644 ${pkgdir}/usr/share/darwinia/darwinian.png ${pkgdir}/usr/share/pixmaps/ || return 1
66   #Copy Desktop File
67   install -d ${pkgdir}/usr/share/applications
68   cp ${srcdir}/darwinia.desktop ${pkgdir}/usr/share/applications/
70   #Copy License
71   install -d ${pkgdir}/usr/share/licenses/${pkgname}
72   install -D -m644 ${pkgdir}/usr/share/darwinia/license.txt ${pkgdir}/usr/share/licenses/${pkgname}/ || return 1
74   chown -Rh root:root ${pkgdir}/usr/share/darwinia