build_data.sh 3.5 KB

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