[csw-devel] SF.net SVN: gar:[11558] csw/mgar/pkg/apache2/trunk/files/conf_build_scripts

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Thu Nov 11 03:33:41 CET 2010


Revision: 11558
          http://gar.svn.sourceforge.net/gar/?rev=11558&view=rev
Author:   bdwalton
Date:     2010-11-11 02:33:41 +0000 (Thu, 11 Nov 2010)

Log Message:
-----------
apache2: add a script that will be used to generate the etc/ template files and deliver the conf files if they do not exist via the build CAS

Added Paths:
-----------
    csw/mgar/pkg/apache2/trunk/files/conf_build_scripts

Added: csw/mgar/pkg/apache2/trunk/files/conf_build_scripts
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/conf_build_scripts	                        (rev 0)
+++ csw/mgar/pkg/apache2/trunk/files/conf_build_scripts	2010-11-11 02:33:41 UTC (rev 11558)
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+ROOT=$1
+
+AP2_ROOT=/opt/csw/apache2
+AP2_CONF=$AP2_ROOT/etc
+
+cd $ROOT/$AP2_CONF;
+
+for f in $(find . -name '*conf'); do
+    if [ ! -f "$f.bak" ]; then
+	perl -pi.bak -e 's/\$/\\\$/g' $f
+    fi 
+
+    cat <<EOF > $f.new
+PIR=\${PKG_INSTALL_ROOT:-/}
+AP2_ROOT=\$PIR/$AP2_ROOT
+AP2_CONF=\$AP2_ROOT/etc
+
+if [ "\$1" = install ]; then
+  cat <<EOS > \$AP2_CONF/$f.CSW
+EOF
+cat $f >> $f.new
+
+cat <<EOF >> $f.new
+EOS
+
+if [ ! -f \$AP2_CONF/$f ]; then
+  cp -p \$AP2_CONF/$f.CSW \$AP2_CONF/$f
+fi
+
+else
+  rm \$AP2_CONF/$f
+fi
+
+EOF
+
+mv $f.new $f
+done


Property changes on: csw/mgar/pkg/apache2/trunk/files/conf_build_scripts
___________________________________________________________________
Added: svn:executable
   + *


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list