s3-tests/bootstrap
Ken Dreyer 276125593a bootstrap: yum install the list of dependencies
This optimizes the bootstrap section for RPM in a couple ways:

1) There's no need to check "rpm -q" before doing "yum install". Yum
   will gracefully skip packages that are already installed.
2) Just assume that the user has sudo rights; don't "echo" what they
   should do. If there are problems, they can read the bootstrap shell
   script to figure out what's going on.
3) Handle all the packages at once; don't loop through them
   individually.

Related: http://tracker.ceph.com/issues/11637
2015-05-15 09:49:15 -06:00

36 lines
1.2 KiB
Bash
Executable file

#!/bin/sh
set -e
if [ -f /etc/debian_version ]; then
for package in python-pip python-virtualenv python-dev libevent-dev; do
if [ "$(dpkg --status -- $package 2>/dev/null|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
fi
if [ -f /etc/redhat-release ]; then
sudo yum install python-pip python-virtualenv python-devel libevent-devel
fi
virtualenv --no-site-packages --distribute 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
./virtualenv/bin/pip install -r requirements.txt
# forbid setuptools from using the network because it'll try to use
# easy_install, and we really wanted pip; next line will fail if pip
# requirements.txt does not match setup.py requirements -- sucky but
# good enough for now
./virtualenv/bin/python setup.py develop \
--allow-hosts None