You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2012/05/28 06:39:29 UTC

svn commit: r1343139 - in /tuscany/sca-cpp/trunk: ./ components/sqldb/ macos/ samples/store-cluster/shared/ samples/store-sql/ ubuntu/

Author: jsdelfino
Date: Mon May 28 04:39:28 2012
New Revision: 1343139

URL: http://svn.apache.org/viewvc?rev=1343139&view=rev
Log:
Database support optimizations. Use PgBouncer to pool connections. Track and manage WAL archives to optimize space and speed up database replication setup.

Added:
    tuscany/sca-cpp/trunk/components/sqldb/pgsql-archive
      - copied, changed from r1343138, tuscany/sca-cpp/trunk/components/sqldb/pgsql-start
    tuscany/sca-cpp/trunk/components/sqldb/pgsql-clean-archive
      - copied, changed from r1343138, tuscany/sca-cpp/trunk/components/sqldb/pgsql-start
    tuscany/sca-cpp/trunk/components/sqldb/pgsql-restore
      - copied, changed from r1343138, tuscany/sca-cpp/trunk/components/sqldb/pgsql
Modified:
    tuscany/sca-cpp/trunk/INSTALL
    tuscany/sca-cpp/trunk/README
    tuscany/sca-cpp/trunk/components/sqldb/Makefile.am
    tuscany/sca-cpp/trunk/components/sqldb/pgsql
    tuscany/sca-cpp/trunk/components/sqldb/pgsql-backup
    tuscany/sca-cpp/trunk/components/sqldb/pgsql-conf
    tuscany/sca-cpp/trunk/components/sqldb/pgsql-standby-conf
    tuscany/sca-cpp/trunk/components/sqldb/pgsql-standby-test.cpp
    tuscany/sca-cpp/trunk/components/sqldb/pgsql-start
    tuscany/sca-cpp/trunk/components/sqldb/pgsql-stop
    tuscany/sca-cpp/trunk/components/sqldb/pgsql-test.cpp
    tuscany/sca-cpp/trunk/components/sqldb/pgsql.hpp
    tuscany/sca-cpp/trunk/components/sqldb/sqldb.componentType
    tuscany/sca-cpp/trunk/components/sqldb/sqldb.composite
    tuscany/sca-cpp/trunk/configure.ac
    tuscany/sca-cpp/trunk/macos/macos-install
    tuscany/sca-cpp/trunk/samples/store-cluster/shared/shared.composite
    tuscany/sca-cpp/trunk/samples/store-sql/store.composite
    tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup
    tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup-all
    tuscany/sca-cpp/trunk/ubuntu/ubuntu-install
    tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all

