--- eclass/php-ext-source-r2.eclass 2011/08/29 01:28:10 1.16 +++ eclass/php-ext-source-r2.eclass 2012/06/22 20:05:24 1.27 @@ -1,6 +1,6 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r2.eclass,v 1.16 2011/08/29 01:28:10 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r2.eclass,v 1.27 2012/06/22 20:05:24 olemarkus Exp $ # @ECLASS: php-ext-source-r2.eclass # @MAINTAINER: @@ -16,24 +16,17 @@ # This eclass provides a unified interface for compiling and installing standalone # PHP extensions (modules). -inherit flag-o-matic autotools +inherit flag-o-matic autotools multilib EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install -# @ECLASS-VARIABLE: PHP_EXT_NAME -# @DESCRIPTION: -# The extension name. This must be set, otherwise the eclass dies. -# Only automagically set by php-ext-pecl-r1.eclass, so unless your ebuild -# inherits that eclass, you must set this manually before inherit. -[[ -z "${PHP_EXT_NAME}" ]] && die "No module name specified for the php-ext-source-r2 eclass" - DEPEND=">=sys-devel/m4-1.4.3 >=sys-devel/libtool-1.5.18" RDEPEND="" # Because of USE deps, we require at least EAPI 2 case ${EAPI} in - 2|3) ;; + 2|3|4) ;; *) die "php-ext-source-r2 is not compatible with EAPI=${EAPI}" esac @@ -60,7 +53,7 @@ # @ECLASS-VARIABLE: USE_PHP # @DESCRIPTION: # Lists the PHP slots compatibile the extension is compatibile with -[[ -z "${USE_PHP}" ]] && USE_PHP="php5-3 php5-2" +[[ -z "${USE_PHP}" ]] && USE_PHP="php5-3" # @ECLASS-VARIABLE: PHP_EXT_OPTIONAL_USE # @DESCRIPTION: @@ -92,6 +85,11 @@ ${PHPDEPEND} ${PHP_EXT_OPTIONAL_USE:+ )}" +DEPEND="${DEPEND} + ${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( } + ${PHPDEPEND} + ${PHP_EXT_OPTIONAL_USE:+ )} +" # @FUNCTION: php-ext-source-r2_src_unpack # @DESCRIPTION: @@ -106,7 +104,7 @@ unpack ${A} local slot orig_s="${PHP_EXT_S}" for slot in $(php_get_slots); do - cp -r "${orig_s}" "${WORKDIR}/${slot}" + cp -r "${orig_s}" "${WORKDIR}/${slot}" || die "Failed to copy source ${orig_s} to PHP target directory" done } @@ -142,6 +140,9 @@ # @DESCRIPTION: # Set this in the ebuild to pass configure options to econf. php-ext-source-r2_src_configure() { + # net-snmp creates this file #385403 + addpredict /usr/share/snmp/mibs/.index + local slot for slot in $(php_get_slots); do php_init_slot_env ${slot} @@ -220,7 +221,7 @@ php-ext-source-r2_buildinilist() { # Work out the list of .ini files to edit/add to if [[ -z "${PHPSAPILIST}" ]] ; then - PHPSAPILIST="apache2 cli cgi fpm" + PHPSAPILIST="apache2 cli cgi fpm embed" fi PHPINIFILELIST=""