secret
Created

Shank 2 PKGBUILD

  • Download Gist
PKGBUILD
Shell
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
# Maintainer: fzerorubigd <fzerorubigd@gmail.com>
# Contributor: N30N <archlinux@alunamation.com>
# Contributor: swiftgeek <swiftgeek@gmail.com>
# Contributor: Marvn <mistrmarvn@gmail.com>
# Contributor: flying sheep <flying-sheep@web.de>
 
pkgname=shank2
pkgver=update3
pkgrel=1
pkgdesc='A 2D side-scrolling beat ’em up.'
url='http://www.shankgame.com/'
license=('custom:commercial')
arch=('i686' 'x86_64')
groups=('humble-indie-bundle7' 'games')
depends=('sdl' 'libgl')
source=('shank2.sh' 'shank2.desktop')
sha1sums=('643c0420c130230da55cde0277f381eb5176b0cd'
'7a9fb9a54fe6d39c8fa795b76940ffb1bb1e47fe')
 
_archive="shank2-linux-$pkgver-1357159966.tar.gz"
_archive_sha1='c690a8c698c69e95d3f46c4ee35295c9ac97a64b'
 
PKGEXT='.pkg.tar'
 
package() {
_get_local_source $_archive --sha1 $_archive_sha1 || {
error "Unable to find the game archive. Please download it from your Humble Bundle page, and place it into one of the above locations."
exit 1
}
cd "$srcdir"
tar xf "$_archive" || true
if [ $CARCH == 'x86_64' ]; then
_arch=64
else
_arch=32
fi
install -Dm755 shank2.sh "$pkgdir/usr/bin/shank2"
install -Dm644 Shank2.xpm "$pkgdir/usr/share/shank2/Shank2.xpm"
install -Dm644 shank2.desktop "$pkgdir/usr/share/applications/shank2.desktop"
install -Dm755 bin/shank2-bin$_arch "$pkgdir/usr/share/shank2/bin/shank2"
install -d "$pkgdir/usr/share/shank2/lib"
install -Dm644 -t "$pkgdir/usr/share/shank2/lib" bin/lib$_arch/*
find data{,-pc} -type f -exec install -Dm644 {} "$pkgdir/usr/share/shank2/{}" \;
}
 
# Locates a file or folder provided by the user, and symlinks it into $srcdir
_get_local_source() {
msg "Looking for '$1'..."; rm -f "$srcdir/$1"
declare -A _search=(['build dir']="$startdir"
['$LOCAL_PACKAGE_SOURCES']="$LOCAL_PACKAGE_SOURCES")
for _key in "${!_search[@]}"; do local _dir="${_search["$_key"]}"
echo -n " - in $_key [${_dir:-<undefined>}] ... ";
if [[ -z "$_dir" || ! -e "$_dir/$1" ]]; then
echo "NOT FOUND"
elif [[ -n $2 && "$(${2#--}sum "$_dir/$1"|awk '{print $1}')" != $3 ]]; then
echo "CHECKSUM FAILED";
else
echo "FOUND"; ln -sfT "$(readlink -f "$_dir/$1")" "$srcdir/$1"; break; fi
done
if [ ! -e "$srcdir/$1" ]; then return 1; fi
}
shank2.desktop
1 2 3 4 5 6 7 8 9
[Desktop Entry]
Type=Application
Name=Shank 2
GenericName=Shank 2
Comment=A 2D side-scrolling beat 'em up.
Categories=Game;ArcadeGame;
Path=/usr/share/shank2/
Icon=/usr/share/shank2/Shank2.xpm
Exec=shank2
shank2.sh
Shell
1 2 3 4 5
#!/bin/sh
 
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/share/shank2/lib/
cd /usr/share/shank2/bin/
exec ./shank2 "$@"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.