summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorConstantin Nickel2016-11-20 00:26:46 +0100
committerConstantin Nickel2016-11-20 00:26:46 +0100
commit296cc5ebffa638520eecf65c6bae9f9a15f5d24d (patch)
treec0c204fc6c94921229a4bc0b41034ed997c47a8e
downloadaur-296cc5ebffa638520eecf65c6bae9f9a15f5d24d.tar.gz
initial commit
-rw-r--r--.SRCINFO32
-rw-r--r--PKGBUILD86
-rw-r--r--dosbox_ipx.conf2
-rw-r--r--dosbox_windowed.conf2
-rw-r--r--dungeon-keeper-gold-gog.desktop7
-rw-r--r--dungeon-keeper-gold-gog.install16
-rw-r--r--dungeon-keeper-gold-gog.sh99
-rw-r--r--fix-dosbox-mounts.patch42
-rw-r--r--fix-permissions.sh15
-rw-r--r--simple-net-config.patch108
10 files changed, 409 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..edf861dab1b6
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = dungeon-keeper-gold-gog
+ pkgdesc = Construct and manage a dungeon, recruiting and catering for minions to run it and defend it from enemy invaders.
+ pkgver = 2.1.0.7
+ pkgrel = 1
+ url = https://www.gog.com/game/dungeon_keeper
+ install = dungeon-keeper-gold-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_dungeon_keeper_gold_2.1.0.7.exe::gogdownloader://dungeon_keeper/installer_win_en
+ source = dungeon-keeper-gold-gog.sh
+ source = dungeon-keeper-gold-gog.desktop
+ source = dosbox_windowed.conf
+ source = dosbox_ipx.conf
+ source = simple-net-config.patch
+ source = fix-dosbox-mounts.patch
+ source = fix-permissions.sh
+ sha256sums = d92ba5f824ce123b281fda9f103d80a0c00af8be06e3c565b596894053233f29
+ sha256sums = a7944e92e1109d5a741ac5147d9a82b911d5d67295d275e0db3bed076abc28fd
+ sha256sums = bdbab0f3525b380d81cea61713009251da55a13c222ee4b4117afec12e90d4f9
+ sha256sums = 50b601b33522677a9bcaf23edc833329067bb87ccda33039c0b95f0d4ddca578
+ sha256sums = e90b33464517fb8b8102f3667755302e01fa10b7bec3d660357f802685416ca8
+ sha256sums = 36f076e6e0aa21d51c98507e4036d30a93234c94dcb0f77752b7ce97caea4f0d
+ sha256sums = 0031fe886d4f163f38ae7a3cdfbafd0b7c43045aa16e4b23b128d0656a83a645
+ sha256sums = bbfa392edd4ac36e2c274d22b07bf2f9115e3f134b0b7c8b146538d2d0b36c2a
+
+pkgname = dungeon-keeper-gold-gog
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e0cdf2c0f1c0
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,86 @@
+# Maintainer: Constantin Nickel <constantin dot nickel at gmail dot com>
+
+pkgname=dungeon-keeper-gold-gog
+pkgver=2.1.0.7
+pkgrel=1
+pkgdesc="Construct and manage a dungeon, recruiting and catering for minions to run it and defend it from enemy invaders."
+url="https://www.gog.com/game/dungeon_keeper"
+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_dungeon_keeper_gold_$pkgver.exe"::"gogdownloader://dungeon_keeper/installer_win_en"
+ "dungeon-keeper-gold-gog.sh"
+ "dungeon-keeper-gold-gog.desktop"
+ "dosbox_windowed.conf"
+ "dosbox_ipx.conf"
+ "simple-net-config.patch"
+ "fix-dosbox-mounts.patch"
+ "fix-permissions.sh")
+
+sha256sums=('d92ba5f824ce123b281fda9f103d80a0c00af8be06e3c565b596894053233f29'
+ 'a7944e92e1109d5a741ac5147d9a82b911d5d67295d275e0db3bed076abc28fd'
+ 'bdbab0f3525b380d81cea61713009251da55a13c222ee4b4117afec12e90d4f9'
+ '50b601b33522677a9bcaf23edc833329067bb87ccda33039c0b95f0d4ddca578'
+ 'e90b33464517fb8b8102f3667755302e01fa10b7bec3d660357f802685416ca8'
+ '36f076e6e0aa21d51c98507e4036d30a93234c94dcb0f77752b7ce97caea4f0d'
+ '0031fe886d4f163f38ae7a3cdfbafd0b7c43045aa16e4b23b128d0656a83a645'
+ 'bbfa392edd4ac36e2c274d22b07bf2f9115e3f134b0b7c8b146538d2d0b36c2a')
+
+# 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_dungeon_keeper_gold_$pkgver.exe
+ # convert icon
+ icotool -x app/goggame-1207658934.ico
+ icotool -x app/gfw_high_addon.ico
+ # create launchers
+ sed "s/Dungeon Keeper/Deeper Dungeons/;s/dungeon-keeper/deeper-dungeons/" \
+ $pkgname.desktop > deeper-dungeons.desktop
+ for _m in client server settings; do
+ sed "s|Exec=dungeon-keeper|& --$_m|;s|Name=Dungeon Keeper|& (${_m^})|" \
+ $pkgname.desktop > dungeon-keeper-$_m.desktop
+ done
+ # remove bundled dosbox, windows stuff and gog client files
+ rm -rf app/{dosbox/,*.ico,*.dll,goggame-1207658934.*,*.zip,__support}
+ # simplified net config for start script
+ patch -p1 -i "$srcdir"/simple-net-config.patch
+ # fix mount directory
+ patch -p1 -i "$srcdir"/fix-dosbox-mounts.patch
+}
+
+package() {
+ # data
+ install -d "$pkgdir"/opt/dungeon-keeper-gold
+ cp -r app/* "$pkgdir"/opt/dungeon-keeper-gold
+ # fix permissions script
+ install -Dm755 fix-permissions.sh "$pkgdir"/opt/dungeon-keeper-gold
+ # additional dosbox config
+ install -m644 dosbox_windowed.conf "$pkgdir"/opt/dungeon-keeper-gold
+ install -m644 dosbox_ipx.conf "$pkgdir"/opt/dungeon-keeper-gold
+ # doc + licenses
+ install -d "$pkgdir"/usr/share/{doc,licenses}/$pkgname
+ ln -s -t "$pkgdir"/usr/share/doc/$pkgname /opt/dungeon-keeper-gold/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/dungeon-keeper.desktop
+ install -Dm644 deeper-dungeons.desktop "$pkgdir"/usr/share/applications/deeper-dungeons.desktop
+ install -Dm755 $pkgname.sh "$pkgdir"/usr/bin/dungeon-keeper
+ ln -s dungeon-keeper "$pkgdir"/usr/bin/deeper-dungeons
+ for _m in client server settings; do
+ install -m644 dungeon-keeper-$_m.desktop "$pkgdir"/usr/share/applications
+ done
+ # icon
+ install -Dm644 goggame-1207658934_6_256x256x32.png "$pkgdir"/usr/share/pixmaps/dungeon-keeper.png
+ install -Dm644 gfw_high_addon_6_256x256x32.png "$pkgdir"/usr/share/pixmaps/deeper-dungeons.png
+}
diff --git a/dosbox_ipx.conf b/dosbox_ipx.conf
new file mode 100644
index 000000000000..4ae02b14d24e
--- /dev/null
+++ b/dosbox_ipx.conf
@@ -0,0 +1,2 @@
+[IPX]
+ipx=true
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/dungeon-keeper-gold-gog.desktop b/dungeon-keeper-gold-gog.desktop
new file mode 100644
index 000000000000..84de052aac0f
--- /dev/null
+++ b/dungeon-keeper-gold-gog.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=Dungeon Keeper
+Exec=dungeon-keeper
+Icon=dungeon-keeper
+Categories=Game;
+Terminal=false
diff --git a/dungeon-keeper-gold-gog.install b/dungeon-keeper-gold-gog.install
new file mode 100644
index 000000000000..c3fe29fd6861
--- /dev/null
+++ b/dungeon-keeper-gold-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/dungeon-keeper-gold/fix-permissions.sh [group]"
+ echo ""
+ echo "Unionfs:"
+ echo 'LOWER_DIR=/opt/dungeon-keeper-gold'
+ echo 'UPPER_DIR=$HOME/.gog/dungeon-keeper-gold/config'
+ echo 'UNION_DIR=$HOME/.gog/dungeon-keeper-gold/game'
+}
+
+post_upgrade() {
+ post_install
+}
diff --git a/dungeon-keeper-gold-gog.sh b/dungeon-keeper-gold-gog.sh
new file mode 100644
index 000000000000..44ab37c63ee2
--- /dev/null
+++ b/dungeon-keeper-gold-gog.sh
@@ -0,0 +1,99 @@
+#!/usr/bin/bash
+
+_help() {
+cat <<EOF
+ Usage: $script [options]
+ Options:
+ -h --help Show this message
+ --windowed Windowed mode
+ --settings Change settings
+ --addon Start the addon Deeper Dungeon
+ --client Start in client mode
+ --server Start in server mode
+ Examples:
+
+ $script --windowed
+ $script --client
+ $script --server --addon
+EOF
+ exit 0
+}
+
+pushd() { builtin pushd "$@" > /dev/null; }
+popd() { builtin popd > /dev/null; }
+
+INSTALL_DIR=/opt/dungeon-keeper-gold
+HOME_DIR="$HOME"/.gog/dungeon-keeper-gold
+
+if which unionfs &> /dev/null; then
+ USE_UNIONFS=1
+fi
+
+script=${0##*/}
+
+if [ "$script" == "deeper-dungeons" ]; then
+ START_ADDON=1
+fi
+
+TEMP=$(getopt -o h --long help,windowed,addon,settings,client,server \
+ -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 ;;
+ --settings) START_SETTINGS=1; shift ;;
+ --addon) START_ADDON=1; shift ;;
+ --client) START_CLIENT=1; shift ;;
+ --server) START_SERVER=1; shift ;;
+ --) shift; break ;;
+ esac
+done
+
+configs=('-conf' 'dosboxdk.conf')
+
+if [ "${START_SERVER:=0}" -eq 1 ] && [ ! "$START_SETTINGS" ]; then
+ configs+=('-conf' 'dosboxdk_server.conf')
+ ENABLE_IPX=1
+fi
+
+if [ "${START_CLIENT:=0}" -eq 1 ] && [ "${START_SERVER:=0}" -ne 1 ] \
+ && [ ! "$START_SETTINGS" ]; then
+ configs+=('-conf' 'dosboxdk_client.conf')
+ ENABLE_IPX=1
+fi
+
+if [ "$WINDOWED" ]; then
+ configs+=('-conf' 'dosbox_windowed.conf')
+fi
+
+if [ "$START_SETTINGS" ]; then
+ configs+=('-conf' 'dosboxdk_settings.conf')
+elif [ "$START_ADDON" ] ; then
+ configs+=('-conf' 'dosboxdk_addon.conf')
+else
+ configs+=('-conf' 'dosboxdk_single.conf')
+fi
+
+if [ "$ENABLE_IPX" ]; then
+ configs+=('-conf' 'dosbox_ipx.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/fix-dosbox-mounts.patch b/fix-dosbox-mounts.patch
new file mode 100644
index 000000000000..4cea8229db9d
--- /dev/null
+++ b/fix-dosbox-mounts.patch
@@ -0,0 +1,42 @@
+diff --git a/app/dosboxdk_addon.conf b/app/dosboxdk_addon.conf
+--- a/app/dosboxdk_addon.conf
++++ b/app/dosboxdk_addon.conf
+@@ -5,8 +5,8 @@ ipx=false
+ [autoexec]
+ # Lines in this section will be run at startup.
+ @echo off
+-mount C ".."
+-imgmount d "..\game.inst" -t iso -fs iso
++mount C "."
++imgmount d "game.inst" -t iso -fs iso
+ c:
+ cls
+ deeper.exe
+diff --git a/app/dosboxdk_settings.conf b/app/dosboxdk_settings.conf
+--- a/app/dosboxdk_settings.conf
++++ b/app/dosboxdk_settings.conf
+@@ -7,8 +7,8 @@ ipx=false
+
+ [autoexec]
+ @echo off
+-mount c ".."
+-imgmount d "..\game.inst" -t iso -fs iso
++mount C "."
++imgmount d "game.inst" -t iso -fs iso
+ c:
+ cls
+
+diff --git a/app/dosboxdk_single.conf b/app/dosboxdk_single.conf
+--- a/app/dosboxdk_single.conf
++++ b/app/dosboxdk_single.conf
+@@ -5,8 +5,8 @@ ipx=false
+ [autoexec]
+ # Lines in this section will be run at startup.
+ @echo off
+-mount C ".."
+-imgmount d "..\game.inst" -t iso -fs iso
++mount C "."
++imgmount d "game.inst" -t iso -fs iso
+ c:
+ cls
+ keeper.exe
diff --git a/fix-permissions.sh b/fix-permissions.sh
new file mode 100644
index 000000000000..d8b19d73d73d
--- /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/dungeon-keeper-gold/{data,save,sound}
+chmod -R g+w /opt/dungeon-keeper-gold/{data,save,sound}
diff --git a/simple-net-config.patch b/simple-net-config.patch
new file mode 100644
index 000000000000..c5d47ae6626a
--- /dev/null
+++ b/simple-net-config.patch
@@ -0,0 +1,108 @@
+diff --git a/app/dosboxdk_client.conf b/app/dosboxdk_client.conf
+--- a/app/dosboxdk_client.conf
++++ b/app/dosboxdk_client.conf
+@@ -3,47 +3,5 @@ ipx=true
+
+ [autoexec]
+ # Lines in this section will be run at startup.
+-echo off
+-cls
+-IPXNET CONNECT 127.0.0.1
+-cls
+-@ECHO 
+-@ECHO ----------------------------
+-@ECHO Dungeon Keeper GOLD
+-@ECHO ----------------------------
+-@ECHO *MULTIPLAYER - CLIENT*
+-@ECHO on
+-@ECHO off
+-@ECHO 1) Dungeon Keeper
+-@ECHO 2) Deeper Dungeons
+-@ECHO on
+-@ECHO off
+-@ECHO ----------------------------
+-@ECHO 3) exit program
+-@ECHO ----------------------------
+-@ECHO 
+-@ECHO on
+-@ECHO off
+-@choice /c123 /s Which game do you want to run? [1-3]: /n
+-if errorlevel 3 goto exit
+-if errorlevel 2 goto deeper
+-if errorlevel 1 goto keeper
+-
+-:keeper
+-mount C ".."
+-imgmount d "..\game.inst" -t iso -fs iso
+-c:
+-cls
+-keeper.exe
+-exit
+-
+-:deeper
+-mount C ".."
+-imgmount d "..\game.inst" -t iso -fs iso
+-c:
+-cls
+-deeper.exe
+-exit
+-
+-:exit
+-exit
++@echo off
++IPXNET CONNECT 127.0.0.1 19900
+\ No newline at end of file
+diff --git a/app/dosboxdk_server.conf b/app/dosboxdk_server.conf
+--- a/app/dosboxdk_server.conf
++++ b/app/dosboxdk_server.conf
+@@ -4,48 +4,4 @@ ipx=true
+ [autoexec]
+ # Lines in this section will be run at startup.
+ @echo off
+-cls
+-IPXNET STARTSERVER
+-cls
+-@ECHO 
+-@ECHO ----------------------------
+-@ECHO Dungeon Keeper GOLD
+-@ECHO ----------------------------
+-@ECHO *MULTIPLAYER - HOST*
+-@ECHO on
+-@ECHO off
+-@ECHO 1) Dungeon Keeper
+-@ECHO 2) Deeper Dungeons
+-@ECHO on
+-@ECHO off
+-@ECHO ----------------------------
+-@ECHO 3) exit program
+-@ECHO ----------------------------
+-@ECHO 
+-@ECHO on
+-@ECHO off
+-@choice /c123 /s Which game do you want to run? [1-3]: /n
+-if errorlevel 3 goto exit
+-if errorlevel 2 goto deeper
+-if errorlevel 1 goto keeper
+-
+-:keeper
+-cls
+-mount C ".."
+-imgmount d "..\game.inst" -t iso -fs iso
+-c:
+-cls
+-keeper.exe
+-exit
+-
+-:deeper
+-cls
+-mount C ".."
+-imgmount d "..\game.inst" -t iso -fs iso
+-c:
+-cls
+-deeper.exe
+-exit
+-
+-:exit
+-exit
++IPXNET STARTSERVER 19900
+\ No newline at end of file