summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorConstantin Nickel2016-11-20 14:21:53 +0100
committerConstantin Nickel2016-11-20 14:21:53 +0100
commitc4e3c7ec80b5cd910b8047d3a849347ba8ecf716 (patch)
tree331e7078481888425dd7ed0974bff9fdebf2087b
downloadaur-c4e3c7ec80b5cd910b8047d3a849347ba8ecf716.tar.gz
initial commit
-rw-r--r--.SRCINFO34
-rw-r--r--PKGBUILD83
-rw-r--r--constructor-gog.desktop7
-rw-r--r--constructor-gog.install16
-rw-r--r--constructor-gog.sh91
-rw-r--r--dosbox_ipx.conf2
-rw-r--r--dosbox_windowed.conf2
-rw-r--r--dosboxconstructor_settings.conf10
-rw-r--r--fix-dosbox-mounts.patch14
-rw-r--r--fix-permissions.sh15
-rw-r--r--simple-net-config.patch55
11 files changed, 329 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..17f7f2e92e0f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,34 @@
+pkgbase = constructor-gog
+ pkgdesc = Control a construction company, and aim to drive the other players out of business.
+ pkgver = 2.0.0.9
+ pkgrel = 1
+ url = https://www.gog.com/game/constructor
+ install = constructor-gog.install
+ arch = any
+ groups = eula
+ license = custom:eula
+ makedepends = innoextract
+ makedepends = icoutils
+ depends = dosbox
+ optdepends = unionfs-fuse: mounting game folder to home for savegames and settings
+ source = setup_constructor_2.0.0.9.exe::gogdownloader://constructor/installer_win_en
+ source = constructor-gog.sh
+ source = constructor-gog.desktop
+ source = dosboxconstructor_settings.conf
+ source = dosbox_windowed.conf
+ source = dosbox_ipx.conf
+ source = simple-net-config.patch
+ source = fix-dosbox-mounts.patch
+ source = fix-permissions.sh
+ sha256sums = 2c996960fef8952601938bbe6ccc93b069b9275716ab202ed14daa443f5e8800
+ sha256sums = 0e78c290229205cb4245beaec1118edc85dc310446292f9c0fefc8a0e34d525f
+ sha256sums = 7db33dbe4048286cc08f76de61c2a81eb9d06f0c8c76d532c5e8c50a7952789f
+ sha256sums = 61e583c4ccf48215d024ee5443399c8f886d0986b46dcf447c9ba65abb469d18
+ sha256sums = 50b601b33522677a9bcaf23edc833329067bb87ccda33039c0b95f0d4ddca578
+ sha256sums = e90b33464517fb8b8102f3667755302e01fa10b7bec3d660357f802685416ca8
+ sha256sums = 72d2a719f7c764f1c19c2660e54272f00c4e468579f99c38fb29be5e6b3d316e
+ sha256sums = a6920807c11c1aa0fcad0bcf6a71adc8b7fd13ed66f5f26ce2973bed97dfc7e4
+ sha256sums = ee6715c4ba84e97ee3d04a4ad00ec1b67439ee8eb4ca2f1fd1000cb47b3f1c92
+
+pkgname = constructor-gog
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..a9df5e753c3f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,83 @@
+# Maintainer: Constantin Nickel <constantin dot nickel at gmail dot com>
+
+pkgname=constructor-gog
+pkgver=2.0.0.9
+pkgrel=1
+pkgdesc="Control a construction company, and aim to drive the other players out of business."
+url="https://www.gog.com/game/constructor"
+license=('custom:eula')
+groups=('eula')
+arch=('any')
+makedepends=('innoextract' 'icoutils')
+depends=('dosbox')
+optdepends=('unionfs-fuse: mounting game folder to home for savegames and settings')
+install=$pkgname.install
+
+source=("setup_constructor_$pkgver.exe"::"gogdownloader://constructor/installer_win_en"
+ "constructor-gog.sh"
+ "constructor-gog.desktop"
+ "dosboxconstructor_settings.conf"
+ "dosbox_windowed.conf"
+ "dosbox_ipx.conf"
+ "simple-net-config.patch"
+ "fix-dosbox-mounts.patch"
+ "fix-permissions.sh")
+
+sha256sums=('2c996960fef8952601938bbe6ccc93b069b9275716ab202ed14daa443f5e8800'
+ '0e78c290229205cb4245beaec1118edc85dc310446292f9c0fefc8a0e34d525f'
+ '7db33dbe4048286cc08f76de61c2a81eb9d06f0c8c76d532c5e8c50a7952789f'
+ '61e583c4ccf48215d024ee5443399c8f886d0986b46dcf447c9ba65abb469d18'
+ '50b601b33522677a9bcaf23edc833329067bb87ccda33039c0b95f0d4ddca578'
+ 'e90b33464517fb8b8102f3667755302e01fa10b7bec3d660357f802685416ca8'
+ '72d2a719f7c764f1c19c2660e54272f00c4e468579f99c38fb29be5e6b3d316e'
+ 'a6920807c11c1aa0fcad0bcf6a71adc8b7fd13ed66f5f26ce2973bed97dfc7e4'
+ 'ee6715c4ba84e97ee3d04a4ad00ec1b67439ee8eb4ca2f1fd1000cb47b3f1c92')
+
+# 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_constructor_$pkgver.exe
+ # convert icon
+ icotool -x app/gfw_high.ico
+ # create launchers
+ for _m in client server; do
+ sed "s|Exec=constructor|& --$_m|;s|Name=Constructor|& (${_m^})|" \
+ $pkgname.desktop > constructor-$_m.desktop
+ done
+ # remove bundled dosbox, windows stuff and gog client files
+ rm -rf app/{dosbox/,*.ico,*.dll,*.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/constructor
+ cp -r app/* "$pkgdir"/opt/constructor
+ # fix permissions script
+ install -Dm755 fix-permissions.sh "$pkgdir"/opt/constructor
+ # additional dosbox config
+ install -m644 dosboxconstructor_settings.conf "$pkgdir"/opt/constructor
+ install -m644 dosbox_windowed.conf "$pkgdir"/opt/constructor
+ install -m644 dosbox_ipx.conf "$pkgdir"/opt/constructor
+ # doc + licenses
+ install -d "$pkgdir"/usr/share/{doc,licenses}/$pkgname
+ ln -s -t "$pkgdir"/usr/share/doc/$pkgname /opt/constructor/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/constructor.desktop
+ install -Dm755 $pkgname.sh "$pkgdir"/usr/bin/constructor
+ for _m in client server; do
+ install -m644 constructor-$_m.desktop "$pkgdir"/usr/share/applications
+ done
+ # icon
+ install -Dm644 gfw_high_6_256x256x32.png "$pkgdir"/usr/share/pixmaps/constructor.png
+}
diff --git a/constructor-gog.desktop b/constructor-gog.desktop
new file mode 100644
index 000000000000..f6083e303bd6
--- /dev/null
+++ b/constructor-gog.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=Constructor
+Exec=constructor
+Icon=constructor
+Categories=Game;
+Terminal=false
diff --git a/constructor-gog.install b/constructor-gog.install
new file mode 100644
index 000000000000..5930c8ace033
--- /dev/null
+++ b/constructor-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/constructor/fix-permissions.sh [group]"
+ echo ""
+ echo "Unionfs:"
+ echo 'LOWER_DIR=/opt/constructor'
+ echo 'UPPER_DIR=$HOME/.gog/constructor/config'
+ echo 'UNION_DIR=$HOME/.gog/constructor/game'
+}
+
+post_upgrade() {
+ post_install
+}
diff --git a/constructor-gog.sh b/constructor-gog.sh
new file mode 100644
index 000000000000..600610f118c3
--- /dev/null
+++ b/constructor-gog.sh
@@ -0,0 +1,91 @@
+#!/usr/bin/bash
+
+_help() {
+cat <<EOF
+ Usage: $script [options]
+ Options:
+ -h --help Show this message
+ --windowed Windowed mode
+ --settings Change settings
+ --client Start in client mode
+ --server Start in server mode
+ Examples:
+
+ $script --windowed
+ $script --client
+ $script --server --windowed
+EOF
+ exit 0
+}
+
+pushd() { builtin pushd "$@" > /dev/null; }
+popd() { builtin popd > /dev/null; }
+
+INSTALL_DIR=/opt/constructor
+HOME_DIR="$HOME"/.gog/constructor
+
+if which unionfs &> /dev/null; then
+ USE_UNIONFS=1
+fi
+
+script=${0##*/}
+
+TEMP=$(getopt -o h --long help,windowed,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 ;;
+ --client) START_CLIENT=1; shift ;;
+ --server) START_SERVER=1; shift ;;
+ --) shift; break ;;
+ esac
+done
+
+configs=('-conf' 'dosboxconstructor.conf')
+
+if [ "${START_SERVER:=0}" -eq 1 ] && [ ! "$START_SETTINGS" ]; then
+ configs+=('-conf' 'dosboxconstructor_server.conf')
+ ENABLE_IPX=1
+fi
+
+if [ "${START_CLIENT:=0}" -eq 1 ] && [ "${START_SERVER:=0}" -ne 1 ] \
+ && [ ! "$START_SETTINGS" ]; then
+ configs+=('-conf' 'dosboxconstructor_client.conf')
+ ENABLE_IPX=1
+fi
+
+if [ "$WINDOWED" ]; then
+ configs+=('-conf' 'dosbox_windowed.conf')
+fi
+
+if [ "$START_SETTINGS" ]; then
+ configs+=('-conf' 'dosboxconstructor_settings.conf')
+else
+ configs+=('-conf' 'dosboxconstructor_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/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/dosboxconstructor_settings.conf b/dosboxconstructor_settings.conf
new file mode 100644
index 000000000000..c83478a02cb9
--- /dev/null
+++ b/dosboxconstructor_settings.conf
@@ -0,0 +1,10 @@
+[sdl]
+fullscreen=false
+
+[autoexec]
+echo off
+mount c "."
+c:
+cls
+call setsound.bat
+exit
diff --git a/fix-dosbox-mounts.patch b/fix-dosbox-mounts.patch
new file mode 100644
index 000000000000..fa4d8235f204
--- /dev/null
+++ b/fix-dosbox-mounts.patch
@@ -0,0 +1,14 @@
+diff --git a/app/dosboxconstructor_single.conf b/app/dosboxconstructor_single.conf
+--- a/app/dosboxconstructor_single.conf
++++ b/app/dosboxconstructor_single.conf
+@@ -5,8 +5,8 @@ ipx=true
+ # Lines in this section will be run at startup.
+
+ @ECHO OFF
+-mount C ".."
+-imgmount d "..\const.gog" -t iso -fs iso
++mount C "."
++imgmount d "const.gog" -t iso -fs iso
+ c:
+ cls
+ game.exe
diff --git a/fix-permissions.sh b/fix-permissions.sh
new file mode 100644
index 000000000000..8730c5ddca89
--- /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/constructor/{savegame,settings/setsnd.cfg,settings/system.ini}
+chmod -R g+w /opt/constructor/{savegame,settings/setsnd.cfg,settings/system.ini}
diff --git a/simple-net-config.patch b/simple-net-config.patch
new file mode 100644
index 000000000000..3038b119ee76
--- /dev/null
+++ b/simple-net-config.patch
@@ -0,0 +1,55 @@
+diff --git a/app/dosboxconstructor_client.conf b/app/dosboxconstructor_client.conf
+--- a/app/dosboxconstructor_client.conf
++++ b/app/dosboxconstructor_client.conf
+@@ -1,16 +1,6 @@
+ [IPX]
+-Enable=1
+-Connection=1
+ ipx=true
+
+ [autoexec]
+-# Lines in this section will be run at startup.
+-
+-@ECHO OFF
+-mount C ".."
+-imgmount d "..\const.gog" -t iso -fs iso
+-c:
++IPXNET CONNECT 127.0.0.1 19900
+ cls
+-IPXNET CONNECT 127.0.0.1
+-game.exe
+-exit
+diff --git a/app/dosboxconstructor_server.conf b/app/dosboxconstructor_server.conf
+--- a/app/dosboxconstructor_server.conf
++++ b/app/dosboxconstructor_server.conf
+@@ -1,16 +1,5 @@
+ [IPX]
+-Enable=1
+-Connection=1
+ ipx=true
+
+ [autoexec]
+-# Lines in this section will be run at startup.
+-
+-@ECHO OFF
+-mount C ".."
+-imgmount d "..\const.gog" -t iso -fs iso
+-c:
+-cls
+-IPXNET STARTSERVER
+-game.exe
+-exit
+\ No newline at end of file
++IPXNET STARTSERVER 19900
+diff --git a/app/dosboxconstructor_single.conf b/app/dosboxconstructor_single.conf
+--- a/app/dosboxconstructor_single.conf
++++ b/app/dosboxconstructor_single.conf
+@@ -1,7 +1,5 @@
+ [IPX]
+-Enable=1
+-Connection=1
+-ipx=true
++ipx=false
+
+ [autoexec]
+ # Lines in this section will be run at startup.