--- /usr/portage/dev-lang/php/php-5.2.8-r2.ebuild 2009-01-14 23:46:49.000000000 +0000 +++ php-5.2.8-r2.ebuild 2009-01-18 12:54:00.000000000 +0000 @@ -1,10 +1,10 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.2.8-r2.ebuild,v 1.1 2009/01/11 21:16:32 hoffie Exp $ +# $Header: $ CGI_SAPI_USE="discard-path force-cgi-redirect" APACHE2_SAPI_USE="concurrentmodphp threads" -IUSE="cli cgi ${CGI_SAPI_USE} ${APACHE2_SAPI_USE} fastbuild" +IUSE="cli cgi embed ${CGI_SAPI_USE} ${APACHE2_SAPI_USE} fastbuild" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" @@ -35,13 +35,13 @@ # Suhosin patch support [[ -n "${SUHOSIN_PATCH}" ]] && SRC_URI="${SRC_URI} suhosin? ( http://gentoo.longitekk.com/${SUHOSIN_PATCH} )" -DESCRIPTION="The PHP language runtime engine: CLI, CGI and Apache2 SAPIs." +DESCRIPTION="The PHP language runtime engine: CLI, CGI, Apache2 and Embed SAPIs." DEPEND="app-admin/php-toolkit imap? ( >=virtual/imap-c-client-2006k ) pcre? ( >=dev-libs/libpcre-7.8 ) xml? ( >=dev-libs/libxml2-2.7.2-r2 ) - xmlrpc? ( >=dev-libs/libxml2-2.7.2-r2 virtual/libiconv )" + xmlrpc? ( >=dev-libs/libxml2-2.7.1-r2 virtual/libiconv )" RDEPEND="${DEPEND}" if [[ -n "${KOLAB_PATCH}" ]] ; then @@ -57,7 +57,7 @@ # Make sure the user has specified at least one SAPI einfo "Determining SAPI(s) to build" - phpconfutils_require_any " Enabled SAPI:" " Disabled SAPI:" cli cgi apache2 + phpconfutils_require_any " Enabled SAPI:" " Disabled SAPI:" cli cgi embed apache2 # Threaded Apache2 support if use apache2 ; then @@ -120,6 +120,10 @@ PHPSAPIS="${PHPSAPIS} cgi" fi + if use embed ; then + PHPSAPIS="${PHPSAPIS} embed" + fi + # note - apache SAPI comes after the simpler cli/cgi sapis if use apache2 ; then PHPSAPIS="${PHPSAPIS} apache${APACHE_VERSION}" @@ -232,6 +236,7 @@ build_cli=0 build_cgi=0 build_apache2=0 + build_embed=0 my_conf="" for x in ${PHPSAPIS} ; do @@ -242,6 +247,9 @@ cgi) build_cgi=1 ;; + embed) + build_embed=1 + ;; apache2) build_apache2=1 ;; @@ -262,6 +270,12 @@ my_conf="${my_conf} --disable-cgi" fi + if [[ ${build_embed} = 1 ]] ; then + my_conf="${my_conf} --enable-embed" + else + my_conf="${my_conf} --disable-embed" + fi + if [[ ${build_apache2} = 1 ]] ; then my_conf="${my_conf} --with-apxs2=/usr/sbin/apxs2" @@ -316,6 +330,19 @@ cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI" fi + if [[ ${build_embed} = 1 ]] ; then + einfo + einfo "Building Embed SAPI" + einfo + + sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php/embed-php5"|g;' -i main/build-defs.h + sed -e 's|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR "/etc/php/embed-php5/ext-active"|g;' -i main/build-defs.h + for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do + [[ -f ${x} ]] && rm -f ${x} + done + make sapi/embed/php || die "Unable to make Embed SAPI" + fi + if [[ ${build_apache2} = 1 ]] ; then einfo einfo "Building apache${APACHE_VERSION} SAPI" @@ -380,6 +407,10 @@ php5_2-sapi_src_compile cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI" ;; + embed) + my_conf="${my_conf} --disable-cli --disable-cgi --enable-embed" + php5_2-sapi_src_compile + ;; apache2) my_conf="${my_conf} --disable-cli --with-apxs2=/usr/sbin/apxs2" php5_2-sapi_src_compile @@ -420,6 +451,12 @@ dobin php-cgi || die "Unable to install ${x} sapi" php5_2-sapi_install_ini ;; + embed) + einfo "Installing Embed SAPI" + into ${destdir} + make INSTALL_ROOT="${D}" install-sapi || die "Unable to install ${x} SAPI" + php5_2-sapi_install_ini + ;; apache2) einfo "Installing Apache${APACHE_VERSION} SAPI" make INSTALL_ROOT="${D}" install-sapi || die "Unable to install ${x} SAPI"