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

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Sun Nov 14 19:49:34 CET 2010


Revision: 11607
          http://gar.svn.sourceforge.net/gar/?rev=11607&view=rev
Author:   bdwalton
Date:     2010-11-14 18:49:34 +0000 (Sun, 14 Nov 2010)

Log Message:
-----------
apache2: simplify delivery of build class template configs by placing them in the real files and having transforms applied by build script instead of delivering as a side effect of the .CSW version

Modified Paths:
--------------
    csw/mgar/pkg/apache2/trunk/Makefile

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

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

Modified: csw/mgar/pkg/apache2/trunk/Makefile
===================================================================
--- csw/mgar/pkg/apache2/trunk/Makefile	2010-11-14 17:05:18 UTC (rev 11606)
+++ csw/mgar/pkg/apache2/trunk/Makefile	2010-11-14 18:49:34 UTC (rev 11607)
@@ -242,20 +242,14 @@
 
 
 post-merge: create-templates
-	@echo "  => Creating template files"
-	@$(FILEDIR)/conf_build_scripts $(PKGROOT)
-	@echo "  => Modifying template files for specific cases"
-	@(cd $(PKGROOT)/$(prefix)/apache2/etc/; \
-               for f in httpd.conf.CSW extra/httpd-ssl.conf.CSW; do \
-		echo ...$$f; \
-		perl -pi -e 's/#*ServerName www.example.com:(80|443)/EOS\necho ServerName `hostname`:$$1 >> \$$TEMPLATE\ncat <<EOS >>\$$TEMPLATE/; \
-		s/#*ServerAdmin you\@example.com/EOS\necho ServerAdmin root@`hostname` >> \$$TEMPLATE\ncat <<EOS >>\$$TEMPLATE/; \
-		s/^User.*daemon/User nobody/; \
-		s/^Group.*daemon/Group nobody/; \
-		s/^(LoadModule.*suexec.*)/#$$1/; \
-		s/^#(Include.*httpd-mpm.conf)/$$1/; \
-		s/^#(Include.*httpd-ssl.conf)/$$1/' $$f; \
-               done )
-	@cp -p $(WORKDIR)/server.crt.build_cas $(PKGROOT)/$(prefix)/apache2/etc/server.crt.CSW
+	@echo "  => Creating template files and CAS shell scripts..."
+	@( cd $(PKGROOT)/opt/csw/apache2/etc; \
+		for f in *conf extra/* mime* magic*; do \
+			echo "...$$f"; \
+			mv $$f $$f.CSW; \
+			$(abspath $(FILEDIR))/build_cas_template $$f > $$f; \
+		done )
+	@echo "  => Creating ssl server.crt build CAS template."
+	@cp -p $(WORKDIR)/server.crt.build_cas $(PKGROOT)/$(prefix)/apache2/etc/server.crt
 	@$(MAKECOOKIE)
 

Added: csw/mgar/pkg/apache2/trunk/files/build_cas_template
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/build_cas_template	                        (rev 0)
+++ csw/mgar/pkg/apache2/trunk/files/build_cas_template	2010-11-14 18:49:34 UTC (rev 11607)
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+cat <<EOF
+#!/bin/sh
+
+if [ "\$1" = install ]; then
+PIR=\${PKG_INSTALL_ROOT:-/}
+AP2_DIR=\$PIR/opt/csw/apache2
+AP2_CONF=\$AP2_DIR/etc/
+
+CONF_FILE=\$AP2_CONF/$1
+
+if [ ! -f "\$CONF_FILE" ]; then
+   cp -p \$CONF_FILE.CSW \$CONF_FILE
+   host=\`hostname\`
+   perl -pi \
+   	-e "s/#*ServerName www.example.com(80|443)/ServerName \$host:\\\$1/;" \
+	-e "s/#*ServerAdmin you\@example.com/ServerAdmin root@\$host/;" \
+	-e "s/^User.*daemon/User nobody/;" \
+	-e "s/^Group.*daemon/Group nobody/;" \
+	-e "s/^(LoadModule.*suexec.*)/#\$1/;" \
+	-e "s/^#(Include.*httpd-mpm.conf)/\$1/;" \
+	-e "s/^#(Include.*httpd-ssl.conf)/\$1/;" \$CONF_FILE
+else
+   # preserve ourselves with no changes
+   cat \$CONF_FILE
+fi
+EOF


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

Deleted: csw/mgar/pkg/apache2/trunk/files/conf_build_scripts
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/conf_build_scripts	2010-11-14 17:05:18 UTC (rev 11606)
+++ csw/mgar/pkg/apache2/trunk/files/conf_build_scripts	2010-11-14 18:49:34 UTC (rev 11607)
@@ -1,41 +0,0 @@
-#!/bin/bash
-
-ROOT=$1
-
-AP2_ROOT=/opt/csw/apache2
-AP2_CONF=$AP2_ROOT/etc
-
-cd $ROOT/$AP2_CONF;
-
-for f in $(find . -type f | grep -v original/ ); do
-    echo "...processing $f"
-    template=$f.CSW
-
-    cat <<EOF > $template
-PIR=\${PKG_INSTALL_ROOT:-/}
-AP2_ROOT=\$PIR/$AP2_ROOT
-AP2_CONF=\$AP2_ROOT/etc
-TEMPLATE=\$AP2_CONF/$template
-
-if [ "\$1" = install ]; then
-  cat <<EOS > \$TEMPLATE
-EOF
-
-perl -pi -e 's/\$/\\\$/g' $f
-cat $f >> $template
-
-cat <<EOF >> $template
-EOS
-
-if [ ! -f \$AP2_CONF/$f ]; then
-  cp -p \$TEMPLATE \$AP2_CONF/$f
-fi
-
-else
-  rm \$TEMPLATE
-fi
-
-EOF
-
-rm $f
-done


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