From caec161501b7157e102c7e6532084616e8dce176 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Tue, 28 Jun 2011 15:50:47 +0000 Subject: Port to Mac OS X 10.6.7. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1140690 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/modules/http/Makefile.am | 10 +++++----- sca-cpp/trunk/modules/http/basic-auth-conf | 4 ++-- sca-cpp/trunk/modules/http/cert-auth-conf | 4 ++-- sca-cpp/trunk/modules/http/form-auth-conf | 4 ++-- sca-cpp/trunk/modules/http/group-auth-conf | 4 ++-- sca-cpp/trunk/modules/http/http-test | 2 +- sca-cpp/trunk/modules/http/httpd-addr | 1 - sca-cpp/trunk/modules/http/httpd-conf | 19 +++++++++++++------ sca-cpp/trunk/modules/http/httpd-debug | 4 ++-- sca-cpp/trunk/modules/http/httpd-event-conf | 4 ++-- sca-cpp/trunk/modules/http/httpd-memgrind | 4 ++-- sca-cpp/trunk/modules/http/httpd-restart | 4 ++-- sca-cpp/trunk/modules/http/httpd-ssl-conf | 6 +++--- sca-cpp/trunk/modules/http/httpd-start | 4 ++-- sca-cpp/trunk/modules/http/httpd-stop | 4 ++-- sca-cpp/trunk/modules/http/httpd-test | 4 ++-- sca-cpp/trunk/modules/http/httpd-worker-conf | 4 ++-- sca-cpp/trunk/modules/http/mod-security-conf | 4 ++-- sca-cpp/trunk/modules/http/open-auth-conf | 4 ++-- sca-cpp/trunk/modules/http/passwd-auth-conf | 4 ++-- sca-cpp/trunk/modules/http/proxy-conf | 4 ++-- sca-cpp/trunk/modules/http/proxy-member-conf | 4 ++-- sca-cpp/trunk/modules/http/proxy-ssl-conf | 4 ++-- sca-cpp/trunk/modules/http/proxy-ssl-member-conf | 4 ++-- sca-cpp/trunk/modules/http/proxy-test | 2 +- sca-cpp/trunk/modules/http/ssl-ca-conf | 8 ++++---- sca-cpp/trunk/modules/http/ssl-cert-conf | 8 ++++---- sca-cpp/trunk/modules/http/ssl-cert-find | 10 +++++++--- sca-cpp/trunk/modules/http/tunnel-ssl-conf | 4 ++-- sca-cpp/trunk/modules/http/vhost-conf | 8 ++++---- sca-cpp/trunk/modules/http/vhost-ssl-conf | 8 ++++---- 31 files changed, 86 insertions(+), 76 deletions(-) (limited to 'sca-cpp/trunk/modules/http') diff --git a/sca-cpp/trunk/modules/http/Makefile.am b/sca-cpp/trunk/modules/http/Makefile.am index f6e95b3996..07a797926a 100644 --- a/sca-cpp/trunk/modules/http/Makefile.am +++ b/sca-cpp/trunk/modules/http/Makefile.am @@ -33,17 +33,17 @@ curl_connect_SOURCES = curl-connect.cpp curl_connect_LDFLAGS = -lxml2 -lcurl -lmozjs mod_LTLIBRARIES = libmod_tuscany_ssltunnel.la libmod_tuscany_openauth.la -noinst_DATA = libmod_tuscany_ssltunnel.so libmod_tuscany_openauth.so +noinst_DATA = libmod_tuscany_ssltunnel${libsuffix} libmod_tuscany_openauth${libsuffix} libmod_tuscany_ssltunnel_la_SOURCES = mod-ssltunnel.cpp libmod_tuscany_ssltunnel_la_LDFLAGS = -lxml2 -lcurl -lmozjs -libmod_tuscany_ssltunnel.so: - ln -s .libs/libmod_tuscany_ssltunnel.so +libmod_tuscany_ssltunnel${libsuffix}: + ln -s .libs/libmod_tuscany_ssltunnel${libsuffix} libmod_tuscany_openauth_la_SOURCES = mod-openauth.cpp libmod_tuscany_openauth_la_LDFLAGS = -lxml2 -lcurl -lmozjs -libmod_tuscany_openauth.so: - ln -s .libs/libmod_tuscany_openauth.so +libmod_tuscany_openauth${libsuffix}: + ln -s .libs/libmod_tuscany_openauth${libsuffix} mod_DATA = httpd.prefix httpd-apachectl.prefix httpd-modules.prefix curl.prefix nobase_dist_mod_DATA = conf/* diff --git a/sca-cpp/trunk/modules/http/basic-auth-conf b/sca-cpp/trunk/modules/http/basic-auth-conf index c3018e1174..d8c013d853 100755 --- a/sca-cpp/trunk/modules/http/basic-auth-conf +++ b/sca-cpp/trunk/modules/http/basic-auth-conf @@ -18,9 +18,9 @@ # under the License. # Generate a minimal HTTPD basic authentication configuration -here=`readlink -f $0`; here=`dirname $here` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` mkdir -p $1 -root=`readlink -f $1` +root=`echo "import os; print os.path.realpath('$1')" | python` conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` host=`echo $conf | awk '{ print $6 }'` diff --git a/sca-cpp/trunk/modules/http/cert-auth-conf b/sca-cpp/trunk/modules/http/cert-auth-conf index c6720c7ae4..38e396b60d 100755 --- a/sca-cpp/trunk/modules/http/cert-auth-conf +++ b/sca-cpp/trunk/modules/http/cert-auth-conf @@ -18,9 +18,9 @@ # under the License. # Generate a minimal HTTPD certificate-based authentication configuration -here=`readlink -f $0`; here=`dirname $here` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` mkdir -p $1 -root=`readlink -f $1` +root=`echo "import os; print os.path.realpath('$1')" | python` conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` host=`echo $conf | awk '{ print $6 }'` diff --git a/sca-cpp/trunk/modules/http/form-auth-conf b/sca-cpp/trunk/modules/http/form-auth-conf index 42b1a656f3..910f906078 100755 --- a/sca-cpp/trunk/modules/http/form-auth-conf +++ b/sca-cpp/trunk/modules/http/form-auth-conf @@ -18,9 +18,9 @@ # under the License. # Generate a minimal HTTPD form authentication configuration -here=`readlink -f $0`; here=`dirname $here` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` mkdir -p $1 -root=`readlink -f $1` +root=`echo "import os; print os.path.realpath('$1')" | python` conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` host=`echo $conf | awk '{ print $6 }'` diff --git a/sca-cpp/trunk/modules/http/group-auth-conf b/sca-cpp/trunk/modules/http/group-auth-conf index dc8dad8641..c9cd7f6e2e 100755 --- a/sca-cpp/trunk/modules/http/group-auth-conf +++ b/sca-cpp/trunk/modules/http/group-auth-conf @@ -17,9 +17,9 @@ # specific language governing permissions and limitations # under the License. -here=`readlink -f $0`; here=`dirname $here` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` mkdir -p $1 -root=`readlink -f $1` +root=`echo "import os; print os.path.realpath('$1')" | python` user=$2 group="members" diff --git a/sca-cpp/trunk/modules/http/http-test b/sca-cpp/trunk/modules/http/http-test index 0db47fe189..e9ce572994 100755 --- a/sca-cpp/trunk/modules/http/http-test +++ b/sca-cpp/trunk/modules/http/http-test @@ -29,4 +29,4 @@ rc=$? # Cleanup ./httpd-stop tmp sleep 2 -return $rc +exit $rc diff --git a/sca-cpp/trunk/modules/http/httpd-addr b/sca-cpp/trunk/modules/http/httpd-addr index 62fc775ea7..735c152f43 100755 --- a/sca-cpp/trunk/modules/http/httpd-addr +++ b/sca-cpp/trunk/modules/http/httpd-addr @@ -51,4 +51,3 @@ fi if [ "$1" = "vhost" ]; then echo $vhost fi -return 0 diff --git a/sca-cpp/trunk/modules/http/httpd-conf b/sca-cpp/trunk/modules/http/httpd-conf index 769211a125..1fac0d56e2 100755 --- a/sca-cpp/trunk/modules/http/httpd-conf +++ b/sca-cpp/trunk/modules/http/httpd-conf @@ -18,11 +18,11 @@ # under the License. # Generate a minimal HTTPD configuration -here=`readlink -f $0`; here=`dirname $here` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` mkdir -p $1 -root=`readlink -f $1` +root=`echo "import os; print os.path.realpath('$1')" | python` -jsprefix=`readlink -f $here/../js` +jsprefix=`echo "import os; print os.path.realpath('$here/../js')" | python` host=$2 port=`$here/httpd-addr port $3` @@ -31,11 +31,18 @@ listen=`$here/httpd-addr listen $3` vhost=`$here/httpd-addr vhost $3` mkdir -p $4 -htdocs=`readlink -f $4` +htdocs=`echo "import os; print os.path.realpath('$4')" | python` user=`id -un` group=`id -gn` +uname=`uname -s` +if [ $uname = "Darwin" ]; then + libsuffix=".dylib" +else + libsuffix=".so" +fi + modules_prefix=`cat $here/httpd-modules.prefix` mkdir -p $root @@ -225,8 +232,8 @@ LoadModule slotmem_shm_module ${modules_prefix}/modules/mod_slotmem_shm.so LoadModule ratelimit_module ${modules_prefix}/modules/mod_ratelimit.so LoadModule reqtimeout_module ${modules_prefix}/modules/mod_reqtimeout.so -LoadModule mod_tuscany_ssltunnel $here/libmod_tuscany_ssltunnel.so -LoadModule mod_tuscany_openauth $here/libmod_tuscany_openauth.so +LoadModule mod_tuscany_ssltunnel $here/libmod_tuscany_ssltunnel$libsuffix +LoadModule mod_tuscany_openauth $here/libmod_tuscany_openauth$libsuffix EOF diff --git a/sca-cpp/trunk/modules/http/httpd-debug b/sca-cpp/trunk/modules/http/httpd-debug index 93a6bf81d4..df0d21fbe5 100755 --- a/sca-cpp/trunk/modules/http/httpd-debug +++ b/sca-cpp/trunk/modules/http/httpd-debug @@ -18,8 +18,8 @@ # under the License. # Start httpd server -here=`readlink -f $0`; here=`dirname $here` -root=`readlink -f $1` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +root=`echo "import os; print os.path.realpath('$1')" | python` httpd=`cat $here/httpd.prefix` $httpd/bin/httpd -X -E $root/logs/error_log -d $root -f $root/conf/httpd.conf diff --git a/sca-cpp/trunk/modules/http/httpd-event-conf b/sca-cpp/trunk/modules/http/httpd-event-conf index 58923d9dd9..7bef30600b 100755 --- a/sca-cpp/trunk/modules/http/httpd-event-conf +++ b/sca-cpp/trunk/modules/http/httpd-event-conf @@ -18,9 +18,9 @@ # under the License. # Configure HTTPD to run with the event MPM -here=`readlink -f $0`; here=`dirname $here` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` mkdir -p $1 -root=`readlink -f $1` +root=`echo "import os; print os.path.realpath('$1')" | python` modules_prefix=`cat $here/httpd-modules.prefix` diff --git a/sca-cpp/trunk/modules/http/httpd-memgrind b/sca-cpp/trunk/modules/http/httpd-memgrind index 3219046c22..55e113bbd3 100755 --- a/sca-cpp/trunk/modules/http/httpd-memgrind +++ b/sca-cpp/trunk/modules/http/httpd-memgrind @@ -18,8 +18,8 @@ # under the License. # Start httpd server -here=`readlink -f $0`; here=`dirname $here` -root=`readlink -f $1` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +root=`echo "import os; print os.path.realpath('$1')" | python` httpd=`cat $here/httpd.prefix` $here/../../etc/memgrind $httpd/bin/httpd -X -E $root/logs/error_log -d $root -f $root/conf/httpd.conf diff --git a/sca-cpp/trunk/modules/http/httpd-restart b/sca-cpp/trunk/modules/http/httpd-restart index 3e3b687f98..81b098d85d 100755 --- a/sca-cpp/trunk/modules/http/httpd-restart +++ b/sca-cpp/trunk/modules/http/httpd-restart @@ -18,8 +18,8 @@ # under the License. # Restart httpd server -here=`readlink -f $0`; here=`dirname $here` -root=`readlink -f $1` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +root=`echo "import os; print os.path.realpath('$1')" | python` apachectl=`cat $here/httpd-apachectl.prefix` $apachectl -k graceful -d $root -f $root/conf/httpd.conf diff --git a/sca-cpp/trunk/modules/http/httpd-ssl-conf b/sca-cpp/trunk/modules/http/httpd-ssl-conf index 9933d1c7d9..77a4898e74 100755 --- a/sca-cpp/trunk/modules/http/httpd-ssl-conf +++ b/sca-cpp/trunk/modules/http/httpd-ssl-conf @@ -18,9 +18,9 @@ # under the License. # Generate a minimal HTTPD SSL configuration -here=`readlink -f $0`; here=`dirname $here` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` mkdir -p $1 -root=`readlink -f $1` +root=`echo "import os; print os.path.realpath('$1')" | python` conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` host=`echo $conf | awk '{ print $6 }'` @@ -34,7 +34,7 @@ sslvhost=`$here/httpd-addr vhost $2` htdocs=`echo $conf | awk '{ print $8 }'` mkdir -p $htdocs -htdocs=`readlink -f $htdocs` +htdocs=`echo "import os; print os.path.realpath('$htdocs')" | python` # Extract organization name from our CA certificate org=`openssl x509 -noout -subject -nameopt multiline -in $root/cert/ca.crt | grep organizationName | awk -F "= " '{ print $2 }'` diff --git a/sca-cpp/trunk/modules/http/httpd-start b/sca-cpp/trunk/modules/http/httpd-start index 5c006d1b54..e38c2f9a94 100755 --- a/sca-cpp/trunk/modules/http/httpd-start +++ b/sca-cpp/trunk/modules/http/httpd-start @@ -18,8 +18,8 @@ # under the License. # Start httpd server -here=`readlink -f $0`; here=`dirname $here` -root=`readlink -f $1` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +root=`echo "import os; print os.path.realpath('$1')" | python` apachectl=`cat $here/httpd-apachectl.prefix` $apachectl -E $root/logs/error_log -k start -d $root -f $root/conf/httpd.conf diff --git a/sca-cpp/trunk/modules/http/httpd-stop b/sca-cpp/trunk/modules/http/httpd-stop index cadec1e6a0..9010e4dd17 100755 --- a/sca-cpp/trunk/modules/http/httpd-stop +++ b/sca-cpp/trunk/modules/http/httpd-stop @@ -18,8 +18,8 @@ # under the License. # Stop httpd server -here=`readlink -f $0`; here=`dirname $here` -root=`readlink -f $1` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +root=`echo "import os; print os.path.realpath('$1')" | python` apachectl=`cat $here/httpd-apachectl.prefix` $apachectl -k graceful-stop -d $root -f $root/conf/httpd.conf 2>/dev/null diff --git a/sca-cpp/trunk/modules/http/httpd-test b/sca-cpp/trunk/modules/http/httpd-test index a3b9145871..909bfa29f1 100755 --- a/sca-cpp/trunk/modules/http/httpd-test +++ b/sca-cpp/trunk/modules/http/httpd-test @@ -18,7 +18,7 @@ # under the License. echo "Testing..." -here=`readlink -f $0`; here=`dirname $here` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` curl_prefix=`cat $here/../http/curl.prefix` # Setup @@ -37,4 +37,4 @@ sleep 2 if [ "$rc" = "0" ]; then echo "OK" fi -return $rc +exit $rc diff --git a/sca-cpp/trunk/modules/http/httpd-worker-conf b/sca-cpp/trunk/modules/http/httpd-worker-conf index bb6bca4562..0d0c866688 100755 --- a/sca-cpp/trunk/modules/http/httpd-worker-conf +++ b/sca-cpp/trunk/modules/http/httpd-worker-conf @@ -18,9 +18,9 @@ # under the License. # Configure HTTPD to run with the worker MPM -here=`readlink -f $0`; here=`dirname $here` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` mkdir -p $1 -root=`readlink -f $1` +root=`echo "import os; print os.path.realpath('$1')" | python` modules_prefix=`cat $here/httpd-modules.prefix` diff --git a/sca-cpp/trunk/modules/http/mod-security-conf b/sca-cpp/trunk/modules/http/mod-security-conf index f988163cf4..c9f0728f88 100755 --- a/sca-cpp/trunk/modules/http/mod-security-conf +++ b/sca-cpp/trunk/modules/http/mod-security-conf @@ -18,9 +18,9 @@ # under the License. # Generate a minimal mod-security configuration. -here=`readlink -f $0`; here=`dirname $here` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` mkdir -p $1 -root=`readlink -f $1` +root=`echo "import os; print os.path.realpath('$1')" | python` modules_prefix=`cat $here/httpd-modules.prefix` modsecurity_prefix=`cat $here/modsecurity.prefix` diff --git a/sca-cpp/trunk/modules/http/open-auth-conf b/sca-cpp/trunk/modules/http/open-auth-conf index 1c4d18b1e9..cde0c6b05f 100755 --- a/sca-cpp/trunk/modules/http/open-auth-conf +++ b/sca-cpp/trunk/modules/http/open-auth-conf @@ -18,9 +18,9 @@ # under the License. # Generate a minimal HTTPD form authentication configuration -here=`readlink -f $0`; here=`dirname $here` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` mkdir -p $1 -root=`readlink -f $1` +root=`echo "import os; print os.path.realpath('$1')" | python` conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` host=`echo $conf | awk '{ print $6 }'` diff --git a/sca-cpp/trunk/modules/http/passwd-auth-conf b/sca-cpp/trunk/modules/http/passwd-auth-conf index 89a3f19e4b..119b0fbb3b 100755 --- a/sca-cpp/trunk/modules/http/passwd-auth-conf +++ b/sca-cpp/trunk/modules/http/passwd-auth-conf @@ -17,9 +17,9 @@ # specific language governing permissions and limitations # under the License. -here=`readlink -f $0`; here=`dirname $here` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` mkdir -p $1 -root=`readlink -f $1` +root=`echo "import os; print os.path.realpath('$1')" | python` user=$2 pass=$3 diff --git a/sca-cpp/trunk/modules/http/proxy-conf b/sca-cpp/trunk/modules/http/proxy-conf index e9abe8435f..8bca7cd2de 100755 --- a/sca-cpp/trunk/modules/http/proxy-conf +++ b/sca-cpp/trunk/modules/http/proxy-conf @@ -18,9 +18,9 @@ # under the License. # Generate a minimal HTTPD proxy balancer configuration -here=`readlink -f $0`; here=`dirname $here` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` mkdir -p $1 -root=`readlink -f $1` +root=`echo "import os; print os.path.realpath('$1')" | python` cat >>$root/conf/vhost.conf <>$root/conf/vhost-ssl.conf <> $root/cert/$certname.pem mkdir -p $root/cert/hash cp $root/cert/$certname.crt $root/cert/hash cp $root/cert/$certname.pem $root/cert/hash -c_rehash $root/cert/hash +perl /usr/bin/c_rehash $root/cert/hash diff --git a/sca-cpp/trunk/modules/http/ssl-cert-find b/sca-cpp/trunk/modules/http/ssl-cert-find index b5aefb8e38..7a4b4f0220 100755 --- a/sca-cpp/trunk/modules/http/ssl-cert-find +++ b/sca-cpp/trunk/modules/http/ssl-cert-find @@ -18,9 +18,13 @@ # under the License. # List certificate files, useful to distribute them to another host -here=`readlink -f $0`; here=`dirname $here` -root=`readlink -f $1` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +root=`echo "import os; print os.path.realpath('$1')" | python` cd $root -find -regex '.*\.\(\(crt\)\|\(pem\)\|\(p12\)\|\(key\)\|\(0\)\)' 2>/dev/null +find . -name "*.crt" +find . -name "*.pem" +find . -name "*.p12" +find . -name "*.key" +find . -name "*.0" diff --git a/sca-cpp/trunk/modules/http/tunnel-ssl-conf b/sca-cpp/trunk/modules/http/tunnel-ssl-conf index 8cf4ada20a..021d205ed9 100755 --- a/sca-cpp/trunk/modules/http/tunnel-ssl-conf +++ b/sca-cpp/trunk/modules/http/tunnel-ssl-conf @@ -18,9 +18,9 @@ # under the License. # Generate an SSL tunnel configuration -here=`readlink -f $0`; here=`dirname $here` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` mkdir -p $1 -root=`readlink -f $1` +root=`echo "import os; print os.path.realpath('$1')" | python` conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` host=`echo $conf | awk '{ print $6 }'` diff --git a/sca-cpp/trunk/modules/http/vhost-conf b/sca-cpp/trunk/modules/http/vhost-conf index a36b195844..150d57f115 100755 --- a/sca-cpp/trunk/modules/http/vhost-conf +++ b/sca-cpp/trunk/modules/http/vhost-conf @@ -18,11 +18,11 @@ # under the License. # Generate mass dynamic virtual hosting configuration -here=`readlink -f $0`; here=`dirname $here` +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` mkdir -p $1 -root=`readlink -f $1` +root=`echo "import os; print os.path.realpath('$1')" | python` -vroot=`readlink -f $2` +vroot=`echo "import os; print os.path.realpath('$2')" | python` vhtdocs=$3 conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"` @@ -34,7 +34,7 @@ vhost=`$here/httpd-addr vhost $addr` htdocs=`echo $conf | awk '{ print $8 }'` mkdir -p $htdocs -htdocs=`readlink -f $htdocs` +htdocs=`echo "import os; print os.path.realpath('$htdocs')" | python` cat >>$root/conf/httpd.conf <>$root/conf/httpd.conf <