prerequisites.sh 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #!/bin/bash
  2. set -x
  3. export DEBIAN_FRONTEND=noninteractive
  4. source $FWROOT/toolset/setup/linux/bash_functions.sh
  5. RETCODE=$(fw_exists fwbm_prereqs_installed)
  6. [ ! "$RETCODE" == 0 ] || { \
  7. echo "Prerequisites installed!";
  8. return 0; }
  9. # Use a more recent version of Mongo shell
  10. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
  11. echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
  12. # Add postgresql-server-dev-9.3 libs in "precise" version of Ubuntu
  13. if [ "$TFB_DISTRIB_CODENAME" == "precise" ]; then
  14. echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
  15. curl -s https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
  16. sudo apt-get update
  17. fi
  18. # One -q produces output suitable for logging (mostly hides
  19. # progress indicators)
  20. sudo apt-get -yq update
  21. # WARNING: DONT PUT A SPACE AFTER ANY BACKSLASH OR APT WILL BREAK
  22. sudo apt-get -qqy install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
  23. cmake build-essential automake `# Needed for building code` \
  24. curl wget unzip `# Common tools` \
  25. software-properties-common `# Needed for add-apt-repository` \
  26. git-core mercurial `# Version control systems` \
  27. libpcre3 libpcre3-dev libpcrecpp0 `# Regular expression support` \
  28. libssl-dev libcurl4-openssl-dev `# SSL libraries` \
  29. libmysqlclient-dev \
  30. mongodb-org-shell \
  31. libsqlite3-dev sqlite3 `# Database libraries` \
  32. zlib1g-dev python-software-properties \
  33. libreadline6-dev \
  34. libbz2-dev \
  35. libyaml-dev libxml2-dev \
  36. libxslt-dev libgdbm-dev ncurses-dev \
  37. libffi-dev htop libtool bison libevent-dev \
  38. libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 \
  39. liborc-0.4-0 libwxbase2.8-0 libwxgtk2.8-0 libgnutls-dev \
  40. libjson0-dev libmcrypt-dev libicu-dev gettext \
  41. libpq-dev mlton \
  42. libjemalloc-dev libluajit-5.1-dev `# Needed by lwan at least` \
  43. libhiredis-dev `# Redis client - Needed by ngx_mruby at least` \
  44. cloc dstat `# Collect resource usage statistics` \
  45. libsasl2-dev `# Needed by mgo for go-mongodb test` \
  46. llvm-dev `# Required for correct Ruby installation` \
  47. libboost-dev `# Silicon relies on boost::lexical_cast.` \
  48. postgresql-server-dev-9.3 `# Needed by cpoll.` \
  49. xdg-utils `# Needed by dlang.` \
  50. python-pip
  51. sudo pip install colorama==0.3.1
  52. # Version 2.3 has a nice Counter() and other features
  53. # but it requires —-allow-external and -—allow-unverified
  54. sudo pip install progressbar==2.2
  55. sudo pip install requests
  56. # Stop permanently overwriting people's files just for
  57. # trying out our software!
  58. RETCODE=$(fw_exists ~/.bash_profile.bak)
  59. [ ! "$RETCODE" == 0 ] || { \
  60. echo "Backing up your original ~/.bash_profile, ~/.profile, ~/.bashrc"
  61. mv ~/.bash_profile ~/.bash_profile.bak || true
  62. mv ~/.profile ~/.profile.bak || true
  63. mv ~/.bashrc ~/.bashrc.bak || true
  64. }
  65. sudo sh -c "echo '* - nofile 65535' >> /etc/security/limits.conf"
  66. sudo sh -c "echo '* hard rtprio 99' >> /etc/security/limits.conf"
  67. sudo sh -c "echo '* soft rtprio 99' >> /etc/security/limits.conf"
  68. # Sudo in case we don't have permissions on IROOT
  69. sudo touch fwbm_prereqs_installed
  70. # Ensure everyone can see the file
  71. sudo chmod 775 fwbm_prereqs_installed