Register default mods during installation on Debian/Ubuntu.

This commit is contained in:
Paul Chote
2017-06-23 20:09:00 +00:00
committed by reaperrr
parent 2c522e0371
commit 2685dbea3b
3 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
#!/bin/sh
set -e
# Register default mods for in-game switching
mkdir -p "{SYSTEMSUPPORTDIR}/ModMetadata"
mono {LIBDIR}/OpenRA.Utility.exe ra --register-mod /usr/games/openra-ra system
mono {LIBDIR}/OpenRA.Utility.exe cnc --register-mod /usr/games/openra-cnc system
mono {LIBDIR}/OpenRA.Utility.exe d2k --register-mod /usr/games/openra-d2k system

View File

@@ -0,0 +1,6 @@
#!/bin/sh
set -e
mono {LIBDIR}/OpenRA.Utility.exe ra --unregister-mod system
mono {LIBDIR}/OpenRA.Utility.exe cnc --unregister-mod system
mono {LIBDIR}/OpenRA.Utility.exe d2k --unregister-mod system

View File

@@ -21,6 +21,7 @@ DEB_BUILD_ROOT="$(pwd)/build"
LIBDIR=/usr/lib/openra LIBDIR=/usr/lib/openra
DOCDIR=/usr/share/doc/openra DOCDIR=/usr/share/doc/openra
SYSTEMSUPPORTDIR=/var/games/openra
LINTIANORDIR=/usr/share/lintian/overrides LINTIANORDIR=/usr/share/lintian/overrides
E_BADARGS=85 E_BADARGS=85
@@ -80,6 +81,9 @@ else
fi fi
sed "s/{VERSION}/${VERSION}/" DEBIAN/control | sed "s/{SIZE}/${PACKAGE_SIZE}/" > "${DEB_BUILD_ROOT}/DEBIAN/control" sed "s/{VERSION}/${VERSION}/" DEBIAN/control | sed "s/{SIZE}/${PACKAGE_SIZE}/" > "${DEB_BUILD_ROOT}/DEBIAN/control"
sed "s|{LIBDIR}|${LIBDIR}|g" DEBIAN/postinst | sed "s|{SYSTEMSUPPORTDIR}|${SYSTEMSUPPORTDIR}|g" > "${DEB_BUILD_ROOT}/DEBIAN/postinst"
sed "s|{LIBDIR}|${LIBDIR}|g" DEBIAN/prerm | sed "s|{SYSTEMSUPPORTDIR}|${SYSTEMSUPPORTDIR}|g" > "${DEB_BUILD_ROOT}/DEBIAN/prerm"
chmod 0755 "${DEB_BUILD_ROOT}/DEBIAN/postinst" "${DEB_BUILD_ROOT}/DEBIAN/prerm"
# Build it in the temp directory, but place the finished deb in our starting directory # Build it in the temp directory, but place the finished deb in our starting directory
pushd "${DEB_BUILD_ROOT}" >/dev/null pushd "${DEB_BUILD_ROOT}" >/dev/null