# $Id: PKGBUILD 64791 2012-02-18 05:19:53Z svenstaro $
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Lone_Wolf <lonewolf@xs4all.nl> 
# Contributor: sausageandeggs <s_stoakley at hotmail.co.uk>

pkgname=singularity
pkgver=0.30c
pkgrel=3
pkgdesc="Strategy game - simulation of true AI"
arch=('any')
url="http://emhsoft.com/singularity/index.html"
license=('GPL2' 'custom')
depends=('python2' 'python-pygame' 'sdl_image' 'sdl_mixer' 'python2-numpy')
source=("http://endgame-singularity.googlecode.com/files/$pkgname-$pkgver-src.tar.gz" \
        "http://endgame-singularity.googlecode.com/files/endgame-$pkgname-music-006.zip" \
        "singularity")
md5sums=('ea4e7d28dd19c33585691ee608672a63'
         'f16d550add4df9c41d4fd68d8ebff40c'
         'fe74e41d2d35dd1907342dea8b078651')

build() {
  cd "$srcdir/$pkgname-$pkgver"
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  # install game
  install -Dm644 singularity.py $pkgdir/usr/share/singularity/singularity.py
  cp -R code data "$srcdir/endgame-$pkgname-music-006/music" "$pkgdir/usr/share/$pkgname"
  sed -i 's|/usr/bin/env python|/usr/bin/env python2|g' "$pkgdir/usr/share/$pkgname/code/singularity.py"

  # install shell script
  install -Dm755 "$srcdir/singularity" "$pkgdir/usr/bin/singularity"

  # license
  # code is GPL2, but data & music fall under other licenses
  install -Dm644 README.txt "$pkgdir/usr/share/doc/$pkgname/README.txt"
  install -d "$pkgdir/usr/share/licenses/$pkgname/"
  cd "$pkgdir/usr/share/licenses/$pkgname/"
  ln -s ../../doc/$pkgname/README.txt .
}
# vim: sw=2:ts=2 et:
