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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

1 vapier 1.14 # Copyright 1999-2011 Gentoo Foundation
2 stuart 1.1 # Distributed under the terms of the GNU General Public License v2
3 vapier 1.14 # $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-pecl-r1.eclass,v 1.13 2010/10/06 19:58:45 olemarkus Exp $
4 jokey 1.7
5     # @ECLASS: php-ext-pecl-r1.eclass
6     # @MAINTAINER:
7     # Gentoo PHP team <php-bugs@gentoo.org>
8 vapier 1.14 # @AUTHOR:
9     # Author: Tal Peer <coredumb@gentoo.org>
10     # Author: Luca Longinotti <chtekk@gentoo.org>
11     # Author: Jakub Moc <jakub@gentoo.org>
12 jokey 1.7 # @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 chtekk 1.5 # For more information about PECL, see http://pecl.php.net/
17 stuart 1.1
18 jokey 1.8 # @ECLASS-VARIABLE: PHP_EXT_PECL_PKG
19     # @DESCRIPTION:
20     # Set in ebuild before inheriting this eclass if the tarball name
21 swegener 1.11 # differs from ${PN/pecl-/} so that SRC_URI and HOMEPAGE gets set
22 jokey 1.8 # 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 swegener 1.11 # HOMEPAGE, PHP_EXT_NAME or ${S}.
36 jokey 1.7
37    
38 chtekk 1.5 [[ -z "${PHP_EXT_PECL_PKG}" ]] && PHP_EXT_PECL_PKG="${PN/pecl-/}"
39 stuart 1.1
40 chtekk 1.5 PECL_PKG="${PHP_EXT_PECL_PKG}"
41     MY_PV="${PV/_/}"
42     PECL_PKG_V="${PECL_PKG}-${MY_PV}"
43 stuart 1.1
44 chtekk 1.5 [[ -z "${PHP_EXT_NAME}" ]] && PHP_EXT_NAME="${PECL_PKG}"
45    
46     inherit php-ext-source-r1 depend.php
47 stuart 1.1
48 mabi 1.12 EXPORT_FUNCTIONS src_compile src_install src_test
49 stuart 1.1
50 chtekk 1.5 if [[ -n "${PHP_EXT_PECL_FILENAME}" ]] ; then
51 sebastian 1.4 FILENAME="${PHP_EXT_PECL_FILENAME}-${MY_PV}.tgz"
52 stuart 1.1 else
53     FILENAME="${PECL_PKG_V}.tgz"
54     fi
55    
56     SRC_URI="http://pecl.php.net/get/${FILENAME}"
57     HOMEPAGE="http://pecl.php.net/${PECL_PKG}"
58 chtekk 1.2
59     S="${WORKDIR}/${PECL_PKG_V}"
60 stuart 1.1
61 jokey 1.7 # @FUNCTION: php-ext-pecl-r1_src_compile
62     # @DESCRIPTION:
63     # Takes care of standard compile for PECL packages.
64 stuart 1.1 php-ext-pecl-r1_src_compile() {
65     has_php
66     php-ext-source-r1_src_compile
67     }
68    
69 jokey 1.7 # @FUNCTION: php-ext-pecl-r1_src_install
70     # @DESCRIPTION:
71     # Takes care of standard install for PECL packages.
72 swegener 1.11 # You can also simply add examples to IUSE to automagically install
73 jokey 1.7 # examples supplied with the package.
74 jokey 1.9
75     # @VARIABLE: DOCS
76     # @DESCRIPTION:
77     # Set in ebuild if you wish to install additional, package-specific documentation.
78 stuart 1.1 php-ext-pecl-r1_src_install() {
79     has_php
80     php-ext-source-r1_src_install
81    
82 jokey 1.10 for doc in ${DOCS} "${WORKDIR}"/package.xml CREDITS ; do
83 jokey 1.6 [[ -s ${doc} ]] && dodoc-php ${doc}
84     done
85 jokey 1.7
86 jokey 1.6 if has examples ${IUSE} && use examples ; then
87     insinto /usr/share/doc/${CATEGORY}/${PF}/examples
88     doins -r examples/*
89     fi
90 stuart 1.1 }
91 mabi 1.12
92     # @FUNCTION: php-ext-pecl-r1_src_test
93     # @DESCRIPTION:
94     # Takes care of running any tests delivered with the PECL package.
95     # Testing is somewhat standardized across pecl extensions through phpize's
96     # run-tests.php - unfortunatly there are some quirks we need to work around
97     php-ext-pecl-r1_src_test() {
98     # Makefile passes a hard-coded -d extension_dir=./modules, we move the lib
99     # away from there in src_compile
100     ln -s "${WORKDIR}/${PHP_EXT_NAME}-default.so" "${S}/modules/${PHP_EXT_NAME}.so"
101    
102 olemarkus 1.13 NO_INTERACTION="yes" emake test || die "emake test failed"
103 mabi 1.12 }

  ViewVC Help
Powered by ViewVC 1.1.20