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

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Fri Oct 1 14:46:18 CEST 2010


Revision: 11117
          http://gar.svn.sourceforge.net/gar/?rev=11117&view=rev
Author:   bdwalton
Date:     2010-10-01 12:46:18 +0000 (Fri, 01 Oct 2010)

Log Message:
-----------
apache2: add the ap2mod CAS and install them appropriately

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

Added Paths:
-----------
    csw/mgar/pkg/apache2/trunk/files/i.cswap2mod
    csw/mgar/pkg/apache2/trunk/files/r.cswap2mod

Modified: csw/mgar/pkg/apache2/trunk/Makefile
===================================================================
--- csw/mgar/pkg/apache2/trunk/Makefile	2010-10-01 12:23:34 UTC (rev 11116)
+++ csw/mgar/pkg/apache2/trunk/Makefile	2010-10-01 12:46:18 UTC (rev 11117)
@@ -45,6 +45,7 @@
 DISTFILES += update20to22
 DISTFILES += README.CSW.apache2 README.CSW.ap2_prefork
 DISTFILES += README.CSW.apache2rt
+DISTFILES += i.cswap2mod r.cswap2mod
 
 UFILES_REGEX = $(GARNAME)-(\d+(?:\.\d+)*).tar.gz
 
@@ -201,8 +202,16 @@
 	@$(MAKECOOKIE)
 
 
-post-install-modulated: rename-httpd copy-local-files create-templates copy-readmes
+post-install-modulated: rename-httpd copy-local-files create-templates copy-readmes install-cas
 
+install-cas: CASD = $(DESTDIR)/usr/sadm/install/scripts
+install-cas:
+	@(cd $(WORKDIR); \
+		ginstall -d -m0755 $(CASD); \
+		for f in *cswap2mod; do \
+			ginstall -m 0555 $$f $(CASD); \
+		done)
+
 copy-readmes:
 	@(cd $(WORKDIR); for f in README.CSW*; do \
 		p=`echo $$f | sed 's/README.CSW.//'`; \

Added: csw/mgar/pkg/apache2/trunk/files/i.cswap2mod
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/i.cswap2mod	                        (rev 0)
+++ csw/mgar/pkg/apache2/trunk/files/i.cswap2mod	2010-10-01 12:46:18 UTC (rev 11117)
@@ -0,0 +1,79 @@
+#!/bin/sh
+#
+# i.cswap2mod - Class action script for installing apache2 modules
+#
+# Written by Ben Walton
+#
+# 2010-09-29 First Release
+#
+
+# Source csw.conf, if it exists
+if [ -f $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf ] ; then
+  . $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf
+fi
+if [ -f $PKG_INSTALL_ROOT/etc/opt/csw/csw.conf ] ; then
+  . $PKG_INSTALL_ROOT/etc/opt/csw/csw.conf
+fi
+
+AP2_PREFIX=/opt/csw/apache2
+AP2_BINDIR=$AP2_PREFIX/sbin
+AP2_LIBEXEC=$AP2_PREFIX/libexec
+AP2_CONFDIR=$AP2_PREFIX/etc
+AP2_CONFIG=$AP2_CONFDIR/httpd.conf
+AP2_APXS=$AP2_BINDIR/apxs
+
+PKG_INSTALL_ROOT=${PKG_INSTALL_ROOT:-'/'}
+
+while read src dest; do
+      # Place the file first
+      /usr/bin/cp -p $src $dest || exit 2
+      echo $dest
+      
+      CONF=$PKG_INSTALL_ROOT/$AP2_CONFIG
+      APXS=$PKG_INSTALL_ROOT/$AP2_APXS
+      MODFILE=`basename $dest`
+      MODNAME=`echo $MODFILE | sed 's/mod_//; s/\.so$//'`
+
+      # Modules will be enabled by default, but a global kill switch
+      # is checked , followed by a module specific value.  Thus,
+      # either ap2_enable_modules or ap2_enable_suexec (for example)
+      # could disable activation of the suexec module.  The 
+      #
+      # This value is passed to apxs (-a: add, enable; -A: add,
+      # disable)
+      enmod=-a
+
+      if [ "$ap2_enable_modules" = "no" ]; then
+	  enmod=-A
+      fi
+
+      eval ap2_mod_specific="\$ap2_enable_$MODNAME"
+      if [ "$ap2_mod_specific" = "no" ]; then
+	  enmod=-A
+      elif [ "$ap2_mod_specific" = "yes" ]; then
+	  enmod=-a
+      fi
+
+      if [ -f "$CONF" -a -x "$APXS" ]; then
+	  # Add the module module, optionally enabling it by default
+	  chroot $PKG_INSTALL_ROOT \
+	      $APXS -e $enmod -n $MODNAME $MODFILE
+	  conftouched=1
+      fi
+done
+
+if [ "$conftouched" = "1" ]; then
+	  cat <<END
+
+
+NOTICE: One or more LoadModule lines was added to your httpd.conf.
+Depending on your csw.conf settings for ap2_enable_modules or
+ap2_enable_\$modulename they may be enabled.  Please review the
+changes, make any futher modifications and then restart apache as
+required.
+
+
+END
+fi
+
+exit 0


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

Added: csw/mgar/pkg/apache2/trunk/files/r.cswap2mod
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/r.cswap2mod	                        (rev 0)
+++ csw/mgar/pkg/apache2/trunk/files/r.cswap2mod	2010-10-01 12:46:18 UTC (rev 11117)
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# r.cswap2mod - Class action script for removing apache2 modules
+#
+# Written by Ben Walton
+#
+# 2010-09-29 First Release
+#
+
+AP2_PREFIX=/opt/csw/apache2
+AP2_BINDIR=$AP2_PREFIX/sbin
+AP2_LIBEXEC=$AP2_PREFIX/libexec
+AP2_CONFDIR=$AP2_PREFIX/etc
+AP2_CONFIG=$AP2_CONFDIR/httpd.conf
+AP2_APXS=$AP2_BINDIR/apxs
+
+PKG_INSTALL_ROOT=${PKG_INSTALL_ROOT:-'/'}
+
+while read dest; do
+      echo $dest
+      
+      CONF=$PKG_INSTALL_ROOT/$AP2_CONFIG
+      APXS=$PKG_INSTALL_ROOT/$AP2_APXS
+      MODFILE=`basename $dest`
+      MODNAME=`echo $MODFILE | sed 's/mod_//; s/\.so$//'`
+
+      if [ -f "$CONF" -a -x "$APXS" ]; then
+	  # Disable the module
+	  chroot $PKG_INSTALL_ROOT \
+	      $APXS -e -A -n $MODNAME $MODFILE
+	  conftouched=1
+      fi
+
+      # Now actually remove the file.
+      /usr/bin/rm -f $dest || exit 2
+done
+
+if [ "$conftouched" = "1" ]; then
+	  cat <<END
+
+
+NOTICE: One or more apache modules was disabled in your apache
+configuration.  Please review these changes and restart apache as
+required.
+
+
+END
+fi
+
+exit 0


Property changes on: csw/mgar/pkg/apache2/trunk/files/r.cswap2mod
___________________________________________________________________
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