summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2e582ba8f83a30666f58d4de077465d258e9ed2a (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
63
64
65
66
67
68
69
70
# Maintainer: Rafael Fontenelle <rafaelff@gnome.org>

pkgname=teeworlds-ddnet
pkgver=10.8.3
pkgrel=1
pkgdesc="A customized version by DDRaceNetwork of this 2D shooting game"
arch=('i686' 'x86_64')
url="https://ddnet.tw"
license=('custom')
depends=('alsa-lib' 'glu' 'sdl2' 'freetype2' 'opusfile' 'curl')
makedepends=('bam' 'imagemagick' 'gendesk' 'python')
optdepends=('teeworlds-ddnet-skins: more skins for your tee'
            'teeworlds-ddnet-maps-git: mainly important for DDNet Server')
provides=('teeworlds')
conflicts=('teeworlds')
source=("$url/downloads/DDNet-$pkgver.tar.xz")
source_i686=("$url/downloads/GraphicsTools-linux_x86.tar.gz")
source_x86_64=("$url/downloads/GraphicsTools-linux_x86_64.tar.gz")
md5sums=('25ea74b6fd56876a32763b07475b90b1')
md5sums_i686=('566354c3b4510b032af7d891381ee711')
md5sums_x86_64=('fc32ca52ae9be02f68b6c257153dbd37')

prepare() {
      # Client
    convert "DDNet-$pkgver/other/icons/DDNet.ico" "$srcdir/$pkgname.png"
    gendesk -f -n --pkgname "$pkgname" --pkgdesc "$pkgdesc" \
        --name 'Teeworlds' --categories 'Game;ArcadeGame'
      
      # Server
    convert "DDNet-$pkgver/other/icons/DDNet-Server.ico" "$srcdir/${pkgname}_srv.png"
      # This desktop file, combined with 'teeworlds-ddnet-maps-git' pkg will
      # run DDNet Server with all votes, maps etc. -- no score/ranking, though
    gendesk -f -n --pkgname "${pkgname}_srv" --pkgdesc "DDNet Server"        \
        --name 'DDNet Server' --categories 'Game;ArcadeGame' --terminal=true \
        --exec='sh -c "cd /usr/share/teeworlds/data && teeworlds-ddnet_srv"'
}

build() {
  cd DDNet-$pkgver
  bam release
}

package() {
  cd DDNet-$pkgver
  
    # Install DDNet client/server binaries
  install -Dm755 DDNet           "$pkgdir/usr/bin/teeworlds-ddnet"
  install -Dm755 DDNet-Server    "$pkgdir/usr/bin/teeworlds-ddnet_srv"
  install -Dm755 config_store    "$pkgdir/usr/bin/ddnet-config_store"
  install -Dm755 config_retrieve "$pkgdir/usr/bin/ddnet-config_retrieve"
    # Install Graphic Tools binaries
  install -Dm755 ../dilate            "$pkgdir/usr/bin/dilate"
  install -Dm755 ../tileset_borderadd "$pkgdir/usr/bin/tileset_borderadd"
  install -Dm755 ../tileset_borderfix "$pkgdir/usr/bin/tileset_borderfix"
  install -Dm755 ../tileset_borderrem "$pkgdir/usr/bin/tileset_borderrem"
  install -Dm755 ../tileset_borderset "$pkgdir/usr/bin/tileset_borderset"
  
    # Install data files
  mkdir -p "$pkgdir/usr/share/teeworlds/data"
  cp -r data/* "$pkgdir/usr/share/teeworlds/data"
  
    # Install desktop and icon files
  install -Dm644 ../teeworlds-ddnet.desktop     "$pkgdir/usr/share/applications/teeworlds-ddnet.desktop"
  install -Dm644 ../teeworlds-ddnet_srv.desktop "$pkgdir/usr/share/applications/teeworlds-ddnet_srv.desktop"
  install -Dm644 ../teeworlds-ddnet-5.png       "$pkgdir/usr/share/pixmaps/teeworlds-ddnet.png"
  install -Dm644 ../teeworlds-ddnet_srv-8.png   "$pkgdir/usr/share/pixmaps/teeworlds-ddnet_srv.png"
  
    # Install license files
  install -Dm644 license.txt "$pkgdir/usr/share/licenses/$pkgname/license.txt"
}