summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorConstantin Nickel2016-11-21 19:33:46 +0100
committerConstantin Nickel2016-11-21 19:33:46 +0100
commit6ee165f665c54054f6d778f5d15c25602b830a10 (patch)
tree1e2401284b4cfafb7c4e3afd63ef66d9796cfce6
downloadaur-6ee165f665c54054f6d778f5d15c25602b830a10.tar.gz
initial commit
-rw-r--r--.SRCINFO34
-rw-r--r--PKGBUILD79
-rw-r--r--battle-isle2-gog.desktop7
-rw-r--r--battle-isle2-gog.install16
-rw-r--r--battle-isle2-gog.sh76
-rw-r--r--dosbox_windowed.conf2
-rw-r--r--dosboxbi2_addon.conf8
-rw-r--r--dosboxbi2_main.conf7
-rw-r--r--fix-dosbox-mounts.patch25
-rw-r--r--fix-image-cue.patch18
-rw-r--r--fix-permissions.sh15
11 files changed, 287 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..1c323b2f80cb
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,34 @@
+pkgbase = battle-isle2-gog
+ pkgdesc = A turn-based tactics game which tells the story about the wars on the fictional planet, Chromos.
+ pkgver = 2.2.0.20
+ pkgrel = 1
+ url = https://www.gog.com/game/battle_isle_platinum
+ install = battle-isle2-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_isle2_2.2.0.20.exe::gogdownloader://battle_isle2/installer_win_en
+ source = battle-isle2-gog.sh
+ source = battle-isle2-gog.desktop
+ source = dosboxbi2_main.conf
+ source = dosboxbi2_addon.conf
+ source = dosbox_windowed.conf
+ source = fix-image-cue.patch
+ source = fix-dosbox-mounts.patch
+ source = fix-permissions.sh
+ sha256sums = 8376ed695366a5495c216ca0ebf7153138318fa2ebff1c78a272b32b89dcbe6f
+ sha256sums = e59720ae6e516c7d78c1174d827ab90e49f084bff5c00204b6d717b1de2ab8cc
+ sha256sums = bb5c13954638d030c740805153aa25db3f94b21e0acef895022f1967d796fed4
+ sha256sums = 0331176b6b3e5505cb81e805cd90a3130bd861403b300b46ca7445aab4b2ca1a
+ sha256sums = 9407e1f77e8ccf1ed20504c42ce13560938e0d5b2412ae249d578a96acad8719
+ sha256sums = 50b601b33522677a9bcaf23edc833329067bb87ccda33039c0b95f0d4ddca578
+ sha256sums = c2164249e7e5968ad356001599f6301c5652bd8d4bed42d36f317ca92b4b2612
+ sha256sums = 1c1917bccab3e7ba21b4a518634122715809a62a9b09cf8a72c9a794db3f02fb
+ sha256sums = f85afa50c4adaf6c9c160da79b6ad77eadf334813f7bdb90eccbaf25bf85d54f
+
+pkgname = battle-isle2-gog
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..25c36e8d60ae
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,79 @@
+# Maintainer: Constantin Nickel <constantin dot nickel at gmail dot com>
+
+pkgname=battle-isle2-gog
+pkgver=2.2.0.20
+pkgrel=1
+pkgdesc="A turn-based tactics game which tells the story about the wars on the fictional planet, Chromos."
+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_isle2_$pkgver.exe"::"gogdownloader://battle_isle2/installer_win_en"
+ "battle-isle2-gog.sh"
+ "battle-isle2-gog.desktop"
+ "dosboxbi2_main.conf"
+ "dosboxbi2_addon.conf"
+ "dosbox_windowed.conf"
+ "fix-image-cue.patch"
+ "fix-dosbox-mounts.patch"
+ "fix-permissions.sh")
+
+sha256sums=('8376ed695366a5495c216ca0ebf7153138318fa2ebff1c78a272b32b89dcbe6f'
+ 'e59720ae6e516c7d78c1174d827ab90e49f084bff5c00204b6d717b1de2ab8cc'
+ 'bb5c13954638d030c740805153aa25db3f94b21e0acef895022f1967d796fed4'
+ '0331176b6b3e5505cb81e805cd90a3130bd861403b300b46ca7445aab4b2ca1a'
+ '9407e1f77e8ccf1ed20504c42ce13560938e0d5b2412ae249d578a96acad8719'
+ '50b601b33522677a9bcaf23edc833329067bb87ccda33039c0b95f0d4ddca578'
+ 'c2164249e7e5968ad356001599f6301c5652bd8d4bed42d36f317ca92b4b2612'
+ '1c1917bccab3e7ba21b4a518634122715809a62a9b09cf8a72c9a794db3f02fb'
+ 'f85afa50c4adaf6c9c160da79b6ad77eadf334813f7bdb90eccbaf25bf85d54f')
+
+# 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_isle2_$pkgver.exe
+ # convert icon
+ icotool -x app/goggame-1207661073.ico
+ # create launchers
+ sed "s|Exec=battle-isle2|& --addon|;s|Name=Battle Isle 2|&: Titan's Legacy|" \
+ $pkgname.desktop > battle-isle2-addon.desktop
+ # remove bundled dosbox, windows stuff and gog client files
+ rm -rf app/{dosbox/,*.ico,*.dll,goggame-1207661073.*,*.zip,__support}
+ # fix image cue
+ patch -p1 -i "$srcdir"/fix-image-cue.patch
+ # fix mount directory
+ patch -p1 -i "$srcdir"/fix-dosbox-mounts.patch
+}
+
+package() {
+ # data
+ install -d "$pkgdir"/opt/battle-isle2
+ cp -r app/* "$pkgdir"/opt/battle-isle2
+ # fix permissions script
+ install -Dm755 fix-permissions.sh "$pkgdir"/opt/battle-isle2
+ # additional dosbox config
+ install -m644 dosbox_windowed.conf "$pkgdir"/opt/battle-isle2
+ install -m644 dosboxbi2_main.conf "$pkgdir"/opt/battle-isle2
+ install -m644 dosboxbi2_addon.conf "$pkgdir"/opt/battle-isle2
+ # doc + licenses
+ install -d "$pkgdir"/usr/share/{doc,licenses}/$pkgname
+ ln -s -t "$pkgdir"/usr/share/doc/$pkgname /opt/battle-isle2/{manual.pdf,scenery\ -\ 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/battle-isle2.desktop
+ install -Dm755 $pkgname.sh "$pkgdir"/usr/bin/battle-isle2
+ install -m644 battle-isle2-addon.desktop "$pkgdir"/usr/share/applications
+ # icon
+ install -Dm644 goggame-1207661073_6_256x256x32.png "$pkgdir"/usr/share/pixmaps/battle-isle2.png
+}
diff --git a/battle-isle2-gog.desktop b/battle-isle2-gog.desktop
new file mode 100644
index 000000000000..bcb597dbd8d2
--- /dev/null
+++ b/battle-isle2-gog.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=Battle Isle 2
+Exec=battle-isle2
+Icon=battle-isle2
+Categories=Game;
+Terminal=false
diff --git a/battle-isle2-gog.install b/battle-isle2-gog.install
new file mode 100644
index 000000000000..fe1e69cba9a9
--- /dev/null
+++ b/battle-isle2-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/battle-isle2/fix-permissions.sh [group]"
+ echo ""
+ echo "Unionfs:"
+ echo 'LOWER_DIR=/opt/battle-isle2'
+ echo 'UPPER_DIR=$HOME/.gog/battle-isle2/config'
+ echo 'UNION_DIR=$HOME/.gog/battle-isle2/game'
+}
+
+post_upgrade() {
+ post_install
+}
diff --git a/battle-isle2-gog.sh b/battle-isle2-gog.sh
new file mode 100644
index 000000000000..502ab4ead876
--- /dev/null
+++ b/battle-isle2-gog.sh
@@ -0,0 +1,76 @@
+#!/usr/bin/bash
+
+_help() {
+cat <<EOF
+ Usage: $script [options]
+ Options:
+ -h --help Show this message
+ --windowed Windowed mode
+ --addon Battle Isle 2 Scenery CD: Titan's Legacy
+ --single Use original gog startup config
+ Examples:
+
+ $script --windowed
+ $script --client
+ $script --server --addon
+EOF
+ exit 0
+}
+
+pushd() { builtin pushd "$@" > /dev/null; }
+popd() { builtin popd > /dev/null; }
+
+INSTALL_DIR=/opt/battle-isle2
+HOME_DIR="$HOME"/.gog/battle-isle2
+
+if which unionfs &> /dev/null; then
+ USE_UNIONFS=1
+fi
+
+script=${0##*/}
+
+TEMP=$(getopt -o h --long help,windowed,addon,single \
+ -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 ;;
+ --single) START_SINGLE=1; shift ;;
+ --addon) START_ADDON=1; shift ;;
+ --) shift; break ;;
+ esac
+done
+
+configs=('-conf' 'dosboxbi2.conf')
+
+if [ "$WINDOWED" ]; then
+ configs+=('-conf' 'dosbox_windowed.conf')
+fi
+
+if [ "$START_SINGLE" ]; then
+ configs+=('-conf' 'dosboxbi2_single.conf')
+elif [ "$START_ADDON" ] ; then
+ configs+=('-conf' 'dosboxbi2_addon.conf')
+else
+ configs+=('-conf' 'dosboxbi2_main.conf')
+fi
+
+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
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/dosboxbi2_addon.conf b/dosboxbi2_addon.conf
new file mode 100644
index 000000000000..03e84759470e
--- /dev/null
+++ b/dosboxbi2_addon.conf
@@ -0,0 +1,8 @@
+[autoexec]
+mount C "scenery"
+imgmount d "scenery/bi2scen.inst" -t iso -fs iso
+c:
+cls
+@INTRO.EXE
+@BATTLE2.EXE ENG
+exit
diff --git a/dosboxbi2_main.conf b/dosboxbi2_main.conf
new file mode 100644
index 000000000000..ae5dd029ef7a
--- /dev/null
+++ b/dosboxbi2_main.conf
@@ -0,0 +1,7 @@
+[autoexec]
+mount C "isle2"
+imgmount d "isle2/bi2.inst" -t iso -fs iso
+c:
+cls
+@BATTLE2.EXE ENG
+exit
diff --git a/fix-dosbox-mounts.patch b/fix-dosbox-mounts.patch
new file mode 100644
index 000000000000..959db281ee83
--- /dev/null
+++ b/fix-dosbox-mounts.patch
@@ -0,0 +1,25 @@
+diff --git a/app/dosboxbi2_single.conf b/app/dosboxbi2_single.conf
+--- a/app/dosboxbi2_single.conf
++++ b/app/dosboxbi2_single.conf
+@@ -25,8 +25,8 @@ if errorlevel 1 goto isle2
+
+ :isle2
+ cls
+-mount C "..\ISLE2"
+-imgmount d "..\ISLE2\BI2.inst" -t iso -fs iso
++mount C "isle2"
++imgmount d "isle2/bi2.inst" -t iso -fs iso
+ c:
+ cls
+ @BATTLE2.EXE ENG
+@@ -34,8 +34,8 @@ exit
+
+ :scenery
+ cls
+-mount C "..\SCENERY"
+-imgmount d "..\SCENERY\BI2scen.inst" -t iso -fs iso
++mount C "scenery"
++imgmount d "scenery/bi2scen.inst" -t iso -fs iso
+ c:
+ cls
+ @INTRO.EXE
diff --git a/fix-image-cue.patch b/fix-image-cue.patch
new file mode 100644
index 000000000000..840c8358de0e
--- /dev/null
+++ b/fix-image-cue.patch
@@ -0,0 +1,18 @@
+diff --git a/app/isle2/bi2.inst b/app/isle2/bi2.inst
+--- a/app/isle2/bi2.inst
++++ b/app/isle2/bi2.inst
+@@ -1,4 +1,4 @@
+-FILE "BI2.gog" BINARY
++FILE "bi2.gog" BINARY
+ TRACK 01 MODE1/2352
+ INDEX 01 00:00:00
+ FILE "bi202.ogg" MP3
+diff --git a/app/scenery/bi2scen.inst b/app/scenery/bi2scen.inst
+--- a/app/scenery/bi2scen.inst
++++ b/app/scenery/bi2scen.inst
+@@ -1,4 +1,4 @@
+-FILE "BI2scen.gog" BINARY
++FILE "bi2scen.gog" BINARY
+ TRACK 01 MODE1/2352
+ INDEX 01 00:00:00
+ FILE "bi202.ogg" MP3
diff --git a/fix-permissions.sh b/fix-permissions.sh
new file mode 100644
index 000000000000..bb460fc18beb
--- /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 -R $_group /opt/battle-isle2/{isle2,scenery}/sav
+chmod -R g+w /opt/battle-isle2/{isle2,scenery}/sav