mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.0 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/kasc/lgeneral/lgeneral.conf
  9. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. bindir=$root/$ROCKCFG_PKG_GAMES_BINDIR
  23. datadir=$root/$ROCKCFG_PKG_GAMES_DATADIR
  24. lgeneral_pm() {
  25. tar $taropt $archdir/pg-data.tar.bz2
  26. mkdir -p $datadir/lgeneral/{nations,gfx/flags,units,gfx/units,maps}
  27. mkdir -p $datadir/lgeneral/{gfx/terrain/pg,sounds/pg,scenarios/pg}
  28. # Ok. This might be one of the ugliest hacks I've ever made for a ROCK
  29. # Linux package.. this app needs an X-display for running the 'lgc-pg'
  30. # binary. So we create a temporary Xvfb process and register it as X-server
  31. # number 42. Let's hope that there isn't already another X-server using
  32. # the same ID ... (Clifford)
  33. echo "Starting Xvfb server .."
  34. Xvfb :42 -fbdir . -screen 0 640x480x15 &
  35. xvfb_pid=$!
  36. lgcpgrun=1
  37. if DISPLAY=:42.0 $bindir/lgc-pg -s pg-data -d $datadir/lgeneral | \
  38. tee /proc/self/fd/2 | grep -q 'Done!'
  39. then lgcpgrun=0; fi
  40. echo "Killing Xvfb server .."
  41. kill -9 $xvfb_pid
  42. if [ $lgcpgrun -ne 0 ]; then
  43. echo "Got error from '$bindir/lgc-pg -s pg-data -d $datadir/lgeneral' !!"
  44. false
  45. fi
  46. }
  47. hook_add postmake 3 lgeneral_pm