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

Contents of /eclass/php-ext-pecl-r2.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download)
Mon Aug 22 04:46:32 2011 UTC (6 years, 5 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +6 -6 lines
fix random bugs in eclass documentation, and convert to new @AUTHOR tag

1 vapier 1.6 # Copyright 1999-2011 Gentoo Foundation
2 olemarkus 1.1 # Distributed under the terms of the GNU General Public License v2
3 vapier 1.6 # $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-pecl-r2.eclass,v 1.5 2011/08/19 09:14:06 olemarkus Exp $
4 olemarkus 1.1
5     # @ECLASS: php-ext-pecl-r1.eclass
6     # @MAINTAINER:
7     # Gentoo PHP team <php-bugs@gentoo.org>
8 vapier 1.6 # @AUTHOR:
9     # Author: Tal Peer <coredumb@gentoo.org>
10     # Author: Luca Longinotti <chtekk@gentoo.org>
11     # Author: Jakub Moc <jakub@gentoo.org>
12 olemarkus 1.1 # @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.
23     #
24     # Setting this variable manually also affects PHP_EXT_NAME and ${S}
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    
37    
38     [[ -z "${PHP_EXT_PECL_PKG}" ]] && PHP_EXT_PECL_PKG="${PN/pecl-/}"
39    
40 olemarkus 1.5
41     [[ -z ${MY_PV} ]] && MY_PV=${PV}
42    
43 olemarkus 1.1 PECL_PKG="${PHP_EXT_PECL_PKG}"
44 olemarkus 1.5 MY_PV="${MY_PV/_/}"
45 olemarkus 1.1 PECL_PKG_V="${PECL_PKG}-${MY_PV}"
46    
47     [[ -z "${PHP_EXT_NAME}" ]] && PHP_EXT_NAME="${PECL_PKG}"
48    
49 olemarkus 1.3 S="${WORKDIR}/${PECL_PKG_V}"
50    
51 olemarkus 1.1 inherit php-ext-source-r2
52    
53     EXPORT_FUNCTIONS src_compile src_install src_test
54    
55     if [[ -n "${PHP_EXT_PECL_FILENAME}" ]] ; then
56     FILENAME="${PHP_EXT_PECL_FILENAME}-${MY_PV}.tgz"
57     else
58     FILENAME="${PECL_PKG_V}.tgz"
59     fi
60    
61     SRC_URI="http://pecl.php.net/get/${FILENAME}"
62     HOMEPAGE="http://pecl.php.net/${PECL_PKG}"
63    
64    
65     # @FUNCTION: php-ext-pecl-r1_src_compile
66     # @DESCRIPTION:
67     # Takes care of standard compile for PECL packages.
68     php-ext-pecl-r2_src_compile() {
69     php-ext-source-r2_src_compile
70     }
71    
72     # @FUNCTION: php-ext-pecl-r1_src_install
73     # @DESCRIPTION:
74     # Takes care of standard install for PECL packages.
75     # You can also simply add examples to IUSE to automagically install
76     # examples supplied with the package.
77    
78     # @VARIABLE: DOCS
79     # @DESCRIPTION:
80     # Set in ebuild if you wish to install additional, package-specific documentation.
81     php-ext-pecl-r2_src_install() {
82     php-ext-source-r2_src_install
83    
84     for doc in ${DOCS} "${WORKDIR}"/package.xml CREDITS ; do
85     [[ -s ${doc} ]] && dodoc ${doc}
86     done
87    
88     if has examples ${IUSE} && use examples ; then
89     insinto /usr/share/doc/${CATEGORY}/${PF}/examples
90     doins -r examples/*
91     fi
92     }
93    
94    
95     # @FUNCTION: php-ext-pecl-r2_src_test
96     # @DESCRIPTION:
97     # Takes care of running any tests delivered with the PECL package.
98 mabi 1.4 # Standard phpize generates a run-tests.php file that is executed in make test
99     # We only need to force it to non-interactive mode
100 olemarkus 1.1 php-ext-pecl-r2_src_test() {
101     for slot in `php_get_slots`; do
102 mabi 1.4 php_init_slot_env ${slot}
103 olemarkus 1.2 NO_INTERACTION="yes" emake test || die "emake test failed for slot ${slot}"
104 olemarkus 1.1 done
105     }

  ViewVC Help
Powered by ViewVC 1.1.20