diff options
-rw-r--r-- | .SRCINFO | 38 | ||||
-rw-r--r-- | PKGBUILD | 85 | ||||
-rw-r--r-- | dosbox_ipx.conf | 2 | ||||
-rw-r--r-- | dosbox_windowed.conf | 2 | ||||
-rw-r--r-- | dosboxsyndicate_addon.conf | 11 | ||||
-rw-r--r-- | dosboxsyndicate_main.conf | 11 | ||||
-rw-r--r-- | dosboxsyndicate_reset.conf | 9 | ||||
-rw-r--r-- | fix-dosbox-mounts.patch | 12 | ||||
-rw-r--r-- | fix-permissions.sh | 15 | ||||
-rw-r--r-- | simple-net-config.patch | 35 | ||||
-rw-r--r-- | syndicate-plus-gog.desktop | 7 | ||||
-rw-r--r-- | syndicate-plus-gog.install | 16 | ||||
-rw-r--r-- | syndicate-plus-gog.sh | 101 |
13 files changed, 344 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..c94b1ba12767 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,38 @@ +pkgbase = syndicate-plus-gog + pkgdesc = In the dark and twisted cities of tomorrow, corporate syndicates compete for global dominance. + pkgver = 2.1.0.15 + pkgrel = 1 + url = https://www.gog.com/game/syndicate + install = syndicate-plus-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_syndicate_plus_2.1.0.15.exe::gogdownloader://syndicate/installer_win_en + source = syndicate-plus-gog.desktop + source = syndicate-plus-gog.sh + source = dosbox_windowed.conf + source = dosbox_ipx.conf + source = dosboxsyndicate_main.conf + source = dosboxsyndicate_addon.conf + source = dosboxsyndicate_reset.conf + source = simple-net-config.patch + source = fix-dosbox-mounts.patch + source = fix-permissions.sh + sha256sums = 671c5197f1a1dbe7fb3118a5f0c5595bb9d65693e1856f656eb4f572c99e1af0 + sha256sums = 9972dfcceb58af7fa0ca258a1c8ecdffbd15fb817dc75f137afa9bc6bfae0256 + sha256sums = 78f956a693b56907632d701e777117f84abb4675fe4d4e8413e8618151f4e6e9 + sha256sums = 50b601b33522677a9bcaf23edc833329067bb87ccda33039c0b95f0d4ddca578 + sha256sums = e90b33464517fb8b8102f3667755302e01fa10b7bec3d660357f802685416ca8 + sha256sums = 693a4d7a323acc98ad2ff585b9f403b937367e9a7ed8f7b1993a98889422a5a8 + sha256sums = a04b70aac6c4190883027db4d8b0bb6ba6222fa75a59e529cecd41f3f6818937 + sha256sums = fd169eb8188428b6cdcce088604439e81f47e5412b122a0b51f88a0d4bd86e1b + sha256sums = aff618cf2fc395598cf12c64ef180a79679c2d79f1ff9e707f19aa384b2beb74 + sha256sums = 33aa6befd7e18dd8d6c84db09879a5414d78e7554940dd31ae58e9bd22e293a0 + sha256sums = 27da071a9e01ea0952c92dcdcd5c8100dc60a5694bd9d183dee79f9d3a10da2a + +pkgname = syndicate-plus-gog + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..fd32eaf68723 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,85 @@ +# Maintainer: Constantin Nickel <constantin dot nickel at gmail dot com> + +pkgname=syndicate-plus-gog +pkgver=2.1.0.15 +pkgrel=1 +pkgdesc="In the dark and twisted cities of tomorrow, corporate syndicates compete for global dominance." +url="https://www.gog.com/game/syndicate" +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_syndicate_plus_$pkgver.exe"::"gogdownloader://syndicate/installer_win_en" + "syndicate-plus-gog.desktop" + "syndicate-plus-gog.sh" + "dosbox_windowed.conf" + "dosbox_ipx.conf" + "dosboxsyndicate_main.conf" + "dosboxsyndicate_addon.conf" + "dosboxsyndicate_reset.conf" + "simple-net-config.patch" + "fix-dosbox-mounts.patch" + "fix-permissions.sh") + +sha256sums=('671c5197f1a1dbe7fb3118a5f0c5595bb9d65693e1856f656eb4f572c99e1af0' + '9972dfcceb58af7fa0ca258a1c8ecdffbd15fb817dc75f137afa9bc6bfae0256' + '78f956a693b56907632d701e777117f84abb4675fe4d4e8413e8618151f4e6e9' + '50b601b33522677a9bcaf23edc833329067bb87ccda33039c0b95f0d4ddca578' + 'e90b33464517fb8b8102f3667755302e01fa10b7bec3d660357f802685416ca8' + '693a4d7a323acc98ad2ff585b9f403b937367e9a7ed8f7b1993a98889422a5a8' + 'a04b70aac6c4190883027db4d8b0bb6ba6222fa75a59e529cecd41f3f6818937' + 'fd169eb8188428b6cdcce088604439e81f47e5412b122a0b51f88a0d4bd86e1b' + 'aff618cf2fc395598cf12c64ef180a79679c2d79f1ff9e707f19aa384b2beb74' + '33aa6befd7e18dd8d6c84db09879a5414d78e7554940dd31ae58e9bd22e293a0' + '27da071a9e01ea0952c92dcdcd5c8100dc60a5694bd9d183dee79f9d3a10da2a') + +# 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_syndicate_plus_$pkgver.exe + # convert icon + icotool -x app/goggame-1207658992.ico + # create launchers + sed "s|Exec=syndicate|& --addon|;s|Name=Syndicate|&: American Revolt|" \ + $pkgname.desktop > syndicate-american-revolt.desktop + # remove bundled dosbox, windows stuff and gog client files + rm -rf app/{dosbox/,*.ico,*.dll,goggame-1207658992.*,*.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/syndicate-plus + cp -r app/* "$pkgdir"/opt/syndicate-plus + # fix permissions script + install -Dm755 fix-permissions.sh "$pkgdir"/opt/syndicate-plus + # additional dosbox config + install -m644 dosbox_windowed.conf "$pkgdir"/opt/syndicate-plus + install -m644 dosbox_ipx.conf "$pkgdir"/opt/syndicate-plus + install -m644 dosboxsyndicate_main.conf "$pkgdir"/opt/syndicate-plus + install -m644 dosboxsyndicate_addon.conf "$pkgdir"/opt/syndicate-plus + install -m644 dosboxsyndicate_reset.conf "$pkgdir"/opt/syndicate-plus + # doc + licenses + install -d "$pkgdir"/usr/share/{doc,licenses}/$pkgname + ln -s -t "$pkgdir"/usr/share/doc/$pkgname /opt/syndicate-plus/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/syndicate.desktop + install -Dm755 $pkgname.sh "$pkgdir"/usr/bin/syndicate + install -m644 syndicate-american-revolt.desktop "$pkgdir"/usr/share/applications + # icon + install -Dm644 goggame-1207658992_6_256x256x32.png "$pkgdir"/usr/share/pixmaps/syndicate.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/dosboxsyndicate_addon.conf b/dosboxsyndicate_addon.conf new file mode 100644 index 000000000000..81c2bec7158d --- /dev/null +++ b/dosboxsyndicate_addon.conf @@ -0,0 +1,11 @@ +[ipx] +ipx=false + +[autoexec] +@echo off +mount c "." +c: +cd datadisk +cls +main.exe +exit
\ No newline at end of file diff --git a/dosboxsyndicate_main.conf b/dosboxsyndicate_main.conf new file mode 100644 index 000000000000..48c103e56d48 --- /dev/null +++ b/dosboxsyndicate_main.conf @@ -0,0 +1,11 @@ +[ipx] +ipx=false + +[autoexec] +@echo off +mount c "." +c: +cd syndicat +cls +main.exe +exit
\ No newline at end of file diff --git a/dosboxsyndicate_reset.conf b/dosboxsyndicate_reset.conf new file mode 100644 index 000000000000..591e7f126230 --- /dev/null +++ b/dosboxsyndicate_reset.conf @@ -0,0 +1,9 @@ +[IPX] +ipx=false + +[sdl] +fullscreen=false + +[autoexec] +call reset_language.bat +exit diff --git a/fix-dosbox-mounts.patch b/fix-dosbox-mounts.patch new file mode 100644 index 000000000000..58fb2f1d2c40 --- /dev/null +++ b/fix-dosbox-mounts.patch @@ -0,0 +1,12 @@ +diff --git a/app/dosboxsyndicate_single.conf b/app/dosboxsyndicate_single.conf +--- a/app/dosboxsyndicate_single.conf ++++ b/app/dosboxsyndicate_single.conf +@@ -3,7 +3,7 @@ ipx=false +
+ [autoexec]
+ @echo off
+-mount c ".."
++mount c "."
+ c:
+ cls
+ synd.exe
diff --git a/fix-permissions.sh b/fix-permissions.sh new file mode 100644 index 000000000000..c7020157716d --- /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/syndicate-plus/{synd,syndicat/data,datadisk/data} +chmod -R g+w /opt/syndicate-plus/{synd,syndicat/data,datadisk/data} diff --git a/simple-net-config.patch b/simple-net-config.patch new file mode 100644 index 000000000000..c57a7e7e27d9 --- /dev/null +++ b/simple-net-config.patch @@ -0,0 +1,35 @@ +diff --git a/app/dosboxsyndicate_client.conf b/app/dosboxsyndicate_client.conf +--- a/app/dosboxsyndicate_client.conf ++++ b/app/dosboxsyndicate_client.conf +@@ -2,11 +2,8 @@ + ipx=true
+
+ [autoexec]
+-@echo off
+-mount c ".."
++mount c "."
+ c:
+-cls
+-IPXNET CONNECT 127.0.0.1
++IPXNET CONNECT 127.0.0.1 19900
+ netbios.exe
+-synd.exe
+-exit
++cls
+diff --git a/app/dosboxsyndicate_server.conf b/app/dosboxsyndicate_server.conf +--- a/app/dosboxsyndicate_server.conf ++++ b/app/dosboxsyndicate_server.conf +@@ -2,11 +2,7 @@ + ipx=true
+
+ [autoexec]
+-@echo off
+-mount c ".."
++mount c "."
+ c:
+-cls
+-IPXNET STARTSERVER
++IPXNET STARTSERVER 19900
+ netbios.exe
+-synd.exe
+-exit
diff --git a/syndicate-plus-gog.desktop b/syndicate-plus-gog.desktop new file mode 100644 index 000000000000..aea88b26d72c --- /dev/null +++ b/syndicate-plus-gog.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=Syndicate +Exec=syndicate +Icon=syndicate +Categories=Game; +Terminal=false diff --git a/syndicate-plus-gog.install b/syndicate-plus-gog.install new file mode 100644 index 000000000000..973bb8770121 --- /dev/null +++ b/syndicate-plus-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/syndicate-plus/fix-permissions.sh [group]" + echo "" + echo "Unionfs:" + echo 'LOWER_DIR=/opt/syndicate-plus' + echo 'UPPER_DIR=$HOME/.gog/syndicate-plus/config' + echo 'UNION_DIR=$HOME/.gog/syndicate-plus/game' +} + +post_upgrade() { + post_install +} diff --git a/syndicate-plus-gog.sh b/syndicate-plus-gog.sh new file mode 100644 index 000000000000..36b36d620504 --- /dev/null +++ b/syndicate-plus-gog.sh @@ -0,0 +1,101 @@ +#!/usr/bin/bash + +_help() { +cat <<EOF + Usage: $script [options] + Options: + -h --help Show this message + --windowed Windowed mode + --single Start Syndicate + --main Start original Syndicate + --addon Start Syndicate: American Revolt + --reset Reset settings + --client Start in client mode + --server Start in server mode + Examples: + + $script --windowed + $script --addon --client + $script --single --server +EOF + exit 0 +} + +pushd() { builtin pushd "$@" > /dev/null; } +popd() { builtin popd > /dev/null; } + +INSTALL_DIR=/opt/syndicate-plus +HOME_DIR="$HOME"/.gog/syndicate-plus + +if which unionfs &> /dev/null; then + USE_UNIONFS=1 +fi + +script=${0##*/} + +TEMP=$(getopt -o h --long help,windowed,single,main,addon,reset,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 ;; + --single) START_SINGLE=1; shift ;; + --main) START_MAIN=1; shift ;; + --addon) START_ADDON=1; shift ;; + --reset) START_RESET=1; shift ;; + --client) START_CLIENT=1; shift ;; + --server) START_SERVER=1; shift ;; + --) shift; break ;; + esac +done + +configs=('-conf' 'dosboxsyndicate.conf') + +if [ "${START_SERVER:=0}" -eq 1 ] && [ ! "$START_RESET" ]; then + configs+=('-conf' 'dosboxsyndicate_server.conf') + ENABLE_IPX=1 +fi + +if [ "${START_CLIENT:=0}" -eq 1 ] && [ "${START_SERVER:=0}" -ne 1 ] \ + && [ ! "$START_RESET" ]; then + configs+=('-conf' 'dosboxsyndicate_client.conf') + ENABLE_IPX=1 +fi + +if [ "$WINDOWED" ]; then + configs+=('-conf' 'dosbox_windowed.conf') +fi + +if [ "$START_SINGLE" ]; then + configs+=('-conf' 'dosboxsyndicate_single.conf') +elif [ "$START_ADDON" ]; then + configs+=('-conf' 'dosboxsyndicate_addon.conf') +elif [ "$START_RESET" ]; then + configs+=('-conf' 'dosboxsyndicate_reset.conf') +else + configs+=('-conf' 'dosboxsyndicate_main.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 |