summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4fadc6c86492887b5b17d6bcc5d18e9619a15bd7 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Maintainer: Eric Anderson <ejona86 at gmail dot com>
# Contributor: jimmy-6 <jakub.jarozek {at} gmail.com>

pkgname=shadowgrounds
pkgver=beta12_update1
pkgrel=4
pkgdesc='A 3D sci-fi alien shooter (game sold separately)'
arch=('i686' 'x86_64')
url='http://shadowgroundsgame.com/'
license=('unknown')
if [ "$CARCH" = "x86_64" ]; then
  depends=('lib32-libglade' 'lib32-mesa' 'lib32-openal' 'lib32-libvorbis'
           'lib32-sdl_ttf' 'lib32-libxmu' 'lib32-sdl_sound' 'lib32-sdl_image')
else
  depends=('libglade' 'mesa' 'openal' 'libvorbis' 'sdl_ttf' 'libxmu' 'sdl_sound'
           'sdl_image')
fi
options=('!strip')
_gamepkg="shadowgroundsUpdate1.run"
source=("${pkgname}-launcher.sh" "${pkgname}.desktop" "hib://${_gamepkg}")
noextract=("${_gamepkg}")
md5sums=('2ed2add4600b899cc4a41bf3d1d51c4d'
         '5bf18b1fff2e96b4a1d70b563c4f2ce7'
         '7c9913f754168742973edfeb66ba8f1c')
# 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'

prepare() {
  cd "${srcdir}"

  mkdir "${pkgname}-${pkgver}"
  bsdtar -x -C "${pkgname}-${pkgver}" -f "${_gamepkg}"
}

package(){
  cd "${srcdir}/${pkgname}-${pkgver}"

  # Copy game files
  mkdir -p "${pkgdir}/opt/"
  cp -rl . "${pkgdir}/opt/${pkgname}"

  # Remove unnecessary files
  rm "${pkgdir}/opt/${pkgname}/createShortcuts.sh"
  rm "${pkgdir}/opt/${pkgname}/removeShortcuts.sh"

  # Use system-provided libraries
  rm "${pkgdir}/opt/${pkgname}/lib32/libasound_module_pcm_pulse.so"
  rm "${pkgdir}/opt/${pkgname}/lib32/libasound.so.2"
  rm "${pkgdir}/opt/${pkgname}/lib32/libexpat.so.1"
  rm "${pkgdir}/opt/${pkgname}/lib32/libFLAC.so.8"
  rm "${pkgdir}/opt/${pkgname}/lib32/libgcc_s.so.1"
  rm "${pkgdir}/opt/${pkgname}/lib32/libgmodule-2.0.so.0"
  rm "${pkgdir}/opt/${pkgname}/lib32/libgomp.so.1"
  rm "${pkgdir}/opt/${pkgname}/lib32/libICE.so.6"
  rm "${pkgdir}/opt/${pkgname}/lib32/libjpeg.so.62"
  rm "${pkgdir}/opt/${pkgname}/lib32/libmikmod.so.2"
  rm "${pkgdir}/opt/${pkgname}/lib32/libm.so.6"
  rm "${pkgdir}/opt/${pkgname}/lib32/libogg.so.0"
  rm "${pkgdir}/opt/${pkgname}/lib32/libopenal.so.1"
  rm "${pkgdir}/opt/${pkgname}/lib32/libpng12.so.0"
  rm "${pkgdir}/opt/${pkgname}/lib32/librt.so.1"
  rm "${pkgdir}/opt/${pkgname}/lib32/libSDL-1.2.so.0"
  rm "${pkgdir}/opt/${pkgname}/lib32/libSDL_image-1.2.so.0"
  rm "${pkgdir}/opt/${pkgname}/lib32/libSDL_sound-1.0.so.1"
  rm "${pkgdir}/opt/${pkgname}/lib32/libSDL_ttf-2.0.so.0"
  rm "${pkgdir}/opt/${pkgname}/lib32/libsmpeg-0.4.so.0"
  rm "${pkgdir}/opt/${pkgname}/lib32/libSM.so.6"
  rm "${pkgdir}/opt/${pkgname}/lib32/libspeex.so.1"
  rm "${pkgdir}/opt/${pkgname}/lib32/libstdc++.so.6"
  rm "${pkgdir}/opt/${pkgname}/lib32/libtiff.so.4"
  rm "${pkgdir}/opt/${pkgname}/lib32/libvorbisfile.so.3"
  rm "${pkgdir}/opt/${pkgname}/lib32/libvorbis.so.0"
  rm "${pkgdir}/opt/${pkgname}/lib32/libX11.so.6"
  rm "${pkgdir}/opt/${pkgname}/lib32/libXau.so.6"
  rm "${pkgdir}/opt/${pkgname}/lib32/libxcb-render.so.0"
  rm "${pkgdir}/opt/${pkgname}/lib32/libxcb-render-util.so.0"
  rm "${pkgdir}/opt/${pkgname}/lib32/libxcb.so.1"
  rm "${pkgdir}/opt/${pkgname}/lib32/libxcb-xlib.so.0"
  rm "${pkgdir}/opt/${pkgname}/lib32/libXcomposite.so.1"
  rm "${pkgdir}/opt/${pkgname}/lib32/libXcursor.so.1"
  rm "${pkgdir}/opt/${pkgname}/lib32/libXdamage.so.1"
  rm "${pkgdir}/opt/${pkgname}/lib32/libXdmcp.so.6"
  rm "${pkgdir}/opt/${pkgname}/lib32/libXext.so.6"
  rm "${pkgdir}/opt/${pkgname}/lib32/libXfixes.so.3"
  rm "${pkgdir}/opt/${pkgname}/lib32/libXinerama.so.1"
  rm "${pkgdir}/opt/${pkgname}/lib32/libXi.so.6"
  rm "${pkgdir}/opt/${pkgname}/lib32/libxml2.so.2"
  rm "${pkgdir}/opt/${pkgname}/lib32/libXmu.so.6"
  rm "${pkgdir}/opt/${pkgname}/lib32/libXrender.so.1"
  rm "${pkgdir}/opt/${pkgname}/lib32/libXt.so.6"
  rm "${pkgdir}/opt/${pkgname}/lib32/libz.so.1"

  # Fix permissions
  find "${pkgdir}/opt/${pkgname}" -type d -exec chmod 755 {} \;
  find "${pkgdir}/opt/${pkgname}" -type f -exec chmod 644 {} \;
  chmod -R 755 "${pkgdir}/opt/${pkgname}/lib32"
  chmod 755 "${pkgdir}/opt/${pkgname}/${pkgname}-bin"
  chmod 755 "${pkgdir}/opt/${pkgname}/${pkgname}-launcher"

  # Copy launchers
  install -Dm755 "${srcdir}/${pkgname}-launcher.sh" \
      "${pkgdir}/usr/bin/${pkgname}"
  install -Dm644 "${srcdir}/${pkgname}.desktop" \
      "${pkgdir}/usr/share/applications/${pkgname}.desktop"
}