summaryrefslogtreecommitdiff
path: root/community/btanks/PKGBUILD
blob: 4506cdc51b0d74f52f1a32f27263847b5c612ce1 (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
58
59
60
61
62
# Contributor: Nick B <Shirakawasuna at gmail _dot_ com>
pkgname=btanks
pkgver=0.9.8083
pkgrel=1
pkgdesc="Fast 2d tank arcade game with multiplayer and split-screen modes."
arch=('i686' 'x86_64' 'mips64el')
url="http://btanks.sourceforge.net"
license=('GPL')
depends=('expat' 'libgl' 'libsigc++2.0' 'libvorbis' 'lua' 'openal' 'sdl' 'sdl_image' 'smpeg' 'btanks-data')
makedepends=('scons' 'chrpath')
source=(http://downloads.sourceforge.net/btanks/btanks-$pkgver.tar.bz2
	btanks_desktop
	btanks_script
	bted_script)
install=btanks.install
md5sums=('49cb95c0eec47d3436c4fdf65e7c9d12'
         'a2ddeb1e79dff8d3fd702984c8d3aab5'
         '07657cfa71b1de1d008cc5e3ade9749b'
         '91a61c0f581ea27281bdaecb7a3cd58b')

build() {
  # Compile with scons
  cd $srcdir/$pkgname-$pkgver
  scons || return 1

  mkdir -p $pkgdir/usr/share/btanks
  cp *.so btanks bted $pkgdir/usr/share/btanks/ || return 1

  # Install script
  install -D -m755 $srcdir/bted_script $pkgdir/usr/bin/bted && \
  install -D -m755 $srcdir/btanks_script $pkgdir/usr/bin/btanks || return 1

  # Install desktop file
  install -D -m644 $srcdir/btanks_desktop $pkgdir/usr/share/applications/btanks.desktop || return 1

  # Install icon
  install -D -m644 $srcdir/$pkgname-$pkgver/data/tiles/icon.png $pkgdir/usr/share/pixmaps/btanks.png || return 1

  # Make settings saveable
  touch $pkgdir/usr/share/btanks/bt.xml
  chown :games $pkgdir/usr/share/btanks/bt.xml
  chmod 664 $pkgdir/usr/share/btanks/bt.xml

  # move executables, fix rpath
  cd $pkgdir/usr/share/btanks
  mkdir -p $pkgdir/usr/bin $pkgdir/usr/lib/btanks

  mv btanks $pkgdir/usr/bin/btanks-bin && \
  mv bted $pkgdir/usr/bin/bted-bin && \
  mv *.so $pkgdir/usr/lib/btanks/ || return 1

  ln -s /usr/bin/btanks-bin ./btanks && \
  ln -s /usr/bin/bted-bin ./bted || return 1

  ls -1 $pkgdir/usr/lib/btanks/ | while read A; do
    ln -s /usr/lib/btanks/$A ./$A || return 1
  done

  chrpath -d $pkgdir/usr/bin/bted-bin && \
  chrpath -d $pkgdir/usr/bin/btanks-bin && \
  chrpath -d $pkgdir/usr/lib/btanks/*.so
}