Skip to content

Instantly share code, notes, and snippets.

@workmajj
Created September 18, 2011 22:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save workmajj/1225653 to your computer and use it in GitHub Desktop.
Save workmajj/1225653 to your computer and use it in GitHub Desktop.
Basic OS X install script for Brubeck.
#!/usr/bin/env sh
# Brubeck install script cribbed from: http://brubeck.io/installing.html
# Version numbers and directories.
ZMQ_VERSION="2.1.9"
VIRTUALENVWRAPPER_SH="/usr/local/bin/virtualenvwrapper.sh"
VIRTUALENV_NAME="brubeck"
# Choose eventlet or gevent.
EVENT_LIB="eventlet"
# EVENT_LIB="gevent"
# Check tool dependencies.
if [ "$#" -ne 1 ]; then
echo "Specify where you want Brubeck installed." && exit 1
fi
if [ -d "$1" ]; then
echo "Directory $1 already exists. Aborting." && exit 1
fi
hash git 2>&- || { echo "Requires git. Aborting."; exit 1; }
hash pip 2>&- || { echo "Requires pip. Aborting."; exit 1; }
hash wget 2>&- || { echo "Requires wget. Aborting."; exit 1; }
hash virtualenv 2>&- || { echo "Requires virtualenv. Aborting."; exit 1; }
if [ ! $WORKON_HOME ]; then
echo "Requires virtualenvwrapper. Aborting." && exit 1
fi
# Create install directory.
mkdir $1
cd $1
# Fetching and unpacking sources.
echo "Fetching Brubeck source..."
git clone https://github.com/j2labs/brubeck.git
echo "Done."
echo "Fetching Mongrel2 source..."
git clone https://github.com/zedshaw/mongrel2.git
echo "Done."
echo "Fetching and unpacking ZeroMQ source..."
wget --no-verbose http://download.zeromq.org/zeromq-$ZMQ_VERSION.tar.gz
tar zxf zeromq-$ZMQ_VERSION.tar.gz
rm zeromq-$ZMQ_VERSION.tar.gz
echo "Done."
# Making sources.
echo "Making ZeroMQ..."
cd zeromq-$ZMQ_VERSION
./autogen.sh
./configure
make
sudo make install
cd ..
echo "Done."
echo "Making Mongrel2..."
cd mongrel2
make
sudo make install
cd ..
echo "Done."
# Setting up virtualenv, requirements, and finally Brubeck.
echo "Setting up virtualenv..."
source /usr/local/bin/virtualenvwrapper.sh
mkvirtualenv $VIRTUALENV_NAME
echo "Done."
echo "Setting up requirements..."
cd brubeck
pip install -I -r ./envs/brubeck.reqs
pip install -I -r ./envs/$EVENT_LIB.reqs
echo "Done."
echo "Setting up Brubeck..."
python setup.py install
echo "Done."
deactivate
echo "Install complete. virtualenv is $VIRTUALENV_NAME."
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment