blob: a2d997c5d41f54a551e78fd32eb3655b9995a0cd [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# Install a minimal distribution, the required system tools and libraries,
# runtime dependencies and the Tuscany SCA runtime on Ubuntu Server 12.04.
# Display commands as they are executed
set -x
# Build and install in the current directory
build=`pwd`
# First update the system
sudo apt-get update
# Install core dev tools
sudo apt-get -y install curl git-core subversion autoconf pkg-config automake libtool g++ make gdb vim
if [ "$?" != "0" ]; then
exit $?
fi
# Build Libexpat
curl -L http://sourceforge.net/projects/expat/files/expat/2.0.1/expat-2.0.1.tar.gz/download -o expat-2.0.1.tar.gz
tar xzf expat-2.0.1.tar.gz
cd expat-2.0.1
./configure --prefix=$build/expat-2.0.1-bin
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build Apache APR and APR util
sudo apt-get -y install libssl-dev libpcre3-dev
if [ "$?" != "0" ]; then
exit $?
fi
curl -OL http://archive.apache.org/dist/apr/apr-1.4.6.tar.gz
tar xzf apr-1.4.6.tar.gz
cd apr-1.4.6
./buildconf
./configure --prefix=$build/apr-1.4.6-bin
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
curl -OL http://archive.apache.org/dist/apr/apr-util-1.4.1.tar.gz
tar xzf apr-util-1.4.1.tar.gz
cd apr-util-1.4.1
curl -OL http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/patches/apr-util-1.4.1.patch
patch -p0 <apr-util-1.4.1.patch
./buildconf --with-apr=$build/apr-1.4.6
./configure --with-apr=$build/apr-1.4.6-bin --with-openssl --with-crypto --with-expat=$build/expat-2.0.1-bin --prefix=$build/apr-util-1.4.1-bin
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build HTTP server
curl -OL http://archive.apache.org/dist/httpd/httpd-2.4.3.tar.gz
tar xzf httpd-2.4.3.tar.gz
cd httpd-2.4.3
./configure --enable-ssl --enable-proxy --enable-usertrack --enable-cgi --enable-session-crypto --enable-mods-shared=most --enable-mpms-shared="prefork worker event" --with-mpm=prefork --with-apr=$build/apr-1.4.6-bin --with-apr-util=$build/apr-util-1.4.1-bin --with-expat=$build/expat-2.0.1-bin --prefix=$build/httpd-2.4.3-bin
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build Memcached
sudo apt-get -y install libevent-dev
if [ "$?" != "0" ]; then
exit $?
fi
curl -OL http://memcached.googlecode.com/files/memcached-1.4.13.tar.gz
tar xzf memcached-1.4.13.tar.gz
cd memcached-1.4.13
./configure --prefix=$build/memcached-1.4.13-bin
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build Tinycdb
curl -OL http://www.corpit.ru/mjt/tinycdb/tinycdb_0.77.tar.gz
tar xzf tinycdb_0.77.tar.gz
cd tinycdb-0.77
make all shared
make prefix=$build/tinycdb-0.77-bin install-all install-sharedlib
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build Libcurl with c-ares
curl -OL http://c-ares.haxx.se/download/c-ares-1.9.1.tar.gz
tar xzf c-ares-1.9.1.tar.gz
cd c-ares-1.9.1
./configure --prefix=$build/c-ares-1.9.1-bin
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
curl -OL http://curl.haxx.se/download/curl-7.28.0.tar.gz
tar xzf curl-7.28.0.tar.gz
cd curl-7.28.0
curl -OL http://curl.haxx.se/ca/cacert.pem
mkdir -p $build/curl-7.28.0-bin/lib
cp cacert.pem $build/curl-7.28.0-bin/lib/cacert.pem
./configure --enable-ares=$build/c-ares-1.9.1-bin --with-ca-bundle=$build/curl-7.28.0-bin/lib/cacert.pem --prefix=$build/curl-7.28.0-bin
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build Libxml2
curl -OL ftp://xmlsoft.org/libxml2/libxml2-sources-2.7.7.tar.gz
tar xzf libxml2-sources-2.7.7.tar.gz
cd libxml2-2.7.7
./configure --prefix=$build/libxml2-2.7.7-bin
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build Jansson
curl -OL http://www.digip.org/jansson/releases/jansson-2.4.tar.gz
tar xzf jansson-2.4.tar.gz
cd jansson-2.4
curl -OL http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/patches/jansson-2.4.patch
patch -p0 <jansson-2.4.patch
./configure --prefix=$build/jansson-2.4-bin
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build Libstrophe
git clone git://github.com/jsdelfino/libstrophe.git
cd libstrophe
./bootstrap.sh
./configure --prefix=$build/libstrophe-bin --with-expat=$build/expat-2.0.1-bin
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build Liboauth
curl -OL http://liboauth.sourceforge.net/pool/liboauth-0.9.1.tar.gz
tar xzf liboauth-0.9.1.tar.gz
cd liboauth-0.9.1
./configure --prefix=$build/liboauth-0.9.1-bin CURL_CFLAGS="-I$build/curl-7.28.0-bin/include" CURL_LIBS="-L$build/curl-7.28.0-bin/lib -lcurl"
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build mod_security
curl -OL http://people.apache.org/~jsdelfino/tuscany/cpp/dependencies/modsecurity-apache_2.6.6.tar.gz
tar xzf modsecurity-apache_2.6.6.tar.gz
cd modsecurity-apache_2.6.6
./configure --prefix=$build/modsecurity-apache-2.6.6-bin --with-apxs=$build/httpd-2.4.3-bin/bin/apxs --with-apr=$build/apr-1.4.6-bin/bin/apr-1-config --with-apu=$build/apr-util-1.4.1-bin/bin/apu-1-config --with-libxml=$build/libxml2-2.7.7-bin --with-curl=$build/curl-7.28.0-bin LIBS="-L$build/expat-2.0.1-bin/lib"
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
curl -OL http://people.apache.org/~jsdelfino/tuscany/cpp/dependencies/modsecurity-crs_2.2.5.tar.gz
tar xzf modsecurity-crs_2.2.5.tar.gz
cd modsecurity-crs_2.2.5
#curl -OL http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/patches/modsecurity-crs_2.2.5.patch
#patch -p0 <modsecurity-crs_2.2.2.patch
cp -R base_rules $build/modsecurity-apache-2.6.6-bin
cp -R optional_rules $build/modsecurity-apache-2.6.6-bin
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build PostgreSQL and PgBouncer
sudo apt-get -y install libreadline-dev
if [ "$?" != "0" ]; then
exit $?
fi
curl -OL http://ftp.postgresql.org/pub/source/v9.1.2/postgresql-9.1.2.tar.gz
tar xzf postgresql-9.1.2.tar.gz
cd postgresql-9.1.2
./configure --prefix=$build/postgresql-9.1.2-bin --enable-thread-safety
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd contrib/pgbench
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
curl -OL http://pgfoundry.org/frs/download.php/3197/pgbouncer-1.5.tar.gz
tar xzf pgbouncer-1.5.tar.gz
cd pgbouncer-1.5
./configure --prefix=$build/pgbouncer-1.5-bin
make
cp install-sh doc
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build Apache Thrift
sudo apt-get -y install bison flex libboost-dev libboost-filesystem-dev
if [ "$?" != "0" ]; then
exit $?
fi
curl -OL http://archive.apache.org/dist/thrift/0.8.0/thrift-0.8.0.tar.gz
tar xzf thrift-0.8.0.tar.gz
cd thrift-0.8.0
curl -OL http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/patches/thrift-0.8.0.patch
patch -p0 <thrift-0.8.0.patch
./configure --prefix=$build/thrift-0.8.0-bin PY_PREFIX=$build/thrift-0.8.0-bin/contrib/fb303 --with-java=no --with-erlang=no --with-perl=no --with-ruby=no --with-csharp=no --disable-static
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build Facebook fb303
cd thrift-0.8.0/contrib/fb303
./bootstrap.sh --prefix=$build/thrift-0.8.0-bin/contrib/fb303 PY_PREFIX=$build/thrift-0.8.0-bin/contrib/fb303 --with-thriftpath=$build/thrift-0.8.0-bin --disable-static CPPFLAGS="-DHAVE_CONFIG_H"
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build Facebook Scribe
sudo apt-get -y install gawk
if [ "$?" != "0" ]; then
exit $?
fi
curl -OL http://github.com/downloads/facebook/scribe/scribe-2.2.tar.gz
tar xzf scribe-2.2.tar.gz
cd scribe
curl -OL http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/patches/scribe-2.2.patch
patch -p0 <scribe-2.2.patch
autoreconf --force --verbose --install
./configure --prefix=$build/scribe-2.2-bin PY_PREFIX=$build/scribe-2.2-bin --with-thriftpath=$build/thrift-0.8.0-bin --with-fb303path=$build/thrift-0.8.0-bin/contrib/fb303 --disable-static CPPFLAGS="-DHAVE_CONFIG_H -DBOOST_FILESYSTEM_VERSION=2" LIBS="-lboost_system -lboost_filesystem"
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cp src/lib/libscribe.so $build/scribe-2.2-bin/lib
cd $build
# Build Python
sudo apt-get -y install libssl-dev
curl -OL http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar xzf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=$build/python-2.7.3-bin --enable-shared --with-system-expat=$build/expat-2.0.1-bin -enable-unicode=ucs4
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build Google Page Speed
curl -OL https://dl-ssl.google.com/page-speed/sdk/current/page-speed-sdk.zip
unzip page-speed-sdk.zip
cd page-speed-1.9
curl -OL http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/patches/page-speed-1.9.patch
patch -p0 <page-speed-1.9.patch
make builddir=$build/page-speed-1.9-bin CXXFLAGS="-Wno-unused-but-set-variable"
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build Apache Nuvem
git clone git://git.apache.org/nuvem.git
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Build Tuscany SCA
git clone git://git.apache.org/tuscany-sca-cpp.git
cd tuscany-sca-cpp
./bootstrap
./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.28.0-bin --with-apr=$build/apr-1.4.6-bin --with-apr-util=$build/apr-util-1.4.1-bin --with-httpd=$build/httpd-2.4.3-bin --with-memcached=$build/memcached-1.4.13-bin --with-tinycdb=$build/tinycdb-0.77-bin --with-jansson=$build/jansson-2.4-bin --enable-pagespeed --with-pagespeed=$build/page-speed-1.9-bin --enable-threads --enable-python --with-python=$build/python-2.7.3-bin --with-libxml2=$build/libxml2-2.7.7-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin --with-pgbouncer=$build/pgbouncer-1.5-bin --enable-log --with-thrift=$build/thrift-0.8.0-bin --with-scribe=$build/scribe-2.2-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.6-bin
make
make install
if [ "$?" != "0" ]; then
exit $?
fi
cd $build
# Create src archive
tar czf tuscany-sca-cpp-1.0-src.tar.gz apr-1.4.6 apr-1.4.6.tar.gz apr-1.4.6-bin apr-util-1.4.1 apr-util-1.4.1.tar.gz apr-util-1.4.1-bin c-ares-1.9.1 c-ares-1.9.1-bin c-ares-1.9.1.tar.gz curl-7.28.0 curl-7.28.0-bin curl-7.28.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz httpd-2.4.3 httpd-2.4.3.tar.gz httpd-2.4.3-bin jansson-2.4 jansson-2.4-bin jansson-2.4.tar.gz liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.13 memcached-1.4.13-bin memcached-1.4.13.tar.gz modsecurity-apache_2.6.6 modsecurity-apache-2.6.6-bin modsecurity-apache_2.6.6.tar.gz modsecurity-crs_2.2.5 modsecurity-crs_2.2.5.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz Python-2.7.3 python-2.7.3-bin Python-2.7.3.tgz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.8.0 thrift-0.8.0-bin thrift-0.8.0.tar.gz tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin
# Create bin archive
tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.6-bin apr-util-1.4.1-bin c-ares-1.9.1-bin curl-7.28.0-bin expat-2.0.1-bin httpd-2.4.3-bin jansson-2.4-bin liboauth-0.9.1-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.13-bin modsecurity-apache-2.6.6-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-bin python-2.7.3-bin scribe-2.2-bin thrift-0.8.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin