summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c10b9cd0337fb4588a4d7e7c2747e7fe0c8fd8ca (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
71
72
73
74
75
76
77
78
79
# Maintainer: carstene1ns <url/mail: arch carsten-teibes de>
# Contributor: Evangelos Foutras <foutrelis gmail com>
# Contributer: Matthew Bauer <mjbauer95 gmail com>

pkgname=smw-svn
pkgver=1.8.r6
pkgrel=1
pkgdesc="Super Mario War multiplayer game (development version)"
arch=('i686' 'x86_64')
url="http://smw.supersanctuary.net/"
license=('GPL2')
depends=('sdl_mixer' 'sdl_image')
makedepends=('dos2unix' 'subversion')
provides=('smw')
conflicts=('smw')
source=(smw::"svn+http://supermariowar.googlecode.com/svn/trunk"
        "smw.desktop"
        "gcc.patch"
        "libpng.patch"
        "smw.png")
sha256sums=('SKIP'
            'c01da67abdc1c7bd46fd2c0420ca2795d77d143df1da7ce0ad95260816d2b80d'
            '7509d33b70b11742fc83cb62dd3e70a51d35596f20eb3a38b3553946261fe986'
            'be105515dbc850fcc8f73d894555ba71a7b89c52d7af2aa329a40f8088c2c75d'
            '28299d22e9ed8ebdecc8d936bfebef4a13381d20afda881c87661debe33f17d6')
pkgver() {
  cd smw

  local ver="$(svnversion)"
  printf "1.8.r%s" "${ver//[[:alpha:]]}"
}

prepare() {
  cd smw

  # Fix line breaks and permission
  dos2unix configure
  chmod +x configure

  # Change data directory
  sed -i "s|usr/share/games/smw|usr/share/smw|" configure

  # Fixes for gcc warnings and libpng >1.5
  patch -Np0 < ../gcc.patch
  patch -Np0 < ../libpng.patch
}

build() {
  cd smw

  ./configure
  make
}

package() {
  cd smw
  # Not using "make install" because of different data directory

  # Install binaries
  msg2 "Installing binaries"
  install -Dm755 smw "$pkgdir"/usr/bin/smw
  install -Dm755 leveledit "$pkgdir"/usr/bin/smw-leveledit
  install -Dm755 worldedit "$pkgdir"/usr/bin/smw-worldedit

  # Install data folders
  msg2 "Installing data folders"
  install -d "$pkgdir"/usr/share/smw/
  for _datadir in gfx maps music sfx tours worlds; do
    cp -r $_datadir "$pkgdir"/usr/share/smw/
  done

  # Set sane permissions
  find "$pkgdir"/usr/share/smw -type d -exec chmod 755 {} \;
  find "$pkgdir"/usr/share/smw -type f -exec chmod 644 {} \;

  # Install application shortcut and icon
  install -Dm644 ../smw.desktop "$pkgdir"/usr/share/applications/smw.desktop
  install -Dm644 ../smw.png "$pkgdir"/usr/share/pixmaps/smw.png
}