summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a9158a23def9b4e9a29b6105e2d5da45b77e6306 (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
80
# Maintainer: Sandy Carter <bwrsandman@gmail.com>
# PKGBUILD source: https://github.com/bwrsandman/pkgbuild/tree/master/openmw-git

pkgname=openmw-git
pkgver=20121105
pkgrel=1
pkgdesc="An open-source engine reimplementation for the role-playing game Morrowind."
arch=('i686' 'x86_64')
url="http://www.openmw.org"
license=('GPL3' 'custom:Bitstream Vera' 'custom:Daedric Font' 'custom:OFL' 'custom:shiny')

depends=('openal' 'ogre=1.8.1' 'mygui>=3.2.0-2' 'bullet>=2.8.0' 'mpg123' 'libsndfile' 'qt')

makedepends=('git' 'cmake' 'boost>=1.5.0')
conflicts=('openmw')
provides=('openmw')

_gitroot="git://github.com/zinnschlag/openmw.git"
_gitname="openmw"

build() {
  msg "Connecting to GIT server...."

  cd "$srcdir"
  if [ -d "$_gitname" ] ; then
    cd "$_gitname" && git pull origin
    git submodule update
    msg "The local files are updated."
  else
    git clone --depth=1 "$_gitroot" "$_gitname"
    cd "$_gitname"
    git submodule update --init
  fi
  msg "GIT checkout done or server timeout"

  msg "Starting make..."
  cmake -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE=RelWithDebInfo
  make -j`getconf _NPROCESSORS_ONLN`
}

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

  # Binaries
  install -d -m755 "$pkgdir"/usr/bin
  install -m755 openmw "$pkgdir"/usr/bin/
  install -m755 omwlauncher "$pkgdir"/usr/bin/
  install -m755 esmtool "$pkgdir"/usr/bin/
  install -m775 mwiniimport "$pkgdir"/usr/bin


  # Config files
  # Replace resources location
  sed -i 's,resources=\./resources,resources=/usr/share/games/openmw/resources,' openmw.cfg || exit 1

  install -d -m755 "$pkgdir"/etc/openmw
  install -m644 openmw.cfg "$pkgdir"/etc/openmw/
  install -m644 settings-default.cfg "$pkgdir"/etc/openmw/
  install -m644 transparency-overrides.cfg "$pkgdir"/etc/openmw/

  # Desktop file and icon
  install -d -m755  "$pkgdir"/usr/share/applications
  install -m644 files/openmw.desktop "$pkgdir"/usr/share/applications/

  install -d -m755 "$pkgdir"/usr/share/pixmaps
  install -m644 apps/launcher/resources/images/openmw.png "$pkgdir"/usr/share/pixmaps/

  # Resources
  install -d -m755 "$pkgdir"/usr/share/games/openmw
  cp -r resources "$pkgdir"/usr/share/games/openmw/ || exit 1
  install -m644 launcher.qss "$pkgdir"/usr/share/games/openmw/resources

  # Custom Licences
  install -d -m755 "$pkgdir"/usr/share/licenses/openmw
  install -D -m644 "Bitstream Vera License.txt" "$pkgdir/usr/share/licenses/openmw/"
  install -D -m644 "Daedric Font License.txt" "$pkgdir/usr/share/licenses/openmw/"
  install -D -m644 "OFL.txt" "$pkgdir/usr/share/licenses/openmw/"
  install -D -m644 "extern/shiny/License.txt" "$pkgdir/usr/share/licenses/openmw/Shiny License.txt"
}