Skip to content

Instantly share code, notes, and snippets.

@cielavenir

cielavenir/wandbox.sh

Last active Feb 22, 2017
Embed
What would you like to do?
wandbox provisioner
set -e
if [ -x /usr/bin/apt-get ]; then
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y git g++ libboost-dev libboost-system-dev libboost-program-options-dev libcap-dev autoconf automake cmake libpcre3-dev zlib1g-dev libgcrypt11-dev libicu-dev python libsqlite3-dev libssl-dev
elif [ -x /usr/bin/yum ]; then
sudo yum -y upgrade
sudo yum -y install git gcc-c++ boost-devel libcap-devel autoconf automake cmake pcre-devel zlib-devel libgcrypt-devel libicu-devel python sqlite-devel openssl-devel
else
echo "Either apt-get or yum is required."
exit 1
fi
sudo mkdir -p /opt/wandbox
sudo mkdir -p /opt/wandbox/etc
sudo mkdir -p /opt/wandbox/share
sudo mkdir -p /var/log/wandbox/ran
sudo mkdir /home/jail /lib32 /lib64 /usr/lib64 || true
sudo chown vagrant /opt/wandbox /opt/wandbox/etc /opt/wandbox/share /var/log/wandbox/ran
git clone https://github.com/melpon/wandbox
cd wandbox
git submodule init
git submodule update
git clone https://github.com/melpon/cppcms.git
mkdir cppcms_build
cd cppcms_build
cmake ../cppcms/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/wandbox -DDISABLE_SHARED=ON -DDISABLE_FCGI=ON -DDISABLE_SCGI=ON -DDISABLE_ICU_LOCALE=ON -DDISABLE_TCPCACHE=ON
make install
cd ..
git clone https://github.com/melpon/cppdb.git
mkdir cppdb_build
cd cppdb_build
cmake ../cppdb/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/wandbox -DDISABLE_MYSQL=ON -DDISABLE_PQ=ON -DDISABLE_ODBC=ON
make install
cd ..
cd cattleshed
sh configure --prefix=/opt/wandbox
make || aclocal
make || automake
make
sudo make install # bah: setcap requires root
cd ..
cd kennel2
sed -i -e 's/\/wandbox//' kennel.json.in
sh autogen.sh
sed -i -e 's/-lcrypto -lpcre/-lgcrypt -lpcre/' configure
sh configure --prefix=/opt/wandbox --with-cppcms=/opt/wandbox --with-cppdb=/opt/wandbox
make install
cd ..
/opt/wandbox/bin/cattleshed &
/opt/wandbox/bin/kennel -c /opt/wandbox/etc/kennel.json &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.