diff options
author | Luca Longinotti <chtekk@gentoo.org> | 2006-07-14 16:02:36 +0000 |
---|---|---|
committer | Luca Longinotti <chtekk@gentoo.org> | 2006-07-14 16:02:36 +0000 |
commit | a0a6615cd04216256d2f49b7c3f669ff5ed5ff58 (patch) | |
tree | af56a54ac3e686e735483bde275c0c97af1d003e /eclass/php-ext-source-r1.eclass | |
parent | ppc stable, bug #139612 (diff) | |
download | historical-a0a6615cd04216256d2f49b7c3f669ff5ed5ff58.tar.gz historical-a0a6615cd04216256d2f49b7c3f669ff5ed5ff58.tar.bz2 historical-a0a6615cd04216256d2f49b7c3f669ff5ed5ff58.zip |
Update PHP eclasses, better ebuild/eclass separation, accomodate for new features.
Diffstat (limited to 'eclass/php-ext-source-r1.eclass')
-rw-r--r-- | eclass/php-ext-source-r1.eclass | 60 |
1 files changed, 48 insertions, 12 deletions
diff --git a/eclass/php-ext-source-r1.eclass b/eclass/php-ext-source-r1.eclass index 894715ff26a7..b9cc9b3d4f33 100644 --- a/eclass/php-ext-source-r1.eclass +++ b/eclass/php-ext-source-r1.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r1.eclass,v 1.4 2005/11/20 01:35:05 chtekk Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r1.eclass,v 1.5 2006/07/14 16:02:36 chtekk Exp $ # # Author: Tal Peer <coredumb@gentoo.org> # Author: Stuart Herbert <stuart@gentoo.org> @@ -13,7 +13,7 @@ # # inherit php-ext-source-r1 -inherit php-ext-base-r1 +inherit php-ext-base-r1 flag-o-matic EXPORT_FUNCTIONS src_compile src_install @@ -25,8 +25,7 @@ EXPORT_FUNCTIONS src_compile src_install # ---end ebuild configurable settings -DEPEND="${DEPEND} - >=sys-devel/m4-1.4.3 +DEPEND=">=sys-devel/m4-1.4.3 >=sys-devel/libtool-1.5.18 >=sys-devel/automake-1.9.6 sys-devel/automake-wrapper @@ -34,22 +33,59 @@ DEPEND="${DEPEND} sys-devel/autoconf-wrapper" php-ext-source-r1_src_compile() { - # pull in the PHP settings + # Pull in the PHP settings has_php + cd "${S}" my_conf="${my_conf} --prefix=${PHPPREFIX} --with-php-config=${PHPCONFIG}" addpredict /usr/share/snmp/mibs/.index - # phpize creates configure out of config.m4 - export WANT_AUTOMAKE=1.9 WANT_AUTOCONF=2.5 + + # Create configure out of config.m4 ${PHPIZE} + + # Set needed automake/autoconf versions + export WANT_AUTOMAKE=1.9 WANT_AUTOCONF=2.5 + + # Concurrent PHP Apache2 modules support + if built_with_use =${PHP_PKG} apache2 || phpconfutils_built_with_use =${PHP_PKG} apache2 ; then + if built_with_use =${PHP_PKG} concurrentmodphp || phpconfutils_built_with_use =${PHP_PKG} concurrentmodphp ; then + append-ldflags "-Wl,--version-script=${ROOT}/var/lib/php-pkg/${PHP_PKG}/php${PHP_VERSION}-ldvs" + fi + fi + + # First compile run: the default ./configure ${my_conf} || die "Unable to configure code to compile" emake || die "Unable to make code" + mv -f "modules/${PHP_EXT_NAME}.so" "${WORKDIR}/${PHP_EXT_NAME}-default.so" || die "Unable to move extension" + + # Concurrent PHP Apache2 modules support + if built_with_use =${PHP_PKG} apache2 || phpconfutils_built_with_use =${PHP_PKG} apache2 ; then + if built_with_use =${PHP_PKG} concurrentmodphp || phpconfutils_built_with_use =${PHP_PKG} concurrentmodphp ; then + # First let's clean up + make distclean || die "Unable to clean build environment" + + # Second compile run: the versioned one + append-ldflags "-Wl,--allow-shlib-undefined -L/usr/$(get_libdir)/apache2/modules/ -lphp${PHP_VERSION}" + ./configure ${my_conf} || die "Unable to configure code to compile" + emake || die "Unable to make code" + mv -f "modules/${PHP_EXT_NAME}.so" "${WORKDIR}/${PHP_EXT_NAME}-versioned.so" || die "Unable to move extension" + fi + fi } php-ext-source-r1_src_install() { has_php - addpredict /usr/share/snmp/mibs/.index - chmod +x build/shtool - insinto ${EXT_DIR} - doins modules/${PHP_EXT_NAME}.so + + # Let's put the default module away + insinto "${EXT_DIR}" + newins "${WORKDIR}/${PHP_EXT_NAME}-default.so" "${PHP_EXT_NAME}.so" + + # And now the versioned one + if built_with_use =${PHP_PKG} apache2 || phpconfutils_built_with_use =${PHP_PKG} apache2 ; then + if built_with_use =${PHP_PKG} concurrentmodphp || phpconfutils_built_with_use =${PHP_PKG} concurrentmodphp ; then + insinto "${EXT_DIR}-versioned" + newins "${WORKDIR}/${PHP_EXT_NAME}-versioned.so" "${PHP_EXT_NAME}.so" + fi + fi + php-ext-base-r1_src_install } |