summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5609d728cdd3e29c5e69d852532a7f95cceb1b9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Contributor: Archadept
#    Revision: 2014-10-24

pkgname=astromenace-svn
pkgver=293
pkgrel=1
pkgdesc="The latest version of hardcore 3D space shooter with spaceship upgrade possibilities"
arch=x86_64
url="http://www.viewizard.com/astromenace/index_linux.php"
license=('GPL3')
conflicts=astromenace
depends=('sdl2' 'freealut'  'libjpeg'  'libvorbis'  'glu'  'freetype2')
makedepends=('cmake')
source=('astromenace.desktop')
md5sums=('b89aa017cdf9db1d6fe085889f8388fc')

_svnsource=svn://svn.code.sf.net/p/openastromenace/code
_svnmod=astromenace
build() {
  cd "${srcdir}"
  msg "Connecting to gna SVN server..."
  msg "Checking out $_svnmod"

  if [ -d $_svnmod/.svn ]; then
    (cd $_svnmod && svn up -r $pkgver)
  else
    svn co $_svnsource --config-dir ./ -r $pkgver $_svnmod
  fi

  msg "SVN checkout done or server timeout"
  msg "Setting up build environment..."

  rm -rf ${srcdir}/$_svnmod-build
  cp -r ${_svnmod} ${_svnmod}-build || return 1
  cd ${_svnmod}-build

  msg "Starting build"

  cd "${srcdir}/${_svnmod}-build"
  cmake -DSDL2=ON ./
  make

  ./AstroMenace --pack --rawdata=./RAW_VFS_DATA
}

package () {
  # Manually install the engine and data
  mkdir -p $pkgdir/usr/share/${_svnmod}
  install -m 644 $srcdir/${_svnmod}-build/gamedata.vfs $pkgdir/usr/share/${_svnmod}/gamedata.vfs

  # Install .desktop, icon and bin
  install -Dm 644 ${startdir}/astromenace.desktop $pkgdir/usr/share/applications/astromenace.desktop
  install -Dm 644 ${srcdir}/${_svnmod}-build/astromenace_128.png $pkgdir/usr/share/pixmaps/astromenace.png
  install -Dm 755 ${srcdir}/${_svnmod}-build/AstroMenace $pkgdir/usr/bin/astromenace
  cd $pkgdir/usr/bin
  ln -s /usr/share/astromenace/gamedata.vfs gamedata.vfs
}