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
71
72
73
74
75
# Maintainer: Lari Tikkanen <[email protected]>
pkgname=teeworlds-git
pkgver=20130329
pkgrel=1
pkgdesc="A multiplayer 2D shooter (Git version)"
arch=('i686' 'x86_64')
url="http://teeworlds.com"
license=('custom')
depends=('alsa-lib' 'glu' 'sdl' 'freetype2')
makedepends=('python' 'git' 'bam' 'mesa')
provides=('teeworlds')
conflicts=('teeworlds')
source=(teeworlds.desktop
        teeworlds.png)
md5sums=('3944aaf7a8c19a83510b2b39c4cddf5f'
         '44f39e398409232a0e0a431ed46d8cc8')

# main teeworlds git repository
_gitroot="git://github.com/teeworlds/teeworlds.git"
_gitname="teeworlds"

# translations are provided in a different repository
_gitlangroot="git://github.com/teeworlds/teeworlds-translation.git"
_gitlangname="teeworlds-translation"

build() {
  msg "Connecting to Teeworlds' main GIT server..."
  cd "$srcdir"
  if [[ -d "$_gitname" ]]; then
    cd "$_gitname" && git pull origin
    msg "The local files are updated."
  else
    git clone "$_gitroot" "$_gitname"
  fi
  
  msg "Connecting to Teeworlds' translations GIT server..."
  cd "$srcdir"
  if [[ -d "$_gitlangname" ]]; then
    cd "$_gitlangname" && git pull origin
    msg "The local files are updated."
  else
    git clone "$_gitlangroot" "$_gitlangname"
  fi

  msg "GIT checkout done or server timeout"
  msg "Starting build..."
  #
  # BUILD HERE
  #
  cd "$srcdir"/$_gitname
  bam release
}

package() {
  cd "$srcdir"/$_gitname

  mkdir -p "$pkgdir"/usr/share/$_gitname/data
  cp -r "$srcdir"/$_gitname/data/* \
    "$pkgdir"/usr/share/$_gitname/data
    
  git clone "$srcdir"/$_gitlangname \
    "$pkgdir"/usr/share/$_gitname/data/languages

  install -Dm755 "$srcdir"/$_gitname/$_gitname \
    "$pkgdir"/usr/bin/$_gitname
  install -Dm755 "$srcdir"/$_gitname/${_gitname}_srv \
    "$pkgdir"/usr/bin/${_gitname}_srv

  install -Dm644 "$srcdir"/$_gitname.desktop \
    "$pkgdir"/usr/share/applications/$_gitname.desktop
  install -Dm644 "$srcdir"/$_gitname.png \
    "$pkgdir"/usr/share/pixmaps/$_gitname.png
  install -Dm644 "$srcdir"/$_gitname/license.txt \
    "$pkgdir"/usr/share/licenses/$_gitname/license.txt
}