/[gentoo-x86]/eclass/php-ext-pecl-r1.eclass
Gentoo

Diff of /eclass/php-ext-pecl-r1.eclass

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

Revision 1.5 Revision 1.10
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/Attic/php-ext-pecl-r1.eclass,v 1.5 2007/03/05 01:50:47 chtekk Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/php-ext-pecl-r1.eclass,v 1.10 2007/10/22 22:54:19 jokey 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# Author: Jakub Moc <jakub@gentoo.org>
8
9# @ECLASS: php-ext-pecl-r1.eclass
10# @MAINTAINER:
7# Maintained by the PHP Team <php-bugs@gentoo.org> 11# Gentoo PHP team <php-bugs@gentoo.org>
12# @BLURB: A uniform way of installing PECL extensions
13# @DESCRIPTION:
14# This eclass should be used by all dev-php[45]/pecl-* ebuilds
15# as a uniform way of installing PECL extensions.
16# For more information about PECL, see http://pecl.php.net/
17
18# @ECLASS-VARIABLE: PHP_EXT_PECL_PKG
19# @DESCRIPTION:
20# Set in ebuild before inheriting this eclass if the tarball name
21# differs from ${PN/pecl-/} so that SRC_URI and HOMEPAGE gets set
22# correctly by the eclass.
8# 23#
9# This eclass should be used by all dev-php[4,5]/pecl-* ebuilds, as a uniform way of installing PECL extensions. 24# Setting this variable manually also affects PHP_EXT_NAME and ${S}
10# For more information about PECL, see http://pecl.php.net/ 25# unless you override those in ebuild. Also see PHP_EXT_PECL_FILENAME
26# if this is not desired for whatever reason.
27
28# @ECLASS-VARIABLE: PHP_EXT_PECL_FILENAME
29# @DESCRIPTION:
30# Set in ebuild before inheriting this eclass if the tarball name
31# differs from ${PN/pecl-/} so that SRC_URI gets set correctly by
32# the eclass.
33#
34# Unlike PHP_EXT_PECL_PKG, setting this variable does not affect
35# HOMEPAGE, PHP_EXT_NAME or ${S}.
36
11 37
12[[ -z "${PHP_EXT_PECL_PKG}" ]] && PHP_EXT_PECL_PKG="${PN/pecl-/}" 38[[ -z "${PHP_EXT_PECL_PKG}" ]] && PHP_EXT_PECL_PKG="${PN/pecl-/}"
13 39
14PECL_PKG="${PHP_EXT_PECL_PKG}" 40PECL_PKG="${PHP_EXT_PECL_PKG}"
15MY_PV="${PV/_/}" 41MY_PV="${PV/_/}"
19 45
20inherit php-ext-source-r1 depend.php 46inherit php-ext-source-r1 depend.php
21 47
22EXPORT_FUNCTIONS src_compile src_install 48EXPORT_FUNCTIONS src_compile src_install
23 49
24# Needs to be set if the filename differs from the package name
25if [[ -n "${PHP_EXT_PECL_FILENAME}" ]] ; then 50if [[ -n "${PHP_EXT_PECL_FILENAME}" ]] ; then
26 FILENAME="${PHP_EXT_PECL_FILENAME}-${MY_PV}.tgz" 51 FILENAME="${PHP_EXT_PECL_FILENAME}-${MY_PV}.tgz"
27else 52else
28 FILENAME="${PECL_PKG_V}.tgz" 53 FILENAME="${PECL_PKG_V}.tgz"
29fi 54fi
31SRC_URI="http://pecl.php.net/get/${FILENAME}" 56SRC_URI="http://pecl.php.net/get/${FILENAME}"
32HOMEPAGE="http://pecl.php.net/${PECL_PKG}" 57HOMEPAGE="http://pecl.php.net/${PECL_PKG}"
33 58
34S="${WORKDIR}/${PECL_PKG_V}" 59S="${WORKDIR}/${PECL_PKG_V}"
35 60
61# @FUNCTION: php-ext-pecl-r1_src_compile
62# @DESCRIPTION:
63# Takes care of standard compile for PECL packages.
36php-ext-pecl-r1_src_compile() { 64php-ext-pecl-r1_src_compile() {
37 has_php 65 has_php
38 php-ext-source-r1_src_compile 66 php-ext-source-r1_src_compile
39} 67}
40 68
69# @FUNCTION: php-ext-pecl-r1_src_install
70# @DESCRIPTION:
71# Takes care of standard install for PECL packages.
72# You can also simply add examples to IUSE to automagically install
73# examples supplied with the package.
74
75# @VARIABLE: DOCS
76# @DESCRIPTION:
77# Set in ebuild if you wish to install additional, package-specific documentation.
41php-ext-pecl-r1_src_install() { 78php-ext-pecl-r1_src_install() {
42 has_php 79 has_php
43 php-ext-source-r1_src_install 80 php-ext-source-r1_src_install
44 81
45 # Those two are always present 82 for doc in ${DOCS} "${WORKDIR}"/package.xml CREDITS ; do
46 dodoc-php "${WORKDIR}/package.xml" CREDITS 83 [[ -s ${doc} ]] && dodoc-php ${doc}
84 done
85
86 if has examples ${IUSE} && use examples ; then
87 insinto /usr/share/doc/${CATEGORY}/${PF}/examples
88 doins -r examples/*
89 fi
47} 90}

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20