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