X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fbin%2Fapache-template-update;h=29024ab32819d0ea98ca67f3616f43f4f61d5aad;hb=cd5b556daa8f53e7e48ad30eaeb43a85d4e80fff;hp=b346dbb0fe9d2914ffeb4773d76622da3b86a7e9;hpb=4d4ad42a0066451c2a0d7bbeedb3a22bb879ea2f;p=mkws-moved-to-github.git diff --git a/test/bin/apache-template-update b/test/bin/apache-template-update index b346dbb..29024ab 100755 --- a/test/bin/apache-template-update +++ b/test/bin/apache-template-update @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2014-2014 IndexData ApS. http://indexdata.com +# Copyright (c) 2014-2014 Index Data ApS. http://indexdata.com # Wolfram Schneider # # generate temp config file for testing @@ -11,26 +11,44 @@ export APACHE_RUN_GROUP=$(groups | awk '{ print $1 }') export APACHE_LOG_DIR=$APACHE_SERVER_ROOT/logs export APACHE_PID_FILE=$APACHE_LOG_DIR/mkws-jasmine.pid -export APACHE_PORT=4040 +export APACHE_LOCK_FILE=$APACHE_LOG_DIR/accept.lock +: ${APACHE_PORT=4040}; export APACHE_PORT export MKWS_ROOT=$(pwd)/.. -MKWS_OS=debian +MKWS_OS=debian +APACHE_VERSION=2.2 +apache2=$(env PATH=/bin:/usr/bin:/usr/sbin which apache2 httpd false 2>/dev/null | head -1) + case $(uname) in - Darwin ) MKWS_OS=macos ;; - Linux ) MKWS_OS=debian + Darwin ) MKWS_OS=macos + test -e libexec || ln -fs /usr/libexec . + ;; + Linux ) MKWS_OS=debian if [ -e /etc/debian_version ]; then - MKWS_OS=debian + MKWS_OS=debian + if $apache2 -v | egrep -q 'Server version: Apache/2\.4\.'; then + APACHE_VERSION=2.4 + fi + fi + if [ -e /etc/redhat-release ]; then + MKWS_OS=centos fi ;; * ) MKWS_OS=debian ;; esac -export APACHE_MODULES="$MKWS_ROOT/tools/apache2/jasmine-dev.apache-modules.$MKWS_OS.conf" -: ${MKWS_APACHE_TEMPLATE="$MKWS_ROOT/tools/apache2/jasmine-dev.template"} +if [ "$APACHE_VERSION" = "2.4" ]; then + : ${MKWS_APACHE_TEMPLATE="$MKWS_ROOT/tools/apache2/jasmine-dev.template-$APACHE_VERSION"} + APACHE_MODULES="$MKWS_ROOT/tools/apache2/jasmine-dev.apache-modules-$APACHE_VERSION.$MKWS_OS.conf" +else + : ${MKWS_APACHE_TEMPLATE="$MKWS_ROOT/tools/apache2/jasmine-dev.template"} + APACHE_MODULES="$MKWS_ROOT/tools/apache2/jasmine-dev.apache-modules.$MKWS_OS.conf" +fi + : ${MKWS_APACHE_FILE="$APACHE_LOG_DIR/jasmine-dev"} +export APACHE_MODULES perl -npe 's,\${(.*?)},$ENV{$1},g; ' $MKWS_APACHE_TEMPLATE > $MKWS_APACHE_FILE.tmp mv -f $MKWS_APACHE_FILE.tmp $MKWS_APACHE_FILE -