[csw-devel] SF.net SVN: gar:[11508] csw/mgar/gar/v2/bin/ap2mod_build_scripts

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Sat Nov 6 14:08:15 CET 2010


Revision: 11508
          http://gar.svn.sourceforge.net/gar/?rev=11508&view=rev
Author:   bdwalton
Date:     2010-11-06 13:08:15 +0000 (Sat, 06 Nov 2010)

Log Message:
-----------
gar/v2: add a script that can build the "e build" script targets for apache modules

Added Paths:
-----------
    csw/mgar/gar/v2/bin/ap2mod_build_scripts

Added: csw/mgar/gar/v2/bin/ap2mod_build_scripts
===================================================================
--- csw/mgar/gar/v2/bin/ap2mod_build_scripts	                        (rev 0)
+++ csw/mgar/gar/v2/bin/ap2mod_build_scripts	2010-11-06 13:08:15 UTC (rev 11508)
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+MERGEDIR=$1; shift
+AP2MODS=opt/csw/apache2/ap2mod
+
+cd $MERGEDIR/
+
+[ -d $AP2MODS ] || mkdir -p $AP2MODS
+
+for a in $*; do
+    for f in $(find . -name "*$a*"); do
+	modfile=$(basename $f)
+	modname=$(echo $modfile | sed 's/mod_//; s/\.so$//')
+	ap2modfile=$AP2MODS/$modname
+	cat <<EOF > $ap2modfile
+!install
+PIR=\${PKG_INSTALL_ROOT:-'/'}
+
+touch \$PIR/$ap2modfile
+
+# Source csw.conf, if it exists
+if [ -f \$PIR/opt/csw/etc/csw.conf ] ; then
+  . \$PIR/opt/csw/etc/csw.conf
+fi
+if [ -f \$PIR/etc/opt/csw/csw.conf ] ; then
+  . \$PIR/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
+
+# 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
+
+if [ "\$ap2_enable_$modname" = "no" ]; then
+    enmod=-A
+elif [ "$ap2_mod_specific" = "yes" ]; then
+    enmod=-a
+fi
+
+if [ -f "\$PIR/\$AP2_CONFIG" -a -x "\$PIR/\$AP2_APXS" ]; then
+    # Add the module module, optionally enabling it by default
+    chroot \$PIR \$AP2_APXS -e \$enmod -n $modname $modfile
+fi
+
+!remove
+PIR=\${PKG_INSTALL_ROOT:-'/'}
+
+rm \$PIR/$ap2modfile
+
+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
+
+if [ -f "\$PIR/\$AP2_CONFIG" -a -x "\$PIR/\$AP2_APXS" ]; then
+  chroot \$PIR \$APXS -e -A -n $modname $modfile
+fi
+EOF
+    done
+done


Property changes on: csw/mgar/gar/v2/bin/ap2mod_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