/[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.15 - (show annotations) (download)
Thu Mar 22 20:12:56 2007 UTC (8 years, 3 months ago) by chtekk
Branch: MAIN
Changes since 1.14: +2 -1 lines
Fix shmem session unlink bug.

1 # Copyright 1999-2007 Gentoo Foundation
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.14 2007/03/05 01:50:47 chtekk Exp $
4 #
5 # Author: Tal Peer <coredumb@gentoo.org>
6 # Author: Luca Longinotti <chtekk@gentoo.org>
7 # Maintained by the PHP Team <php-bugs@gentoo.org>
8 #
9 # The php-pear-r1 eclass provides means for an easy installation of PEAR
10 # packages, see http://pear.php.net/
11
12 # Note that this eclass doesn't handle PEAR packages' dependencies on
13 # purpose, please use (R)DEPEND to define them correctly!
14
15 EXPORT_FUNCTIONS src_install
16
17 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
24 fix_PEAR_PV() {
25 tmp="${PV}"
26 tmp="${tmp/_/}"
27 tmp="${tmp/rc/RC}"
28 tmp="${tmp/beta/b}"
29 PEAR_PV="${tmp}"
30 }
31
32 PEAR_PV=""
33 fix_PEAR_PV
34 PEAR_PN="${PHP_PEAR_PKG_NAME}-${PEAR_PV}"
35
36 [[ -z "${SRC_URI}" ]] && SRC_URI="http://pear.php.net/get/${PEAR_PN}.tgz"
37 [[ -z "${HOMEPAGE}" ]] && HOMEPAGE="http://pear.php.net/${PHP_PEAR_PKG_NAME}"
38
39 S="${WORKDIR}/${PEAR_PN}"
40
41 php-pear-r1_src_install() {
42 # SNMP support
43 addpredict /usr/share/snmp/mibs/.index
44 addpredict /var/lib/net-snmp/
45 addpredict /session_mm_cli0.sem
46
47 case "${CATEGORY}" in
48 dev-php)
49 if has_version '=dev-lang/php-5*' ; then
50 PHP_BIN="/usr/lib/php5/bin/php"
51 else
52 PHP_BIN="/usr/lib/php4/bin/php"
53 fi ;;
54 dev-php4) PHP_BIN="/usr/lib/php4/bin/php" ;;
55 dev-php5) PHP_BIN="/usr/lib/php5/bin/php" ;;
56 *) die "Version of PHP required by packages in category ${CATEGORY} unknown"
57 esac
58
59 cd "${S}"
60 mv -f "${WORKDIR}/package.xml" "${S}"
61
62 if has_version '>=dev-php/PEAR-PEAR-1.4.8' ; then
63 pear -d php_bin="${PHP_BIN}" install --force --loose --nodeps --offline --packagingroot="${D}" "${S}/package.xml" > /dev/null || die "Unable to install PEAR package"
64 else
65 pear -d php_bin="${PHP_BIN}" install --nodeps --packagingroot="${D}" "${S}/package.xml" > /dev/null || die "Unable to install PEAR package"
66 fi
67
68 rm -Rf "${D}/usr/share/php/.channels" \
69 "${D}/usr/share/php/.depdblock" \
70 "${D}/usr/share/php/.depdb" \
71 "${D}/usr/share/php/.filemap" \
72 "${D}/usr/share/php/.lock" \
73 "${D}/usr/share/php/.registry"
74 }

  ViewVC Help
Powered by ViewVC 1.1.20