build_data.sh 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #!/bin/sh
  2. # Copyright (c) 2009,2010,2011 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 1st CDROM
  15. # Heroes3.snd from the original 2nd CDROM
  16. # the WoG release v3.58f: allinone_358f.zip
  17. # the VCMI distribution: vcmi_089.zip
  18. # the menu graphic pack: vcmi32menu.zip
  19. # Usage: put this script and the 4 data files into the same directory
  20. # and run the script.
  21. DESTDIR=`pwd`/vcmi
  22. rm -rf $DESTDIR
  23. mkdir $DESTDIR
  24. # Extract Data from original CD-ROM
  25. # 376917499 2002-06-14 14:32 _setup/data1.cab
  26. # 27308 2002-06-14 14:32 _setup/data1.hdr
  27. rm -rf temp
  28. mkdir temp
  29. cd temp
  30. echo Extracting data1.cab
  31. unshield x ../data1.cab || exit 1
  32. echo Done extracting data1.cab
  33. rm -rf CommonFiles
  34. rm -rf GameUpdate
  35. rm -rf Support
  36. rm -rf Program_Files/mplayer
  37. rm -rf Program_Files/ONLINE
  38. find . -name "*.DLL" | xargs rm -f
  39. find . -name "*.dll" | xargs rm -f
  40. find . -name "*.pdf" -print0 | xargs -0 rm -f
  41. find . -name "*.HLP" | xargs rm -f
  42. find . -name "*.TXT" | xargs rm -f
  43. find . -name "*.cnt" | xargs rm -f
  44. find . -name "*.exe" | xargs rm -f
  45. find . -name "*.EXE" | xargs rm -f
  46. find . -name "*.ASI" | xargs rm -f
  47. # Tree is clean. Move extracted files to their final destination
  48. mv Program_Files/* $DESTDIR
  49. cd ..
  50. # Copy Heroes3.snd from 2nd CDROM and rename it to avoid a name conflict.
  51. cp Heroes3.snd $DESTDIR/Data/Heroes3-cd2.snd
  52. # Extract Data from WoG
  53. # 39753248 allinone_358f.zip
  54. rm -rf temp
  55. mkdir temp
  56. cd temp
  57. unzip ../allinone_358f.zip
  58. cd WoG_Install
  59. mkdir temp
  60. cd temp
  61. unrar x -o+ ../main1.wog
  62. unrar x -o+ ../main2.wog
  63. unrar x -o+ ../main3.wog
  64. unrar x -o+ ../main4.wog
  65. #unrar x -o+ ../main5.wog
  66. #unrar x -o+ ../main6_optional.wog
  67. #unrar x -o+ ../main7_optional.wog
  68. #unrar x -o+ ../main8_optional.wog
  69. #unrar x -o+ ../main9_optional.wog
  70. mkdir -p $DESTDIR/Data/zvs/
  71. mv data/zvs/Lib1.res $DESTDIR/Data/zvs/
  72. rm -rf picsall Documentation Data data update
  73. rm -f action.txt h3bitmap.txt H3sprite.txt InstMult.txt
  74. rm -f ACTION.TXT H3BITMAP.TXT H3SPRITE.TXT INSTMULT.TXT
  75. rm -f *.DLL *.dll *.fnt readme.txt *.exe *.EXE *.lod *.vid h3ab_ahd.snd
  76. rename 'y/a-z/A-Z/' *
  77. # Tree is clean. Move extracted files to their final destination
  78. mv MAPS/* $DESTDIR/Maps
  79. rmdir MAPS
  80. mkdir $DESTDIR/Sprites
  81. mv *.MSK *.DEF $DESTDIR/Sprites
  82. mv * $DESTDIR/Data/
  83. cd ../../..
  84. # Extract Data from VCMI release
  85. rm -rf temp
  86. mkdir temp
  87. cd temp
  88. #7zr x ../vcmi_088b.7z
  89. unzip ../vcmi_089.zip
  90. find . -name "*.dll" | xargs rm -f
  91. find . -name "*.DLL" | xargs rm -f
  92. find . -name "*.exe" | xargs rm -f
  93. rm -rf AI
  94. rm -f AUTHORS ChangeLog license.txt Microsoft.VC90.CRT.manifest
  95. rm -rf MP3
  96. rm -rf Games
  97. # Tree is clean. Move extracted files to their final destination
  98. cp -a . $DESTDIR
  99. cd ..
  100. # Extract graphics package
  101. rm -rf temp
  102. mkdir temp
  103. cd temp
  104. unzip ../vcmi32menu.zip
  105. # Tree is already clean. Move extracted files to their final destination
  106. cp -a . $DESTDIR
  107. cd ..
  108. # Done
  109. echo
  110. echo The complete game data is at $DESTDIR
  111. echo You could move it to /usr/local/share/games/
  112. echo and configure vcmi with:
  113. echo ./configure --datadir=/usr/local/share/games/ --bindir=\`pwd\` --libdir=\`pwd\`
  114. echo
  115. echo If you want to run from your VCMI tree, create those links
  116. echo at the root of your VCMI tree:
  117. echo ln -s client/vcmiclient .
  118. echo ln -s server/vcmiserver .
  119. echo ln -s AI/GeniusAI/.libs/GeniusAI.so .