ceph/bootstrap
Zack Cerza ac62ea8cbe Fix typo
Signed-off-by: Zack Cerza <zack@cerza.org>
2014-11-04 10:16:05 -07:00

73 lines
2.1 KiB
Bash
Executable File

#!/bin/sh
set -e
case "$(uname -s)" in
Linux)
case "$(lsb_release --id --short)" in
Ubuntu|Debian)
for package in python-dev python-pip python-virtualenv libevent-dev python-libvirt libmysqlclient-dev; do
if [ "$(dpkg --status -- $package|sed -n 's/^Status: //p')" != "install ok installed" ]; then
# add a space after old values
missing="${missing:+$missing }$package"
fi
done
if [ -n "$missing" ]; then
echo "$0: missing required packages, please install them:" 1>&2
echo "sudo apt-get install $missing"
exit 1
fi
;;
Fedora)
for package in python-pip python-virtualenv libevent-devel libvirt-python community-mysql-devel; do
if [ "$(rpm -q $package)" == "package $package is not installed" ]; then
missing="${missing:+$missing }$package"
fi
done
if [ -n "$missing" ]; then
echo "$0: missing required packages, please install them:" 1>&2
echo "sudo yum install $missing"
exit 1
fi
;;
*)
echo "This script does not support your Linux distribution yet. Patches encouraged!"
exit 1
;;
esac
;;
Darwin)
if ! which brew > /dev/null; then
echo "You need Homebrew: http://brew.sh/"
exit 1
fi
for keg in python libvirt libevent; do
if brew list $keg >/dev/null 2>&1; then
echo "Found $keg"
else
brew install $keg
fi
done
;;
*)
echo "This script does not support your OS yet. Patches encouraged!"
exit 1
;;
esac
if [ -z "$NO_CLOBBER" ] || [ ! -e ./virtualenv ]; then
# site packages needed because libvirt python bindings are not nicely
# packaged
virtualenv --system-site-packages --setuptools virtualenv
# avoid pip bugs
./virtualenv/bin/pip install --upgrade pip
# work-around change in pip 1.5
./virtualenv/bin/pip install setuptools --no-use-wheel --upgrade
fi
./virtualenv/bin/pip install -r requirements.txt
./virtualenv/bin/python setup.py develop