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

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

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

Revision 1.7 Revision 1.8
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/php-ext-base-r1.eclass,v 1.7 2007/05/12 02:54:35 chtekk Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-base-r1.eclass,v 1.8 2007/09/01 15:58:17 jokey Exp $
4# 4#
5# Author: Tal Peer <coredumb@gentoo.org> 5# Author: Tal Peer <coredumb@gentoo.org>
6# Author: Stuart Herbert <stuart@gentoo.org> 6# Author: Stuart Herbert <stuart@gentoo.org>
7# Author: Luca Longinotti <chtekk@gentoo.org> 7# Author: Luca Longinotti <chtekk@gentoo.org>
8# Author: Jakub Moc <jakub@gentoo.org> (documentation)
9
10# @ECLASS: php-ext-base-r1.eclass
11# @MAINTAINER:
8# Maintained by the PHP Team <php-bugs@gentoo.org> 12# Gentoo PHP team <php-bugs@gentoo.org>
9# 13# @BLURB: A unified interface for adding standalone PHP extensions.
14# @DESCRIPTION:
10# The php-ext-base-r1 eclass provides a unified interface for adding standalone 15# This eclass provides a unified interface for adding standalone
11# PHP extensions ('modules') to the php.ini files on your system. 16# PHP extensions (modules) to the php.ini files on your system.
12# 17#
13# Combined with php-ext-source-r1, we have a standardised solution for supporting 18# Combined with php-ext-source-r1, we have a standardised solution for supporting
14# PHP extensions. 19# PHP extensions.
15 20
16inherit depend.php 21inherit depend.php
17 22
18EXPORT_FUNCTIONS src_install 23EXPORT_FUNCTIONS src_install
19 24
25# @ECLASS-VARIABLE: PHP_EXT_NAME
26# @DESCRIPTION:
20# The extension name, this must be set, otherwise we die 27# The extension name. This must be set, otherwise the eclass dies.
28# Only automagically set by php-ext-pecl-r1.eclass, so unless your ebuild
29# inherits that eclass, you must set this manually before inherit.
21[[ -z "${PHP_EXT_NAME}" ]] && die "No module name specified for the php-ext-base-r1 eclass" 30[[ -z "${PHP_EXT_NAME}" ]] && die "No module name specified for the php-ext-base-r1 eclass"
22 31
32# @ECLASS-VARIABLE: PHP_EXT_INI
33# @DESCRIPTION:
23# Wether or not to add a line to php.ini for the extension 34# Controls whether or not to add a line to php.ini for the extension.
24# (defaults to "yes" and shouldn't be changed in most cases) 35# Defaults to "yes" and should not be changed in most cases.
25[[ -z "${PHP_EXT_INI}" ]] && PHP_EXT_INI="yes" 36[[ -z "${PHP_EXT_INI}" ]] && PHP_EXT_INI="yes"
26 37
38# @ECLASS-VARIABLE: PHP_EXT_ZENDEXT
39# @DESCRIPTION:
27# Wether the extension is a ZendEngine extension or not 40# Controls whether the extension is a ZendEngine extension or not.
28# (defaults to "no" and if you don't know what is it, you don't need it) 41# Defaults to "no" and if you don't know what is it, you don't need it.
29[[ -z "${PHP_EXT_ZENDEXT}" ]] && PHP_EXT_ZENDEXT="no" 42[[ -z "${PHP_EXT_ZENDEXT}" ]] && PHP_EXT_ZENDEXT="no"
43
30 44
31php-ext-base-r1_buildinilist() { 45php-ext-base-r1_buildinilist() {
32 # Work out the list of <ext>.ini files to edit/add to 46 # Work out the list of <ext>.ini files to edit/add to
33 if [[ -z "${PHPSAPILIST}" ]] ; then 47 if [[ -z "${PHPSAPILIST}" ]] ; then
34 PHPSAPILIST="apache2 cli cgi" 48 PHPSAPILIST="apache2 cli cgi"
41 PHPINIFILELIST="${PHPINIFILELIST} etc/php/${x}-php${PHP_VERSION}/ext/${PHP_EXT_NAME}.ini" 55 PHPINIFILELIST="${PHPINIFILELIST} etc/php/${x}-php${PHP_VERSION}/ext/${PHP_EXT_NAME}.ini"
42 fi 56 fi
43 done 57 done
44} 58}
45 59
60# @FUNCTION: php-ext-base-r1_src_install
61# @DESCRIPTION:
62# Takes care of standard install for PHP extensions (modules).
46php-ext-base-r1_src_install() { 63php-ext-base-r1_src_install() {
47 # Pull in the PHP settings 64 # Pull in the PHP settings
48 has_php 65 has_php
49 addpredict /usr/share/snmp/mibs/.index 66 addpredict /usr/share/snmp/mibs/.index
50 67
98 115
99# $1 - Setting name 116# $1 - Setting name
100# $2 - Setting value 117# $2 - Setting value
101# $3 - File to add to 118# $3 - File to add to
102# $4 - Sanitized text to output 119# $4 - Sanitized text to output
103
104php-ext-base-r1_addtoinifile() { 120php-ext-base-r1_addtoinifile() {
105 if [[ ! -d `dirname $3` ]] ; then 121 if [[ ! -d `dirname $3` ]] ; then
106 mkdir -p `dirname $3` 122 mkdir -p `dirname $3`
107 fi 123 fi
108 124
123 139
124 insinto /`dirname $3` 140 insinto /`dirname $3`
125 doins "$3" 141 doins "$3"
126} 142}
127 143
144# @FUNCTION: php-ext-base-r1_addtoinifiles
145# @USAGE: <setting name> <setting value> [message to output]; or just [section name]
146# @DESCRIPTION:
147# Add value settings to php.ini file installed by the extension (module).
148# You can also add a [section], see examples below.
149#
150# @CODE
151# Add some settings for the extension:
152#
153# php-ext-base-r1_addtoinifiles "zend_optimizer.optimization_level" "15"
154# php-ext-base-r1_addtoinifiles "zend_optimizer.enable_loader" "0"
155# php-ext-base-r1_addtoinifiles "zend_optimizer.disable_licensing" "0"
156#
157# Adding values to a section in php.ini file installed by the extension:
158#
159# php-ext-base-r1_addtoinifiles "[Debugger]"
160# php-ext-base-r1_addtoinifiles "debugger.enabled" "on"
161# php-ext-base-r1_addtoinifiles "debugger.profiler_enabled" "on"
162# @CODE
128php-ext-base-r1_addtoinifiles() { 163php-ext-base-r1_addtoinifiles() {
129 for x in ${PHPINIFILELIST} ; do 164 for x in ${PHPINIFILELIST} ; do
130 php-ext-base-r1_addtoinifile "$1" "$2" "$x" "$3" 165 php-ext-base-r1_addtoinifile "$1" "$2" "$x" "$3"
131 done 166 done
132} 167}

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20