/[gentoo-x86]/eclass/depend.php.eclass
Gentoo

Diff of /eclass/depend.php.eclass

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

Revision 1.26 Revision 1.33
1# Copyright 1999-2007 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/depend.php.eclass,v 1.26 2010/07/13 23:48:46 mabi Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/depend.php.eclass,v 1.33 2015/06/17 18:54:44 grknight Exp $
4 4
5# @ECLASS: depend.php.eclass
6# @MAINTAINER:
7# Gentoo PHP team <php-bugs@gentoo.org>
8# @AUTHOR:
5# Author: Stuart Herbert <stuart@gentoo.org> 9# Author: Stuart Herbert <stuart@gentoo.org>
6# Author: Luca Longinotti <chtekk@gentoo.org> 10# Author: Luca Longinotti <chtekk@gentoo.org>
7# Author: Jakub Moc <jakub@gentoo.org> (documentation) 11# Author: Jakub Moc <jakub@gentoo.org> (documentation)
8
9# @ECLASS: depend.php.eclass
10# @MAINTAINER:
11# Gentoo PHP team <php-bugs@gentoo.org>
12# @BLURB: Functions to allow ebuilds to depend on php5 and check for specific features. 12# @BLURB: Functions to allow ebuilds to depend on php5 and check for specific features.
13# @DESCRIPTION: 13# @DESCRIPTION:
14# This eclass provides functions that allow ebuilds to depend on php5 and check 14# This eclass provides functions that allow ebuilds to depend on php5 and check
15# for specific PHP features, SAPIs etc. Also provides dodoc-php wrapper to install 15# for specific PHP features, SAPIs etc. Also provides dodoc-php wrapper to install
16# documentation for PHP packages to php-specific location. 16# documentation for PHP packages to php-specific location.
17 17
18
19inherit eutils phpconfutils 18inherit eutils multilib phpconfutils
20 19
21# PHP5-only depend functions 20# PHP5-only depend functions
22 21
23# @FUNCTION: need_php5_cli 22# @FUNCTION: need_php5_cli
24# @DESCRIPTION: 23# @DESCRIPTION:
25# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP5 24# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP5
26# with cli SAPI. 25# with cli SAPI.
27need_php5_cli() { 26need_php5_cli() {
27 eqawarn "(need_php5_cli) Deprecated function call. Set to be removed on 2015-07-17"
28 DEPEND="${DEPEND} =virtual/php-5*" 28 DEPEND="${DEPEND} =dev-lang/php-5*"
29 RDEPEND="${RDEPEND} =virtual/php-5*" 29 RDEPEND="${RDEPEND} =dev-lang/php-5*"
30 PHP_VERSION="5" 30 PHP_VERSION="5"
31} 31}
32 32
33# @FUNCTION: need_php5_httpd 33# @FUNCTION: need_php5_httpd
34# @DESCRIPTION: 34# @DESCRIPTION:
35# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP5 35# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP5
36# with either cgi or apache2 SAPI. 36# with either cgi or apache2 SAPI.
37need_php5_httpd() { 37need_php5_httpd() {
38 eqawarn "(need_php5_httpd) Deprecated function call. Set to be removed on 2015-07-17"
38 DEPEND="${DEPEND} =virtual/httpd-php-5*" 39 DEPEND="${DEPEND} =virtual/httpd-php-5*"
39 RDEPEND="${RDEPEND} =virtual/httpd-php-5*" 40 RDEPEND="${RDEPEND} =virtual/httpd-php-5*"
40 PHP_VERSION="5" 41 PHP_VERSION="5"
41} 42}
42 43
74# @FUNCTION: need_php_cli 75# @FUNCTION: need_php_cli
75# @DESCRIPTION: 76# @DESCRIPTION:
76# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP 77# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP
77# (any version) with cli SAPI. 78# (any version) with cli SAPI.
78need_php_cli() { 79need_php_cli() {
80 eqawarn "(need_php_cli) Deprecated function call. Set to be removed on 2015-07-17"
79 DEPEND="${DEPEND} virtual/php" 81 DEPEND="${DEPEND} dev-lang/php"
80 RDEPEND="${RDEPEND} virtual/php" 82 RDEPEND="${RDEPEND} dev-lang/php"
81} 83}
82 84
83# @FUNCTION: need_php_httpd 85# @FUNCTION: need_php_httpd
84# @DESCRIPTION: 86# @DESCRIPTION:
85# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP 87# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP
103# @DESCRIPTION: 105# @DESCRIPTION:
104# Set this after setting DEPEND/RDEPEND in your ebuild to depend on PHP version 106# Set this after setting DEPEND/RDEPEND in your ebuild to depend on PHP version
105# determined by ${CATEGORY} - any PHP version or PHP5 for dev-php or 107# determined by ${CATEGORY} - any PHP version or PHP5 for dev-php or
106# dev-php5, respectively. 108# dev-php5, respectively.
107need_php_by_category() { 109need_php_by_category() {
110 eqawarn "(need_php_by_category) Deprecated function call. Set to be removed on 2015-07-17"
108 case "${CATEGORY}" in 111 case "${CATEGORY}" in
109 dev-php) need_php ;; 112 dev-php) need_php ;;
110 dev-php5) need_php5 ;;
111 *) die "Version of PHP required by packages in category ${CATEGORY} unknown" 113 *) die "Version of PHP required by packages in category ${CATEGORY} unknown"
112 esac 114 esac
113} 115}
114 116
115 117
145# require_php_cli or require_php_cgi) in pkg_setup until we are able to 147# require_php_cli or require_php_cgi) in pkg_setup until we are able to
146# depend on USE flags being enabled. The above described need_php[45]_cli 148# depend on USE flags being enabled. The above described need_php[45]_cli
147# and need_php[45]_httpd functions cannot guarantee these requirements. 149# and need_php[45]_httpd functions cannot guarantee these requirements.
148# See Bug 2272 for details. 150# See Bug 2272 for details.
149require_php_sapi_from() { 151require_php_sapi_from() {
152 eqawarn "(require_php_sapi_from) Deprecated function call. Set to be removed on 2015-07-17"
150 has_php 153 has_php
151 154
152 local has_sapi="0" 155 local has_sapi="0"
153 local x 156 local x
154 157
205 local x 208 local x
206 209
207 einfo "Checking for required PHP feature(s) ..." 210 einfo "Checking for required PHP feature(s) ..."
208 211
209 for x in $@ ; do 212 for x in $@ ; do
213 case $x in
214 pcre|spl|reflection|mhash)
215 eqawarn "require_php_with_use MUST NOT check for the pcre, spl, mhash or reflection USE flag."
216 eqawarn "These USE flags are removed from >=dev-lang/php-5.3 and your ebuild will break"
217 eqawarn "if you check the USE flags against PHP 5.3 ebuilds."
218 eqawarn "Please use USE dependencies from EAPI 2 instead"
219 ;;
220 esac
221
210 if ! built_with_use =${PHP_PKG} ${x} && ! phpconfutils_built_with_use =${PHP_PKG} ${x} ; then 222 if ! built_with_use =${PHP_PKG} ${x} && ! phpconfutils_built_with_use =${PHP_PKG} ${x} ; then
211 einfo " Discovered missing USE flag: ${x}" 223 einfo " Discovered missing USE flag: ${x}"
212 missing_use="${missing_use} ${x}" 224 missing_use="${missing_use} ${x}"
213 fi 225 fi
214 done 226 done
239# @DESCRIPTION: 251# @DESCRIPTION:
240# Call this function from pkg_setup if your package requires PHP compiled with 252# Call this function from pkg_setup if your package requires PHP compiled with
241# any of specified USE flags. Returns if any of the listed USE flags are enabled. 253# any of specified USE flags. Returns if any of the listed USE flags are enabled.
242# Dies if all of the listed USE flags are disabled. 254# Dies if all of the listed USE flags are disabled.
243require_php_with_any_use() { 255require_php_with_any_use() {
256 eqawarn "(require_php_with_any_use) Deprecated function call. Set to be removed on 2015-07-17"
244 has_php 257 has_php
245 258
246 local missing_use="" 259 local missing_use=""
247 local x 260 local x
248 261
287# @FUNCTION: has_zts 300# @FUNCTION: has_zts
288# @DESCRIPTION: 301# @DESCRIPTION:
289# Check if our PHP was compiled with ZTS (Zend Thread Safety) enabled. 302# Check if our PHP was compiled with ZTS (Zend Thread Safety) enabled.
290# @RETURN: 0 if true, 1 otherwise 303# @RETURN: 0 if true, 1 otherwise
291has_zts() { 304has_zts() {
305 eqawarn "(has_zts) Deprecated function call. Set to be removed on 2015-07-17"
292 has_php 306 has_php
293 307
294 if built_with_use =${PHP_PKG} apache2 threads || phpconfutils_built_with_use =${PHP_PKG} apache2 threads ; then 308 if built_with_use =${PHP_PKG} apache2 threads || phpconfutils_built_with_use =${PHP_PKG} apache2 threads ; then
295 return 0 309 return 0
296 fi 310 fi
301# @FUNCTION: has_debug 315# @FUNCTION: has_debug
302# @DESCRIPTION: 316# @DESCRIPTION:
303# Check if our PHP was built with debug support enabled. 317# Check if our PHP was built with debug support enabled.
304# @RETURN: 0 if true, 1 otherwise 318# @RETURN: 0 if true, 1 otherwise
305has_debug() { 319has_debug() {
320 eqawarn "(has_debug) Deprecated function call. Set to be removed on 2015-07-17"
306 has_php 321 has_php
307 322
308 if built_with_use =${PHP_PKG} debug || phpconfutils_built_with_use =${PHP_PKG} debug ; then 323 if built_with_use =${PHP_PKG} debug || phpconfutils_built_with_use =${PHP_PKG} debug ; then
309 return 0 324 return 0
310 fi 325 fi
315# @FUNCTION: has_concurrentmodphp 330# @FUNCTION: has_concurrentmodphp
316# @DESCRIPTION: 331# @DESCRIPTION:
317# Check if our PHP was built with the concurrentmodphp support enabled. 332# Check if our PHP was built with the concurrentmodphp support enabled.
318# @RETURN: 0 if true, 1 otherwise 333# @RETURN: 0 if true, 1 otherwise
319has_concurrentmodphp() { 334has_concurrentmodphp() {
335 eqawarn "(has_concurrentmodphp) Deprecated function call. Set to be removed on 2015-07-17"
320 has_php 336 has_php
321 337
322 if built_with_use =${PHP_PKG} apache2 concurrentmodphp || phpconfutils_built_with_use =${PHP_PKG} apache2 concurrentmodphp ; then 338 if built_with_use =${PHP_PKG} apache2 concurrentmodphp || phpconfutils_built_with_use =${PHP_PKG} apache2 concurrentmodphp ; then
323 return 0 339 return 0
324 fi 340 fi
338# This function is now redundant and DEPRECATED since 354# This function is now redundant and DEPRECATED since
339# pdo-external use flag and pecl-pdo-* ebuilds were removed. 355# pdo-external use flag and pecl-pdo-* ebuilds were removed.
340# You should use require_php_with_use pdo instead now. 356# You should use require_php_with_use pdo instead now.
341# @RETURN: die if feature is missing 357# @RETURN: die if feature is missing
342require_pdo() { 358require_pdo() {
359 eqawarn "(require_pdo) Deprecated function call. Set to be removed on 2015-07-17"
343 has_php 360 has_php
344 361
345 # Was PHP5 compiled with internal PDO support? 362 # Was PHP5 compiled with internal PDO support?
346 if built_with_use =${PHP_PKG} pdo || phpconfutils_built_with_use =${PHP_PKG} pdo ; then 363 if built_with_use =${PHP_PKG} pdo || phpconfutils_built_with_use =${PHP_PKG} pdo ; then
347 return 364 return
430# @FUNCTION: require_sqlite 447# @FUNCTION: require_sqlite
431# @DESCRIPTION: 448# @DESCRIPTION:
432# Require a PHP built with SQLite support 449# Require a PHP built with SQLite support
433# @RETURN: die if feature is missing 450# @RETURN: die if feature is missing
434require_sqlite() { 451require_sqlite() {
452 eqawarn "(require_sqlite) Deprecated function call. Set to be removed on 2015-07-17"
435 has_php 453 has_php
436 454
437 # Has our PHP been built with SQLite support? 455 # Has our PHP been built with SQLite support?
438 if built_with_use =${PHP_PKG} sqlite || phpconfutils_built_with_use =${PHP_PKG} sqlite ; then 456 if built_with_use =${PHP_PKG} sqlite || phpconfutils_built_with_use =${PHP_PKG} sqlite ; then
439 return 457 return
452# @FUNCTION: require_gd 470# @FUNCTION: require_gd
453# @DESCRIPTION: 471# @DESCRIPTION:
454# Require a PHP built with GD support 472# Require a PHP built with GD support
455# @RETURN: die if feature is missing 473# @RETURN: die if feature is missing
456require_gd() { 474require_gd() {
475 eqawarn "(require_gd) Deprecated function call. Set to be removed on 2015-07-17"
457 has_php 476 has_php
458 477
459 # Do we have the internal GD support installed? 478 # Do we have the internal GD support installed?
460 if built_with_use =${PHP_PKG} gd || phpconfutils_built_with_use =${PHP_PKG} gd ; then 479 if built_with_use =${PHP_PKG} gd || phpconfutils_built_with_use =${PHP_PKG} gd ; then
461 return 480 return
485 504
486# @FUNCTION: php_binary_extension 505# @FUNCTION: php_binary_extension
487# @DESCRIPTION: 506# @DESCRIPTION:
488# Executes some checks needed when installing a binary PHP extension. 507# Executes some checks needed when installing a binary PHP extension.
489php_binary_extension() { 508php_binary_extension() {
509 eqawarn "(php_binary_extension) Deprecated function call. Set to be removed on 2015-07-17"
490 has_php 510 has_php
491 511
492 local PUSE_ENABLED="" 512 local PUSE_ENABLED=""
493 513
494 # Binary extensions do not support the change of PHP 514 # Binary extensions do not support the change of PHP

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.33

  ViewVC Help
Powered by ViewVC 1.1.20