2011-04-04 21:45:42 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
2011-07-13 20:52:54 +00:00
|
|
|
|
2013-07-24 18:10:36 +00:00
|
|
|
if [ -f /etc/debian_version ]; then
|
2016-05-19 15:12:46 +00:00
|
|
|
for package in python-pip python-virtualenv python-dev libevent-dev libxml2-dev libxslt-dev zlib1g-dev; do
|
2013-07-10 01:15:25 +00:00
|
|
|
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
|
2015-05-15 17:15:33 +00:00
|
|
|
echo "$0: missing required DEB packages. Installing via sudo." 1>&2
|
|
|
|
sudo apt-get -y install $missing
|
2013-07-10 01:15:25 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ -f /etc/redhat-release ]; then
|
2016-05-19 15:12:46 +00:00
|
|
|
for package in python-pip python-virtualenv python-devel libevent-devel libxml2-devel libxslt-devel zlib-devel; do
|
2013-07-10 01:15:25 +00:00
|
|
|
if [ "$(rpm -qa $package 2>/dev/null)" == "" ]; then
|
|
|
|
missing="${missing:+$missing }$package"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -n "$missing" ]; then
|
2015-05-15 17:15:33 +00:00
|
|
|
echo "$0: missing required RPM packages. Installing via sudo." 1>&2
|
|
|
|
sudo yum -y install $missing
|
2011-07-13 20:52:54 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2011-04-04 21:45:42 +00:00
|
|
|
virtualenv --no-site-packages --distribute virtualenv
|
2011-07-13 20:52:54 +00:00
|
|
|
|
|
|
|
# avoid pip bugs
|
|
|
|
./virtualenv/bin/pip install --upgrade pip
|
|
|
|
|
2017-01-25 16:04:51 +00:00
|
|
|
# work-around change in pip 1.5 (and more recent)
|
|
|
|
./virtualenv/bin/pip install setuptools --upgrade
|
2014-01-10 03:09:39 +00:00
|
|
|
|
2011-04-04 21:45:42 +00:00
|
|
|
./virtualenv/bin/pip install -r requirements.txt
|
2011-07-13 20:52:54 +00:00
|
|
|
|
|
|
|
# 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
|
2015-07-14 17:19:37 +00:00
|
|
|
./virtualenv/bin/python setup.py develop
|