updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / jamestown / PKGBUILD
blob2573509cd31bc44dbb3585114302d56ad19f97d1
1 # Maintainer: Yann Kaiser <kaiser.yann@gmail.com>
2 pkgname=jamestown
3 pkgver=1.0.1
4 _pkgver=1_0_1
5 _timestamp=1324610248
6 pkgrel=1
7 pkgdesc="A neo-classical top-down shooter for up to four players set on 17th-century British Colonial Mars."
8 arch=('i686' 'x86_64')
9 url="http://www.finalformgames.com/jamestown/"
10 license=('custom')
11 depends=('libgl' 'openal' 'sdl' 'libxext' 'libx11' 'libxcb' 'libxau' 'libxdmcp')
12 makedepends=()
13 source=('jamestown.desktop')
14 md5sums=('8769d7f0e88d26c87d64dcdaaeb0d64a')
16 _archive_name="jtownlinux"
17 _archive_md5="cc8ae55f3231ff7659c3e2ffbb524b7b"
19 _archive="${_archive_name}_${_pkgver}_${_timestamp}.zip"
21 build() {
22   cd ${srcdir}
24   if [ ! -f ${_jtarchivelocation}${_archive} ]; then
25           if [ ! -f ${_archive} ] && [ -n "${_humblebundle4key}" ]; then
26                 rm -f ${_archive}* index.html\?key\=${_humblebundle4key}*
27                 wget http://www.humblebundle.com/?key=${_humblebundle4key}
28                 wget $(cat index.html\?key\=${_humblebundle4key} | grep "${_archive}" | cut -d "'" -f 10)
29                 mv ${_archive}* ${_archive}
30           elif [ -z "${_humblebundle4key}" ]; then
31                 echo You can automate the download of the archive using the _humblebundle4key bash variable.
32                 echo Just add \'export _humblebundle4key\=\<Your key here\>\' to \.bashrc
33                 echo
34                 echo Otherwise please just place ${_archive} into $(pwd)/
35                 echo Press Enter to continue
36                 read -a _unused
37           fi
38   fi
39   #'
41   if [ ! -f ${_jtarchivelocation}${_archive} ]; then
42     echo "${_jtarchivelocation}${_archive} not found!"
43     return 1
44   fi  
46   if ! echo "${_archive_md5}  ${_jtarchivelocation}${_archive}" | md5sum -c --quiet; then
47     echo "Invalid checksum for ${_jtarchivelocation}${_archive}"
48     return 1
49   fi
51   bsdtar -xf ${_jtarchivelocation}${_archive}
52   rm -rf jamestown
53   unzip -d jamestown JamestownInstaller_${_pkgver}-bin || true
55   cd ${srcdir}/jamestown/data/
57   if test "${CARCH}" == "x86_64"; then
58     rm -R x86 Jamestown-x86
59   else
60     rm -R amd64 Jamestown-amd64
61   fi
62   sed -i -e "2aJAMESTOWN_ARCH=${CARCH}" Jamestown
64   mkdir -p ${pkgdir}/opt/ ${pkgdir}/usr/bin/ \
65     ${pkgdir}/usr/share/applications
66   cp -r . ${pkgdir}/opt/jamestown
67   cp ${srcdir}/jamestown.desktop ${pkgdir}/usr/share/applications/
68   chmod a+r ${pkgdir}/usr/share/applications/jamestown.desktop
69   ln -s /opt/jamestown/Jamestown ${pkgdir}/usr/bin/jamestown
72 # vim: et ts=2 sw=2 sts=2