rebuild-wekan.sh 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/bin/bash
  2. echo "Note: If you use other locale than en_US.UTF-8 , you need to additionally install en_US.UTF-8"
  3. echo " with 'sudo dpkg-reconfigure locales' , so that MongoDB works correctly."
  4. echo " You can still use any other locale as your main locale."
  5. #X64NODE="https://nodejs.org/dist/v8.14.1/node-v8.14.1-linux-x64.tar.gz"
  6. function pause(){
  7. read -p "$*"
  8. }
  9. echo
  10. PS3='Please enter your choice: '
  11. options=("Install Wekan dependencies" "Build Wekan" "Quit")
  12. select opt in "${options[@]}"
  13. do
  14. case $opt in
  15. "Install Wekan dependencies")
  16. if [[ "$OSTYPE" == "linux-gnu" ]]; then
  17. echo "Linux";
  18. echo "Ubuntu, Mint, Debian, or Debian on Windows Subsystem for Linux";
  19. sudo apt-get install -y build-essential git curl wget;
  20. curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -;
  21. elif [[ "$OSTYPE" == "darwin"* ]]; then
  22. echo "macOS";
  23. pause '1) Install XCode 2) Install Node 8.x from https://nodejs.org/en/ 3) Press [Enter] key to continue.'
  24. elif [[ "$OSTYPE" == "cygwin" ]]; then
  25. # POSIX compatibility layer and Linux environment emulation for Windows
  26. echo "TODO: Add Cygwin";
  27. exit;
  28. elif [[ "$OSTYPE" == "msys" ]]; then
  29. # Lightweight shell and GNU utilities compiled for Windows (part of MinGW)
  30. echo "TODO: Add msys on Windows";
  31. exit;
  32. elif [[ "$OSTYPE" == "win32" ]]; then
  33. # I'm not sure this can happen.
  34. echo "TODO: Add Windows";
  35. exit;
  36. elif [[ "$OSTYPE" == "freebsd"* ]]; then
  37. echo "TODO: Add FreeBSD";
  38. exit;
  39. else
  40. echo "Unknown"
  41. echo ${OSTYPE}
  42. exit;
  43. fi
  44. ## Latest npm with Meteor 1.6
  45. sudo npm -g install npm
  46. sudo npm -g install node-gyp
  47. # Latest fibers for Meteor 1.6
  48. sudo npm -g install fibers@2.0.0
  49. # Install Meteor, if it's not yet installed
  50. curl https://install.meteor.com | bash
  51. mkdir ~/repos
  52. cd ~/repos
  53. git clone https://github.com/wekan/wekan.git
  54. cd wekan
  55. git checkout devel
  56. break
  57. ;;
  58. "Build Wekan")
  59. echo "Building Wekan."
  60. cd ~/repos/wekan
  61. mkdir -p ~/repos/wekan/packages
  62. cd ~/repos/wekan/packages
  63. git clone --depth 1 -b master https://github.com/wekan/flow-router.git kadira-flow-router
  64. git clone --depth 1 -b master https://github.com/meteor-useraccounts/core.git meteor-useraccounts-core
  65. git clone --depth 1 -b master https://github.com/wekan/meteor-accounts-cas.git
  66. git clone --depth 1 -b master https://github.com/wekan/wekan-ldap.git
  67. git clone --depth 1 -b master https://github.com/wekan/wekan-scrollbar.git
  68. if [[ "$OSTYPE" == "darwin"* ]]; then
  69. echo "sed at macOS";
  70. sed -i '' 's/api\.versionsFrom/\/\/api.versionsFrom/' ~/repos/wekan/packages/meteor-useraccounts-core/package.js
  71. else
  72. echo "sed at ${OSTYPE}"
  73. sed -i 's/api\.versionsFrom/\/\/api.versionsFrom/' ~/repos/wekan/packages/meteor-useraccounts-core/package.js
  74. fi
  75. cd ~/repos/wekan
  76. rm -rf node_modules
  77. meteor npm install
  78. rm -rf .build
  79. meteor build .build --directory
  80. cp -f fix-download-unicode/cfs_access-point.txt .build/bundle/programs/server/packages/cfs_access-point.js
  81. #Removed binary version of bcrypt because of security vulnerability that is not fixed yet.
  82. #https://github.com/wekan/wekan/commit/4b2010213907c61b0e0482ab55abb06f6a668eac
  83. #https://github.com/wekan/wekan/commit/7eeabf14be3c63fae2226e561ef8a0c1390c8d3c
  84. #cd ~/repos/wekan/.build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt
  85. #rm -rf node_modules/bcrypt
  86. #meteor npm install bcrypt
  87. cd ~/repos/wekan/.build/bundle/programs/server
  88. rm -rf node_modules
  89. meteor npm install
  90. #meteor npm install bcrypt
  91. cd ~/repos
  92. echo Done.
  93. break
  94. ;;
  95. "Quit")
  96. break
  97. ;;
  98. *) echo invalid option;;
  99. esac
  100. done