summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 97b59d6479d11ef2d8bd615b422f5f660d96cc14 (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
# Maintainer: Eric Anderson <ejona86 at gmail dot com>
# Contributor: Zachary A. Jones <jazzplayerl9@gmail.com>

pkgname=uplink-hib
_pkgname=uplink
pkgver=1.6_1
_pkgver=1.6-1
pkgrel=9
pkgdesc='A futuristic computer crime game (requires uplink from Humble Bundle)'
arch=('i686' 'x86_64')
url='http://www.introversion.co.uk/uplink'
license=('custom')
depends=('mesa' 'libjpeg6-turbo' 'sdl_mixer' 'freetype2')
conflicts=('uplink')
source=("${_pkgname}.desktop")
sha256sums=('4998ac81d6fd071355cd421b3206c69470f929613dfcc97361a12194e8cfbfaa')
source_x86_64=("hib://${_pkgname}_${_pkgver}_amd64.tar.gz")
md5sums_x86_64=('8ee01e7d0d688339fbd84e2005d4625b')
source_i686=("hib://${_pkgname}_${_pkgver}_i386.tar.gz")
md5sums_i686=('db4f1b9506cff9e348dd52709f6a8ad7')
# You can download the Humble Indie Bundle file manually, or you can configure
# DLAGENTS in makepkg.conf to auto-download.
#
# For example, to use hib-dlagent to download files set something like this in
# your makepkg.conf (change/add -k and add -u/-p to your needs):
# DLAGENTS=('hib::/usr/bin/hib-dlagent -k 1a2b3c -o %o $(echo %u | cut -c 7-)')
#
# To auto-search through a directory containing Humble Bundle downloads, you
# could set:
# DLAGENTS=('hib::/usr/bin/find /path/to/downloads -name $(echo %u | cut -c 7-) -exec ln -s \{\} %o \; -quit')
DLAGENTS+=('hib::/usr/bin/echo "Could not find %u. Download the file manually to \"$(pwd)\" or setup hib:// DLAGENT in /etc/makepkg.conf"; echo "Read this PKGBUILD for more info."; exit 1')
PKGEXT='.pkg.tar.gz'

if [ "$CARCH" = "x86_64" ]; then
  _archi='x64'
  _aarchi='x86_64'
  _libi='lib64'
else
  _archi='x86'
  _aarchi='x86'
  _libi='lib'
fi

package() {
  cd "${srcdir}/${_pkgname}-${_archi}"

  install -d "${pkgdir}/opt"
  cp -r . "${pkgdir}/opt/${_pkgname}"

  # Use system-provided libraries where possible. Use provided mikmod since the
  # system so version is too new. Use provided SDL_mixer since it crashes with
  # newer versions.
  rm "${pkgdir}/opt/${_pkgname}/${_libi}/libjpeg.so.62"
  rm "${pkgdir}/opt/${_pkgname}/${_libi}/libjpeg.so.62.0.0"
  rm "${pkgdir}/opt/${_pkgname}/${_libi}/libSDL-1.2.so.0"
  rm "${pkgdir}/opt/${_pkgname}/${_libi}/libSDL-1.2.so.0.11.3"

  # Fix permissions
  chmod -R 644 "${pkgdir}/opt/${_pkgname}"
  chmod +x "${pkgdir}/opt/${_pkgname}/${_libi}"
  chmod +x "${pkgdir}/opt/${_pkgname}"
  chmod +x "${pkgdir}/opt/${_pkgname}/uplink.bin.${_aarchi}"

  # Install Desktop File
  install -D -m644 "${srcdir}/${_pkgname}.desktop" \
      "${pkgdir}/usr/share/applications/${_pkgname}.desktop"

  # Install License
  install -D -m644 "${pkgdir}/opt/${_pkgname}/license.txt" \
      "${pkgdir}/usr/share/licenses/${pkgname}/license.txt"

  # Link Executable
  install -d "${pkgdir}/usr/bin"
  ln -s "/opt/${_pkgname}/uplink.bin.${_aarchi}" "${pkgdir}/usr/bin/${_pkgname}"
}