/install.sh

https://github.com/mkb218/wub-machine · Shell · 133 lines · 101 code · 22 blank · 10 comment · 17 complexity · 7f4421ce07136b41b6e2148f4cc05696 MD5 · raw file

  1. #!/bin/bash
  2. platform='unknown'
  3. packagemanager='unknown'
  4. unamestr=`uname`
  5. if [[ "$unamestr" == 'Linux' ]]; then
  6. platform='linux'
  7. packagemanager='apt-get'
  8. elif [[ "$unamestr" == 'Darwin' ]]; then
  9. platform='macosx'
  10. packagemanager='brew'
  11. fi
  12. if [[ $platform == 'unknown' ]]; then
  13. echo "Unknown platform detected - OS X and Ubuntu currently supported."
  14. exit 1
  15. fi
  16. if [ "$(id -u)" != "0" ]; then
  17. echo "This installer requires root permissions - please run sudo ./install.sh instead"'!'
  18. exit 1
  19. fi
  20. echo "------------------------------------------------------"
  21. echo "------ INSTALLING THE WUB MACHINE'S DEPENDENCIES -----"
  22. echo "---------- Be careful, this might not work ----------"
  23. echo "--------- In fact, this might screw things up --------"
  24. echo "-- I take no responsibility if something goes wrong. -"
  25. echo "------------------------------------------------------"
  26. echo "-- Really, all this script does is run a bunch of --"
  27. echo "-- $packagemanager installs and pip installs. --"
  28. echo "-- A little bit of code is downloaded from Github. --"
  29. echo "-- You'll get FFMpeg, LAME, SoundStretch, SHNtool...--"
  30. echo "------------------------------------------------------"
  31. echo
  32. read -p "Do you agree and take all responsibility if something goes wrong? (y/n): " RESP
  33. if [ $RESP != "y" ]; then
  34. echo "Exiting."
  35. exit 0
  36. fi
  37. hash $packagemanager 2>&- || { echo >&2 "This installer requires $packagemanager."; exit 1; }
  38. # Install Python-dev
  39. if [[ $platform == 'linux' ]]; then
  40. apt-get install git-core python-setuptools python-dev build-essential python-pip
  41. # Install server-specific stuff: SQLAlchemy, Tornadio, Tornadio from HEADs
  42. apt-get install python-mysqldb
  43. pip install sqlalchemy
  44. git clone https://github.com/facebook/tornado.git
  45. cd tornado
  46. python setup.py install
  47. cd ..
  48. rm -rf tornado/
  49. git clone https://github.com/MrJoes/tornadio.git
  50. cd tornadio
  51. python setup.py install
  52. cd ..
  53. rm -rf tornadio/
  54. # Other handy things
  55. apt-get install libyaml-dev
  56. pip install pyyaml
  57. pip install numpy
  58. pip install mutagen
  59. apt-get install libjpeg-dev
  60. pip install PIL
  61. # The Echo Nest Remix API
  62. apt-get install ffmpeg
  63. sudo ln -s `which ffmpeg` /usr/local/bin/en-ffmpeg
  64. git clone https://github.com/echonest/remix.git
  65. cd remix
  66. git clone https://github.com/echonest/pyechonest pyechonest
  67. python setup.py install
  68. cd ..
  69. rm -rf remix/
  70. # Command-line programs used to speed up remixing
  71. apt-get install lame soundstretch shntool
  72. else
  73. hash easy_install 2>&- || hash pip 2>&- || { echo >&2 "This installer requires easy_install or pip."; exit 1; }
  74. hash pip 2>&- || easy_install pip
  75. # Install server-specific stuff: SQLAlchemy, Tornadio, Tornadio from HEADs
  76. pip install python-mysqldb
  77. pip install sqlalchemy
  78. git clone https://github.com/facebook/tornado.git
  79. cd tornado
  80. python setup.py install
  81. cd ..
  82. rm -rf tornado/
  83. git clone https://github.com/MrJoes/tornadio.git
  84. cd tornadio
  85. python setup.py install
  86. cd ..
  87. rm -rf tornadio/
  88. # Other handy things
  89. brew install libyaml
  90. pip install pyyaml
  91. pip install numpy
  92. pip install mutagen
  93. brew install jpeg
  94. pip install PIL
  95. # The Echo Nest Remix API
  96. hash ffmpeg 2>&- || brew install ffmpeg
  97. sudo ln -s `which ffmpeg` /usr/local/bin/en-ffmpeg
  98. git clone https://github.com/echonest/remix.git
  99. cd remix
  100. git clone https://github.com/echonest/pyechonest pyechonest
  101. python setup.py install
  102. cd ..
  103. rm -rf remix/
  104. # Command-line programs used to speed up remixing
  105. brew install lame
  106. wget "http://www.surina.net/soundtouch/soundstretch_mac_osx_x64_1.6.0.zip"
  107. unzip "soundstretch_mac_osx_x64_1.6.0.zip"
  108. mv ./soundstretch /usr/bin/soundstretch
  109. rm "soundstretch_mac_osx_x64_1.6.0.zip"
  110. brew install shntool
  111. fi