/[gentoo-x86]/eclass/php-pear-r1.eclass
Gentoo

Diff of /eclass/php-pear-r1.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.19 Revision 1.20
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/php-pear-r1.eclass,v 1.19 2007/11/08 16:07:22 jokey Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/php-pear-r1.eclass,v 1.20 2008/02/11 20:47:35 armin76 Exp $
4# 4#
5# Author: Tal Peer <coredumb@gentoo.org> 5# Author: Tal Peer <coredumb@gentoo.org>
6# Author: Luca Longinotti <chtekk@gentoo.org> 6# Author: Luca Longinotti <chtekk@gentoo.org>
7 7
8# @ECLASS: php-pear-r1.eclass 8# @ECLASS: php-pear-r1.eclass
13# This eclass provides means for an easy installation of PEAR packages. 13# This eclass provides means for an easy installation of PEAR packages.
14# For more information on PEAR, see http://pear.php.net/ 14# For more information on PEAR, see http://pear.php.net/
15# Note that this eclass doesn't handle dependencies of PEAR packages 15# Note that this eclass doesn't handle dependencies of PEAR packages
16# on purpose; please use (R)DEPEND to define them correctly! 16# on purpose; please use (R)DEPEND to define them correctly!
17 17
18inherit multilib
19
18EXPORT_FUNCTIONS src_install 20EXPORT_FUNCTIONS src_install
19 21
20DEPEND="dev-lang/php >=dev-php/PEAR-PEAR-1.4.8" 22DEPEND="dev-lang/php >=dev-php/PEAR-PEAR-1.6.1"
21RDEPEND="${DEPEND}" 23RDEPEND="${DEPEND}"
22 24
23# @ECLASS-VARIABLE: PHP_PEAR_PKG_NAME 25# @ECLASS-VARIABLE: PHP_PEAR_PKG_NAME
24# @DESCRIPTION: 26# @DESCRIPTION:
25# Set this if the the PEAR package name differs from ${PN/PEAR-/} 27# Set this if the the PEAR package name differs from ${PN/PEAR-/}
57 addpredict /session_mm_cli0.sem 59 addpredict /session_mm_cli0.sem
58 60
59 case "${CATEGORY}" in 61 case "${CATEGORY}" in
60 dev-php) 62 dev-php)
61 if has_version '=dev-lang/php-5*' ; then 63 if has_version '=dev-lang/php-5*' ; then
62 PHP_BIN="/usr/lib/php5/bin/php" 64 PHP_BIN="/usr/$(get_libdir)/php5/bin/php"
63 else 65 else
64 PHP_BIN="/usr/lib/php4/bin/php" 66 PHP_BIN="/usr/$(get_libdir)/php4/bin/php"
65 fi ;; 67 fi ;;
66 dev-php4) PHP_BIN="/usr/lib/php4/bin/php" ;; 68 dev-php4) PHP_BIN="/usr/$(get_libdir)/php4/bin/php" ;;
67 dev-php5) PHP_BIN="/usr/lib/php5/bin/php" ;; 69 dev-php5) PHP_BIN="/usr/$(get_libdir)/php5/bin/php" ;;
68 *) die "Version of PHP required by packages in category ${CATEGORY} unknown" 70 *) die "Version of PHP required by packages in category ${CATEGORY} unknown"
69 esac 71 esac
70 72
71 cd "${S}" 73 cd "${S}"
74
75 if [[ -f "${WORKDIR}"/package2.xml ]] ; then
72 mv -f "${WORKDIR}/package.xml" "${S}" 76 mv -f "${WORKDIR}/package2.xml" "${S}"
73 77 pear -d php_bin="${PHP_BIN}" install --force --loose --nodeps --offline --packagingroot="${D}" \
74 if [[ -f "${S}"/package2.xml ]] ; then 78 "${S}/package2.xml" || die "Unable to install PEAR package"
75 pear -d php_bin="${PHP_BIN}" install --force --loose --nodeps --offline --packagingroot="${D}" "${S}/package2.xml" > /dev/null || die "Unable to install PEAR package"
76 else 79 else
77 pear -d php_bin="${PHP_BIN}" install --force --loose --nodeps --offline --packagingroot="${D}" "${S}/package.xml" > /dev/null || die "Unable to install PEAR package" 80 mv -f "${WORKDIR}/package.xml" "${S}"
81 pear -d php_bin="${PHP_BIN}" install --force --loose --nodeps --offline --packagingroot="${D}" \
82 "${S}/package.xml" || die "Unable to install PEAR package"
78 fi 83 fi
79 84
80 rm -Rf "${D}/usr/share/php/.channels" \ 85 rm -Rf "${D}/usr/share/php/.channels" \
81 "${D}/usr/share/php/.depdblock" \ 86 "${D}/usr/share/php/.depdblock" \
82 "${D}/usr/share/php/.depdb" \ 87 "${D}/usr/share/php/.depdb" \

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.20