summaryrefslogtreecommitdiffstats
path: root/sca-cpp/branches/lightweight-sca/ubuntu
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/branches/lightweight-sca/ubuntu')
-rw-r--r--sca-cpp/branches/lightweight-sca/ubuntu/Makefile.am22
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/ip-redirect35
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/ip-redirect-all31
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/ubuntu-backup28
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/ubuntu-backup-all28
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/ubuntu-bin-all-image98
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/ubuntu-bin-image80
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/ubuntu-dev-all-image40
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/ubuntu-dev-image40
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install344
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-all458
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-all-dependencies86
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-dependencies68
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-nothreads344
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/uec2-bin-all-image23
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/uec2-bin-image23
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/uec2-conf39
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/uec2-dev-all-image23
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/uec2-dev-image23
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/uec2-setenv34
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/uec2-ssh21
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/uec2-start41
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/uec2-status23
-rwxr-xr-xsca-cpp/branches/lightweight-sca/ubuntu/uec2-stop24
24 files changed, 1976 insertions, 0 deletions
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/Makefile.am b/sca-cpp/branches/lightweight-sca/ubuntu/Makefile.am
new file mode 100644
index 0000000000..a1e092944c
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/Makefile.am
@@ -0,0 +1,22 @@
+# 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.
+
+dist_ubuntu_SCRIPTS = ip-redirect ip-redirect-all uec2-conf uec2-setenv uec2-ssh uec2-start uec2-status uec2-stop
+ubuntudir=$(prefix)/ubuntu
+
+dist_noinst_SCRIPTS = ubuntu-bin-image ubuntu-bin-all-image ubuntu-dev-image ubuntu-dev-all-image ubuntu-install ubuntu-install-dependencies ubuntu-backup ubuntu-install-all ubuntu-install-all-dependencies ubuntu-backup-all uec2-bin-image uec2-bin-all-image uec2-dev-image uec2-dev-all-image
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/ip-redirect b/sca-cpp/branches/lightweight-sca/ubuntu/ip-redirect
new file mode 100755
index 0000000000..f2f33e27ff
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/ip-redirect
@@ -0,0 +1,35 @@
+# 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.
+
+# Redirect TCP/IP traffic to a particular IP address from one port to another
+# port. This is useful to handle incoming traffic on a standard reserved port
+# like 80 or 443 for example in an unprivileged user process bound to a non
+# reserved port.
+# Example: ip-redirect 80 8090 10.1.1.1
+
+sport=$1
+tport=$2
+dest=$3
+
+# Redirect external incoming traffic
+sudo /sbin/iptables -t nat -S PREROUTING | grep "\-d $dest/" | grep "\-p tcp" | grep "\-\-dport $sport" | grep "\-j DNAT" | sed "s/^-A/-D/" | awk -F "\t" '{ printf "sudo /sbin/iptables -t nat %s\n", $1 }' | /bin/sh
+sudo /sbin/iptables -t nat -A PREROUTING --destination $dest -p tcp --dport $sport -j DNAT --to $dest:$tport
+
+# Redirect local traffic as well
+sudo /sbin/iptables -t nat -S OUTPUT | grep "\-d $dest/" | grep "\-p tcp" | grep "\-\-dport $sport" | grep "\-j DNAT" | sed "s/^-A/-D/" | awk -F "\t" '{ printf "sudo /sbin/iptables -t nat %s\n", $1 }' | /bin/sh
+sudo /sbin/iptables -t nat -A OUTPUT --destination $dest -p tcp --dport $sport -j DNAT --to $dest:$tport
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/ip-redirect-all b/sca-cpp/branches/lightweight-sca/ubuntu/ip-redirect-all
new file mode 100755
index 0000000000..c8743add5d
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/ip-redirect-all
@@ -0,0 +1,31 @@
+# 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.
+
+# Redirect TCP/IP traffic to all local addresses from one port to another
+# Example: ip-redirect-all 80 8090
+
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
+sport=$1
+tport=$2
+
+# Cleanup existing rules
+sudo /sbin/iptables -t nat -S PREROUTING | grep "\-p tcp" | grep "\-\-dport $sport" | grep "\-j REDIRECT" | sed "s/^-A/-D/" | awk -F "\t" '{ printf "sudo /sbin/iptables -t nat %s\n", $1 }' | /bin/sh
+sudo /sbin/iptables -t nat -S OUTPUT | grep "\-p tcp" | grep "\-\-dport $sport" | grep "\-j REDIRECT" | sed "s/^-A/-D/" | awk -F "\t" '{ printf "sudo /sbin/iptables -t nat %s\n", $1 }' | /bin/sh
+
+# Redirect traffic
+/sbin/ifconfig | grep "inet addr:" | awk -F ":" '{ print $2 }' | awk '{ print $1 }' | xargs -i $here/ip-redirect $sport $tport {}
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-backup b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-backup
new file mode 100755
index 0000000000..55c5f7e61b
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-backup
@@ -0,0 +1,28 @@
+# 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.
+
+# Create backup archives of a minimal Tuscany SCA runtime distribution.
+
+# Display commands as they are executed
+set -x
+
+# Create src archive
+tar czf tuscany-sca-cpp-1.0-src.tar.gz apr-1.4.6.tar.gz apr-1.4.6 apr-1.4.6-bin apr-util-1.4.1.tar.gz apr-util-1.4.1 apr-util-1.4.1-bin curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz httpd-2.4.2 httpd-2.4.2.tar.gz httpd-2.4.2-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.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 nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.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.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.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 curl-7.24.0-bin expat-2.0.1-bin httpd-2.4.2-bin js-1.8.5-bin liboauth-0.9.1-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.13-bin modsecurity-apache-2.6.6-bin nspr-4.8.8-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.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-backup-all b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-backup-all
new file mode 100755
index 0000000000..9a740c46de
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-backup-all
@@ -0,0 +1,28 @@
+# 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.
+
+# Create backup archives of a complete Tuscany SCA runtime distribution.
+
+# Display commands as they are executed
+set -x
+
+# Create src archive
+tar czf tuscany-sca-cpp-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 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 axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin 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 mod_auth_openid mod-auth-openid-bin 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 nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.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 qpidc-0.6 qpidc-0.6-bin qpid-cpp-0.6.tar.gz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 vysper-0.6-bin.tar.gz
+
+# Create bin archive
+tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.6-bin apr-util-1.4.1-bin axis2c-1.6.0-bin curl-7.24.0-bin expat-2.0.1-bin google_appengine htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.13-bin mod-auth-openid-bin modsecurity-apache-2.6.6-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-bin python-2.7.3-bin qpidc-0.6-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-bin-all-image b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-bin-all-image
new file mode 100755
index 0000000000..ff1b75298c
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-bin-all-image
@@ -0,0 +1,98 @@
+# 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 complete 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
+
+# First update the system
+sudo apt-get update
+
+# Create install directory
+u=`id -un`
+g=`id -gn`
+sudo mkdir -p /opt/tuscany
+sudo chown $u /opt/tuscany
+sudo chgrp $g /opt/tuscany
+cd /opt/tuscany
+
+# 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
+
+# Install the Apache HTTP server dependencies
+sudo apt-get -y install libssl-dev libpcre3-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Memcached dependencies
+sudo apt-get -y install libevent-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the SpiderMonkey dependencies
+sudo apt-get -y install zip unzip
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Apache Qpid/C++ dependencies
+sudo apt-get -y install libboost-dev libboost-program-options-dev libboost-filesystem-dev uuid-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Apache Vysper dependencies
+sudo apt-get -y install openjdk-6-jdk
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the HTML Tidy dependencies
+sudo apt-get -y install cvs
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the PostgreSQL dependencies
+sudo apt-get -y install libreadline-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Apache Thrift dependencies
+sudo apt-get -y install bison flex
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Facebook Scribe dependencies
+sudo apt-get -y install gawk
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Download and install the Tuscany runtime
+curl -OL http://people.apache.org/~jsdelfino/tuscany/test/tuscany-sca-cpp-all-1.0.tar.gz
+tar xzf tuscany-sca-cpp-all-1.0.tar.gz
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-bin-image b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-bin-image
new file mode 100755
index 0000000000..d9bd4a919c
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-bin-image
@@ -0,0 +1,80 @@
+# 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
+
+# First update the system
+sudo apt-get update
+
+# Create install directory
+u=`id -un`
+g=`id -gn`
+sudo mkdir -p /opt/tuscany
+sudo chown $u /opt/tuscany
+sudo chgrp $g /opt/tuscany
+cd /opt/tuscany
+
+# 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
+
+# Install the Apache HTTP server dependencies
+sudo apt-get -y install libssl-dev libpcre3-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Memcached dependencies
+sudo apt-get -y install libevent-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the SpiderMonkey dependencies
+sudo apt-get -y install zip unzip
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the PostgreSQL dependencies
+sudo apt-get -y install libreadline-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Apache Thrift dependencies
+sudo apt-get -y install bison flex libboost-dev libboost-filesystem-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Facebook Scribe dependencies
+sudo apt-get -y install gawk
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Download and install the Tuscany runtime
+curl -OL http://people.apache.org/~jsdelfino/tuscany/test/tuscany-sca-cpp-1.0.tar.gz
+tar xzf tuscany-sca-cpp-1.0.tar.gz
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-dev-all-image b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-dev-all-image
new file mode 100755
index 0000000000..4015550662
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-dev-all-image
@@ -0,0 +1,40 @@
+# 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 complete 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
+
+# First update the system
+sudo apt-get update
+
+# Create install directory
+u=`id -un`
+g=`id -gn`
+sudo mkdir -p /opt/tuscany
+sudo chown $u /opt/tuscany
+sudo chgrp $g /opt/tuscany
+cd /opt/tuscany
+
+# Download and run install script
+sudo apt-get -y install curl
+curl -OL http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all
+chmod +x ./ubuntu-install-all
+./ubuntu-install-all
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-dev-image b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-dev-image
new file mode 100755
index 0000000000..10f821a39b
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-dev-image
@@ -0,0 +1,40 @@
+# 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 a Ubuntu Server 12.04.
+
+# Display commands as they are executed
+set -x
+
+# First update the system
+sudo apt-get update
+
+# Create install directory
+u=`id -un`
+g=`id -gn`
+sudo mkdir -p /opt/tuscany
+sudo chown $u /opt/tuscany
+sudo chgrp $g /opt/tuscany
+cd /opt/tuscany
+
+# Download and run install script
+sudo apt-get -y install curl
+curl -OL http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-install
+chmod +x ./ubuntu-install
+./ubuntu-install
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install
new file mode 100755
index 0000000000..fbd2587e13
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install
@@ -0,0 +1,344 @@
+# 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.2.tar.gz
+tar xzf httpd-2.4.2.tar.gz
+cd httpd-2.4.2
+./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.2-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
+curl -OL http://curl.haxx.se/download/curl-7.24.0.tar.gz
+tar xzf curl-7.24.0.tar.gz
+cd curl-7.24.0
+./configure --enable-threaded-resolver --prefix=$build/curl-7.24.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 Mozilla Portable Runtime
+curl -OL http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.8/src/nspr-4.8.8.tar.gz
+tar xzf nspr-4.8.8.tar.gz
+cd nspr-4.8.8/mozilla/nsprpub
+./configure --prefix=$build/nspr-4.8.8-bin --enable-64bit
+make
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cd $build
+
+# Build SpiderMonkey
+sudo apt-get -y install zip unzip
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+curl -OL http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
+tar xzf js185-1.0.0.tar.gz
+cd js-1.8.5/js/src
+export LD_RUN_PATH=$build/nspr-4.8.8-bin/lib
+./configure --prefix=$build/js-1.8.5-bin --enable-threadsafe --with-system-nspr --with-nspr-prefix=$build/nspr-4.8.8-bin
+make
+make install
+unset LD_RUN_PATH
+ln -s $build/js-1.8.5-bin/lib/libmozjs185.so $build/js-1.8.5-bin/lib/libmozjs.so
+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.24.0-bin/include" CURL_LIBS="-L$build/curl-7.24.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.2-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.24.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 $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/incubator/thrift/0.2.0-incubating/thrift-0.2.0-incubating.tar.gz
+tar xzf thrift-0.2.0-incubating.tar.gz
+cd thrift-0.2.0
+curl -OL http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/patches/thrift-0.2.0.patch
+patch -p0 <thrift-0.2.0.patch
+./bootstrap.sh
+./configure --prefix=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no --with-py=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.2.0/contrib/fb303
+./bootstrap.sh
+./configure --prefix=$build/thrift-0.2.0-bin/contrib/fb303 PY_PREFIX=$build/thrift-0.2.0-bin/contrib/fb303 --with-thriftpath=$build/thrift-0.2.0-bin --disable-static
+make
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cp cpp/lib/libfb303.so $build/thrift-0.2.0-bin/contrib/fb303/lib
+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.2.0-bin --with-fb303path=$build/thrift-0.2.0-bin/contrib/fb303 --disable-static CPPFLAGS="-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
+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
+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
+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.24.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.2-bin --with-memcached=$build/memcached-1.4.13-bin --with-tinycdb=$build/tinycdb-0.77-bin --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --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.2.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 curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz httpd-2.4.2 httpd-2.4.2.tar.gz httpd-2.4.2-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.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 nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.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.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.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 curl-7.24.0-bin expat-2.0.1-bin httpd-2.4.2-bin js-1.8.5-bin liboauth-0.9.1-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.13-bin modsecurity-apache-2.6.6-bin nspr-4.8.8-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.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-all b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-all
new file mode 100755
index 0000000000..00d3c54abc
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-all
@@ -0,0 +1,458 @@
+# 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 complete 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-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.2.tar.gz
+tar xzf httpd-2.4.2.tar.gz
+cd httpd-2.4.2
+./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.2-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 LevelDB
+git clone https://code.google.com/p/leveldb/
+cd leveldb
+make all
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cd $build
+
+# Build Libcurl
+curl -OL http://curl.haxx.se/download/curl-7.24.0.tar.gz
+tar xzf curl-7.24.0.tar.gz
+cd curl-7.24.0
+./configure --enable-threaded-resolver --prefix=$build/curl-7.24.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 Mozilla Portable Runtime
+curl -OL http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.8/src/nspr-4.8.8.tar.gz
+tar xzf nspr-4.8.8.tar.gz
+cd nspr-4.8.8/mozilla/nsprpub
+./configure --prefix=$build/nspr-4.8.8-bin --enable-64bit
+make
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cd $build
+
+# Build SpiderMonkey
+sudo apt-get -y install zip unzip
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+curl -OL http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
+tar xzf js185-1.0.0.tar.gz
+cd js-1.8.5/js/src
+export LD_RUN_PATH=$build/nspr-4.8.8-bin/lib
+./configure --prefix=$build/js-1.8.5-bin --enable-threadsafe --with-system-nspr --with-nspr-prefix=$build/nspr-4.8.8-bin
+make
+make install
+unset LD_RUN_PATH
+ln -s $build/js-1.8.5-bin/lib/libmozjs185.so $build/js-1.8.5-bin/lib/libmozjs.so
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cd $build
+
+# Install Google AppEngine SDK
+curl -OL http://googleappengine.googlecode.com/files/google_appengine_1.4.0.zip
+unzip google_appengine_1.4.0.zip
+
+# Build Apache Axis2/C
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+curl -OL http://www.apache.org/dist/ws/axis2-c/1_6_0/axis2c-src-1.6.0.tar.gz
+tar xzf axis2c-src-1.6.0.tar.gz
+cd axis2c-src-1.6.0
+./configure --enable-openssl --with-apache2=$build/httpd-2.4.2-bin/include --with-apr=$build/apr-1.4.6-bin/include/apr-1 --prefix=$build/axis2c-1.6.0-bin
+make
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+export AXIS2C_HOME=$build/axis2c-1.6.0-bin
+cd samples
+./configure --prefix=$build/axis2c-1.6.0-bin --with-axis2=$build/axis2c-1.6.0-bin/include/axis2-1.6.0
+make
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cd $build
+
+# Build Apache Qpid/C++
+sudo apt-get -y install libboost-dev libboost-program-options-dev libboost-filesystem-dev uuid-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+curl -OL http://archive.apache.org/dist/qpid/0.6/qpid-cpp-0.6.tar.gz
+tar xzf qpid-cpp-0.6.tar.gz
+cd qpidc-0.6
+./configure --prefix=$build/qpidc-0.6-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
+
+# Install Apache Vysper
+sudo apt-get -y install openjdk-6-jdk
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+curl -OL http://archive.apache.org/dist/mina/vysper/0.6/vysper-0.6-bin.tar.gz
+tar xzf vysper-0.6-bin.tar.gz
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Build HTML Tidy
+sudo apt-get -y install cvs
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cvs -z3 -d:pserver:anonymous@tidy.cvs.sourceforge.net:/cvsroot/tidy co -P tidy
+cd tidy
+sh build/gnuauto/setup.sh
+./configure --prefix=$build/htmltidy-bin
+make
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cd $build
+
+# Build Libopkele
+git clone git://github.com/jsdelfino/libopkele.git
+cd libopkele
+./autogen.bash
+./configure --prefix=$build/libopkele-bin --with-curl=$build/curl-7.24.0-bin --with-expat=$build/expat-2.0.1-bin --with-htmltidy=$build/htmltidy-bin
+make
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cd $build
+
+# Build Mod_auth_openid
+git clone git://github.com/jsdelfino/mod_auth_openid.git
+cd mod_auth_openid
+./autogen.sh
+./configure --prefix=$build/mod-auth-openid-bin --with-apr=$build/apr-1.4.6-bin --with-httpd=$build/httpd-2.4.2-bin --with-curl=$build/curl-7.24.0-bin --with-libopkele=$build/libopkele-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.24.0-bin/include" CURL_LIBS="-L$build/curl-7.24.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.2-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.24.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.2.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 $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/incubator/thrift/0.2.0-incubating/thrift-0.2.0-incubating.tar.gz
+tar xzf thrift-0.2.0-incubating.tar.gz
+cd thrift-0.2.0
+curl -OL http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/patches/thrift-0.2.0.patch
+patch -p0 <thrift-0.2.0.patch
+./bootstrap.sh
+./configure --prefix=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no --with-py=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.2.0/contrib/fb303
+./bootstrap.sh
+./configure --prefix=$build/thrift-0.2.0-bin/contrib/fb303 PY_PREFIX=$build/thrift-0.2.0-bin/contrib/fb303 --with-thriftpath=$build/thrift-0.2.0-bin --disable-static
+make
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cp cpp/lib/libfb303.so $build/thrift-0.2.0-bin/contrib/fb303/lib
+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.2.0-bin --with-fb303path=$build/thrift-0.2.0-bin/contrib/fb303 --disable-static CPPFLAGS="-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
+curl -OL http://www.python.org/ftp/python/2.6.6/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
+make
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cd $build
+
+# Build Apache Libcloud
+curl -OL http://archive.apache.org/dist/incubator/libcloud/apache-libcloud-incubating-0.4.2.tar.bz2
+tar xjf apache-libcloud-incubating-0.4.2.tar.bz2
+cd apache-libcloud-incubating-0.4.2
+python setup.py build
+python setup.py install --home $build/libcloud-0.4.2-bin
+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
+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.24.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.2-bin --with-memcached=$build/memcached-1.4.13-bin --with-tinycdb=$build/tinycdb-0.77-bin --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-pagespeed --with-pagespeed=$build/page-speed-1.9-bin --enable-libcloud --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --with-python=$build/python-2.7.3-bin --enable-gae --with-gae=$build/google_appengine --enable-java --with-java=/usr/lib/jvm/java-6-openjdk --enable-webservice --with-libxml2=$build/libxml2-2.7.7-bin --with-axis2c=$build/axis2c-1.6.0-bin --enable-queue --with-qpidc=$build/qpidc-0.6-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --with-vysper=$build/vysper-0.6 --enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin --with-pgbouncer=$build/pgbouncer-1.5-bin --enable-log --with-thrift=$build/thrift-0.2.0-bin --with-scribe=$build/scribe-2.2-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-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-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 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 axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin httpd-2.4.2 httpd-2.4.2.tar.gz httpd-2.4.2-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin 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 mod_auth_openid mod-auth-openid-bin 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 nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.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 qpidc-0.6 qpidc-0.6-bin qpid-cpp-0.6.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.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 vysper-0.6-bin.tar.gz
+
+# Create bin archive
+tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.6-bin apr-util-1.4.1-bin axis2c-1.6.0-bin curl-7.24.0-bin expat-2.0.1-bin google_appengine htmltidy-bin httpd-2.4.2-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.13-bin mod-auth-openid-bin modsecurity-apache-2.6.6-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin postgresql-9.1.2-bin python-2.7.3-bin qpidc-0.6-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-all-dependencies b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-all-dependencies
new file mode 100755
index 0000000000..87710309df
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-all-dependencies
@@ -0,0 +1,86 @@
+# 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 the required system tools and libraries and runtime dependencies
+# for a complete Tuscany SCA runtime distribution on Ubuntu Server 12.04.
+
+# Display commands as they are executed
+set -x
+
+# 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
+
+# Install the Apache HTTP server dependencies
+sudo apt-get -y install libssl-dev libpcre3-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Memcached dependencies
+sudo apt-get -y install libevent-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the SpiderMonkey dependencies
+sudo apt-get -y install zip unzip
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Apache Qpid/C++ dependencies
+sudo apt-get -y install libboost-dev libboost-program-options-dev libboost-filesystem-dev uuid-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Apache Vysper dependencies
+sudo apt-get -y install openjdk-6-jdk
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the HTML Tidy dependencies
+sudo apt-get -y install cvs
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the PostgreSQL dependencies
+sudo apt-get -y install libreadline-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Apache Thrift dependencies
+sudo apt-get -y install bison flex
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Facebook Scribe dependencies
+sudo apt-get -y install gawk
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-dependencies b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-dependencies
new file mode 100755
index 0000000000..c9c140564d
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-dependencies
@@ -0,0 +1,68 @@
+# 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 the required system tools and libraries and runtime dependencies
+# for a minimal Tuscany SCA runtime distribution on Ubuntu Server 12.04.
+
+# Display commands as they are executed
+set -x
+
+# 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
+
+# Install the Apache HTTP server dependencies
+sudo apt-get -y install libssl-dev libpcre3-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Memcached dependencies
+sudo apt-get -y install libevent-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the SpiderMonkey dependencies
+sudo apt-get -y install zip unzip
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the PostgreSQL dependencies
+sudo apt-get -y install libreadline-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Apache Thrift dependencies
+sudo apt-get -y install bison flex libboost-dev libboost-filesystem-dev
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
+# Install the Facebook Scribe dependencies
+sudo apt-get -y install gawk
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-nothreads b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-nothreads
new file mode 100755
index 0000000000..9c17fbb3ef
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/ubuntu-install-nothreads
@@ -0,0 +1,344 @@
+# 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 --disable-threads
+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-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.2.tar.gz
+tar xzf httpd-2.4.2.tar.gz
+cd httpd-2.4.2
+./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.2-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
+curl -OL http://curl.haxx.se/download/curl-7.24.0.tar.gz
+tar xzf curl-7.24.0.tar.gz
+cd curl-7.24.0
+./configure --prefix=$build/curl-7.24.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 --without-threads
+make
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cd $build
+
+# Build Mozilla Portable Runtime
+curl -OL http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.8/src/nspr-4.8.8.tar.gz
+tar xzf nspr-4.8.8.tar.gz
+cd nspr-4.8.8/mozilla/nsprpub
+./configure --prefix=$build/nspr-4.8.8-bin --enable-64bit
+make
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cd $build
+
+# Build SpiderMonkey
+sudo apt-get -y install zip unzip
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+curl -OL http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
+tar xzf js185-1.0.0.tar.gz
+cd js-1.8.5/js/src
+export LD_RUN_PATH=$build/nspr-4.8.8-bin/lib
+./configure --prefix=$build/js-1.8.5-bin --with-system-nspr --enable-gczeal --with-nspr-prefix=$build/nspr-4.8.8-bin
+make
+make install
+unset LD_RUN_PATH
+ln -s $build/js-1.8.5-bin/lib/libmozjs185.so $build/js-1.8.5-bin/lib/libmozjs.so
+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.24.0-bin/include" CURL_LIBS="-L$build/curl-7.24.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.2-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.24.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 --disable-thread-safety
+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/incubator/thrift/0.2.0-incubating/thrift-0.2.0-incubating.tar.gz
+tar xzf thrift-0.2.0-incubating.tar.gz
+cd thrift-0.2.0
+curl -OL http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/patches/thrift-0.2.0.patch
+patch -p0 <thrift-0.2.0.patch
+./bootstrap.sh
+./configure --prefix=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no --with-py=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.2.0/contrib/fb303
+./bootstrap.sh
+./configure --prefix=$build/thrift-0.2.0-bin/contrib/fb303 PY_PREFIX=$build/thrift-0.2.0-bin/contrib/fb303 --with-thriftpath=$build/thrift-0.2.0-bin --disable-static
+make
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cp cpp/lib/libfb303.so $build/thrift-0.2.0-bin/contrib/fb303/lib
+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.2.0-bin --with-fb303path=$build/thrift-0.2.0-bin/contrib/fb303 --disable-static CPPFLAGS="-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
+curl -OL http://www.python.org/ftp/python/2.6.6/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 --without-threads --with-system-expat=$build/expat-2.0.1-bin
+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
+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.24.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.2-bin --with-memcached=$build/memcached-1.4.13-bin --with-tinycdb=$build/tinycdb-0.77-bin --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-pagespeed --with-pagespeed=$build/page-speed-1.9-bin --disable-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.2.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 curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz httpd-2.4.2 httpd-2.4.2.tar.gz httpd-2.4.2-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.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 nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.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.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.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 curl-7.24.0-bin expat-2.0.1-bin httpd-2.4.2-bin js-1.8.5-bin liboauth-0.9.1-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.13-bin modsecurity-apache-2.6.6-bin nspr-4.8.8-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.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/uec2-bin-all-image b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-bin-all-image
new file mode 100755
index 0000000000..f8b34e9083
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-bin-all-image
@@ -0,0 +1,23 @@
+# 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 Tuscany image on an EC2 instance
+host=$1
+
+# Download and execute Tuscany SCA install script
+ssh -i $HOME/.ec2/ec2-keypair.pem ubuntu@$host "wget http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-bin-all-image; chmod 700 ./ubuntu-bin-all-image; ./ubuntu-bin-all-image"
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/uec2-bin-image b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-bin-image
new file mode 100755
index 0000000000..fbcbe091b5
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-bin-image
@@ -0,0 +1,23 @@
+# 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 Tuscany image on an EC2 instance
+host=$1
+
+# Download and execute Tuscany SCA install script
+ssh -i $HOME/.ec2/ec2-keypair.pem ubuntu@$host "wget http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-bin-image; chmod 700 ./ubuntu-bin-image; ./ubuntu-bin-image"
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/uec2-conf b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-conf
new file mode 100755
index 0000000000..37d786896e
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-conf
@@ -0,0 +1,39 @@
+# 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.
+
+# Configure EC2 for use with Tuscany SCA
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
+. $here/uec2-setenv
+
+# Display commands as they are executed
+set -x
+
+# Install EC2 tools
+# See https://help.ubuntu.com/community/EC2StartersGuide for more info
+sudo apt-get install ec2-api-tools
+
+# Create an EC2 SSH keypair if necessary
+if [ ! -f $HOME/.ec2/ec2-keypair.pem ]; then
+ ec2-add-keypair ec2-keypair --region us-west-1 > $HOME/.ec2/ec2-keypair.pem
+ chmod 600 $HOME/.ec2/ec2-keypair.pem
+fi
+
+# Authorize SSH, HTTP and HTTPS access to EC2 instances
+ec2-authorize default -p 22 --region us-west-1
+ec2-authorize default -p 80 --region us-west-1
+ec2-authorize default -p 443 --region us-west-1
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/uec2-dev-all-image b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-dev-all-image
new file mode 100755
index 0000000000..d56f05cdda
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-dev-all-image
@@ -0,0 +1,23 @@
+# 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.
+
+# Build a Tuscany image on an EC2 instance
+host=$1
+
+# Download and execute Tuscany SCA install script
+ssh -i $HOME/.ec2/ec2-keypair.pem ubuntu@$host "wget http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-dev-all-image; chmod 700 ./ubuntu-dev-all-image; ./ubuntu-dev-all-image"
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/uec2-dev-image b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-dev-image
new file mode 100755
index 0000000000..206443a7ae
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-dev-image
@@ -0,0 +1,23 @@
+# 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.
+
+# Build a Tuscany image on an EC2 instance
+host=$1
+
+# Download and execute Tuscany SCA install script
+ssh -i $HOME/.ec2/ec2-keypair.pem ubuntu@$host "wget http://svn.apache.org/repos/asf/tuscany/sca-cpp/trunk/ubuntu/ubuntu-dev-image; chmod 700 ./ubuntu-dev-image; ./ubuntu-dev-image"
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/uec2-setenv b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-setenv
new file mode 100755
index 0000000000..67d57df83a
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-setenv
@@ -0,0 +1,34 @@
+# 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.
+
+# Configure EC2 environment variables
+export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
+
+# Expect to find your EC2 private key and X.509 certificate in $HOME/.ec2
+key=`ls $HOME/.ec2/pk-*.pem`
+if [ "$key" = "" ]; then
+ echo "Couldn't find EC2 private key $HOME/.ec2/pk-*.pem"
+ exit 1
+fi
+cert=`ls $HOME/.ec2/cert-*.pem`
+if [ "$cert" = "" ]; then
+ echo "Couldn't find EC2 X.509 certificate $HOME/.ec2/pk-*.pem"
+ exit 1
+fi
+export EC2_PRIVATE_KEY=$key
+export EC2_CERT=$cert
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/uec2-ssh b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-ssh
new file mode 100755
index 0000000000..41738df7e6
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-ssh
@@ -0,0 +1,21 @@
+# 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.
+
+# SSH to an EC2 instance
+host=$1
+ssh -i $HOME/.ec2/ec2-keypair.pem ubuntu@$host
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/uec2-start b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-start
new file mode 100755
index 0000000000..ef3dc4efdb
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-start
@@ -0,0 +1,41 @@
+# 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.
+
+# Start an Ubuntu 10.10 64-bit EC2 instance for use with Tuscany
+
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
+. $here/uec2-setenv
+
+# Here are the AMI IDs you can use in the different EC2 regions:
+
+# Ubuntu 10.10 32-bit instance storage, suitable for small instances
+# AP s.east - ami-7c423c2e
+# EU west 1 - ami-339ca947
+# US east 1 - ami-a6f504cf
+# US west 1 - ami-957e2ed0
+
+# More AMI IDs at http://uec-images.ubuntu.com
+
+# Here are some of the instance types you can use:
+# t1.micro
+# m1.small
+# m1.large
+
+#ec2-run-instances "ami-ca1f4f8f" -t m1.large -k ec2-keypair --region us-west-1
+#ec2-run-instances "ami-ca1f4f8f" -t t1.micro -k ec2-keypair --region us-west-1
+ec2-run-instances "ami-957e2ed0" -t m1.small -k ec2-keypair --region us-west-1
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/uec2-status b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-status
new file mode 100755
index 0000000000..f7a0722fe9
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-status
@@ -0,0 +1,23 @@
+# 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.
+
+# Display the status of EC2 instances
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
+. $here/uec2-setenv
+
+ec2-describe-instances --region us-west-1
+
diff --git a/sca-cpp/branches/lightweight-sca/ubuntu/uec2-stop b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-stop
new file mode 100755
index 0000000000..575fb4e3cd
--- /dev/null
+++ b/sca-cpp/branches/lightweight-sca/ubuntu/uec2-stop
@@ -0,0 +1,24 @@
+# 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.
+
+# Terminate an EC2 instance
+instance=$1
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
+. $here/uec2-setenv
+
+ec2-terminate-instances $instance --region us-west-1
+