summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Longinotti <chtekk@gentoo.org>2007-03-05 01:50:47 +0000
committerLuca Longinotti <chtekk@gentoo.org>2007-03-05 01:50:47 +0000
commit94fed447c2fbec3ccb7ecba38a7431b9e9b48de5 (patch)
tree4b87f93787b23c3581cd9290855b2cdc70da0b61 /eclass/php-pear-r1.eclass
parentFix compile on 5.2. (diff)
downloadhistorical-94fed447c2fbec3ccb7ecba38a7431b9e9b48de5.tar.gz
historical-94fed447c2fbec3ccb7ecba38a7431b9e9b48de5.tar.bz2
historical-94fed447c2fbec3ccb7ecba38a7431b9e9b48de5.zip
New updated PHP eclasses, fix lots of bugs, introduce PHP 5.2 support.
Diffstat (limited to 'eclass/php-pear-r1.eclass')
-rw-r--r--eclass/php-pear-r1.eclass55
1 files changed, 25 insertions, 30 deletions
diff --git a/eclass/php-pear-r1.eclass b/eclass/php-pear-r1.eclass
index 9f9d742ee9c9..552b5516f280 100644
--- a/eclass/php-pear-r1.eclass
+++ b/eclass/php-pear-r1.eclass
@@ -1,41 +1,40 @@
-# 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-pear-r1.eclass,v 1.13 2006/03/10 10:47:49 sebastian Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/php-pear-r1.eclass,v 1.14 2007/03/05 01:50:47 chtekk Exp $
#
# Author: Tal Peer <coredumb@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-pear-r1 eclass provides means for an easy installation of PEAR
-# packages, see http://pear.php.net
+# packages, see http://pear.php.net/
# Note that this eclass doesn't handle PEAR packages' dependencies on
-# purpose, please use (R)DEPEND to define them.
+# purpose, please use (R)DEPEND to define them correctly!
EXPORT_FUNCTIONS src_install
-# Set this is the the package name on PEAR is different than the one in
-# portage (generally shouldn't be the case).
-[ -z "${PHP_PEAR_PKG_NAME}" ] && PHP_PEAR_PKG_NAME=${PN/PEAR-/}
+DEPEND="dev-lang/php >=dev-php/PEAR-PEAR-1.4.6"
+RDEPEND="${DEPEND}"
-# We must depend on the base package as we need it to do
-# install tasks (it provides the pear binary).
-DEPEND="${DEPEND} dev-lang/php >=dev-php/PEAR-PEAR-1.3.6"
-RDEPEND="${RDEPEND} ${DEPEND}"
+# Set this if the the PEAR package name is different than the one in
+# Portage (generally shouldn't be the case).
+[[ -z "${PHP_PEAR_PKG_NAME}" ]] && PHP_PEAR_PKG_NAME="${PN/PEAR-/}"
fix_PEAR_PV() {
- tmp=${PV}
- tmp=${tmp/_/}
- tmp=${tmp/rc/RC}
- tmp=${tmp/beta/b}
- PEAR_PV=${tmp}
+ tmp="${PV}"
+ tmp="${tmp/_/}"
+ tmp="${tmp/rc/RC}"
+ tmp="${tmp/beta/b}"
+ PEAR_PV="${tmp}"
}
PEAR_PV=""
fix_PEAR_PV
-PEAR_PN=${PHP_PEAR_PKG_NAME}-${PEAR_PV}
+PEAR_PN="${PHP_PEAR_PKG_NAME}-${PEAR_PV}"
-[ -z "${SRC_URI}" ] && SRC_URI="http://pear.php.net/get/${PEAR_PN}.tgz"
-[ -z "${HOMEPAGE}" ] && HOMEPAGE="http://pear.php.net/${PHP_PEAR_PKG_NAME}"
+[[ -z "${SRC_URI}" ]] && SRC_URI="http://pear.php.net/get/${PEAR_PN}.tgz"
+[[ -z "${HOMEPAGE}" ]] && HOMEPAGE="http://pear.php.net/${PHP_PEAR_PKG_NAME}"
S="${WORKDIR}/${PEAR_PN}"
@@ -53,23 +52,19 @@ php-pear-r1_src_install() {
fi ;;
dev-php4) PHP_BIN="/usr/lib/php4/bin/php" ;;
dev-php5) PHP_BIN="/usr/lib/php5/bin/php" ;;
- *) die "I don't know which version of PHP packages in ${CATEGORY} require"
+ *) die "Version of PHP required by packages in category ${CATEGORY} unknown"
esac
cd "${S}"
- mv "${WORKDIR}/package.xml" "${S}"
+ mv -f "${WORKDIR}/package.xml" "${S}"
- if has_version '=dev-php/PEAR-PEAR-1.3*' ; then
- pear -d php_bin="${PHP_BIN}" install --nodeps --installroot="${D}" "${S}/package.xml" > /dev/null || die "Unable to install PEAR package"
+ if has_version '>=dev-php/PEAR-PEAR-1.4.8' ; then
+ pear -d php_bin="${PHP_BIN}" install --force --loose --nodeps --offline --packagingroot="${D}" "${S}/package.xml" > /dev/null || die "Unable to install PEAR package"
else
- if has_version '>=dev-php/PEAR-PEAR-1.4.8' ; then
- pear -d php_bin="${PHP_BIN}" install --force --loose --nodeps --offline --packagingroot="${D}" "${S}/package.xml" > /dev/null || die "Unable to install PEAR package"
- else
- pear -d php_bin="${PHP_BIN}" install --nodeps --packagingroot="${D}" "${S}/package.xml" > /dev/null || die "Unable to install PEAR package"
- fi
+ pear -d php_bin="${PHP_BIN}" install --nodeps --packagingroot="${D}" "${S}/package.xml" > /dev/null || die "Unable to install PEAR package"
fi
- rm -rf "${D}/usr/share/php/.channels" \
+ rm -Rf "${D}/usr/share/php/.channels" \
"${D}/usr/share/php/.depdblock" \
"${D}/usr/share/php/.depdb" \
"${D}/usr/share/php/.filemap" \