summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsmls2015-07-09 16:53:44 +0200
committersmls2015-07-09 16:53:44 +0200
commitffa920d29c41a42dceced94479ed099efba151f5 (patch)
tree8644ee39136e22506cfd52b74691f8fed1cfb747
downloadaur-ffa920d29c41a42dceced94479ed099efba151f5.tar.gz
Initial import
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD51
-rw-r--r--arx-fatalis-data-demo.install10
-rwxr-xr-xinstall-demo138
4 files changed, 218 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..3fa111b59cb4
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = arx-fatalis-data-demo
+ pkgdesc = Arx Fatalis game data from official free demo
+ pkgver = 0
+ pkgrel = 1
+ url = http://www.arkane-studios.com/uk/arx.php
+ install = arx-fatalis-data-demo.install
+ arch = i686
+ arch = x86_64
+ license = custom:freeware
+ makedepends = cabextract
+ makedepends = libarchive
+ provides = arx-fatalis-data
+ conflicts = arx-fatalis-data-gog
+ conflicts = arx-fatalis-data-copy
+ source = install-demo
+ md5sums = d6bc2486243986694426260d2d76f5cb
+
+pkgname = arx-fatalis-data-demo
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..481892304384
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,51 @@
+# Maintainer: Sam S. <smls75@gmail.com>
+
+pkgname=arx-fatalis-data-demo
+pkgver=0
+pkgrel=1
+pkgdesc='Arx Fatalis game data from official free demo'
+url='http://www.arkane-studios.com/uk/arx.php'
+arch=('i686' 'x86_64')
+license=('custom:freeware')
+makedepends=('cabextract' 'libarchive')
+provides=('arx-fatalis-data')
+conflicts=('arx-fatalis-data-gog' 'arx-fatalis-data-copy')
+source=("install-demo")
+md5sums=('d6bc2486243986694426260d2d76f5cb')
+install='arx-fatalis-data-demo.install'
+PKGEXT='.pkg.tar'
+
+_gamepkg="arx_demo_english.zip"
+
+
+package() {
+ cd $srcdir
+ _get_local_source "$_gamepkg" || {
+ error "Unable to find the game demo archive. Please download it from one of
+ the sites listed at
+ http://wiki.arx-libertatis.org/Getting_the_game_data#Demo ,
+ rename it to 'arx_demo_english.zip', and copy or symlink it into one
+ of the above directories."
+ exit 1; }
+
+ msg "Starting setup..."
+ chmod +x install-demo
+ ./install-demo "$_gamepkg" "$pkgdir/usr/share/arx"
+ mkdir "$pkgdir/usr/share/games" && ln -s "/usr/share/arx/" "$pkgdir/usr/share/games/arx"
+}
+
+
+# Locate a file or folder provided by the user, and symlink it into $srcdir
+_get_local_source() {
+ msg "Looking for '$1'..."
+ declare -A _search=(['build dir']="$startdir"
+ ['$LOCAL_PACKAGE_SOURCES']="$LOCAL_PACKAGE_SOURCES")
+ for _key in "${!_search[@]}"; do local _dir="${_search["$_key"]}"
+ if [ -z "$_dir" ]; then _dir="<undefined>"; fi
+ echo -n " - in $_key ['$_dir'] ... ";
+ if [ -e "$_dir/$1" ]; then
+ echo "FOUND"; ln -sfT "$(readlink -f "$_dir/$1")" "$srcdir/$1"; break; fi
+ echo "NOT FOUND"
+ done
+ if [ ! -e "$srcdir/$1" ]; then return 1; fi
+}
diff --git a/arx-fatalis-data-demo.install b/arx-fatalis-data-demo.install
new file mode 100644
index 000000000000..cc0ad4328b57
--- /dev/null
+++ b/arx-fatalis-data-demo.install
@@ -0,0 +1,10 @@
+
+post_install() {
+ echo "This package only installs the (proprietary) game demo data, no"
+ echo "game binaries."
+ echo "To actually play the demo, compile and install Arx Libertatis,"
+ echo "the community-driven open-source port of Arx Fatalis for Linux"
+ echo "based on the publically released Arx Fatalis 1.21 source code."
+ echo " -> http://arx-libertatis.org"
+ echo " -> AUR package: arx-libertatis"
+}
diff --git a/install-demo b/install-demo
new file mode 100755
index 000000000000..db11cbe2f99c
--- /dev/null
+++ b/install-demo
@@ -0,0 +1,138 @@
+#!/bin/sh
+
+die() {
+ echo "$@" >&2
+ exit 1
+}
+
+# Handle arguments
+
+[ "$1" = "--help" ] || [ "$1" = "-h" ] || zipfile="$(readlink -m "$1")"
+
+[ "$zipfile" != "" ] || die "\
+Usage: install-demo path/to/arx_demo_english.zip [output_dir]
+
+This script can be used to install the Arx Fatalis demo data.
+Files will be verified and renamed as needed by Arx Libertatis.
+
+For demo download locations see http://wiki.arx-libertatis.org/Getting_the_game_data#Demo"
+
+if [ "$2" = "" ]
+ then destdir="$(pwd)"
+ else destdir="$(readlink -m "$2")"
+fi
+
+cd "$(dirname "$0")"
+here="$(pwd)"
+
+echo "Installing Arx Fatalis demo data from \"$zipfile\" to \"$destdir\".
+"
+
+# Check for required commands
+
+cabextract=`which cabextract 2> /dev/null`
+unzip=`which unzip 2> /dev/null`
+bsdtar=`which bsdtar 2> /dev/null`
+md5sum=`which md5sum 2> /dev/null`
+
+[ -f "$cabextract" ] \
+ || die "Please install cabextract (http://www.cabextract.org.uk/)"
+
+[ -f "$unzip" ] || [ -f "$bsdtar" ] \
+ || die "Please install unzip (http://www.info-zip.org/)" \
+ "or bsdtar from libarchive (http://libarchive.github.com/)"
+
+[ -f "$zipfile" ] || die "Input file \"$zipfile\" not found."
+
+extract_cab() {
+ "$cabextract" "$1"
+}
+
+extract_zip() {
+ if [ -f "$unzip" ]
+ then "$unzip" "$1"
+ else "$bsdtar" xvf "$1"
+ fi
+}
+
+# Verify input file
+
+if [ -f "$md5sum" ]
+ then
+ checksum="$(md5sum -b "$zipfile" | sed 's/ .*//')"
+ expected='3c59a5799e1237b1b181c96e8c09155a'
+ if [ "$checksum" = "$expected" ]
+ then echo "Checksum matched."
+ else echo "Got checksum $checksum, expected $expected."
+ fi
+ else echo "Missing md5sum, cannot verify that you have the correct archive."
+fi
+
+# Prepare output and temp dirs
+
+mkdir -p "$destdir" || exit 1
+
+tempdir="$destdir/arx-install-demo-temp"
+
+rm -rf "$tempdir" 2> /dev/null
+mkdir "$tempdir" || exit 1
+cd "$tempdir" || exit 1
+
+# Extract files
+
+extract_zip "$zipfile"
+
+extract_cab Setup1.cab
+extract_cab Setup2.cab
+extract_cab Setup3.cab
+
+# Install required files
+
+doinstall() {
+ mv -fv "$1" "$destdir/$2"
+ chmod "--reference=$destdir" "$destdir/$2" > /dev/null 2>&1
+ chmod -x "$destdir/$2" > /dev/null 2>&1
+}
+
+mkdir -pv "$destdir/misc"
+doinstall "bin/Arx.ttf" "misc/arx.ttf"
+doinstall "bin/Logo.bmp" "misc/logo.bmp"
+doinstall "bin/data2.pak" "data2.pak"
+doinstall "bin/LOC.pak" "loc.pak"
+doinstall "data.pak" "data.pak"
+doinstall "SFX.pak" "sfx.pak"
+doinstall "SPEECH.pak" "speech.pak"
+
+# Cleanup temporary files
+
+rm -rf "$tempdir"
+
+echo "
+Done:"
+
+# Verify installed files
+
+[ -f "$md5sum" ] || ( echo "Could not verify checksum, md5sum not available." ; exit )
+
+cd "$destdir"
+checksums=`"$md5sum" -b data2.pak data.pak loc.pak misc/arx.ttf misc/logo.bmp sfx.pak speech.pak`
+
+checksums_demo="\
+958b78f8f370b06d769843137138c461 *data2.pak
+5d7ba6e6c79ebf7fbb232eaced9e8ad9 *data.pak
+2ae16d3925c597dca70f960f175def3a *loc.pak
+9a95ff96795c034524ba1c2e94ea12c7 *misc/arx.ttf
+aa3dfbd4bc9c863d10a0c5345ae5a4c9 *misc/logo.bmp
+ea1b3e6d6f4906905d4a34f07e9a59ac *sfx.pak
+62ca7b1751c0615ee131a94f0856b389 *speech.pak"
+
+[ "$checksums" = "$checksums_demo" ] || die "
+Checksum mismatch, expected
+
+$checksums_demo
+
+ got
+
+$checksums"
+
+echo "Checksum match."