diff options
author | Luca Longinotti <chtekk@gentoo.org> | 2007-03-05 01:50:47 +0000 |
---|---|---|
committer | Luca Longinotti <chtekk@gentoo.org> | 2007-03-05 01:50:47 +0000 |
commit | 3866af48f35422b30b80deefcf0de589c569ddf7 (patch) | |
tree | b543212474a6c4d3d0c296fcc01716ecd5e14711 /eclass/php-ext-base-r1.eclass | |
parent | Fix compile on 5.2. (diff) | |
download | gentoo-2-3866af48f35422b30b80deefcf0de589c569ddf7.tar.gz gentoo-2-3866af48f35422b30b80deefcf0de589c569ddf7.tar.bz2 gentoo-2-3866af48f35422b30b80deefcf0de589c569ddf7.zip |
New updated PHP eclasses, fix lots of bugs, introduce PHP 5.2 support.
Diffstat (limited to 'eclass/php-ext-base-r1.eclass')
-rw-r--r-- | eclass/php-ext-base-r1.eclass | 97 |
1 files changed, 51 insertions, 46 deletions
diff --git a/eclass/php-ext-base-r1.eclass b/eclass/php-ext-base-r1.eclass index c0bb1221784d..52ac269da525 100644 --- a/eclass/php-ext-base-r1.eclass +++ b/eclass/php-ext-base-r1.eclass @@ -1,10 +1,11 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-base-r1.eclass,v 1.5 2007/02/02 19:09:33 chtekk Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-base-r1.eclass,v 1.6 2007/03/05 01:50:47 chtekk Exp $ # # Author: Tal Peer <coredumb@gentoo.org> # Author: Stuart Herbert <stuart@gentoo.org> -# Maintained by the PHP Herd <php-bugs@gentoo.org> +# Author: Luca Longinotti <chtekk@gentoo.org> +# Maintained by the PHP Team <php-bugs@gentoo.org> # # The php-ext-base-r1 eclass provides a unified interface for adding standalone # PHP extensions ('modules') to the php.ini files on your system. @@ -16,72 +17,78 @@ inherit depend.php EXPORT_FUNCTIONS src_install -# ---begin ebuild configurable settings +# The extension name, this must be set, otherwise we die +[[ -z "${PHP_EXT_NAME}" ]] && die "No module name specified for the php-ext-base-r1 eclass" -# The extension name, this must be set, otherwise we die. -[ -z "${PHP_EXT_NAME}" ] && die "No module name specified for the php-ext eclass." - -# Wether the extensions is a Zend Engine extension -#(defaults to "no" and if you don't know what is it, you don't need it.) -[ -z "${PHP_EXT_ZENDEXT}" ] && PHP_EXT_ZENDEXT="no" - -# Wether or not to add a line in the php.ini for the extension +# Wether or not to add a line to php.ini for the extension # (defaults to "yes" and shouldn't be changed in most cases) -[ -z "${PHP_EXT_INI}" ] && PHP_EXT_INI="yes" +[[ -z "${PHP_EXT_INI}" ]] && PHP_EXT_INI="yes" -# ---end ebuild configurable settings - -DEPEND="${DEPEND} - >=sys-devel/m4-1.4.3 - >=sys-devel/libtool-1.5.18 - >=sys-devel/automake-1.9.6 - sys-devel/automake-wrapper - >=sys-devel/autoconf-2.59 - sys-devel/autoconf-wrapper" +# Wether the extension is a ZendEngine extension or not +# (defaults to "no" and if you don't know what is it, you don't need it) +[[ -z "${PHP_EXT_ZENDEXT}" ]] && PHP_EXT_ZENDEXT="no" php-ext-base-r1_buildinilist() { - # work out the list of .ini files to edit/add to - if [ -z "${PHPSAPILIST}" ]; then + # Work out the list of <ext>.ini files to edit/add to + if [[ -z "${PHPSAPILIST}" ]] ; then PHPSAPILIST="apache1 apache2 cli cgi" fi - PHPINIFILELIST= + PHPINIFILELIST="" for x in ${PHPSAPILIST} ; do - if [ -f /etc/php/${x}-php${PHP_VERSION}/php.ini ]; then + if [[ -f "/etc/php/${x}-php${PHP_VERSION}/php.ini" ]] ; then PHPINIFILELIST="${PHPINIFILELIST} etc/php/${x}-php${PHP_VERSION}/ext/${PHP_EXT_NAME}.ini" fi done } php-ext-base-r1_src_install() { + # Pull in the PHP settings has_php addpredict /usr/share/snmp/mibs/.index + + # Build the list of <ext>.ini files to edit/add to php-ext-base-r1_buildinilist - if [ "${PHP_EXT_INI}" = "yes" ] ; then + + # Add the needed lines to the <ext>.ini files + if [[ "${PHP_EXT_INI}" = "yes" ]] ; then php-ext-base-r1_addextension "${PHP_EXT_NAME}.so" fi + + # Symlink the <ext>.ini files from ext/ to ext-active/ for inifile in ${PHPINIFILELIST} ; do - inidir=${inifile/${PHP_EXT_NAME}.ini/} - inidir=${inidir/ext/ext-active} + inidir="${inifile/${PHP_EXT_NAME}.ini/}" + inidir="${inidir/ext/ext-active}" dodir "/${inidir}" dosym "/${inifile}" "/${inifile/ext/ext-active}" done - # add support for installing php files into a version dependant directory + + # Add support for installing PHP files into a version dependant directory PHP_EXT_SHARED_DIR="/usr/share/${PHP_SHARED_CAT}/${PHP_EXT_NAME}" } php-ext-base-r1_addextension() { - if [ "${PHP_EXT_ZENDEXT}" = "yes" ] ; then + if [[ "${PHP_EXT_ZENDEXT}" = "yes" ]] ; then + # We need the full path for ZendEngine extensions + # and we need to check for debugging enabled! if has_zts ; then - ext_type="zend_extension_ts" + if has_debug ; then + ext_type="zend_extension_debug_ts" + else + ext_type="zend_extension_ts" + fi ext_file="${EXT_DIR}/$1" else - ext_type="zend_extension" + if has_debug ; then + ext_type="zend_extension_debug" + else + ext_type="zend_extension" + fi ext_file="${EXT_DIR}/$1" fi else - # we do *not* add the full path for the extension! + # We don't need the full path for normal extensions! ext_type="extension" ext_file="$1" fi @@ -89,35 +96,33 @@ php-ext-base-r1_addextension() { php-ext-base-r1_addtoinifiles "${ext_type}" "${ext_file}" "Extension added" } -# $1 - setting name -# $2 - setting value -# $3 - file to add to -# $4 - sanitised text to output +# $1 - Setting name +# $2 - Setting value +# $3 - File to add to +# $4 - Sanitized text to output php-ext-base-r1_addtoinifile() { - if [[ ! -d `dirname $3` ]]; then + if [[ ! -d `dirname $3` ]] ; then mkdir -p `dirname $3` fi - # are we adding the name of a section? + # Are we adding the name of a section? if [[ ${1:0:1} == "[" ]] ; then - echo "$1" >> $3 + echo "$1" >> "$3" my_added="$1" else - echo "$1=$2" >> $3 + echo "$1=$2" >> "$3" my_added="$1=$2" fi - if [ -z "$4" ]; then + if [[ -z "$4" ]] ; then einfo "Added '$my_added' to /$3" else einfo "$4 to /$3" fi - # yes, this is inefficient - but it works every time ;-) - insinto /`dirname $3` - doins $3 + doins "$3" } php-ext-base-r1_addtoinifiles() { |