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

Diff of /eclass/php-ext-source-r2.eclass

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

Revision 1.28 Revision 1.35
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2015 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-source-r2.eclass,v 1.28 2012/08/01 10:55:29 olemarkus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r2.eclass,v 1.35 2015/05/04 18:59:30 grknight Exp $
4 4
5# @ECLASS: php-ext-source-r2.eclass 5# @ECLASS: php-ext-source-r2.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Gentoo PHP team <php-bugs@gentoo.org> 7# Gentoo PHP team <php-bugs@gentoo.org>
8# @AUTHOR: 8# @AUTHOR:
14# @BLURB: A unified interface for compiling and installing standalone PHP extensions. 14# @BLURB: A unified interface for compiling and installing standalone PHP extensions.
15# @DESCRIPTION: 15# @DESCRIPTION:
16# This eclass provides a unified interface for compiling and installing standalone 16# This eclass provides a unified interface for compiling and installing standalone
17# PHP extensions (modules). 17# PHP extensions (modules).
18 18
19inherit flag-o-matic autotools multilib 19inherit flag-o-matic autotools multilib eutils
20 20
21EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install 21EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install
22 22
23DEPEND=">=sys-devel/m4-1.4.3 23DEPEND=">=sys-devel/m4-1.4.3
24 >=sys-devel/libtool-1.5.18" 24 >=sys-devel/libtool-1.5.18"
25RDEPEND="" 25RDEPEND=""
26 26
27# Because of USE deps, we require at least EAPI 2 27# Because of USE deps, we require at least EAPI 2
28case ${EAPI} in 28case ${EAPI} in
29 2|3|4) ;; 29 4|5) ;;
30 *) 30 *)
31 die "php-ext-source-r2 is not compatible with EAPI=${EAPI}" 31 die "php-ext-source-r2 is not compatible with EAPI=${EAPI}"
32esac 32esac
33 33
34# @ECLASS-VARIABLE: PHP_EXT_NAME 34# @ECLASS-VARIABLE: PHP_EXT_NAME
35# @REQUIRED
35# @DESCRIPTION: 36# @DESCRIPTION:
36# The extension name. This must be set, otherwise the eclass dies. 37# The extension name. This must be set, otherwise the eclass dies.
37# Only automagically set by php-ext-pecl-r2.eclass, so unless your ebuild 38# Only automagically set by php-ext-pecl-r2.eclass, so unless your ebuild
38# inherits that eclass, you must set this manually before inherit. 39# inherits that eclass, you must set this manually before inherit.
39[[ -z "${PHP_EXT_NAME}" ]] && die "No module name specified for the php-ext-source-r2 eclass" 40[[ -z "${PHP_EXT_NAME}" ]] && die "No module name specified for the php-ext-source-r2 eclass"
49# Controls whether the extension is a ZendEngine extension or not. 50# Controls whether the extension is a ZendEngine extension or not.
50# Defaults to "no" and if you don't know what is it, you don't need it. 51# Defaults to "no" and if you don't know what is it, you don't need it.
51[[ -z "${PHP_EXT_ZENDEXT}" ]] && PHP_EXT_ZENDEXT="no" 52[[ -z "${PHP_EXT_ZENDEXT}" ]] && PHP_EXT_ZENDEXT="no"
52 53
53# @ECLASS-VARIABLE: USE_PHP 54# @ECLASS-VARIABLE: USE_PHP
55# @REQUIRED
54# @DESCRIPTION: 56# @DESCRIPTION:
55# Lists the PHP slots compatibile the extension is compatibile with 57# Lists the PHP slots compatibile the extension is compatibile with
56[[ -z "${USE_PHP}" ]] && USE_PHP="php5-3" 58# Example:
59# @CODE
60# USE_PHP="php5-5 php5-6"
61# @CODE
62[[ -z "${USE_PHP}" ]] && die "USE_PHP is not set for the php-ext-source-r2 eclass"
57 63
58# @ECLASS-VARIABLE: PHP_EXT_OPTIONAL_USE 64# @ECLASS-VARIABLE: PHP_EXT_OPTIONAL_USE
59# @DESCRIPTION: 65# @DESCRIPTION:
60# If set, this is the USE flag that the PHP dependencies are behind 66# If set, this is the USE flag that the PHP dependencies are behind
61# Most commonly set as PHP_EXT_OPTIONAL_USE=php to get the dependencies behind 67# Most commonly set as PHP_EXT_OPTIONAL_USE=php to get the dependencies behind
66# The relative location of the temporary build directory for the PHP extension within 72# The relative location of the temporary build directory for the PHP extension within
67# the source package. This is useful for packages that bundle the PHP extension. 73# the source package. This is useful for packages that bundle the PHP extension.
68# Defaults to ${S} 74# Defaults to ${S}
69[[ -z "${PHP_EXT_S}" ]] && PHP_EXT_S="${S}" 75[[ -z "${PHP_EXT_S}" ]] && PHP_EXT_S="${S}"
70 76
71#Make sure at least one target is installed. Abuses USE dependencies. 77#Make sure at least one target is installed.
78REQUIRED_USE="${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( }|| ( "
72for target in ${USE_PHP}; do 79for target in ${USE_PHP}; do
73 IUSE="${IUSE} php_targets_${target}" 80 IUSE="${IUSE} php_targets_${target}"
74 target=${target/+} 81 target=${target/+}
75 SELFDEPEND="${SELFDEPEND} =${CATEGORY}/${PF}[php_targets_${target}]" 82 REQUIRED_USE+="php_targets_${target} "
76 slot=${target/php} 83 slot=${target/php}
77 slot=${slot/-/.} 84 slot=${slot/-/.}
78 PHPDEPEND="${PHPDEPEND} 85 PHPDEPEND="${PHPDEPEND}
79 php_targets_${target}? ( dev-lang/php:${slot} )" 86 php_targets_${target}? ( dev-lang/php:${slot} )"
80done 87done
88REQUIRED_USE+=") ${PHP_EXT_OPTIONAL_USE:+ )}"
81 89
82RDEPEND="${RDEPEND} 90RDEPEND="${RDEPEND}
83 ${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( } 91 ${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( }
84 || ( ${SELFDEPEND} )
85 ${PHPDEPEND} 92 ${PHPDEPEND}
86 ${PHP_EXT_OPTIONAL_USE:+ )}" 93 ${PHP_EXT_OPTIONAL_USE:+ )}"
87 94
88DEPEND="${DEPEND} 95DEPEND="${DEPEND}
89 ${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( } 96 ${PHP_EXT_OPTIONAL_USE}${PHP_EXT_OPTIONAL_USE:+? ( }
140# @DESCRIPTION: 147# @DESCRIPTION:
141# Set this in the ebuild to pass configure options to econf. 148# Set this in the ebuild to pass configure options to econf.
142php-ext-source-r2_src_configure() { 149php-ext-source-r2_src_configure() {
143 # net-snmp creates this file #385403 150 # net-snmp creates this file #385403
144 addpredict /usr/share/snmp/mibs/.index 151 addpredict /usr/share/snmp/mibs/.index
152 addpredict /var/lib/net-snmp/mib_indexes
145 153
146 local slot 154 local slot
147 for slot in $(php_get_slots); do 155 for slot in $(php_get_slots); do
148 php_init_slot_env ${slot} 156 php_init_slot_env ${slot}
149 # Set the correct config options 157 # Set the correct config options
155# @DESCRIPTION: 163# @DESCRIPTION:
156# Takes care of standard compile for PHP extensions (modules). 164# Takes care of standard compile for PHP extensions (modules).
157php-ext-source-r2_src_compile() { 165php-ext-source-r2_src_compile() {
158 # net-snmp creates this file #324739 166 # net-snmp creates this file #324739
159 addpredict /usr/share/snmp/mibs/.index 167 addpredict /usr/share/snmp/mibs/.index
168 addpredict /var/lib/net-snmp/mib_indexes
169
160 # shm extension createss a semaphore file #173574 170 # shm extension createss a semaphore file #173574
161 addpredict /session_mm_cli0.sem 171 addpredict /session_mm_cli0.sem
162 local slot 172 local slot
163 for slot in $(php_get_slots); do 173 for slot in $(php_get_slots); do
164 php_init_slot_env ${slot} 174 php_init_slot_env ${slot}
257 267
258 # Symlink the <ext>.ini files from ext/ to ext-active/ 268 # Symlink the <ext>.ini files from ext/ to ext-active/
259 local inifile 269 local inifile
260 for inifile in ${PHPINIFILELIST} ; do 270 for inifile in ${PHPINIFILELIST} ; do
261 if [[ -n "${PHP_EXT_INIFILE}" ]]; then 271 if [[ -n "${PHP_EXT_INIFILE}" ]]; then
262 cat "${FILESDIR}/${PHP_EXT_INIFILE}" > "${inifile}" 272 cat "${FILESDIR}/${PHP_EXT_INIFILE}" >> "${ED}/${inifile}"
263 einfo "Added content of ${FILESDIR}/${PHP_EXT_INIFILE} to ${inifile}" 273 einfo "Added content of ${FILESDIR}/${PHP_EXT_INIFILE} to ${inifile}"
264 fi 274 fi
265
266
267
268
269 inidir="${inifile/${PHP_EXT_NAME}.ini/}" 275 inidir="${inifile/${PHP_EXT_NAME}.ini/}"
270 inidir="${inidir/ext/ext-active}" 276 inidir="${inidir/ext/ext-active}"
271 dodir "/${inidir}" 277 dodir "/${inidir}"
272 dosym "/${inifile}" "/${inifile/ext/ext-active}" 278 dosym "/${inifile}" "/${inifile/ext/ext-active}"
273 done 279 done

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.35

  ViewVC Help
Powered by ViewVC 1.1.20