rebuild-wekan.sh 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. git clone --depth 1 -b master https://github.com/wekan/meteor-accounts-oidc.git
  69. mv meteor-accounts-oidc/packages/switch_accounts-oidc wekan_accounts-oidc
  70. mv meteor-accounts-oidc/packages/switch_oidc wekan_oidc
  71. rm -rf meteor-accounts-oidc
  72. if [[ "$OSTYPE" == "darwin"* ]]; then
  73. echo "sed at macOS";
  74. sed -i '' 's/api\.versionsFrom/\/\/api.versionsFrom/' ~/repos/wekan/packages/meteor-useraccounts-core/package.js
  75. else
  76. echo "sed at ${OSTYPE}"
  77. sed -i 's/api\.versionsFrom/\/\/api.versionsFrom/' ~/repos/wekan/packages/meteor-useraccounts-core/package.js
  78. fi
  79. cd ~/repos/wekan
  80. rm -rf node_modules
  81. meteor npm install
  82. rm -rf .build
  83. meteor build .build --directory
  84. cp -f fix-download-unicode/cfs_access-point.txt .build/bundle/programs/server/packages/cfs_access-point.js
  85. #Removed binary version of bcrypt because of security vulnerability that is not fixed yet.
  86. #https://github.com/wekan/wekan/commit/4b2010213907c61b0e0482ab55abb06f6a668eac
  87. #https://github.com/wekan/wekan/commit/7eeabf14be3c63fae2226e561ef8a0c1390c8d3c
  88. #cd ~/repos/wekan/.build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt
  89. #rm -rf node_modules/bcrypt
  90. #meteor npm install bcrypt
  91. cd ~/repos/wekan/.build/bundle/programs/server
  92. rm -rf node_modules
  93. meteor npm install
  94. #meteor npm install bcrypt
  95. cd ~/repos
  96. echo Done.
  97. break
  98. ;;
  99. "Quit")
  100. break
  101. ;;
  102. *) echo invalid option;;
  103. esac
  104. done