[csw-devel] SF.net SVN: gar:[14475] csw/mgar/pkg/php5/trunk

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Sat Apr 30 03:05:36 CEST 2011


Revision: 14475
          http://gar.svn.sourceforge.net/gar/?rev=14475&view=rev
Author:   bdwalton
Date:     2011-04-30 01:05:35 +0000 (Sat, 30 Apr 2011)

Log Message:
-----------
php5/trunk: add preremove and postinstall scripts for modphp5 to manage httpd-php5.conf

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

Added Paths:
-----------
    csw/mgar/pkg/php5/trunk/files/CSWap2-modphp5.postinstall
    csw/mgar/pkg/php5/trunk/files/CSWap2-modphp5.preremove

Modified: csw/mgar/pkg/php5/trunk/Makefile
===================================================================
--- csw/mgar/pkg/php5/trunk/Makefile	2011-04-29 23:53:22 UTC (rev 14474)
+++ csw/mgar/pkg/php5/trunk/Makefile	2011-04-30 01:05:35 UTC (rev 14475)
@@ -41,6 +41,8 @@
 DISTFILES += phpext pear.conf.CSW CSWphp5.postinstall
 DISTFILES += CSWphp5.cswreleasenotes
 DISTFILES += CSWap2-modphp5.cswreleasenotes
+DISTFILES += CSWap2-modphp5.postinstall
+DISTFILES += CSWap2-modphp5.preremove
 DISTFILES += httpd-php5.conf
 
 PATCHFILES += 0001-Strip-usr-ucblib-references.patch

Added: csw/mgar/pkg/php5/trunk/files/CSWap2-modphp5.postinstall
===================================================================
--- csw/mgar/pkg/php5/trunk/files/CSWap2-modphp5.postinstall	                        (rev 0)
+++ csw/mgar/pkg/php5/trunk/files/CSWap2-modphp5.postinstall	2011-04-30 01:05:35 UTC (rev 14475)
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+CSW_PREFIX=${PKG_INSTALL_ROOT}/opt/csw
+AP2_CONFIG=$CSW_PREFIX/apache2/etc/httpd.conf
+
+# Configure mod_php5 in httpd.conf
+if [ -n "`egrep 'IfModule (mod_php|php_module)' $AP2_CONFIG`" ]
+then
+    echo "Existing mod_php5 configuration detected"
+elif [ -n "`egrep '#Include etc/extra/httpd-php5.conf' $AP2_CONFIG`" ]; then
+    echo "Re-enabling existing config"
+    perl -i -plne 's,^#(Include etc/extra/httpd-php5.conf),$1,' $AP2_CONFIG
+else
+    echo "Adding Include for extra/http-php5.conf to httpd.conf"
+    cat << END >> $AP2_CONFIG
+
+Include etc/extra/httpd-php5.conf
+END
+fi
+
+# Finito
+cat <<END
+
+NOTICE: mod_php5 is enabled in httpd.conf but the server was not restarted.
+Please examine your php5 configuration and restart apache.
+
+END
+
+exit 0

Added: csw/mgar/pkg/php5/trunk/files/CSWap2-modphp5.preremove
===================================================================
--- csw/mgar/pkg/php5/trunk/files/CSWap2-modphp5.preremove	                        (rev 0)
+++ csw/mgar/pkg/php5/trunk/files/CSWap2-modphp5.preremove	2011-04-30 01:05:35 UTC (rev 14475)
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+CSW_PREFIX=${PKG_INSTALL_ROOT}/opt/csw
+AP2_CONFIG=$CSW_PREFIX/apache2/etc/httpd.conf
+
+echo "Disabling httpd-php5.conf in httpd.conf"
+perl -i -plne 's,(?<!#)(Include etc/extra/httpd-php5.conf),#$1,' $AP2_CONFIG
+
+cat <<END
+
+NOTICE: mod_php5 is disabled in httpd.conf but the server was not restarted.
+Please check your configuration and restart apache.
+
+END
+
+exit 0


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