summaryrefslogtreecommitdiff
path: root/pcr/boswars/PKGBUILD
blob: 61657d82b5428f3ae233790a8b4b71ec40ea70d9 (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
# Maintainer : Aurélien DESBRIÈRES <aurelien@hackers.camp>
# Contributor: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG
# Contributor: Diogo Leal <estranho@diogoleal.com>

pkgname=boswars
pkgver=2.7
pkgrel=5
pkgdesc="Futuristic real-time strategy game"
url="http://www.boswars.org"
license=('GPL')
arch=('i686' 'x86_64')
depends=('sdl' 'libpng' 'lua51' 'libvorbis' 'libtheora' 'libgl' 'python2')
makedepends=('glu' 'coreutils') # nproc is in coreutils
source=("http://www.boswars.org/dist/releases/$pkgname-$pkgver-src.tar.gz"
        "boswars.sh"
        "boswars.png"
        "boswars.desktop")

prepare() {
  cd $pkgname-$pkgver-src

  # use python2 in doc generator scripts
  sed 's|env python$|&2|' -i doc/scripts/*.py
  # fix 'zlib too far back error' of png images (needed for libpng>=1.6)
  msg2 "Fixing PNG images…"
  for _f in {maps/antarticum.map/terrain,graphics/ui/ui_*,units/{radar/*,tree*/tree0?}}.png
  do
    pngfix -e -w --out=$_f.fixed $_f || : # ignore exit code
    mv $_f.fixed $_f
  done
}

build() {
  cd $pkgname-$pkgver-src

  # speed up build process with parallel building
  python2 make.py -j $(nproc)
}

package(){
  cd $pkgname-$pkgver-src

  # data
  install -d "$pkgdir"/opt/bos/languages
  install -m644 languages/*.po "$pkgdir"/opt/bos/languages
  cp -r campaigns doc graphics intro maps patches scripts sounds units "$pkgdir"/opt/bos

  # binary + launcher
  install -Dm755 fbuild/release/boswars "$pkgdir"/opt/bos/boswars
  install -Dm755 ../boswars.sh "$pkgdir"/usr/bin/boswars
  # .desktop entry
  install -Dm644 ../boswars.png "$pkgdir"/usr/share/pixmaps/boswars.png
  install -Dm644 ../boswars.desktop "$pkgdir"/usr/share/applications/boswars.desktop
  # license + doc
  install -d "$pkgdir"/usr/share/{licenses/$pkgname,doc}
  install -m644 COPYRIGHT.txt "$pkgdir"/usr/share/licenses/$pkgname
  ln -s /opt/bos/doc "$pkgdir"/usr/share/doc/$pkgname
}