Modified: tuscany/sca-cpp/trunk/INSTALL
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/INSTALL?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/INSTALL (original)
+++ tuscany/sca-cpp/trunk/INSTALL Mon May 28 04:39:28 2012
@@ -149,6 +149,7 @@ Google LevelDB 1.2 (http://code.google.c
 
 SQL database:
 PostgreSQL 9.1.2 (http://www.postgresql.org/)
+PgBouncer 1.5 (http://wiki.postgresql.org/wiki/PgBouncer)
 
 Logging:
 Facebook Scribe 2.2 (http://github.com/facebook/scribe/downloads)
@@ -197,7 +198,7 @@ Vysper if you want to run the tests with
 To build the Log utility component (requires Facebook Scribe and Apache Thrift):
 --enable-log
 
-To build the SQL Database utility component (requires PostgreSQL):
+To build the SQL Database utility component (requires PostgreSQL and PgBouncer):
 --enable-sqldb
 
 To build the Web service utility component (requires Apache Axis2/C):
@@ -247,6 +248,7 @@ dependencies installed under $build:
 --enable-chat --with-libstrophe=$build/libstrophe-bin \
 --with-vysper=$build/vysper-0.5 \
 --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 \

Modified: tuscany/sca-cpp/trunk/README
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/README?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/README (original)
+++ tuscany/sca-cpp/trunk/README Mon May 28 04:39:28 2012
@@ -21,7 +21,7 @@ Smtp: SMTP client, using Libcurl;
 Kvdb: fast key/value persistent store, using LevelDB;
 Log: distributed logger, using Facebook Scribe;
 Queue: AMQP queuing, using Apache Qpid/C;
-Sqldb: SQL database, using PostgreSQL;
+Sqldb: SQL database, using PostgreSQL and PgBouncer;
 Webservice: Web service gateway, using Apache Axis2/C.
 
 These components present a simple ATOMPub REST interface, allowing you to send

Modified: tuscany/sca-cpp/trunk/components/sqldb/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/Makefile.am?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/Makefile.am Mon May 28 04:39:28 2012
@@ -22,12 +22,14 @@ INCLUDES = -I${PGSQL_INCLUDE}
 incl_HEADERS = *.hpp
 incldir = $(prefix)/include/components/sqldb
 
-dist_comp_SCRIPTS = pgsql-conf pgsql-log-conf pgsql-start pgsql-stop pgsql pgsql-standby-conf pgsql-backup
+dist_comp_SCRIPTS = pgsql-conf pgsql-log-conf pgsql-start pgsql-stop pgsql pgsql-standby-conf pgsql-archive pgsql-backup pgsql-restore pgsql-clean-archive
 compdir=$(prefix)/components/sqldb
 
-comp_DATA = pgsql.prefix
+comp_DATA = pgsql.prefix pgbouncer.prefix
 pgsql.prefix: $(top_builddir)/config.status
 	echo ${PGSQL_PREFIX} >pgsql.prefix
+pgbouncer.prefix: $(top_builddir)/config.status
+	echo ${PGBOUNCER_PREFIX} >pgbouncer.prefix
 
 EXTRA_DIST = sqldb.composite sqldb.componentType
 

Modified: tuscany/sca-cpp/trunk/components/sqldb/pgsql
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/pgsql?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/pgsql (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/pgsql Mon May 28 04:39:28 2012
@@ -23,7 +23,7 @@ pgsql_prefix=`cat $here/pgsql.prefix`
 
 if [ "$2" = "" ]; then
     host="localhost"
-    port="5432"
+    port="6432"
     cmd="$1"
 else
     host="$1"

Copied: tuscany/sca-cpp/trunk/components/sqldb/pgsql-archive (from r1343138, tuscany/sca-cpp/trunk/components/sqldb/pgsql-start)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/pgsql-archive?p2=tuscany/sca-cpp/trunk/components/sqldb/pgsql-archive&p1=tuscany/sca-cpp/trunk/components/sqldb/pgsql-start&r1=1343138&r2=1343139&rev=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/pgsql-start (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/pgsql-archive Mon May 28 04:39:28 2012
@@ -17,29 +17,43 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Start postgresql
+# PostgreSQL archive command
 here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
 root=`echo "import os; print os.path.realpath('$1')" | python`
 
-pgsql_prefix=`cat $here/pgsql.prefix`
+host=$2
+port=$3
+walp=$4
+walf=$5
 
-if [ -f "$root/sqldb/log.conf" ]; then
-    pgsql_log=`cat $root/sqldb/log.conf`
-else
-    mkdir -p $root/logs
-    pgsql_log="cat >>$root/logs/postgresql"
+# Copy WAL to archive directory
+if [ ! -f $root/sqldb/archive/$walf ]; then
+    cp $walp $root/sqldb/archive/$walf
+    rc=$?
+    if [ "$rc" != "0" ]; then
+        exit $rc
+    fi
+fi
+
+# Trigger a backup if we have 10 WAL files archived since the last backup
+lastbak=`ls $root/sqldb/archive | sort -r | grep "\.backup$" | head -1`
+if [ "$lastbak" = "" ]; then
+    exit 0
 fi
-mkdir -p $root/sqldb
-echo $pgsql_log >$root/sqldb/logger
+wals=`ls $root/sqldb/archive | sort -r | grep -v "\.backup\.tar\.gz$"`
 
-nohup /bin/sh -c "($pgsql_prefix/bin/pg_ctl start -W -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger)" 1>/dev/null 2>/dev/null &
-sti=0
-while [ $sti -ne 30 ]; do
-    st=`$pgsql_prefix/bin/pg_ctl status -D $root/sqldb/data | grep 'server is running'`
-    if [ "$st" != "" ]; then
+w=0
+for f in $wals; do
+    if [ "$f" = "$lastbak" ]; then
+        break
+    fi
+    w=$((w+1))
+
+    if [ "$w" = "10" ]; then
+        nohup /bin/sh -c "$here/pgsql-backup $root $host $port" 1>/dev/null 2>/dev/null &
         break
     fi
-    sleep 1
-    sti=$((sti+1))
 done
 
+exit 0
+

Modified: tuscany/sca-cpp/trunk/components/sqldb/pgsql-backup
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/pgsql-backup?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/pgsql-backup (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/pgsql-backup Mon May 28 04:39:28 2012
@@ -23,7 +23,7 @@ root=`echo "import os; print os.path.rea
 
 if [ "$2" = "" ]; then
     host="localhost"
-    port="5432"
+    port="6432"
 else
     host="$2"
     port="$3"
@@ -40,12 +40,40 @@ fi
 mkdir -p $root/sqldb
 echo $pgsql_log >$root/sqldb/logger
 
-$pgsql_prefix/bin/psql -h $host -p $port -c "SELECT pg_start_backup('backup', true)" db 2>&1 | sh $root/sqldb/logger
+mkdir -p $root/sqldb/backup
+mkdir -p $root/sqldb/archive
 
-echo "Content-type: application/x-compressed"
-echo
+# Make sure that only one backup is in progress at a time
+if [ -f $root/sqldb/backup/inprogress ]; then
+    exit 0
+fi
+touch $root/sqldb/backup/inprogress
 
-tar -C $root/sqldb -cz data
+# Backup
+stamp=`date +%Y%m%d%H%M%S`
+$pgsql_prefix/bin/psql -h $host -p $port -c "SELECT pg_start_backup('$stamp', true)" db 2>&1 | sh $root/sqldb/logger
+
+uname=`uname -s`
+if [ $uname = "Darwin" ]; then
+    tar=gnutar
+else
+    tar=tar
+fi
+$tar -C $root/sqldb --exclude data/postmaster.pid --exclude data/postmaster.opts --exclude data/pg_xlog --ignore-failed-read -czf $root/sqldb/backup/$stamp.backup.tar.gz data
+rc=$?
+if [ "$rc" = "0" ]; then
+    mv $root/sqldb/backup/$stamp.backup.tar.gz $root/sqldb/archive/$stamp.backup.tar.gz
+fi
 
 $pgsql_prefix/bin/psql -h $host -p $port -c "SELECT pg_stop_backup()" db 2>&1 | sh $root/sqldb/logger
 
+if [ "$rc" != "0" ]; then
+    rm -f $root/sqldb/backup/inprogress
+    exit $rc
+fi
+
+# Clean obsolete backup and WAL files
+$here/pgsql-clean-archive $root
+
+rm -f $root/sqldb/backup/inprogress
+

Copied: tuscany/sca-cpp/trunk/components/sqldb/pgsql-clean-archive (from r1343138, tuscany/sca-cpp/trunk/components/sqldb/pgsql-start)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/pgsql-clean-archive?p2=tuscany/sca-cpp/trunk/components/sqldb/pgsql-clean-archive&p1=tuscany/sca-cpp/trunk/components/sqldb/pgsql-start&r1=1343138&r2=1343139&rev=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/pgsql-start (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/pgsql-clean-archive Mon May 28 04:39:28 2012
@@ -17,29 +17,42 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Start postgresql
+# Cleanup database archive.
+# Keep the last two backups and corresponding WAL files.
+
 here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
 root=`echo "import os; print os.path.realpath('$1')" | python`
 
-pgsql_prefix=`cat $here/pgsql.prefix`
+baks=`ls $root/sqldb/archive | sort -r | grep "\.backup$" | head -2`
+wals=`ls $root/sqldb/archive | sort -r | grep -v "\.backup\.tar\.gz$"`
+tars=`ls $root/sqldb/archive | sort -r | grep "\.backup\.tar\.gz$"`
+
+for f in $baks; do
+    if [ "$lastbak" = "" ]; then
+        lastbak=$f
+    else
+        prevbak=$f
+    fi
+done
+
+w=0
+for f in $wals; do
+    if [ "$w" = "2" ]; then
+        rm $root/sqldb/archive/$f
+    fi
+    if [ "$w" = "1" ]; then
+        w=2
+    fi
+    if [ "$f" = "$prevbak" ]; then
+        w=1
+    fi
+done
 
-if [ -f "$root/sqldb/log.conf" ]; then
-    pgsql_log=`cat $root/sqldb/log.conf`
-else
-    mkdir -p $root/logs
-    pgsql_log="cat >>$root/logs/postgresql"
-fi
-mkdir -p $root/sqldb
-echo $pgsql_log >$root/sqldb/logger
-
-nohup /bin/sh -c "($pgsql_prefix/bin/pg_ctl start -W -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger)" 1>/dev/null 2>/dev/null &
-sti=0
-while [ $sti -ne 30 ]; do
-    st=`$pgsql_prefix/bin/pg_ctl status -D $root/sqldb/data | grep 'server is running'`
-    if [ "$st" != "" ]; then
-        break
+t=0
+for f in $tars; do
+    if [ "$t" = "2" ]; then
+        rm $root/sqldb/archive/$f
     fi
-    sleep 1
-    sti=$((sti+1))
+    t=$((t+1))
 done
 

Modified: tuscany/sca-cpp/trunk/components/sqldb/pgsql-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/pgsql-conf?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/pgsql-conf (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/pgsql-conf Mon May 28 04:39:28 2012
@@ -33,11 +33,15 @@ else
     fi
     port=`$here/../../modules/http/httpd-addr port $addr`
 fi
+bport=`expr $port + 1000`
 
 pgsql_prefix=`cat $here/pgsql.prefix`
+pgbouncer_prefix=`cat $here/pgbouncer.prefix`
+
 mkdir -p $root/sqldb/data
 chmod 700 $root/sqldb/data
 mkdir -p $root/sqldb/archive
+mkdir -p $root/sqldb/backup
 
 if [ -f "$root/sqldb/log.conf" ]; then
     pgsql_log=`cat $root/sqldb/log.conf`
@@ -48,6 +52,7 @@ fi
 mkdir -p $root/sqldb
 echo $pgsql_log >$root/sqldb/logger
 
+# Initialize PostgreSQL
 if [ ! -f $root/sqldb/data/postgresql.conf ]; then
     $pgsql_prefix/bin/pg_ctl init -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger
     cp $root/sqldb/data/postgresql.conf $root/sqldb/data/postgresql-init.conf
@@ -77,7 +82,7 @@ port = $port
 
 # Setup archival
 archive_mode = on
-archive_command = 'cp %p $root/sqldb/archive/%f'
+archive_command = '$here/pgsql-archive $root localhost $bport %p %f'
 
 # Setup hot standby with streaming replication
 wal_level = hot_standby
@@ -97,7 +102,7 @@ host    replication     all             
 
 EOF
 
-# Create the db
+# Create the db if it's not created yet
 nohup /bin/sh -c "($pgsql_prefix/bin/pg_ctl start -W -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger)" 1>/dev/null 2>/dev/null &
 sti=0
 while [ $sti -ne 30 ]; do
@@ -110,15 +115,22 @@ while [ $sti -ne 30 ]; do
 done
 
 $pgsql_prefix/bin/createdb -h localhost -p $port db 2>&1 | sh $root/sqldb/logger
+
+# Backup the db if there's no backup for it yet
+baks=`ls $root/sqldb/archive | sort -r  | grep "\.backup\.tar\.gz$"`
+if [ "$baks" = "" ]; then
+    $here/pgsql-backup $root localhost $port
+fi
+
 $pgsql_prefix/bin/pg_ctl stop -w -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger
 
-# Generate database backup script
+# Generate database restore script
 mkdir -p $root/sqldb/scripts
-cat >$root/sqldb/scripts/backup <<EOF
+cat >$root/sqldb/scripts/restore <<EOF
 #!/bin/sh
-$here/pgsql-backup $root localhost $port
+$here/pgsql-restore $root
 EOF
-chmod 700 $root/sqldb/scripts/backup
+chmod 700 $root/sqldb/scripts/restore
 
 # Configure HTTPD to serve backup and archive files
 if [ -f "$root/conf/httpd.conf" ]; then
@@ -126,10 +138,44 @@ if [ -f "$root/conf/httpd.conf" ]; then
 # Generated by: pgsql-conf $*
 
 # Serve PostgreSQL backup and WAL archive files
-ScriptAlias /pgsql-backup "$root/sqldb/scripts/backup"
+ScriptAlias /pgsql-restore "$root/sqldb/scripts/restore"
 Alias /pgsql-archive "$root/sqldb/archive"
 
 EOF
 
 fi
 
+# Configure PgBouncer
+mkdir -p $root/logs
+id=`id -un`
+cat >$root/sqldb/data/pgbouncer.conf <<EOF
+
+[databases]
+db = host=localhost dbname=db
+
+[pgbouncer]
+pool_mode = session
+listen_port = $bport
+listen_addr = $ip
+auth_type = trust
+auth_file=$root/sqldb/data/pgbouncer-auth.conf
+logfile = $root/logs/pgbouncer
+pidfile = $root/logs/pgbouncer.pid
+max_client_conn = 1000
+pool_mode = transaction
+server_reset_query =
+default_pool_size = 500
+min_pool_size = 5
+reserve_pool_size = 50
+log_connections = 0
+log_disconnections = 0
+stats_period = 3600
+admin_users = $id
+
+EOF
+
+cat >$root/sqldb/data/pgbouncer-auth.conf <<EOF
+"$id" "password"
+
+EOF
+

Copied: tuscany/sca-cpp/trunk/components/sqldb/pgsql-restore (from r1343138, tuscany/sca-cpp/trunk/components/sqldb/pgsql)
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/pgsql-restore?p2=tuscany/sca-cpp/trunk/components/sqldb/pgsql-restore&p1=tuscany/sca-cpp/trunk/components/sqldb/pgsql&r1=1343138&r2=1343139&rev=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/pgsql (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/pgsql-restore Mon May 28 04:39:28 2012
@@ -17,23 +17,14 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Run SQL command
+# Backup postgresql data directory
 here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
-pgsql_prefix=`cat $here/pgsql.prefix`
+root=`echo "import os; print os.path.realpath('$1')" | python`
 
-if [ "$2" = "" ]; then
-    host="localhost"
-    port="5432"
-    cmd="$1"
-else
-    host="$1"
-    port="$2"
-    cmd="$3"
-fi
+tar=`ls $root/sqldb/archive | sort -r  | grep "\.backup\.tar\.gz$" | head -1`
 
-if [ "$cmd" = "" ]; then
-    $pgsql_prefix/bin/psql -h $host -p $port db
-else
-    $pgsql_prefix/bin/psql -h $host -p $port -c "$cmd" db
-fi
+echo "Content-type: application/x-compressed"
+echo ""
+
+cat $root/sqldb/archive/$tar
 

Modified: tuscany/sca-cpp/trunk/components/sqldb/pgsql-standby-conf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/pgsql-standby-conf?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/pgsql-standby-conf (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/pgsql-standby-conf Mon May 28 04:39:28 2012
@@ -34,6 +34,7 @@ else
     fi
     port=`$here/../../modules/http/httpd-addr port $addr`
 fi
+bport=`expr $port + 1000`
 
 # Master server address
 if [ "$3" = "" ]; then
@@ -47,6 +48,12 @@ else
 fi
 
 pgsql_prefix=`cat $here/pgsql.prefix`
+pgbouncer_prefix=`cat $here/pgbouncer.prefix`
+
+mkdir -p $root/sqldb/data
+chmod 700 $root/sqldb/data
+mkdir -p $root/sqldb/archive
+mkdir -p $root/sqldb/backup
 
 if [ -f "$root/sqldb/log.conf" ]; then
     pgsql_log=`cat $root/sqldb/log.conf`
@@ -57,14 +64,15 @@ fi
 mkdir -p $root/sqldb
 echo $pgsql_log >$root/sqldb/logger
 
-mkdir -p $root/sqldb/data
-chmod 700 $root/sqldb/data
-mkdir -p $root/sqldb/archive
-
 # Initialize from a backup of the master
 if [ ! -f $root/sqldb/data/postgresql.conf ]; then
-    (curl -L -# http://$mhost:$mhttpport/pgsql-backup | tar -C $root/sqldb -xz) 2>&1 | grep -v "100.0%" | sh $root/sqldb/logger
-    rm -rf $root/sqldb/data/postmaster.pid $root/sqldb/data/pg_xlog
+    uname=`uname -s`
+    if [ $uname = "Darwin" ]; then
+        tar=gnutar
+    else
+        tar=tar
+    fi
+    (curl -L -# http://$mhost:$mhttpport/pgsql-restore | $tar -C $root/sqldb -xz) 2>&1 | grep -v "100.0%" | sh $root/sqldb/logger
     mkdir -p $root/sqldb/data/pg_xlog/archive_status
     chmod 700 $root/sqldb/data/pg_xlog/archive_status
 fi
@@ -92,7 +100,7 @@ port = $port
 
 # Setup archival
 archive_mode = on
-archive_command = 'cp %p $root/sqldb/archive/%f'
+archive_command = '$here/pgsql-archive $root localhost $bport %p %f'
 
 # Setup hot standby with streaming replication
 wal_level = hot_standby
@@ -119,13 +127,13 @@ restore_command = 'curl -L -# http://$mh
 
 EOF
 
-# Generate database backup script
+# Generate database restore script
 mkdir -p $root/sqldb/scripts
-cat >$root/sqldb/scripts/backup <<EOF
+cat >$root/sqldb/scripts/restore <<EOF
 #!/bin/sh
-$here/pgsql-backup $root localhost $port
+$here/pgsql-restore $root
 EOF
-chmod 700 $root/sqldb/scripts/backup
+chmod 700 $root/sqldb/scripts/restore
 
 # Configure HTTPD to serve backup and archive files
 if [ -f "$root/conf/httpd.conf" ]; then
@@ -133,10 +141,44 @@ if [ -f "$root/conf/httpd.conf" ]; then
 # Generated by: pgsql-standby-conf $*
 
 # Serve PostgreSQL backup and WAL archive files
-ScriptAlias /pgsql-backup "$root/sqldb/scripts/backup"
+ScriptAlias /pgsql-restore "$root/sqldb/scripts/restore"
 Alias /pgsql-archive "$root/sqldb/archive"
 
 EOF
 
 fi
 
+# Configure PgBouncer
+mkdir -p $root/logs
+id=`id -un`
+cat >$root/sqldb/data/pgbouncer.conf <<EOF
+
+[databases]
+db = host=localhost dbname=db
+
+[pgbouncer]
+pool_mode = session
+listen_port = $bport
+listen_addr = $ip
+auth_type = trust
+auth_file=$root/sqldb/data/pgbouncer-auth.conf
+logfile = $root/logs/pgbouncer
+pidfile = $root/logs/pgbouncer.pid
+max_client_conn = 1000
+pool_mode = transaction
+server_reset_query =
+default_pool_size = 500
+min_pool_size = 5
+reserve_pool_size = 50
+log_connections = 0
+log_disconnections = 0
+stats_period = 3600
+admin_users = $id
+
+EOF
+
+cat >$root/sqldb/data/pgbouncer-auth.conf <<EOF
+"$id" "password"
+
+EOF
+

Modified: tuscany/sca-cpp/trunk/components/sqldb/pgsql-standby-test.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/pgsql-standby-test.cpp?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/pgsql-standby-test.cpp (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/pgsql-standby-test.cpp Mon May 28 04:39:28 2012
@@ -33,8 +33,8 @@ namespace tuscany {
 namespace pgsql {
 
 bool testPGSql() {
-    PGSql wpg("host=localhost port=5432 dbname=db", "test");
-    PGSql rpg("host=localhost port=5433 dbname=db", "test");
+    PGSql wpg("host=localhost port=6432 dbname=db", "test");
+    PGSql rpg("host=localhost port=6433 dbname=db", "test");
     const value k = mklist<value>("a");
 
     assert(hasContent(post(k, string("AAA"), wpg)));
@@ -63,8 +63,8 @@ struct getLoop {
 
 bool testGetPerf() {
     const value k = mklist<value>("c");
-    PGSql wpg("host=localhost port=5432 dbname=db", "test");
-    PGSql rpg("host=localhost port=5433 dbname=db", "test");
+    PGSql wpg("host=localhost port=6432 dbname=db", "test");
+    PGSql rpg("host=localhost port=6433 dbname=db", "test");
     assert(hasContent(post(k, string("CCC"), wpg)));
     sleep(1);
 

Modified: tuscany/sca-cpp/trunk/components/sqldb/pgsql-start
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/pgsql-start?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/pgsql-start (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/pgsql-start Mon May 28 04:39:28 2012
@@ -22,6 +22,7 @@ here=`echo "import os; print os.path.rea
 root=`echo "import os; print os.path.realpath('$1')" | python`
 
 pgsql_prefix=`cat $here/pgsql.prefix`
+pgbouncer_prefix=`cat $here/pgbouncer.prefix`
 
 if [ -f "$root/sqldb/log.conf" ]; then
     pgsql_log=`cat $root/sqldb/log.conf`
@@ -43,3 +44,7 @@ while [ $sti -ne 30 ]; do
     sti=$((sti+1))
 done
 
+# Start PgBouncer
+mkdir -p $root/logs
+$pgbouncer_prefix/bin/pgbouncer -q -d $root/sqldb/data/pgbouncer.conf
+

Modified: tuscany/sca-cpp/trunk/components/sqldb/pgsql-stop
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/pgsql-stop?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/pgsql-stop (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/pgsql-stop Mon May 28 04:39:28 2012
@@ -22,6 +22,7 @@ here=`echo "import os; print os.path.rea
 root=`echo "import os; print os.path.realpath('$1')" | python`
 
 pgsql_prefix=`cat $here/pgsql.prefix`
+pgbouncer_prefix=`cat $here/pgbouncer.prefix`
 
 if [ -f "$root/sqldb/log.conf" ]; then
     pgsql_log=`cat $root/sqldb/log.conf`
@@ -32,5 +33,11 @@ fi
 mkdir -p $root/sqldb
 echo $pgsql_log >$root/sqldb/logger
 
+pgb="$pgbouncer_prefix/bin/pgbouncer -q -d $root/sqldb/data/pgbouncer.conf"
+k=`ps -ef | grep -v grep | grep "${pgb}" | awk '{ print $2 }'`
+if [ "$k" != "" ]; then
+    kill $k
+fi
+
 $pgsql_prefix/bin/pg_ctl stop -w -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger
 

Modified: tuscany/sca-cpp/trunk/components/sqldb/pgsql-test.cpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/pgsql-test.cpp?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/pgsql-test.cpp (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/pgsql-test.cpp Mon May 28 04:39:28 2012
@@ -33,7 +33,7 @@ namespace tuscany {
 namespace pgsql {
 
 bool testPGSql() {
-    PGSql pg("host=localhost port=5432 dbname=db", "test");
+    PGSql pg("host=localhost port=6432 dbname=db", "test");
     const value k = mklist<value>("a");
 
     assert(hasContent(post(k, string("AAA"), pg)));
@@ -59,7 +59,7 @@ struct getLoop {
 
 bool testGetPerf() {
     const value k = mklist<value>("c");
-    PGSql pg("host=localhost port=5432 dbname=db", "test");
+    PGSql pg("host=localhost port=6432 dbname=db", "test");
     assert(hasContent(post(k, string("CCC"), pg)));
 
     const lambda<bool()> gl = getLoop(k, pg);

Modified: tuscany/sca-cpp/trunk/components/sqldb/pgsql.hpp
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/pgsql.hpp?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/pgsql.hpp (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/pgsql.hpp Mon May 28 04:39:28 2012
@@ -61,12 +61,30 @@ public:
     PGSql(const string& conninfo, const string& table) : owner(true), conn(NULL), conninfo(conninfo), table(table) {
         debug(conninfo, "pgsql::pgsql::conninfo");
         debug(table, "pgsql::pgsql::table");
+
+        // Connect to the database
         conn = PQconnectdb(c_str(conninfo));
         if (PQstatus(conn) != CONNECTION_OK) {
             mkfailure<bool>(string("Couldn't connect to postgresql database: ") + PQerrorMessage(conn));
             return;
         }
-        setup(true);
+
+        // Find the name of the first column in the target table
+        // Assume that's the key we need to use
+        string ks = string("select a.attname from pg_attribute a, pg_class c where a.attrelid = c.relfilenode and c.relname = '") + table + string("' and a.attnum in (1, 2) order by a.attnum;");
+        PGresult* kr = PQexec(conn, c_str(ks));
+        if (PQresultStatus(kr) != PGRES_TUPLES_OK) {
+            mkfailure<bool>(string("Couldn't execute postgresql column select statement: ") + pgfailure(kr, conn));
+            return;
+        }
+        if (PQntuples(kr) != 2) {
+            PQclear(kr);
+            mkfailure<bool>(string("Couldn't find postgresql table key and value column names"));
+            return;
+        }
+        kname = PQgetvalue(kr, 0, 0);
+        vname = PQgetvalue(kr, 1, 0);
+        PQclear(kr);
     }
 
     PGSql(const PGSql& c) : owner(false), conn(c.conn), conninfo(c.conninfo), table(c.table) {
@@ -86,78 +104,29 @@ private:
     bool owner;
     PGconn *conn;
     string conninfo;
-    string table;
+    const string table;
+    string kname;
+    string vname;
 
     friend const failable<bool> setup(const PGSql& pgsql);
     friend const failable<bool> post(const value& key, const value& val, const PGSql& pgsql);
     friend const failable<bool> put(const value& key, const value& val, const PGSql& pgsql);
     friend const failable<value> get(const value& key, const PGSql& pgsql);
     friend const failable<bool> del(const value& key, const PGSql& pgsql);
-
-    /**
-     * Setup the database connection.
-     */
-    const failable<bool> setup(const bool init) const {
-
-        // Check the status of the connection and reconnect if necessary
-        if (!init) {
-            if (PQstatus(conn) == CONNECTION_OK)
-                return true;
-            debug("pgsql::setup::reset");
-            PQreset(conn);
-            if (PQstatus(conn) != CONNECTION_OK)
-                return mkfailure<bool>(string("Couldn't reconnect to postgresql database: ") + PQerrorMessage(conn));
-        }
-        debug("pgsql::setup::init");
-
-        // Find the name of the first column in the target table
-        // Assume that's the key we need to use
-        string ks = string("select a.attname from pg_attribute a, pg_class c where a.attrelid = c.relfilenode and c.relname = '") + table + string("' and a.attnum in (1, 2) order by a.attnum;");
-        PGresult* kr = PQexec(conn, c_str(ks));
-        if (PQresultStatus(kr) != PGRES_TUPLES_OK)
-            return mkfailure<bool>(string("Couldn't execute postgresql column select statement: ") + pgfailure(kr, conn));
-        if (PQntuples(kr) != 2) {
-            PQclear(kr);
-            return mkfailure<bool>(string("Couldn't find postgresql table key and value column names"));
-        }
-        const string kname = PQgetvalue(kr, 0, 0);
-        const string vname = PQgetvalue(kr, 1, 0);
-        PQclear(kr);
-
-        // Prepare the post, put, get and delete statements
-        {
-            PGresult* r = PQprepare(conn, "post", c_str(string("insert into ") + table + string(" values($1, $2);")), 2, NULL);
-            if (PQresultStatus(r) != PGRES_COMMAND_OK)
-                return mkfailure<bool>(string("Couldn't prepare post postgresql SQL statement: ") + pgfailure(r, conn));
-            PQclear(r);
-        }
-        {
-            PGresult* r = PQprepare(conn, "put", c_str(string("update ") + table + string(" set ") + vname + string(" = $2 where ") + kname + string(" = $1;")), 2, NULL);
-            if (PQresultStatus(r) != PGRES_COMMAND_OK)
-                return mkfailure<bool>(string("Couldn't prepare put postgresql SQL statement: ") + pgfailure(r, conn));
-            PQclear(r);
-        }
-        {
-            PGresult* r = PQprepare(conn, "get", c_str(string("select * from ") + table + string(" where ") + kname + string(" = $1;")), 1, NULL);
-            if (PQresultStatus(r) != PGRES_COMMAND_OK)
-                return mkfailure<bool>(string("Couldn't prepare get postgresql SQL statement: ") + pgfailure(r, conn));
-            PQclear(r);
-        }
-        {
-            PGresult* r = PQprepare(conn, "delete", c_str(string("delete from ") + table + string(" where ") + kname + string(" = $1;")), 1, NULL);
-            if (PQresultStatus(r) != PGRES_COMMAND_OK)
-                return mkfailure<bool>(string("Couldn't prepare delete postgresql SQL statement: ") + pgfailure(r, conn));
-            PQclear(r);
-        }
-        return true;
-    }
 };
 
 /**
  * Setup the database connection if necessary.
  */
 const failable<bool> setup(const PGSql& pgsql) {
-    return pgsql.setup(false);
+    debug("pgsql::setup");
+    if (PQstatus(pgsql.conn) == CONNECTION_OK)
+        return true;
+    debug("pgsql::setup::reset");
+    PQreset(pgsql.conn);
+    if (PQstatus(pgsql.conn) != CONNECTION_OK)
+        return mkfailure<bool>(string("Couldn't reconnect to postgresql database: ") + PQerrorMessage(pgsql.conn));
+    return true;
 }
 
 /**
@@ -173,7 +142,7 @@ const failable<bool> post(const value& k
     const string ks(scheme::writeValue(key));
     const string vs(scheme::writeValue(val));
     const char* params[2] = { c_str(ks), c_str(vs) };
-    PGresult* r = PQexecPrepared(pgsql.conn, "post", 2, params, NULL, NULL, 0);
+    PGresult* r = PQexecParams(pgsql.conn, c_str(string("insert into ") + pgsql.table + string(" values($1, $2);")), 2, NULL, params, NULL, NULL, 0);
     if (PQresultStatus(r) != PGRES_COMMAND_OK)
         return mkfailure<bool>(string("Couldn't execute insert postgresql SQL statement: ") + pgfailure(r, pgsql.conn));
     PQclear(r);
@@ -195,7 +164,7 @@ const failable<bool> put(const value& ke
     const string ks(scheme::writeValue(key));
     const string vs(scheme::writeValue(val));
     const char* params[2] = { c_str(ks), c_str(vs) };
-    PGresult* r = PQexecPrepared(pgsql.conn, "put", 2, params, NULL, NULL, 0);
+    PGresult* r = PQexecParams(pgsql.conn, c_str(string("update ") + pgsql.table + string(" set ") + pgsql.vname + string(" = $2 where ") + pgsql.kname + string(" = $1;")), 2, NULL, params, NULL, NULL, 0);
     if (PQresultStatus(r) != PGRES_COMMAND_OK)
         return mkfailure<bool>(string("Couldn't execute update postgresql SQL statement: ") + pgfailure(r, pgsql.conn));
     const string t = PQcmdTuples(r);
@@ -206,7 +175,7 @@ const failable<bool> put(const value& ke
     }
     PQclear(r);
 
-    PGresult* pr = PQexecPrepared(pgsql.conn, "post", 2, params, NULL, NULL, 0);
+    PGresult* pr = PQexecParams(pgsql.conn, c_str(string("insert into ") + pgsql.table + string(" values($1, $2);")), 2, NULL, params, NULL, NULL, 0);
     if (PQresultStatus(pr) != PGRES_COMMAND_OK)
         return mkfailure<bool>(string("Couldn't execute insert postgresql SQL statement: ") + pgfailure(pr, pgsql.conn));
     PQclear(pr);
@@ -226,14 +195,14 @@ const failable<value> get(const value& k
 
     const string ks(scheme::writeValue(key));
     const char* params[1] = { c_str(ks) };
-    PGresult* r = PQexecPrepared(pgsql.conn, "get", 1, params, NULL, NULL, 0);
+    PGresult* r = PQexecParams(pgsql.conn, c_str(string("select * from ") + pgsql.table + string(" where ") + pgsql.kname + string(" = $1;")), 1, NULL, params, NULL, NULL, 0);
     if (PQresultStatus(r) != PGRES_TUPLES_OK)
         return mkfailure<value>(string("Couldn't execute select postgresql SQL statement: ") + pgfailure(r, pgsql.conn));
     if (PQntuples(r) < 1) {
         PQclear(r);
         ostringstream os;
         os << "Couldn't get postgresql entry: " << key;
-        return mkfailure<value>(str(os));
+        return mkfailure<value>(str(os), 404, false);
     }
     const char* data = PQgetvalue(r, 0, 1);
     const value val(scheme::readValue(string(data)));
@@ -254,7 +223,7 @@ const failable<bool> del(const value& ke
 
     const string ks(scheme::writeValue(key));
     const char* params[1] = { c_str(ks) };
-    PGresult* r = PQexecPrepared(pgsql.conn, "delete", 1, params, NULL, NULL, 0);
+    PGresult* r = PQexecParams(pgsql.conn, c_str(string("delete from ") + pgsql.table + string(" where ") + pgsql.kname + string(" = $1;")), 1, NULL, params, NULL, NULL, 0);
     if (PQresultStatus(r) != PGRES_COMMAND_OK)
         return mkfailure<bool>(string("Couldn't execute delete postgresql SQL statement: ") + pgfailure(r, pgsql.conn));
     PQclear(r);

Modified: tuscany/sca-cpp/trunk/components/sqldb/sqldb.componentType
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/sqldb.componentType?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/sqldb.componentType (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/sqldb.componentType Mon May 28 04:39:28 2012
@@ -23,7 +23,7 @@
   targetNamespace="http://tuscany.apache.org/xmlns/sca/components">
         
     <service name="sqldb"/>
-    <property name="conninfo" type="xsd:string">host=localhost port=5432 dbname=db</property>
+    <property name="conninfo" type="xsd:string">host=localhost port=6432 dbname=db</property>
     <property name="table" type=xsd:string"/>
 
 </composite>

Modified: tuscany/sca-cpp/trunk/components/sqldb/sqldb.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/components/sqldb/sqldb.composite?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/components/sqldb/sqldb.composite (original)
+++ tuscany/sca-cpp/trunk/components/sqldb/sqldb.composite Mon May 28 04:39:28 2012
@@ -23,7 +23,7 @@
         
     <component name="sqldb">
         <implementation.cpp path="." library="libsqldb"/>
-        <property name="conninfo">host=localhost port=5432 dbname=db</property>
+        <property name="conninfo">host=localhost port=6432 dbname=db</property>
         <property name="table">test</property>
         <service name="sqldb">
             <binding.http uri="sqldb"/>

Modified: tuscany/sca-cpp/trunk/configure.ac
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/configure.ac?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/configure.ac (original)
+++ tuscany/sca-cpp/trunk/configure.ac Mon May 28 04:39:28 2012
@@ -191,7 +191,7 @@ AC_ARG_ENABLE(malloc-mmap, [AS_HELP_STRI
     ;;
   esac ],
 [ AC_MSG_RESULT(no)])
-if test "${want_efence}" = "true"; then
+if test "${want_malloc_mmap}" = "true"; then
   AM_CONDITIONAL([WANT_MALLOC_MMAP], true)
   AC_DEFINE([WANT_MALLOC_MMAP], 1, [use mmap for memory allocation])
 else
@@ -264,6 +264,7 @@ AC_ARG_WITH([curl], [AC_HELP_STRING([--w
   AC_MSG_RESULT(/usr)
 ])
 AC_SUBST(CURL_PREFIX)
+AC_DEFINE_UNQUOTED([CURL_PREFIX], "${CURL_PREFIX}", [path to installed curl])
 AC_SUBST(LIBCURL_INCLUDE)
 AC_SUBST(LIBCURL_LIB)
 LIBS="-L${LIBCURL_LIB} ${defaultlibs}"
@@ -339,6 +340,7 @@ AC_ARG_WITH([httpd], [AC_HELP_STRING([--
   AC_MSG_RESULT(/usr)
 ])
 AC_SUBST(HTTPD_PREFIX)
+AC_DEFINE_UNQUOTED([HTTPD_PREFIX], "${HTTPD_PREFIX}", [path to installed Apache HTTPD])
 AC_SUBST(HTTPD_APACHECTL_PREFIX)
 AC_SUBST(HTTPD_MODULES_PREFIX)
 AC_SUBST(HTTPD_INCLUDE)
@@ -365,6 +367,7 @@ AC_ARG_WITH([memcached], [AC_HELP_STRING
   AC_MSG_RESULT(/usr)
 ])
 AC_SUBST(MEMCACHED_PREFIX)
+AC_DEFINE_UNQUOTED([MEMCACHED_PREFIX], "${MEMCACHED_PREFIX}", [path to installed memcached])
 AC_MSG_CHECKING([for ${MEMCACHED_PREFIX}/bin/memcached])
 if test -x "${MEMCACHED_PREFIX}/bin/memcached"; then
     AC_MSG_RESULT(found)
@@ -386,6 +389,7 @@ AC_ARG_WITH([tinycdb], [AC_HELP_STRING([
   AC_MSG_RESULT(/usr)
 ])
 AC_SUBST(TINYCDB_PREFIX)
+AC_DEFINE_UNQUOTED([TINYCDB_PREFIX], "${TINYCDB_PREFIX}", [path to installed tinycdb])
 AC_SUBST(TINYCDB_INCLUDE)
 AC_SUBST(TINYCDB_LIB)
 LIBS="-L${TINYCDB_LIB} ${defaultlibs}"
@@ -428,6 +432,7 @@ if test "${want_python}" = "true"; then
     AC_MSG_RESULT(/usr)
   ])
   AC_SUBST(PYTHON_PREFIX)
+  AC_DEFINE_UNQUOTED([PYTHON_PREFIX], "${PYTHON_PREFIX}", [path to installed Python])
   AC_SUBST(PYTHON_INCLUDE)
   AC_SUBST(PYTHON_LIB)
   LIBS="-L${PYTHON_LIB} ${defaultlibs}"
@@ -480,6 +485,7 @@ if test "${want_pagespeed}" = "true"; th
     fi
   AM_CONDITIONAL([WANT_PAGESPEED], true)
   AC_DEFINE([WANT_PAGESPEED], 1, [run Page Speed optimizations])
+  AC_DEFINE_UNQUOTED([PAGESPEED_PREFIX], "${PAGESPEED_PREFIX}", [path to installed Page Speed])
 else
   AM_CONDITIONAL([WANT_PAGESPEED], false)
 fi
@@ -559,6 +565,7 @@ if test "${want_java}" = "true"; then
     AC_MSG_RESULT(/usr/lib/jvm/default-java)
   ])
   AC_SUBST(JAVA_PREFIX)
+  AC_DEFINE_UNQUOTED([JAVA_PREFIX], "${JAVA_PREFIX}", [path to installed Java])
   AC_SUBST(JAVA_INCLUDE)
   AC_SUBST(JAVAC)
   AC_SUBST(JAR)
@@ -655,6 +662,7 @@ if test "${want_openid}" = "true"; then
     AC_MSG_RESULT(/usr/local)
   ])
   AC_SUBST(MODAUTHOPENID_PREFIX)
+  AC_DEFINE_UNQUOTED([MODAUTHOPENID_PREFIX], "${MODAUTHOPENID_PREFIX}", [path to installed mod-auth-openid])
 
   AM_CONDITIONAL([WANT_OPENID], true)
   AC_DEFINE([WANT_OPENID], 1, [enable OpenID support])
@@ -726,6 +734,7 @@ if test "${want_modsecurity}" = "true"; 
     AC_MSG_RESULT(/usr/local)
   ])
   AC_SUBST(MODSECURITY_PREFIX)
+  AC_DEFINE_UNQUOTED([MODSECURITY_PREFIX], "${MODSECURITY_PREFIX}", [path to installed mod-security])
 
   AM_CONDITIONAL([WANT_MODSECURITY], true)
   AC_DEFINE([WANT_MODSECURITY], 1, [enable mod-security support])
@@ -827,6 +836,7 @@ if test "${want_webservice}" = "true"; t
     AC_MSG_RESULT(/usr/local/axis2c)
   ])
   AC_SUBST(AXIS2C_PREFIX)
+  AC_DEFINE_UNQUOTED([AXIS2C_PREFIX], "${AXIS2C_PREFIX}", [path to installed Axis2C])
   AC_SUBST(AXIS2C_INCLUDE)
   AC_SUBST(AXIS2C_LIB)
   LIBS="-L${AXIS2C_LIB} ${defaultlibs}"
@@ -868,9 +878,22 @@ if test "${want_sqldb}" = "true"; then
     AC_MSG_RESULT(/usr/local)
   ])
   AC_SUBST(PGSQL_PREFIX)
+  AC_DEFINE_UNQUOTED([PGSQL_PREFIX], "${PGSQL_PREFIX}", [path to installed PostgreSQL])
   AC_SUBST(PGSQL_INCLUDE)
   AC_SUBST(PGSQL_LIB)
 
+  # Configure path to PgBouncer.
+  AC_MSG_CHECKING([for pgbouncer])
+  AC_ARG_WITH([pgbouncer], [AC_HELP_STRING([--with-pgbouncer=PATH], [path to installed PgBouncer [default=/usr/local]])], [
+    PGBOUNCER_PREFIX="${withval}"
+    AC_MSG_RESULT("${withval}")
+  ], [
+    PGBOUNCER_PREFIX="/usr/local"
+    AC_MSG_RESULT(/usr/local)
+  ])
+  AC_SUBST(PGBOUNCER_PREFIX)
+  AC_DEFINE_UNQUOTED([PGBOUNCER_PREFIX], "${PGBOUNCER_PREFIX}", [path to installed PgBouncer])
+
   AM_CONDITIONAL([WANT_SQLDB], true)
   AC_DEFINE([WANT_SQLDB], 1, [enable SQL Database component])
 else
@@ -906,6 +929,7 @@ if test "${want_queue}" = "true"; then
     AC_MSG_RESULT(/usr/local)
   ])
   AC_SUBST(QPIDC_PREFIX)
+  AC_DEFINE_UNQUOTED([QPIDC_PREFIX], "${QPIDC_PREFIX}", [path to installed Qpid/C++])
   AC_SUBST(QPIDC_INCLUDE)
   AC_SUBST(QPIDC_LIB)
 
@@ -1015,6 +1039,7 @@ if test "${want_log}" = "true"; then
     AC_MSG_RESULT(/usr/local)
   ])
   AC_SUBST(THRIFT_PREFIX)
+  AC_DEFINE_UNQUOTED([THRIFT_PREFIX], "${THRIFT_PREFIX}", [path to installed Apache Thrift])
   AC_SUBST(THRIFT_INCLUDE)
   AC_SUBST(THRIFT_LIB)
   AC_SUBST(FB303_PREFIX)
@@ -1035,6 +1060,7 @@ if test "${want_log}" = "true"; then
     AC_MSG_RESULT(/usr/local)
   ])
   AC_SUBST(SCRIBE_PREFIX)
+  AC_DEFINE_UNQUOTED([SCRIBE_PREFIX], "${SCRIBE_PREFIX}", [path to installed Facebook Scribe])
   AC_SUBST(SCRIBE_INCLUDE)
   AC_SUBST(SCRIBE_LIB)
 

Modified: tuscany/sca-cpp/trunk/macos/macos-install
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/macos/macos-install?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/macos/macos-install (original)
+++ tuscany/sca-cpp/trunk/macos/macos-install Mon May 28 04:39:28 2012
@@ -276,7 +276,7 @@ if [ "$?" != "0" ]; then
 fi
 cd $build
 
-# Build PostgreSQL
+# Build PostgreSQL and PgBouncer
 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
@@ -287,6 +287,17 @@ 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 --with-libevent=$build/libevent-2.0.13-stable-bin
+make
+cp install-sh doc
+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
@@ -310,7 +321,7 @@ cd $build
 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.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-bin --with-leveldb=$build/leveldb --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-libcloud --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --enable-opencl --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 --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.1-bin
+./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-bin --with-leveldb=$build/leveldb --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-libcloud --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --enable-opencl --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-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.1-bin
 make
 make install
 if [ "$?" != "0" ]; then
@@ -319,8 +330,8 @@ fi
 cd $build
 
 # Create src archive
-tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin autoconf-2.13 autoconf-2.13-bin autoconf-2.13.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 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 libevent-2.0.13-stable libevent-2.0.13-stable-bin libevent-2.0.13-stable.tar.gz 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.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.0-bin modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem pcre-8.12 pcre-8.12-bin pcre-8.12.zip pkg-c
 onfig-0.25 pkg-config-0.25-bin pkg-config-0.25.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz tidy tinycdb tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin autoconf-2.13 autoconf-2.13-bin autoconf-2.13.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 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 libevent-2.0.13-stable libevent-2.0.13-stable-bin libevent-2.0.13-stable.tar.gz 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.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.0-bin modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem pcre-8.12 pcre-8.12-bin pcre-8.12.zip pkg-c
 onfig-0.25 pkg-config-0.25-bin pkg-config-0.25.tar.gz 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 tidy tinycdb tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin
 
 # Create bin archive
-tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin libevent-2.0.13-stable-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel pcre-8.12-bin postgresql-9.1.2-bin tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin libevent-2.0.13-stable-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel pcre-8.12-bin pgbouncer-1.5-bin postgresql-9.1.2-bin tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin
 

Modified: tuscany/sca-cpp/trunk/samples/store-cluster/shared/shared.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-cluster/shared/shared.composite?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-cluster/shared/shared.composite (original)
+++ tuscany/sca-cpp/trunk/samples/store-cluster/shared/shared.composite Mon May 28 04:39:28 2012
@@ -44,7 +44,7 @@
 
     <component name="Masterdb">
         <implementation.cpp path="../../../components/sqldb" library="libsqldb"/>
-        <property name="conninfo">host=localhost port=5432 dbname=db</property>
+        <property name="conninfo">host=localhost port=6432 dbname=db</property>
         <property name="table">store</property>
         <service name="Masterdb">
             <binding.atom uri="masterdb"/>
@@ -53,7 +53,7 @@
 
     <component name="Standbydb">
         <implementation.cpp path="../../../components/sqldb" library="libsqldb"/>
-        <property name="conninfo">host=localhost port=5433 dbname=db</property>
+        <property name="conninfo">host=localhost port=6433 dbname=db</property>
         <property name="table">store</property>
         <service name="Standbydb">
             <binding.atom uri="standbydb"/>

Modified: tuscany/sca-cpp/trunk/samples/store-sql/store.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/samples/store-sql/store.composite?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/samples/store-sql/store.composite (original)
+++ tuscany/sca-cpp/trunk/samples/store-sql/store.composite Mon May 28 04:39:28 2012
@@ -79,7 +79,7 @@
 
     <component name="Sqldb">
         <implementation.cpp path="../../components/sqldb" library="libsqldb"/>
-        <property name="conninfo">host=localhost port=5432 dbname=db</property>
+        <property name="conninfo">host=localhost port=6432 dbname=db</property>
         <property name="table">store</property>
         <service name="Sqldb">
             <binding.atom uri="sqldb"/>

Modified: tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup (original)
+++ tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup Mon May 28 04:39:28 2012
@@ -23,8 +23,8 @@
 set -x
 
 # Create src archive
-tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-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 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.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.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 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 tiny
 cdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-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 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.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.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 scribe s
 cribe-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
 
 # Create bin archive
-tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin 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.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin 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.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin
 

Modified: tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup-all
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup-all?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup-all (original)
+++ tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup-all Mon May 28 04:39:28 2012
@@ -23,8 +23,8 @@
 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.x apr-1.4.x-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.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.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 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 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
+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.x apr-1.4.x-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.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.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 pgb
 ouncer-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 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.x-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.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin postgresql-9.1.2-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
+tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.x-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.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-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
 

Modified: tuscany/sca-cpp/trunk/ubuntu/ubuntu-install
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/ubuntu/ubuntu-install?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/ubuntu/ubuntu-install (original)
+++ tuscany/sca-cpp/trunk/ubuntu/ubuntu-install Mon May 28 04:39:28 2012
@@ -249,7 +249,7 @@ if [ "$?" != "0" ]; then
 fi
 cd $build
 
-# Build PostgreSQL
+# Build PostgreSQL and PgBouncer
 sudo apt-get -y install libreadline-dev
 if [ "$?" != "0" ]; then
     exit $?
@@ -264,9 +264,20 @@ 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 python-dev libboost-dev libboost-filesystem-dev 
+sudo apt-get -y install bison flex libboost-dev libboost-filesystem-dev 
 if [ "$?" != "0" ]; then
     exit $?
 fi
@@ -274,7 +285,7 @@ curl -OL http://archive.apache.org/dist/
 tar xzf thrift-0.2.0-incubating.tar.gz
 cd thrift-0.2.0
 ./bootstrap.sh
-./configure --prefix=$build/thrift-0.2.0-bin PY_PREFIX=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no --with-perl=no --with-ruby=no --with-csharp=no --disable-static
+./configure --prefix=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no --with-perl=no --with-ruby=no --with-csharp=no --disable-static
 make
 make install
 if [ "$?" != "0" ]; then
@@ -345,7 +356,7 @@ cd $build
 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.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-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-libxml2=$build/libxml2-2.7.7-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --enable-sqldb --with-pgsql=$build/postgresql-9.1.2-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.1-bin
+./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-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-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-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.1-bin
 make
 make install
 if [ "$?" != "0" ]; then
@@ -354,8 +365,8 @@ fi
 cd $build
 
 # Create src archive
-tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-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 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.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.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 postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.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
+tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-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 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.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.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 scribe s
 cribe-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
 
 # Create bin archive
-tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin 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.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin postgresql-9.1.2-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin 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.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin
 

Modified: tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all?rev=1343139&r1=1343138&r2=1343139&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all (original)
+++ tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all Mon May 28 04:39:28 2012
@@ -303,7 +303,7 @@ if [ "$?" != "0" ]; then
 fi
 cd $build
 
-# Build PostgreSQL
+# Build PostgreSQL and PgBouncer
 sudo apt-get -y install libreadline-dev
 if [ "$?" != "0" ]; then
     exit $?
@@ -318,9 +318,20 @@ 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 python-dev libboost-dev libboost-filesystem-dev
+sudo apt-get -y install bison flex libboost-dev libboost-filesystem-dev
 if [ "$?" != "0" ]; then
     exit $?
 fi
@@ -328,7 +339,7 @@ curl -OL http://archive.apache.org/dist/
 tar xzf thrift-0.2.0-incubating.tar.gz
 cd thrift-0.2.0
 ./bootstrap.sh
-./configure --prefix=$build/thrift-0.2.0-bin PY_PREFIX=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no --with-perl=no --with-ruby=no --with-csharp=no --disable-static
+./configure --prefix=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no --with-perl=no --with-ruby=no --with-csharp=no --disable-static
 make
 make install
 if [ "$?" != "0" ]; then
@@ -399,7 +410,7 @@ cd $build
 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.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-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 --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 --enable-log --with-thrift=$build/thrift-0.2.0-bin --with-scribe=$build/scribe-2.2-bin --enable-openid --with-mod-auth-op
 enid=$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.1-bin
+./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-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 --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.1-bin
 make
 make install
 if [ "$?" != "0" ]; then
@@ -408,7 +419,7 @@ 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.x apr-1.4.x-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.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.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 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 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
+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.x apr-1.4.x-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.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.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 pgb
 ouncer-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 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.x-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.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin postgresql-9.1.2-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