-
Notifications
You must be signed in to change notification settings - Fork 31
/
prepare.sh
executable file
·60 lines (55 loc) · 2.1 KB
/
prepare.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
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root!" 1>&2
exit 1
fi
# This should follow what is on the following website.
URL="https://github.com/yahoo/Openstack-DevstackPy/wiki/Simple-Setup"
ME=`basename $0`
if [[ `cat /etc/issue | grep -i "ubuntu"` ]] ; then
PKGS="git python-pip python-dev python-yaml gcc pep8 pylint python-progressbar python"
PIPS="netifaces termcolor"
APT="apt-get -y -qq"
PIP="pip -q"
# Now do it!
echo "Preparing DEVSTACKpy for ubuntu."
echo "Installing packages: $PKGS"
$APT install $PKGS
echo "Installing pypi packages: $PIPS"
$PIP install netifaces termcolor
echo "DEVSTACKpy for ubuntu is ready to rock & roll."
elif [[ `cat /etc/issue | grep -i "red hat enterprise.*release.*6.*"` ]] ; then
EPEL_RPM="epel-release-6-5.noarch.rpm"
PKGS="python-pip gcc python-netifaces git python-pep8 pylint python-progressbar python"
PIPS="termcolor pyyaml"
PIP="pip-python -q"
YUM="yum install -q"
WGET="wget -q"
# Now do it!
echo "Preparing DEVSTACKpy for RHEL 6"
echo "Fetching and installing EPEL rpm: $EPEL_RPM"
TMP_DIR=`mktemp -d`
$WGET http://download.fedoraproject.org/pub/epel/6/i386/$EPEL_RPM -O $TMP_DIR/$EPEL_RPM
$YUM install $TMP_DIR/$EPEL_RPM
rm -rf $TMP_DIR
echo "Installing packages: $PKGS"
$YUM install $PKGS
echo "Installing pypi packages: $PIPS"
$PIP install $PIPS
echo "DEVSTACKpy for RHEL 6 is ready to rock & roll."
elif [[ `cat /etc/issue | grep -i "fedora.*release.*16"` ]] ; then
PKGS="python-pip gcc python-netifaces git python-pep8 pylint python-yaml python python-progressbar"
PIPS="termcolor"
PIP="pip-python -q"
YUM="yum install -q"
# Now do it!
echo "Preparing DEVSTACKpy for Fedora 16"
echo "Installing packages: $PKGS"
$YUM install $PKGS
echo "Installing pypi packages: $PIPS"
$PIP install $PIPS
echo "DEVSTACKpy for Fedora 16 is ready to rock & roll."
else
echo "DEVSTACKpy '$ME' is being ran on an unknown distribution."
echo "Please update '$URL' when you get it to run. Much appreciated!"
fi