X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fbin%2Fapache-template-update;h=6c903415523d0a7bcd79213e98ca6274ac1e6edd;hb=f88a194fc9da41b17d432a7df935fe41e88c8101;hp=f094eaedccde3ea0f238635784e8416151a8c1be;hpb=c61c2a4ce84abe9e6685711fa827407ca84db915;p=mkws-moved-to-github.git diff --git a/test/bin/apache-template-update b/test/bin/apache-template-update index f094eae..6c90341 100755 --- a/test/bin/apache-template-update +++ b/test/bin/apache-template-update @@ -16,27 +16,39 @@ export APACHE_LOCK_FILE=$APACHE_LOG_DIR/accept.lock 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 + Darwin ) MKWS_OS=macos test -e libexec || ln -fs /usr/libexec . ;; - Linux ) MKWS_OS=debian + 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 + 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 -