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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (hide annotations) (download)
Mon Aug 27 11:15:19 2007 UTC (6 years, 10 months ago) by jokey
Branch: MAIN
Changes since 1.15: +4 -3 lines
Fix for beta/rc versions in SRC_URI

1 chtekk 1.14 # Copyright 1999-2007 Gentoo Foundation
2 stuart 1.1 # Distributed under the terms of the GNU General Public License v2
3 jokey 1.16 # $Header: /var/cvsroot/gentoo-x86/eclass/php-pear-r1.eclass,v 1.15 2007/03/22 20:12:56 chtekk Exp $
4 stuart 1.1 #
5     # Author: Tal Peer <coredumb@gentoo.org>
6 chtekk 1.14 # Author: Luca Longinotti <chtekk@gentoo.org>
7     # Maintained by the PHP Team <php-bugs@gentoo.org>
8 stuart 1.1 #
9 chtekk 1.7 # The php-pear-r1 eclass provides means for an easy installation of PEAR
10 chtekk 1.14 # packages, see http://pear.php.net/
11 stuart 1.1
12     # Note that this eclass doesn't handle PEAR packages' dependencies on
13 chtekk 1.14 # purpose, please use (R)DEPEND to define them correctly!
14 stuart 1.1
15     EXPORT_FUNCTIONS src_install
16    
17 chtekk 1.14 DEPEND="dev-lang/php >=dev-php/PEAR-PEAR-1.4.6"
18     RDEPEND="${DEPEND}"
19    
20     # Set this if the the PEAR package name is different than the one in
21     # Portage (generally shouldn't be the case).
22     [[ -z "${PHP_PEAR_PKG_NAME}" ]] && PHP_PEAR_PKG_NAME="${PN/PEAR-/}"
23 stuart 1.1
24     fix_PEAR_PV() {
25 chtekk 1.14 tmp="${PV}"
26     tmp="${tmp/_/}"
27     tmp="${tmp/rc/RC}"
28     tmp="${tmp/beta/b}"
29     PEAR_PV="${tmp}"
30 stuart 1.1 }
31    
32 jokey 1.16 # Set PEAR_PV in ebuilds if the PV mangling for beta/rc versions breaks SRC_URI
33     [[ -z "${PEAR_PV}" ]] && fix_PEAR_PV
34    
35 chtekk 1.14 PEAR_PN="${PHP_PEAR_PKG_NAME}-${PEAR_PV}"
36 stuart 1.1
37 chtekk 1.14 [[ -z "${SRC_URI}" ]] && SRC_URI="http://pear.php.net/get/${PEAR_PN}.tgz"
38     [[ -z "${HOMEPAGE}" ]] && HOMEPAGE="http://pear.php.net/${PHP_PEAR_PKG_NAME}"
39 chtekk 1.7
40 stuart 1.1 S="${WORKDIR}/${PEAR_PN}"
41    
42 beu 1.3 php-pear-r1_src_install() {
43 chtekk 1.6 # SNMP support
44 stuart 1.1 addpredict /usr/share/snmp/mibs/.index
45     addpredict /var/lib/net-snmp/
46 chtekk 1.15 addpredict /session_mm_cli0.sem
47 stuart 1.1
48 sebastian 1.8 case "${CATEGORY}" in
49     dev-php)
50     if has_version '=dev-lang/php-5*' ; then
51     PHP_BIN="/usr/lib/php5/bin/php"
52     else
53     PHP_BIN="/usr/lib/php4/bin/php"
54     fi ;;
55     dev-php4) PHP_BIN="/usr/lib/php4/bin/php" ;;
56     dev-php5) PHP_BIN="/usr/lib/php5/bin/php" ;;
57 chtekk 1.14 *) die "Version of PHP required by packages in category ${CATEGORY} unknown"
58 sebastian 1.8 esac
59    
60 chtekk 1.6 cd "${S}"
61 chtekk 1.14 mv -f "${WORKDIR}/package.xml" "${S}"
62 sebastian 1.13
63 chtekk 1.14 if has_version '>=dev-php/PEAR-PEAR-1.4.8' ; then
64     pear -d php_bin="${PHP_BIN}" install --force --loose --nodeps --offline --packagingroot="${D}" "${S}/package.xml" > /dev/null || die "Unable to install PEAR package"
65 sebastian 1.10 else
66 chtekk 1.14 pear -d php_bin="${PHP_BIN}" install --nodeps --packagingroot="${D}" "${S}/package.xml" > /dev/null || die "Unable to install PEAR package"
67 sebastian 1.10 fi
68 sebastian 1.13
69 chtekk 1.14 rm -Rf "${D}/usr/share/php/.channels" \
70 sebastian 1.10 "${D}/usr/share/php/.depdblock" \
71     "${D}/usr/share/php/.depdb" \
72     "${D}/usr/share/php/.filemap" \
73 sebastian 1.9 "${D}/usr/share/php/.lock" \
74     "${D}/usr/share/php/.registry"
75 stuart 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20