[72026] trunk/dports/games/PlasmaClient
ryandesign at macports.org
ryandesign at macports.org
Thu Sep 30 12:14:46 PDT 2010
Revision: 72026
http://trac.macports.org/changeset/72026
Author: ryandesign at macports.org
Date: 2010-09-30 12:14:41 -0700 (Thu, 30 Sep 2010)
Log Message:
-----------
PlasmaClient: update to 250, fix wrapper script to download SDL and python files using Drizzle, refer users to GoW IRC channel for help
Modified Paths:
--------------
trunk/dports/games/PlasmaClient/Portfile
trunk/dports/games/PlasmaClient/files/PlasmaClient.in
Modified: trunk/dports/games/PlasmaClient/Portfile
===================================================================
--- trunk/dports/games/PlasmaClient/Portfile 2010-09-30 17:01:59 UTC (rev 72025)
+++ trunk/dports/games/PlasmaClient/Portfile 2010-09-30 19:14:41 UTC (rev 72026)
@@ -5,8 +5,8 @@
PortGroup cmake 1.0
name PlasmaClient
-version 0.0-244
-revision 1
+epoch 1
+version 0.0.0-250
categories games
platforms darwin
maintainers ryandesign
@@ -23,7 +23,7 @@
fetch.type hg
hg.url http://uru.zrax.net/hg/plasmaclient
-hg.tag 7db98e0ff970
+hg.tag f04432964c17
# Decompress these into MO:ULa data dir
#http://stashbox.org/919902/python.zip
@@ -38,6 +38,8 @@
port:libsdl \
port:libhsplasma
+depends_run port:Drizzle
+
if {![file exists ${prefix}/lib/libboost_python-mt.dylib]} {
depends_lib-delete port:boost
pre-configure {
@@ -67,6 +69,7 @@
post-build {
reinplace "s|@PREFIX@|${prefix}|g" ${workpath}/PlasmaClient
+ reinplace "s|@APPLICATIONS_DIR@|${applications_dir}|g" ${workpath}/PlasmaClient
}
destroot.keepdirs ${destroot}${prefix}/var/log/${name}
@@ -78,6 +81,10 @@
xinstall -d -m 777 ${destroot}${prefix}/var/log/${name}
}
+notes "
+For assistance with ${name}, please visit the Guild of Writers' IRC channel at irc://irc.guildofwriters.com/#writers
+"
+
platform darwin powerpc {
notes-append "\n\n${name} probably does not work at all on PowerPC Macs at this time; try an Intel Mac."
}
Modified: trunk/dports/games/PlasmaClient/files/PlasmaClient.in
===================================================================
--- trunk/dports/games/PlasmaClient/files/PlasmaClient.in 2010-09-30 17:01:59 UTC (rev 72025)
+++ trunk/dports/games/PlasmaClient/files/PlasmaClient.in 2010-09-30 19:14:41 UTC (rev 72026)
@@ -1,21 +1,22 @@
#!/bin/sh
# $Id$
-if [ -z "$PREFIX" ]; then
- PREFIX="@PREFIX@"
-fi
+[ -n "${PREFIX}" ] || PREFIX="@PREFIX@"
+[ -n "${APPLICATIONS_DIR}" ] || APPLICATIONS_DIR="@APPLICATIONS_DIR@"
+NEED_RELAUNCH=0
MOULDATADIR="${PREFIX}/share/mystonline/data"
LOGDIR="${PREFIX}/var/log/PlasmaClient"
LOGFILE="PlasmaClient.$(date '+%s').log"
LOGLINK="PlasmaClient.log"
PLIST="org.macports.PlasmaClient"
-if [ ! -d "${MOULDATADIR}" ]; then
+if [ ! -d "${MOULDATADIR}/dat" ]; then
osascript \
-e 'tell app "Finder"' \
-e 'activate' \
-e "display dialog \"PlasmaClient needs the Myst Online: URU Live again game data files. Install the “mystonline-cider” port and run the application to let it download all the game data. Then come back to PlasmaClient.\" buttons {\"OK\"} default button \"OK\" with title \"PlasmaClient\" with icon note" \
+ -e 'return' \
-e 'end'
exit
fi
@@ -31,15 +32,15 @@
if [ -z "${USERNAME}" -o -z "${PASSWORD}" -o ${LASTLOGINFAILED} -eq 1 ]; then
+ NEED_RELAUNCH=1
+
USERNAME="$(osascript \
-e 'tell app "Finder"' \
-e 'activate' \
-e "display dialog \"PlasmaClient needs to know your Myst Online: URU Live again account name (email address). (If you enter this incorrectly, PlasmaClient will hang during startup.)\" default answer \"${USERNAME}\" buttons {\"Cancel\", \"OK\"} default button \"OK\" with title \"PlasmaClient\" with icon note" \
-e 'return text returned of the result' \
-e 'end')" || exit
- if [ -z "${USERNAME}" ]; then
- exit
- fi
+ [ -n "${USERNAME}" ] || exit
PASSWORD="$(osascript \
-e 'tell app "Finder"' \
@@ -47,9 +48,7 @@
-e "display dialog \"PlasmaClient needs to know your Myst Online: URU Live again password. (If you enter this incorrectly, PlasmaClient will hang during startup.)\" default answer \"${PASSWORD}\" with hidden answer buttons {\"Cancel\", \"OK\"} default button \"OK\" with title \"PlasmaClient\" with icon note" \
-e 'return text returned of the result' \
-e 'end')" || exit
- if [ -z "${PASSWORD}" ]; then
- exit
- fi
+ [ -n "${PASSWORD}" ] || exit
defaults write $PLIST username "$USERNAME"
defaults write $PLIST password "$PASSWORD"
@@ -62,6 +61,45 @@
rm -f "${LOGDIR}/${LOGLINK}"
ln -s "${LOGFILE}" "${LOGDIR}/${LOGLINK}"
echo "Logging to ${LOGDIR}/${LOGFILE}"
+exec > "${LOGDIR}/${LOGFILE}" 2>&1
+if [ ! -d "${MOULDATADIR}/SDL" -o ! -d "${MOULDATADIR}/python" ]; then
+ NEED_RELAUNCH=1
+
+ osascript \
+ -e 'tell app "Finder"' \
+ -e 'activate' \
+ -e "display dialog \"PlasmaClient needs to download the Myst Online: URU Live again Python and SDL data files. This may take a few minutes but only needs to be done once.\" buttons {\"Cancel\", \"OK\"} default button \"OK\" with title \"PlasmaClient\" with icon note" \
+ -e 'return' \
+ -e 'end' || exit
+ TMPDIR="$(mktemp -d /tmp/PlasmaClientXXXXXXXX)"
+
+ echo "Downloading secure MOULa files"
+ # Drizzle doesn't quit when it's done downloading the files so we have to kill it.
+ ${PREFIX}/bin/drizzle -downloadsecuremoulagainfiles "${USERNAME}" "${PASSWORD}" "${TMPDIR}" &
+ PID=$!
+ sleep 5
+ while [ -z "$(tail -n 10 "${LOGDIR}/${LOGFILE}" | grep '^All done!$')" ]; do
+ sleep 1
+ done
+ kill $PID
+ wait $PID
+ mv "${TMPDIR}/Python/python.pak" "${TMPDIR}"
+ rmdir "${TMPDIR}/Python"
+
+ echo "Decompiling secure MOULa Python files"
+ ${PREFIX}/bin/drizzle -decompilepak "${TMPDIR}/python.pak" "${TMPDIR}/python" moul || exit
+ rm "${TMPDIR}/python.pak"
+ rm -rf "${MOULDATADIR}/SDL" "${MOULDATADIR}/python"
+ mv "${TMPDIR}/python" "${TMPDIR}/SDL" "${MOULDATADIR}"
+ rmdir "$TMPDIR"
+fi
+
+if [ ${NEED_RELAUNCH} -eq 1 ]; then
+ # Relaunch to fix the Dock icon.
+ open -a "${APPLICATIONS_DIR}/PlasmaClient.app"
+ exit
+fi
+
cd "${MOULDATADIR}"
-"${PREFIX}/bin/PlasmaClient" "${USERNAME}" "${PASSWORD}" > "${LOGDIR}/${LOGFILE}" 2>&1
+exec "${PREFIX}/bin/PlasmaClient" "${USERNAME}" "${PASSWORD}"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100930/3ab9a256/attachment-0001.html>
More information about the macports-changes
mailing list