summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorConstantin Nickel2016-11-21 23:57:40 +0100
committerConstantin Nickel2016-11-21 23:57:40 +0100
commitf68ed9f2f1daee589996ffd71f845dc1980c06d7 (patch)
tree1fdf4d107a5ec9541a059b3ff78acf9cd066cc65
downloadaur-f68ed9f2f1daee589996ffd71f845dc1980c06d7.tar.gz
initial commit
-rw-r--r--.SRCINFO28
-rw-r--r--PKGBUILD65
-rw-r--r--dosbox_windowed.conf2
-rw-r--r--fix-dosbox-mounts.patch12
-rw-r--r--fix-permissions.sh15
-rw-r--r--historyline-1914-1918-gog.desktop7
-rw-r--r--historyline-1914-1918-gog.install16
-rw-r--r--historyline-1914-1918-gog.sh65
8 files changed, 210 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..2899b4937245
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,28 @@
+pkgbase = historyline-1914-1918-gog
+ pkgdesc = A turn-based tactics game which takes the player through various battles of the First World War.
+ pkgver = 2.2.0.20
+ pkgrel = 1
+ url = https://www.gog.com/game/battle_isle_platinum
+ install = historyline-1914-1918-gog.install
+ arch = any
+ groups = games
+ license = custom:eula
+ makedepends = innoextract
+ makedepends = icoutils
+ depends = dosbox
+ optdepends = unionfs-fuse: mounting game folder to home for savegames and settings
+ source = setup_battle_isle_historyline_2.2.0.20.exe::gogdownloader://historyline_19141918/installer_win_en
+ source = historyline-1914-1918-gog.desktop
+ source = historyline-1914-1918-gog.sh
+ source = dosbox_windowed.conf
+ source = fix-dosbox-mounts.patch
+ source = fix-permissions.sh
+ sha256sums = bd2083c0e6ffc51ef214ce2b8bc3903751db575215ecb3354a6251b766e62891
+ sha256sums = 3e23da721bf92236f431cb6d1131ae2d0681afc162baa027167816d164c9567b
+ sha256sums = 96426337f51658c94be5ad91a21fefcec936d73e35d66a27e79ef69e93ddc428
+ sha256sums = 50b601b33522677a9bcaf23edc833329067bb87ccda33039c0b95f0d4ddca578
+ sha256sums = 9e8cfbbba458f19373df1c32c69cbc91c5c49d25d9cd0585b19839b9844ed3d3
+ sha256sums = 8cb0a355c97b243e495509fd63191ba93b8e2e89fc45bf636938f691580102d0
+
+pkgname = historyline-1914-1918-gog
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..6d35b2c5002f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,65 @@
+# Maintainer: Constantin Nickel <constantin dot nickel at gmail dot com>
+
+pkgname=historyline-1914-1918-gog
+pkgver=2.2.0.20
+pkgrel=1
+pkgdesc="A turn-based tactics game which takes the player through various battles of the First World War."
+url="https://www.gog.com/game/battle_isle_platinum"
+license=('custom:eula')
+groups=('games')
+arch=('any')
+makedepends=('innoextract' 'icoutils')
+depends=('dosbox')
+optdepends=('unionfs-fuse: mounting game folder to home for savegames and settings')
+install=$pkgname.install
+
+source=("setup_battle_isle_historyline_$pkgver.exe"::"gogdownloader://historyline_19141918/installer_win_en"
+ "historyline-1914-1918-gog.desktop"
+ "historyline-1914-1918-gog.sh"
+ "dosbox_windowed.conf"
+ "fix-dosbox-mounts.patch"
+ "fix-permissions.sh")
+
+sha256sums=('bd2083c0e6ffc51ef214ce2b8bc3903751db575215ecb3354a6251b766e62891'
+ '3e23da721bf92236f431cb6d1131ae2d0681afc162baa027167816d164c9567b'
+ '96426337f51658c94be5ad91a21fefcec936d73e35d66a27e79ef69e93ddc428'
+ '50b601b33522677a9bcaf23edc833329067bb87ccda33039c0b95f0d4ddca578'
+ '9e8cfbbba458f19373df1c32c69cbc91c5c49d25d9cd0585b19839b9844ed3d3'
+ '8cb0a355c97b243e495509fd63191ba93b8e2e89fc45bf636938f691580102d0')
+
+# You need to download the gog.com installer file to this directory ($PWD),
+# either manually or with lgogdownloader. You can also configure DLAGENTS in
+# makepkg.conf to auto-download.
+#
+# The following is just a fallback to the above to notify the user:
+DLAGENTS+=('gogdownloader::/usr/bin/awk BEGIN{print"Please\ download\ the\ file\ \\""\ substr("%o",1,length("%o")-5)\ "\\"\ manually\\nor\ setup\ a\ gogdownloader://\ DLAGENT\ in\ makepkg.conf!\ Read\ this\ PKGBUILD\ for\ more\ information.";exit\ 1}')
+
+prepare() {
+ # extract installer (convert files to lowercase, as DOS does not care)
+ innoextract -e -L -d "$srcdir" setup_battle_isle_historyline_$pkgver.exe
+ # convert icon
+ icotool -x app/goggame-1207661063.ico
+ # remove bundled dosbox, windows stuff and gog client files
+ rm -rf app/{dosbox/,*.ico,*.dll,goggame-1207661063.*,*.zip,__support}
+ # fix mount directory
+ patch -p1 -i "$srcdir"/fix-dosbox-mounts.patch
+}
+
+package() {
+ # data
+ install -d "$pkgdir"/opt/historyline-1914-1918
+ cp -r app/* "$pkgdir"/opt/historyline-1914-1918
+ # fix permissions script
+ install -Dm755 fix-permissions.sh "$pkgdir"/opt/historyline-1914-1918
+ # additional dosbox configs
+ install -m644 dosbox_windowed.conf "$pkgdir"/opt/historyline-1914-1918
+ # doc + licenses
+ install -d "$pkgdir"/usr/share/{doc,licenses}/$pkgname
+ ln -s -t "$pkgdir"/usr/share/doc/$pkgname /opt/historyline-1914-1918/manual.pdf
+ install -m644 tmp/{gog_,}eula.txt "$pkgdir"/usr/share/licenses/$pkgname
+ # .desktop files and launchers
+ install -Dm644 $pkgname.desktop "$pkgdir"/usr/share/applications/historyline-1914-1918.desktop
+ install -Dm755 $pkgname.sh "$pkgdir"/usr/bin/historyline-1914-1918
+ # icon
+ install -Dm644 goggame-1207661063_6_256x256x32.png "$pkgdir"/usr/share/pixmaps/historyline-1914-1918.png
+}
diff --git a/dosbox_windowed.conf b/dosbox_windowed.conf
new file mode 100644
index 000000000000..79c944cd3b8f
--- /dev/null
+++ b/dosbox_windowed.conf
@@ -0,0 +1,2 @@
+[sdl]
+fullscreen=false \ No newline at end of file
diff --git a/fix-dosbox-mounts.patch b/fix-dosbox-mounts.patch
new file mode 100644
index 000000000000..5c107fae02ad
--- /dev/null
+++ b/fix-dosbox-mounts.patch
@@ -0,0 +1,12 @@
+diff --git a/app/dosboxbi1hl_single.conf b/app/dosboxbi1hl_single.conf
+--- a/app/dosboxbi1hl_single.conf
++++ b/app/dosboxbi1hl_single.conf
+@@ -6,7 +6,7 @@ ipx=false
+ # Lines in this section will be run at startup.
+
+ @ECHO OFF
+-mount C ".."
++mount C "."
+ c:
+ cls
+ HL14-18.EXE
diff --git a/fix-permissions.sh b/fix-permissions.sh
new file mode 100644
index 000000000000..84429f47da7d
--- /dev/null
+++ b/fix-permissions.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/sh
+
+_group="${1:-games}"
+
+getent group $_group &> /dev/null
+
+if [ $? != 0 ]; then
+ echo "group '$_group' not found";
+ echo "${0##/} [group] default: games"
+ exit 1
+fi
+
+# fix permissions
+chgrp $_group /opt/historyline-1914-1918
+chmod g+w /opt/historyline-1914-1918
diff --git a/historyline-1914-1918-gog.desktop b/historyline-1914-1918-gog.desktop
new file mode 100644
index 000000000000..4fb7a968452c
--- /dev/null
+++ b/historyline-1914-1918-gog.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=Historyline 1914-1918
+Exec=historyline-1914-1918
+Icon=historyline-1914-1918
+Categories=Game;
+Terminal=false
diff --git a/historyline-1914-1918-gog.install b/historyline-1914-1918-gog.install
new file mode 100644
index 000000000000..83cb850dccb3
--- /dev/null
+++ b/historyline-1914-1918-gog.install
@@ -0,0 +1,16 @@
+post_install() {
+ echo "In order to save or change settings you have to use the fix-permissions.sh"
+ echo "script or install 'unionfs-fuse' to get the game folder mounted in your home dir."
+ echo ""
+ echo "Fix permissions: The default group is 'games'"
+ echo "/opt/historyline-1914-1918/fix-permissions.sh [group]"
+ echo ""
+ echo "Unionfs:"
+ echo 'LOWER_DIR=/opt/historyline-1914-1918'
+ echo 'UPPER_DIR=$HOME/.gog/historyline-1914-1918/config'
+ echo 'UNION_DIR=$HOME/.gog/historyline-1914-1918/game'
+}
+
+post_upgrade() {
+ post_install
+}
diff --git a/historyline-1914-1918-gog.sh b/historyline-1914-1918-gog.sh
new file mode 100644
index 000000000000..c63cd462f7f4
--- /dev/null
+++ b/historyline-1914-1918-gog.sh
@@ -0,0 +1,65 @@
+#!/usr/bin/bash
+
+_help() {
+cat <<EOF
+ Usage: $script [options]
+ Options:
+ -h --help Show this message
+ --windowed Windowed mode
+ Examples:
+
+ $script
+ $script --windowed
+EOF
+ exit 0
+}
+
+pushd() { builtin pushd "$@" > /dev/null; }
+popd() { builtin popd > /dev/null; }
+
+INSTALL_DIR=/opt/historyline-1914-1918
+HOME_DIR="$HOME"/.gog/historyline-1914-1918
+
+if which unionfs &> /dev/null; then
+ USE_UNIONFS=1
+fi
+
+script=${0##*/}
+
+TEMP=$(getopt -o h --long help,windowed \
+ -n "$script" -- "$@")
+
+if [ $? != 0 ] ; then exit 1 ; fi
+
+eval set -- "$TEMP"
+
+while true; do
+ case "$1" in
+ -h|--help) _help; shift ;;
+ --windowed) WINDOWED=1; shift ;;
+ --) shift; break ;;
+ esac
+done
+
+configs=('-conf' 'dosboxbi1hl.conf')
+
+if [ "$WINDOWED" ]; then
+ configs+=('-conf' 'dosbox_windowed.conf')
+fi
+
+configs+=('-conf' 'dosboxbi1hl_single.conf')
+
+if [ "$USE_UNIONFS" ]; then
+ LOWER_DIR="$INSTALL_DIR"
+ UPPER_DIR="$HOME_DIR/config"
+ UNION_DIR="$HOME_DIR/game"
+ mkdir -p "$HOME_DIR"/{game,config}
+
+ unionfs -o cow,relaxed_permissions "$UPPER_DIR=RW:$LOWER_DIR=RO" "$UNION_DIR"
+ echo "Launching game within $UNION_DIR"
+ pushd "$UNION_DIR" && dosbox "${configs[@]}"
+ popd && fusermount -u "$UNION_DIR"
+else
+ echo "Launching game within $INSTALL_DIR"
+ cd $INSTALL_DIR && dosbox "${configs[@]}"
+fi