| # 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 | |
| } |
| [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 |