/[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.29 Revision 1.35
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.29 2011/03/18 15:59:25 olemarkus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/depend.php.eclass,v 1.35 2015/06/18 14:22:59 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
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} =dev-lang/php-5*" 28 DEPEND="${DEPEND} =dev-lang/php-5*"
29 RDEPEND="${RDEPEND} =dev-lang/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} dev-lang/php" 81 DEPEND="${DEPEND} dev-lang/php"
80 RDEPEND="${RDEPEND} dev-lang/php" 82 RDEPEND="${RDEPEND} dev-lang/php"
81} 83}
82 84
83# @FUNCTION: need_php_httpd 85# @FUNCTION: need_php_httpd
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
155 einfo "Checking for compatible SAPI(s)" 158 einfo "Checking for compatible SAPI(s)"
156 159
157 for x in $@ ; do 160 for x in $@ ; do
158 if built_with_use =${PHP_PKG} ${x} || phpconfutils_built_with_use =${PHP_PKG} ${x} ; then 161 if built_with_use =${PHP_PKG} ${x} ; then
159 einfo " Discovered compatible SAPI ${x}" 162 einfo " Discovered compatible SAPI ${x}"
160 has_sapi="1" 163 has_sapi="1"
161 fi 164 fi
162 done 165 done
163 166
214 eqawarn "if you check the USE flags against PHP 5.3 ebuilds." 217 eqawarn "if you check the USE flags against PHP 5.3 ebuilds."
215 eqawarn "Please use USE dependencies from EAPI 2 instead" 218 eqawarn "Please use USE dependencies from EAPI 2 instead"
216 ;; 219 ;;
217 esac 220 esac
218 221
219 if ! built_with_use =${PHP_PKG} ${x} && ! phpconfutils_built_with_use =${PHP_PKG} ${x} ; then 222 if ! built_with_use =${PHP_PKG} ${x} ; then
220 einfo " Discovered missing USE flag: ${x}" 223 einfo " Discovered missing USE flag: ${x}"
221 missing_use="${missing_use} ${x}" 224 missing_use="${missing_use} ${x}"
222 fi 225 fi
223 done 226 done
224 227
248# @DESCRIPTION: 251# @DESCRIPTION:
249# 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
250# 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.
251# Dies if all of the listed USE flags are disabled. 254# Dies if all of the listed USE flags are disabled.
252require_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"
253 has_php 257 has_php
254 258
255 local missing_use="" 259 local missing_use=""
256 local x 260 local x
257 261
258 einfo "Checking for required PHP feature(s) ..." 262 einfo "Checking for required PHP feature(s) ..."
259 263
260 for x in $@ ; do 264 for x in $@ ; do
261 if built_with_use =${PHP_PKG} ${x} || phpconfutils_built_with_use =${PHP_PKG} ${x} ; then 265 if built_with_use =${PHP_PKG} ${x} ; then
262 einfo " USE flag ${x} is enabled, ok ..." 266 einfo " USE flag ${x} is enabled, ok ..."
263 return 267 return
264 else 268 else
265 missing_use="${missing_use} ${x}" 269 missing_use="${missing_use} ${x}"
266 fi 270 fi
296# @FUNCTION: has_zts 300# @FUNCTION: has_zts
297# @DESCRIPTION: 301# @DESCRIPTION:
298# 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.
299# @RETURN: 0 if true, 1 otherwise 303# @RETURN: 0 if true, 1 otherwise
300has_zts() { 304has_zts() {
305 eqawarn "(has_zts) Deprecated function call. Set to be removed on 2015-07-17"
301 has_php 306 has_php
302 307
303 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 ; then
304 return 0 309 return 0
305 fi 310 fi
306 311
307 return 1 312 return 1
308} 313}
310# @FUNCTION: has_debug 315# @FUNCTION: has_debug
311# @DESCRIPTION: 316# @DESCRIPTION:
312# Check if our PHP was built with debug support enabled. 317# Check if our PHP was built with debug support enabled.
313# @RETURN: 0 if true, 1 otherwise 318# @RETURN: 0 if true, 1 otherwise
314has_debug() { 319has_debug() {
320 eqawarn "(has_debug) Deprecated function call. Set to be removed on 2015-07-17"
315 has_php 321 has_php
316 322
317 if built_with_use =${PHP_PKG} debug || phpconfutils_built_with_use =${PHP_PKG} debug ; then 323 if built_with_use =${PHP_PKG} debug ; then
318 return 0 324 return 0
319 fi 325 fi
320 326
321 return 1 327 return 1
322} 328}
324# @FUNCTION: has_concurrentmodphp 330# @FUNCTION: has_concurrentmodphp
325# @DESCRIPTION: 331# @DESCRIPTION:
326# Check if our PHP was built with the concurrentmodphp support enabled. 332# Check if our PHP was built with the concurrentmodphp support enabled.
327# @RETURN: 0 if true, 1 otherwise 333# @RETURN: 0 if true, 1 otherwise
328has_concurrentmodphp() { 334has_concurrentmodphp() {
335 eqawarn "(has_concurrentmodphp) Deprecated function call. Set to be removed on 2015-07-17"
329 has_php 336 has_php
330 337
331 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 ; then
332 return 0 339 return 0
333 fi 340 fi
334 341
335 return 1 342 return 1
336} 343}
347# This function is now redundant and DEPRECATED since 354# This function is now redundant and DEPRECATED since
348# pdo-external use flag and pecl-pdo-* ebuilds were removed. 355# pdo-external use flag and pecl-pdo-* ebuilds were removed.
349# You should use require_php_with_use pdo instead now. 356# You should use require_php_with_use pdo instead now.
350# @RETURN: die if feature is missing 357# @RETURN: die if feature is missing
351require_pdo() { 358require_pdo() {
359 eqawarn "(require_pdo) Deprecated function call. Set to be removed on 2015-07-17"
352 has_php 360 has_php
353 361
354 # Was PHP5 compiled with internal PDO support? 362 # Was PHP5 compiled with internal PDO support?
355 if built_with_use =${PHP_PKG} pdo || phpconfutils_built_with_use =${PHP_PKG} pdo ; then 363 if built_with_use =${PHP_PKG} pdo ; then
356 return 364 return
357 else 365 else
358 eerror 366 eerror
359 eerror "No PDO extension for PHP found." 367 eerror "No PDO extension for PHP found."
360 eerror "Please note that PDO only exists for PHP 5." 368 eerror "Please note that PDO only exists for PHP 5."
370# Determines which installed PHP version has the CLI SAPI enabled. 378# Determines which installed PHP version has the CLI SAPI enabled.
371# Useful for PEAR stuff, or anything which needs to run PHP script 379# Useful for PEAR stuff, or anything which needs to run PHP script
372# depending on the CLI SAPI. 380# depending on the CLI SAPI.
373# @RETURN: die if feature is missing 381# @RETURN: die if feature is missing
374require_php_cli() { 382require_php_cli() {
383 eqawarn "(require_php_cli) Deprecated function call. Set to be removed on 2015-07-17"
375 # If PHP_PKG is set, then we have remembered our PHP settings 384 # If PHP_PKG is set, then we have remembered our PHP settings
376 # from last time 385 # from last time
377 if [[ -n ${PHP_PKG} ]] ; then 386 if [[ -n ${PHP_PKG} ]] ; then
378 return 387 return
379 fi 388 fi
381 local PHP_PACKAGE_FOUND="" 390 local PHP_PACKAGE_FOUND=""
382 391
383 if has_version '=dev-lang/php-5*' ; then 392 if has_version '=dev-lang/php-5*' ; then
384 PHP_PACKAGE_FOUND="1" 393 PHP_PACKAGE_FOUND="1"
385 pkg="$(best_version '=dev-lang/php-5*')" 394 pkg="$(best_version '=dev-lang/php-5*')"
386 if built_with_use =${pkg} cli || phpconfutils_built_with_use =${pkg} cli ; then 395 if built_with_use =${pkg} cli ; then
387 PHP_VERSION="5" 396 PHP_VERSION="5"
388 fi 397 fi
389 fi 398 fi
390 399
391 if [[ -z ${PHP_PACKAGE_FOUND} ]] ; then 400 if [[ -z ${PHP_PACKAGE_FOUND} ]] ; then
416 local PHP_PACKAGE_FOUND="" 425 local PHP_PACKAGE_FOUND=""
417 426
418 if has_version '=dev-lang/php-5*' ; then 427 if has_version '=dev-lang/php-5*' ; then
419 PHP_PACKAGE_FOUND="1" 428 PHP_PACKAGE_FOUND="1"
420 pkg="$(best_version '=dev-lang/php-5*')" 429 pkg="$(best_version '=dev-lang/php-5*')"
421 if built_with_use =${pkg} cgi || phpconfutils_built_with_use =${pkg} cgi ; then 430 if built_with_use =${pkg} cgi ; then
422 PHP_VERSION="5" 431 PHP_VERSION="5"
423 fi 432 fi
424 fi 433 fi
425 434
426 if [[ -z ${PHP_PACKAGE_FOUND} ]] ; then 435 if [[ -z ${PHP_PACKAGE_FOUND} ]] ; then
439# @FUNCTION: require_sqlite 448# @FUNCTION: require_sqlite
440# @DESCRIPTION: 449# @DESCRIPTION:
441# Require a PHP built with SQLite support 450# Require a PHP built with SQLite support
442# @RETURN: die if feature is missing 451# @RETURN: die if feature is missing
443require_sqlite() { 452require_sqlite() {
453 eqawarn "(require_sqlite) Deprecated function call. Set to be removed on 2015-07-17"
444 has_php 454 has_php
445 455
446 # Has our PHP been built with SQLite support? 456 # Has our PHP been built with SQLite support?
447 if built_with_use =${PHP_PKG} sqlite || phpconfutils_built_with_use =${PHP_PKG} sqlite ; then 457 if built_with_use =${PHP_PKG} sqlite ; then
448 return 458 return
449 fi 459 fi
450 460
451 # If we get here, then we don't have any SQLite support for PHP installed 461 # If we get here, then we don't have any SQLite support for PHP installed
452 eerror 462 eerror
461# @FUNCTION: require_gd 471# @FUNCTION: require_gd
462# @DESCRIPTION: 472# @DESCRIPTION:
463# Require a PHP built with GD support 473# Require a PHP built with GD support
464# @RETURN: die if feature is missing 474# @RETURN: die if feature is missing
465require_gd() { 475require_gd() {
476 eqawarn "(require_gd) Deprecated function call. Set to be removed on 2015-07-17"
466 has_php 477 has_php
467 478
468 # Do we have the internal GD support installed? 479 # Do we have the internal GD support installed?
469 if built_with_use =${PHP_PKG} gd || phpconfutils_built_with_use =${PHP_PKG} gd ; then 480 if built_with_use =${PHP_PKG} gd ; then
470 return 481 return
471 fi 482 fi
472 483
473 # Ok, maybe GD was built using the external library support? 484 # Ok, maybe GD was built using the external library support?
474 if built_with_use =${PHP_PKG} gd-external || phpconfutils_built_with_use =${PHP_PKG} gd-external ; then 485 if built_with_use =${PHP_PKG} gd-external ; then
475 return 486 return
476 fi 487 fi
477 488
478 # If we get here, then we have no GD support 489 # If we get here, then we have no GD support
479 eerror 490 eerror
494 505
495# @FUNCTION: php_binary_extension 506# @FUNCTION: php_binary_extension
496# @DESCRIPTION: 507# @DESCRIPTION:
497# Executes some checks needed when installing a binary PHP extension. 508# Executes some checks needed when installing a binary PHP extension.
498php_binary_extension() { 509php_binary_extension() {
510 eqawarn "(php_binary_extension) Deprecated function call. Set to be removed on 2015-07-17"
499 has_php 511 has_php
500 512
501 local PUSE_ENABLED="" 513 local PUSE_ENABLED=""
502 514
503 # Binary extensions do not support the change of PHP 515 # Binary extensions do not support the change of PHP

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

  ViewVC Help
Powered by ViewVC 1.1.20