From db4a0fbc2327720ff60feb0c1d10fd3e7c92f566 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 25 Feb 2005 19:21:14 +0000 Subject: [PATCH] Clifford Wolf: Fixed lgeneral (an ugly fix for an ugly problem) [2005022315384800953] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@5665 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- package/kasc/lgeneral/lgeneral.conf | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/package/kasc/lgeneral/lgeneral.conf b/package/kasc/lgeneral/lgeneral.conf index 5de0001a6..8ec9ea1c0 100644 --- a/package/kasc/lgeneral/lgeneral.conf +++ b/package/kasc/lgeneral/lgeneral.conf @@ -25,9 +25,31 @@ bindir=$root/$ROCKCFG_PKG_GAMES_BINDIR datadir=$root/$ROCKCFG_PKG_GAMES_DATADIR lgeneral_pm() { - tar $taropt $archdir/pg-data.tar.bz2 - $bindir/lgc-pg -s pg-data -d $datadir/lgeneral - rm -Rf pg-data + tar $taropt $archdir/pg-data.tar.bz2 + + mkdir -p $datadir/lgeneral/{nations,gfx/flags,units,gfx/units,maps} + mkdir -p $datadir/lgeneral/{gfx/terrain/pg,sounds/pg,scenarios/pg} + + # Ok. This might be one of the ugliest hacks I've ever made for a ROCK + # Linux package.. this app needs an X-display for running the 'lgc-pg' + # binary. So we create a temporary Xvfb process and register it as X-server + # number 42. Let's hope that there isn't already another X-server using + # the same ID ... (Clifford) + + echo "Starting Xvfb server .." + Xvfb :42 -fbdir . -screen 0 640x480x15 & + + lgcpgrun=1 + if DISPLAY=:42.0 $bindir/lgc-pg -s pg-data -d $datadir/lgeneral | grep 'Done!' + then lgcpgrun=0; fi + + echo "Killing Xvfb server .." + fuser -k Xvfb_screen0; sleep 1 + + if [ $lgcpgrun -ne 0 ]; then + echo "Got error from '$bindir/lgc-pg -s pg-data -d $datadir/lgeneral' !!" + false + fi } hook_add postmake 3 lgeneral_pm