prerequisites.sh 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/bash
  2. set -x
  3. export DEBIAN_FRONTEND=noninteractive
  4. RETCODE=$(fw_exists fwbm_prereqs_installed)
  5. [ ! "$RETCODE" == 0 ] || { \
  6. echo "Prerequisites installed!";
  7. return 0;
  8. }
  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. # One -q produces output suitable for logging (mostly hides
  13. # progress indicators)
  14. sudo apt-get -yq update
  15. # WARNING: DONT PUT A SPACE AFTER ANY BACKSLASH OR APT WILL BREAK
  16. sudo apt-get -qqy install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
  17. cmake build-essential automake `# Needed for building code` \
  18. curl wget unzip `# Common tools` \
  19. software-properties-common `# Needed for add-apt-repository` \
  20. git-core mercurial `# Version control systems` \
  21. libpcre3 libpcre3-dev libpcrecpp0 `# Regular expression support` \
  22. libssl-dev libcurl4-openssl-dev `# SSL libraries` \
  23. libmysqlclient-dev \
  24. mongodb-org-shell \
  25. libsqlite3-dev sqlite3 `# Database libraries` \
  26. zlib1g-dev python-software-properties \
  27. libreadline6-dev \
  28. libbz2-dev \
  29. libyaml-dev libxml2-dev \
  30. libxslt-dev libgdbm-dev ncurses-dev \
  31. libffi-dev htop libtool bison libevent-dev \
  32. libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 \
  33. liborc-0.4-0 libwxbase2.8-0 libwxgtk2.8-0 libgnutls-dev \
  34. libjson0-dev libmcrypt-dev libicu-dev gettext \
  35. libpq-dev mlton \
  36. libjemalloc-dev libluajit-5.1-dev `# Needed by lwan at least` \
  37. libhiredis-dev `# Redis client - Needed by ngx_mruby at least` \
  38. cloc dstat `# Collect resource usage statistics` \
  39. libsasl2-dev `# Needed by mgo for go-mongodb test` \
  40. llvm-dev `# Required for correct Ruby installation` \
  41. libboost-dev `# Silicon relies on boost::lexical_cast.`
  42. # Install gcc-4.8 and gcc-4.9
  43. sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
  44. sudo apt-get -yq update
  45. sudo apt-get install -qqy gcc-4.8 g++-4.8 gcc-4.9 g++-4.9
  46. # Stop permanently overwriting people's files just for
  47. # trying out our software!
  48. RETCODE=$(fw_exists ~/.bash_profile.bak)
  49. [ ! "$RETCODE" == 0 ] || { \
  50. echo "Backing up your original ~/.bash_profile, ~/.profile, ~/.bashrc"
  51. mv ~/.bash_profile ~/.bash_profile.bak || true
  52. mv ~/.profile ~/.profile.bak || true
  53. mv ~/.bashrc ~/.bashrc.bak || true
  54. }
  55. sudo sh -c "echo '* - nofile 65535' >> /etc/security/limits.conf"
  56. sudo sh -c "echo '* hard rtprio 99' >> /etc/security/limits.conf"
  57. sudo sh -c "echo '* soft rtprio 99' >> /etc/security/limits.conf"
  58. # Sudo in case we don't have permissions on IROOT
  59. sudo touch fwbm_prereqs_installed
  60. # Ensure everyone can see the file
  61. sudo chmod 775 fwbm_prereqs_installed