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

valholla at users.sourceforge.net valholla at users.sourceforge.net
Fri May 8 18:18:36 CEST 2009


Revision: 4763
          http://gar.svn.sourceforge.net/gar/?rev=4763&view=rev
Author:   valholla
Date:     2009-05-08 16:18:33 +0000 (Fri, 08 May 2009)

Log Message:
-----------
add fast-cgi and fix post-install bug 3660

Modified Paths:
--------------
    csw/mgar/pkg/php5/trunk/Makefile
    csw/mgar/pkg/php5/trunk/files/CSWphp5.postinstall

Modified: csw/mgar/pkg/php5/trunk/Makefile
===================================================================
--- csw/mgar/pkg/php5/trunk/Makefile	2009-05-08 15:18:47 UTC (rev 4762)
+++ csw/mgar/pkg/php5/trunk/Makefile	2009-05-08 16:18:33 UTC (rev 4763)
@@ -73,7 +73,6 @@
 CONFIGURE_ARGS += --with-exec-dir=$(prefix)/php5/bin
 CONFIGURE_ARGS += --enable-cli
 CONFIGURE_ARGS += --enable-fastcgi
-CONFIGURE_ARGS += --enable-force-cgi-redirect
 CONFIGURE_ARGS += --enable-pcntl=shared
 CONFIGURE_ARGS += --enable-pdo=shared
 CONFIGURE_ARGS += --with-mm=$(prefix)
@@ -93,6 +92,7 @@
 # Copy over template config files and utility scripts
 
 PI_SCRIPTS  = install-extras
+PI_SCRIPTS += install-sapi-cgi
 PI_SCRIPTS += install-ap2modphp5
 PI_SCRIPTS += install-modphp5
 
@@ -139,6 +139,17 @@
 		-mindepth 1 -type d | egrep -v "etc|libexec" | xargs grm -fr )
 	@$(MAKECOOKIE)
 
+install-sapi-cgi:
+	@( echo "  ==> Now Building php-cgi <==" )
+	@( if [ -f $(WORKSRC)/Makefile ]; then \
+		$(BUILD_ENV) gmake -C $(WORKSRC) distclean; fi )
+	@( cd $(WORKSRC) && $(BUILD_ENV) \
+		./configure $(CONFIGURE_ARGS) --enable-force-cgi-redirect)
+	@( $(GARBIN)/fixlibtool $(WORKSRC) )
+	@( $(BUILD_ENV) $(INSTALL_ENV) gmake -C $(WORKSRC) install-sapi )
+	@( strip $(DESTDIR)$(prefix)/php5/bin/php-cgi )
+	@$(MAKECOOKIE)
+
 EXTFILES = $(shell find extensions/*/files/* -prune -type f)
 pre-fetch:
 	$(foreach F,$(EXTFILES),$(shell cp $(F) $(DOWNLOADDIR)))

Modified: csw/mgar/pkg/php5/trunk/files/CSWphp5.postinstall
===================================================================
--- csw/mgar/pkg/php5/trunk/files/CSWphp5.postinstall	2009-05-08 15:18:47 UTC (rev 4762)
+++ csw/mgar/pkg/php5/trunk/files/CSWphp5.postinstall	2009-05-08 16:18:33 UTC (rev 4763)
@@ -1,7 +1,9 @@
 #!/bin/sh
 
+PATH=/bin:/usr/bin:/opt/csw/bin:/sbin:/usr/sbin:/opt/csw/sbin
 PKG_INSTALL_ROOT=${PKG_INSTALL_ROOT:-'/'}
 PHP_LIB=$PKG_INSTALL_ROOT/opt/csw/php5/lib
+PHP_BIN=$PKG_INSTALL_ROOT/opt/csw/php5/bin
 PHP_INI=$PHP_LIB/php.ini
 
 if [ ! -f $PHP_INI ]; then
@@ -9,7 +11,8 @@
 else
     echo "php.ini already exists"
 
-    extdir=`ls -d $PHP_LIB/php/extensions/no-debug-non-zts-* | xargs basename`
+    extdir_ext=`${PHP_BIN}/php -i |grep 'PHP Extension' |awk '{print $NF}'`
+    extdir="${PHP_LIB}/php/extensions/no-debug-non-zts-${extdir_ext}"
     curextdir=`perl -lne '/(no-debug-non-zts-[0-9]+)/ && print $1' $PHP_INI`
 
     if [ "$extdir" != "$curextdir" ]; then
@@ -123,6 +126,16 @@
 _EOT_
     fi
 fi
+if [ ! -d ${extdir} ]; then
+    mkdir -p ${extdir}
+    for dir in `${PHP_BIN}/php -i |grep extension_dir |\
+                 awk -F'/' '{print $(NF-1), $NF}'`; do
+        chown -R root:bin ${dir}
+        chmod -R 0755 ${dir}
+        installf ${PKGINST} ${dir}
+    done
+    installf -f ${PKGINST}
+fi
 
 echo "PHP5 configuration: $PHP_INI"
 


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