| 1 | # Copyright 1999-2005 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.4 2006/09/05 07:42:00 sebastian Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/Attic/php-ext-pecl-r1.eclass,v 1.7 2007/08/31 10:00:56 jokey Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Tal Peer <coredumb@gentoo.org> |
5 | # Author: Tal Peer <coredumb@gentoo.org> |
| 6 | # Maintained by the PHP Herd <php-bugs@gentoo.org> |
6 | # Author: Luca Longinotti <chtekk@gentoo.org> |
| 7 | # |
7 | # Author: Jakub Moc <jakub@gentoo.org> |
| 8 | # This eclass should be used by all dev-php[4,5]/pecl-* ebuilds, as a uniform way of installing PECL extensions. |
|
|
| 9 | # For more information about PECL, see: http://pecl.php.net |
|
|
| 10 | |
8 | |
| 11 | [ -z "${PHP_EXT_PECL_PKG}" ] && PHP_EXT_PECL_PKG=${PN/pecl-/} |
9 | # @ECLASS: php-ext-pecl-r1.eclass |
| 12 | PECL_PKG=${PHP_EXT_PECL_PKG} |
10 | # @MAINTAINER: |
| 13 | MY_PV=${PV/_/} |
11 | # Gentoo PHP team <php-bugs@gentoo.org> |
| 14 | PECL_PKG_V=${PECL_PKG}-${MY_PV} |
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/ |
| 15 | |
17 | |
| 16 | [ -z "${PHP_EXT_NAME}" ] && PHP_EXT_NAME=${PECL_PKG} |
18 | # @VARIABLE: PHP_EXT_PECL_FILENAME |
|
|
19 | # @DESCRIPTION: |
|
|
20 | # Set in ebuild if the filename differs from the package name so that SRC_URI gets set correctly. |
| 17 | |
21 | |
|
|
22 | # @VARIABLE: DOCS |
|
|
23 | # @DESCRIPTION: |
|
|
24 | # Set in ebuild if you wish to install additional, package-specific documentation. |
|
|
25 | |
|
|
26 | [[ -z "${PHP_EXT_PECL_PKG}" ]] && PHP_EXT_PECL_PKG="${PN/pecl-/}" |
|
|
27 | |
|
|
28 | PECL_PKG="${PHP_EXT_PECL_PKG}" |
|
|
29 | MY_PV="${PV/_/}" |
|
|
30 | PECL_PKG_V="${PECL_PKG}-${MY_PV}" |
|
|
31 | |
|
|
32 | [[ -z "${PHP_EXT_NAME}" ]] && PHP_EXT_NAME="${PECL_PKG}" |
|
|
33 | |
| 18 | inherit php-ext-source-r1 |
34 | inherit php-ext-source-r1 depend.php |
| 19 | |
35 | |
| 20 | EXPORT_FUNCTIONS src_compile src_install |
36 | EXPORT_FUNCTIONS src_compile src_install |
| 21 | |
37 | |
| 22 | # ---begin ebuild configurable settings |
|
|
| 23 | |
|
|
| 24 | # Needs to be set if the filename is other than the package name |
|
|
| 25 | if [ -n "${PHP_EXT_PECL_FILENAME}" ]; then |
38 | if [[ -n "${PHP_EXT_PECL_FILENAME}" ]] ; then |
| 26 | FILENAME="${PHP_EXT_PECL_FILENAME}-${MY_PV}.tgz" |
39 | FILENAME="${PHP_EXT_PECL_FILENAME}-${MY_PV}.tgz" |
| 27 | else |
40 | else |
| 28 | FILENAME="${PECL_PKG_V}.tgz" |
41 | FILENAME="${PECL_PKG_V}.tgz" |
| 29 | fi |
42 | fi |
| 30 | |
|
|
| 31 | # ---end ebuild configurable settings |
|
|
| 32 | |
43 | |
| 33 | SRC_URI="http://pecl.php.net/get/${FILENAME}" |
44 | SRC_URI="http://pecl.php.net/get/${FILENAME}" |
| 34 | HOMEPAGE="http://pecl.php.net/${PECL_PKG}" |
45 | HOMEPAGE="http://pecl.php.net/${PECL_PKG}" |
| 35 | |
46 | |
| 36 | S="${WORKDIR}/${PECL_PKG_V}" |
47 | S="${WORKDIR}/${PECL_PKG_V}" |
| 37 | |
48 | |
|
|
49 | # @FUNCTION: php-ext-pecl-r1_src_compile |
|
|
50 | # @DESCRIPTION: |
|
|
51 | # Takes care of standard compile for PECL packages. |
| 38 | php-ext-pecl-r1_src_compile() { |
52 | php-ext-pecl-r1_src_compile() { |
| 39 | has_php |
53 | has_php |
| 40 | php-ext-source-r1_src_compile |
54 | php-ext-source-r1_src_compile |
| 41 | } |
55 | } |
| 42 | |
56 | |
|
|
57 | # @FUNCTION: php-ext-pecl-r1_src_install |
|
|
58 | # @DESCRIPTION: |
|
|
59 | # Takes care of standard install for PECL packages. |
|
|
60 | # You can also simply add examples to IUSE to automagically install |
|
|
61 | # examples supplied with the package. |
| 43 | php-ext-pecl-r1_src_install() { |
62 | php-ext-pecl-r1_src_install() { |
| 44 | has_php |
63 | has_php |
| 45 | php-ext-source-r1_src_install |
64 | php-ext-source-r1_src_install |
| 46 | |
65 | |
| 47 | # Those two are always present |
66 | # Those two are always present. |
| 48 | dodoc-php "${WORKDIR}/package.xml" CREDITS |
67 | dodoc-php "${WORKDIR}/package.xml" CREDITS |
|
|
68 | |
|
|
69 | for doc in ${DOCS} ; do |
|
|
70 | [[ -s ${doc} ]] && dodoc-php ${doc} |
|
|
71 | done |
|
|
72 | |
|
|
73 | if has examples ${IUSE} && use examples ; then |
|
|
74 | insinto /usr/share/doc/${CATEGORY}/${PF}/examples |
|
|
75 | doins -r examples/* |
|
|
76 | fi |
| 49 | } |
77 | } |