package.sh 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. version=v0.8.0-rc
  2. nodejs_zip_url="https://nodejs.org/dist/v8.11.3/node-v8.11.3-win-x64.zip"
  3. portable_python_url="http://elvis.rowan.edu/mirrors/portablepython/v2.7/PortablePython_2.7.6.1.exe"
  4. igraph_whl_url="https://github.com/AToMPM/atompm/releases/download/v0.7.0/python_igraph-0.7.1.post6-cp27-cp27m-win32.whl"
  5. chrome_url="https://newcontinuum.dl.sourceforge.net/project/portableapps/Google%20Chrome%20Portable/GoogleChromePortable_67.0.3396.87_online.paf.exe"
  6. manual_url="https://media.readthedocs.org/pdf/atompm/latest/atompm.pdf"
  7. #echo $nodejs_zip_url
  8. #echo $portable_python_url
  9. #echo $igraph_whl_url
  10. # STEPS
  11. # 1. Download Python
  12. # a. Currently, this is PortablePython from
  13. # b. http://portablepython.com/wiki/PortablePython2.7.6.1/
  14. function get_PP() {
  15. echo "Downloading PortablePython"
  16. PP_file=$(basename $portable_python_url)
  17. echo $PP_file
  18. if [ ! -f $PP_file ]; then
  19. echo "Downloading $portable_python_url"
  20. curl -O $portable_python_url
  21. fi
  22. # c. Install PortablePython with no packages selected
  23. #TODO: Automate installation
  24. #Z:\home\dcx\Projects\AToMPM\packaging\atompm-portable\platform\PortablePython27\
  25. #No modules and no core editors
  26. wine $PP_file
  27. # d. Install pip on the packaging machine (Python2 version)
  28. cd atompm-portable/platform/PortablePython27/App
  29. # INSTALL PIP
  30. #TODO: Fix this installation
  31. #wine scripts/easy_install.exe pip
  32. #TODO: Replace with above
  33. #pip2 install --upgrade --target=Lib/site-packages/ pip
  34. #INSTALL IGRAPH
  35. igraph_whl_file=$(basename $igraph_whl_url)
  36. echo $igraph_whl_file
  37. #if [ ! -f $igraph_whl_file ]; then
  38. # echo "Downloading $igraph_whl_url"
  39. # curl -O $igraph_whl_url
  40. #fi
  41. #MUST HAVE WHL FILE LOCALLY FOR NOW
  42. cd ../../../..
  43. unzip -o $igraph_whl_file -d atompm-portable/platform/PortablePython27/App/Lib/site-packages/
  44. }
  45. function get_nodejs() {
  46. echo "Downloading NodeJS"
  47. # 2. Download node.js https://nodejs.org/en/download/
  48. # a. Choose Windows Binary (.zip)
  49. nodejs_file=$(basename $nodejs_zip_url)
  50. echo $nodejs_file
  51. if [ ! -f $nodejs_file ]; then
  52. echo "Downloading $nodejs_zip_url"
  53. curl -O $nodejs_zip_url
  54. fi
  55. unzip -o $nodejs_file -d atompm-portable/platform/
  56. mv atompm-portable/platform/node-v* atompm-portable/platform/NodeJS
  57. }
  58. # 3. Add ChromePortable
  59. function get_chrome() {
  60. echo "Downloading PortableChrome"
  61. chrome_file=$(basename $chrome_url)
  62. echo $chrome_file
  63. if [ ! -f $chrome_file ]; then
  64. echo "Downloading $chrome_url"
  65. curl -O $chrome_url
  66. fi
  67. #TODO: Automate installation
  68. #Z:\home\dcx\Projects\AToMPM\packaging\atompm-portable\platform\GoogleChromePortable
  69. wine GoogleChromePortable_67.0.3396.87_online.paf.exe
  70. }
  71. # 4. Add AToMPM files
  72. function add_atompm () {
  73. echo "Adding AToMPM"
  74. rm -rf atompm-portable/atompm
  75. cd atompm-portable
  76. git clone https://github.com/AToMPM/atompm.git
  77. cd atompm
  78. git checkout $version
  79. rm -rf .git
  80. npm install --production
  81. cd ../..
  82. }
  83. # 5. Add Windows batch scripts
  84. function add_batch_scripts (){
  85. echo "Adding batch scripts"
  86. cp windows_scripts/*.bat atompm-portable/
  87. }
  88. # 6. Add manual
  89. function add_manual(){
  90. echo "Adding manual"
  91. manual_filename="atompm-userguide.pdf"
  92. curl $manual_url -o $manual_filename
  93. cp $manual_filename atompm-portable/
  94. rm $manual_filename
  95. }
  96. ###MAIN######
  97. if [ ! -d ./atompm-portable/platform/PortablePython27 ]; then
  98. get_PP
  99. fi
  100. if [ ! -d ./atompm-portable/platform/NodeJS ]; then
  101. get_nodejs
  102. fi
  103. if [ ! -d ./atompm-portable/platform/GoogleChromePortable ]; then
  104. get_chrome
  105. fi
  106. add_atompm
  107. add_batch_scripts
  108. add_manual
  109. rm atompm-portable.zip
  110. zip -r atompm-portable.zip atompm-portable/