build_data.sh 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #!/bin/sh
  2. # Copyright (c) 2009,2010 Frank Zago
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2 of the License, or
  7. # (at your option) any later version.
  8. # Extract game data from various archives and create a tree with the right files
  9. # Tools needed:
  10. # unshield: sudo apt-get install unshield
  11. # rename (from perl)
  12. # unrar: sudo apt-get install unrar
  13. # Data files needed:
  14. # data1.cab and data1.hdr from the original CDROM
  15. # the WoG release v3.58f: allinone_358f.zip
  16. # the VCMI distribution: vcmi_08.zip
  17. # Usage: put this script and the 4 data files into the same directory
  18. # and run the script.
  19. DESTDIR=`pwd`/vcmi
  20. rm -rf $DESTDIR
  21. mkdir $DESTDIR
  22. # Extract Data from original CD-ROM
  23. # 376917499 2002-06-14 14:32 _setup/data1.cab
  24. # 27308 2002-06-14 14:32 _setup/data1.hdr
  25. rm -rf temp
  26. mkdir temp
  27. cd temp
  28. echo Extracting data1.cab
  29. unshield x ../data1.cab || exit 1
  30. echo Done extracting data1.cab
  31. rm -rf CommonFiles
  32. rm -rf GameUpdate
  33. rm -rf Support
  34. rm -rf Program_Files/mplayer
  35. rm -rf Program_Files/ONLINE
  36. find . -name "*.DLL" | xargs rm -f
  37. find . -name "*.dll" | xargs rm -f
  38. find . -name "*.pdf" -print0 | xargs -0 rm -f
  39. find . -name "*.HLP" | xargs rm -f
  40. find . -name "*.TXT" | xargs rm -f
  41. find . -name "*.cnt" | xargs rm -f
  42. find . -name "*.exe" | xargs rm -f
  43. find . -name "*.EXE" | xargs rm -f
  44. find . -name "*.ASI" | xargs rm -f
  45. # Tree is clean. Move extracted files to their final destination
  46. mv Program_Files/* $DESTDIR
  47. cd ..
  48. # Extract Data from WoG
  49. # 39753248 allinone_358f.zip
  50. rm -rf temp
  51. mkdir temp
  52. cd temp
  53. unzip ../allinone_358f.zip
  54. cd WoG_Install
  55. mkdir temp
  56. cd temp
  57. unrar x -o+ ../main1.wog
  58. unrar x -o+ ../main2.wog
  59. #unrar x -o+ ../main3.wog
  60. unrar x -o+ ../main4.wog
  61. #unrar x -o+ ../main5.wog
  62. #unrar x -o+ ../main6_optional.wog
  63. #unrar x -o+ ../main7_optional.wog
  64. #unrar x -o+ ../main8_optional.wog
  65. #unrar x -o+ ../main9_optional.wog
  66. rm -rf picsall Documentation Data data update
  67. rm -f action.txt h3bitmap.txt H3sprite.txt InstMult.txt
  68. rm -f ACTION.TXT H3BITMAP.TXT H3SPRITE.TXT INSTMULT.TXT
  69. rm -f *.DLL *.dll *.fnt readme.txt *.exe *.EXE *.lod *.vid h3ab_ahd.snd
  70. rename 'y/a-z/A-Z/' *
  71. # Tree is clean. Move extracted files to their final destination
  72. mv MAPS/* $DESTDIR/Maps
  73. rmdir MAPS
  74. mkdir $DESTDIR/Sprites
  75. mv *.MSK *.DEF $DESTDIR/Sprites
  76. mv * $DESTDIR/Data/
  77. cd ../../..
  78. # Extract Data from VCMI release
  79. # 4060120 .... vcmi_08.zip
  80. rm -rf temp
  81. mkdir temp
  82. cd temp
  83. unzip ../vcmi_08.zip
  84. find . -name "*.dll" | xargs rm -f
  85. find . -name "*.DLL" | xargs rm -f
  86. find . -name "*.exe" | xargs rm -f
  87. rm -rf AI
  88. rm -f AUTHORS ChangeLog license.txt Microsoft.VC90.CRT.manifest
  89. rm -rf MP3
  90. rm -rf Games
  91. mv sprites Sprites
  92. # Tree is clean. Move extracted files to their final destination
  93. cp -a . $DESTDIR
  94. cd ..
  95. rm -rf temp
  96. # Done
  97. echo
  98. echo The complete game data is at $DESTDIR
  99. echo You could move it to /usr/local/share/games/
  100. echo and configure vcmi with:
  101. echo ./configure --datadir=/usr/local/share/games/ --bindir=\`pwd\` --libdir=\`pwd\`
  102. echo
  103. echo If you want to run from your VCMI tree, create those links
  104. echo at the root of your VCMI tree:
  105. echo ln -s client/vcmiclient .
  106. echo ln -s server/vcmiserver .
  107. echo ln -s AI/GeniusAI/.libs/GeniusAI.so .