summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c9ec86f34e8698ed0e315b359d7c70bb105e66f7 (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
# Maintainer: Lucki <https://aur.archlinux.org/account/Lucki/>
# Contributor: leper <blubblub@mail.ru>

pkgname=smokinguns-git
_pkgname=smokinguns
pkgver=1.1.r859.gf5d9ecf2
pkgrel=3
pkgdesc='A semi-realistic simulation of the old west great atmosphere built on id Tech 3.'
url="http://www.smokin-guns.org"
arch=('i686' 'x86_64')
license=('GPL2')
changelog=.CHANGELOG
depends=('sdl' 'speex' 'hicolor-icon-theme' 'freetype2' 'libglvnd' 'libjpeg-turbo')
makedepends=('gendesk')
conflicts=('smokinguns-bin' 'smokinguns' 'smokinguns-data')
provides=('smokinguns-data' 'smokinguns')
source=("${pkgname}::git+https://github.com/smokin-guns/SmokinGuns.git"
        "${pkgname}-data::http://www.smokin-guns.org/downloads/Smokin_Guns_1.1.zip")
sha512sums=('SKIP'
            '51954ce00cccd9eb95a10491f0fcdea2d024058da11cbda7ee56c6369e8bc101d89ed95549cf4255393c3e1bec4585be12937e7ed7b20ff4cc0ce96685a5ce72')

pkgver()
{
	cd "${srcdir}/${pkgname}"
	git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare()
{
  cd "${srcdir}"
  gendesk -n -f --name="Smokin' Guns"
  
  # update .CHANGELOG
  git -C "${srcdir}/${pkgname}" log --graph -10 > "${startdir}/.CHANGELOG"

  cd "${srcdir}/${pkgname}"

  # Set basedir
  echo "DEFAULT_BASEDIR = /usr/share/${_pkgname}" >> "Makefile.local"
  # Use system libraries
  echo "USE_INTERNAL_ZLIB=0" >> "Makefile.local"
  echo "USE_INTERNAL_JPEG=0" >> "Makefile.local"
  echo "USE_INTERNAL_SPEEX=0" >> "Makefile.local"
  echo "USE_INTERNAL_OPUS=1" >> "Makefile.local"
  echo "USE_INTERNAL_OGG=0" >> "Makefile.local"
  # Use system headers
  echo "USE_LOCAL_HEADERS=0" >> "Makefile.local"
}

build()
{
  cd "${srcdir}/${pkgname}"
  make
}

package()
{
  cd "${srcdir}/Smokin' Guns 1.1"
  install -d "${pkgdir}/usr/share/${_pkgname}/baseq3"
  install -m 644 baseq3/* "${pkgdir}/usr/share/${_pkgname}/baseq3"
  install -d "${pkgdir}/usr/share/${_pkgname}/${_pkgname}"
  install -m 644 ${_pkgname}/* "${pkgdir}/usr/share/${_pkgname}/${_pkgname}"
  
  cd "${srcdir}/${pkgname}"

  SUFFIX=${CARCH//i686/i386}
  install -Dm 755 "build/release-linux-${SUFFIX}/${_pkgname}.${SUFFIX}" "${pkgdir}/usr/bin/${_pkgname}"
  install -Dm 755 "build/release-linux-${SUFFIX}/${_pkgname}_dedicated.${SUFFIX}" "${pkgdir}/usr/bin/${_pkgname}_dedicated"
  install -Dm 644 "build/release-linux-${SUFFIX}/renderer_opengl1_${SUFFIX}.so" "${pkgdir}/usr/share/${_pkgname}"
  install -Dm 644 "build/release-linux-${SUFFIX}/renderer_opengl2_${SUFFIX}.so" "${pkgdir}/usr/share/${_pkgname}"

  install -Dm 644 "${srcdir}/${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
  install -Dm 644 "misc/${_pkgname}.png" "${pkgdir}/usr/share/icons/hicolor/256x256/apps/${_pkgname}.png"
}

# vim:set ts=2 sw=2 et: