Support Apache 2.4 for phantomjs test
[mkws-moved-to-github.git] / test / bin / apache-template-update
index f094eae..54d2f8c 100755 (executable)
@@ -17,13 +17,19 @@ export APACHE_LOCK_FILE=$APACHE_LOG_DIR/accept.lock
 export MKWS_ROOT=$(pwd)/..
 
 MKWS_OS=debian 
+APACHE_VERSION=2.2
 case $(uname) in
   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
+               # Ubuntu with Apache 2.2 can continue using debian
+               if /usr/bin/dpkg -s apache2 | grep -q "Version: 2\.4\..*ubuntu"; then
+                       MKWS_OS=ubuntu
+                        APACHE_VERSION=2.4
+               fi
           fi
           if [ -e /etc/redhat-release ]; then
                MKWS_OS=centos  
@@ -34,9 +40,13 @@ 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-2.4"}
+else
+       : ${MKWS_APACHE_TEMPLATE="$MKWS_ROOT/tools/apache2/jasmine-dev.template"}
+fi
 : ${MKWS_APACHE_FILE="$APACHE_LOG_DIR/jasmine-dev"}
 
+
 perl -npe 's,\${(.*?)},$ENV{$1},g; ' $MKWS_APACHE_TEMPLATE > $MKWS_APACHE_FILE.tmp
 mv -f $MKWS_APACHE_FILE.tmp $MKWS_APACHE_FILE
-