/[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.21 Revision 1.22
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/depend.php.eclass,v 1.21 2007/09/01 15:58:17 jokey Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/depend.php.eclass,v 1.22 2007/12/24 12:29:36 armin76 Exp $
4 4
5# Author: Stuart Herbert <stuart@gentoo.org> 5# Author: Stuart Herbert <stuart@gentoo.org>
6# Author: Luca Longinotti <chtekk@gentoo.org> 6# Author: Luca Longinotti <chtekk@gentoo.org>
7# Author: Jakub Moc <jakub@gentoo.org> (documentation) 7# Author: Jakub Moc <jakub@gentoo.org> (documentation)
8 8
58 58
59 PHPIZE="/usr/${libdir}/php4/bin/phpize" 59 PHPIZE="/usr/${libdir}/php4/bin/phpize"
60 PHPCONFIG="/usr/${libdir}/php4/bin/php-config" 60 PHPCONFIG="/usr/${libdir}/php4/bin/php-config"
61 PHPCLI="/usr/${libdir}/php4/bin/php" 61 PHPCLI="/usr/${libdir}/php4/bin/php"
62 PHPCGI="/usr/${libdir}/php4/bin/php-cgi" 62 PHPCGI="/usr/${libdir}/php4/bin/php-cgi"
63 PHP_PKG="`best_version =dev-lang/php-4*`" 63 PHP_PKG="$(best_version =dev-lang/php-4*)"
64 PHPPREFIX="/usr/${libdir}/php4" 64 PHPPREFIX="/usr/${libdir}/php4"
65 EXT_DIR="`${PHPCONFIG} --extension-dir 2>/dev/null`" 65 EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)"
66 66
67 einfo 67 einfo
68 einfo "Using ${PHP_PKG}" 68 einfo "Using ${PHP_PKG}"
69 einfo 69 einfo
70} 70}
109 109
110 PHPIZE="/usr/${libdir}/php5/bin/phpize" 110 PHPIZE="/usr/${libdir}/php5/bin/phpize"
111 PHPCONFIG="/usr/${libdir}/php5/bin/php-config" 111 PHPCONFIG="/usr/${libdir}/php5/bin/php-config"
112 PHPCLI="/usr/${libdir}/php5/bin/php" 112 PHPCLI="/usr/${libdir}/php5/bin/php"
113 PHPCGI="/usr/${libdir}/php5/bin/php-cgi" 113 PHPCGI="/usr/${libdir}/php5/bin/php-cgi"
114 PHP_PKG="`best_version =dev-lang/php-5*`" 114 PHP_PKG="$(best_version =dev-lang/php-5*)"
115 PHPPREFIX="/usr/${libdir}/php5" 115 PHPPREFIX="/usr/${libdir}/php5"
116 EXT_DIR="`${PHPCONFIG} --extension-dir 2>/dev/null`" 116 EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)"
117 117
118 einfo 118 einfo
119 einfo "Using ${PHP_PKG}" 119 einfo "Using ${PHP_PKG}"
120 einfo 120 einfo
121} 121}
395# ======================================================================== 395# ========================================================================
396 396
397# @FUNCTION: require_pdo 397# @FUNCTION: require_pdo
398# @DESCRIPTION: 398# @DESCRIPTION:
399# Require a PHP built with PDO support (PHP5 only). 399# Require a PHP built with PDO support (PHP5 only).
400# This function is now redundant and DEPRECATED since
401# pdo-external use flag and pecl-pdo-* ebuilds were removed.
402# You should use require_php_with_use pdo instead now.
400# @RETURN: die if feature is missing 403# @RETURN: die if feature is missing
401require_pdo() { 404require_pdo() {
402 has_php 405 has_php
403 406
404 # Do we have PHP5 installed? 407 # Do we have PHP5 installed?
405 if [[ "${PHP_VERSION}" == "4" ]] ; then 408 if [[ "${PHP_VERSION}" == "4" ]] ; then
406 eerror 409 eerror
407 eerror "This package requires PDO." 410 eerror "This package requires PDO."
408 eerror "PDO is only available for PHP 5." 411 eerror "PDO is only available for PHP 5."
409 eerror "You must install >=dev-lang/php-5.1 with" 412 eerror "You must install >=dev-lang/php-5.1 with USE=\"pdo\"."
410 eerror "either the 'pdo' or the 'pdo-external'"
411 eerror "USE flags turned on." 413 eerror "pdo USE flags turned on."
412 eerror 414 eerror
413 die "PHP 5 not installed" 415 die "PHP 5 not installed"
414 fi 416 fi
415 417
416 # Was PHP5 compiled with internal PDO support? 418 # Was PHP5 compiled with internal PDO support?
417 if built_with_use =${PHP_PKG} pdo || phpconfutils_built_with_use =${PHP_PKG} pdo ; then 419 if built_with_use =${PHP_PKG} pdo || phpconfutils_built_with_use =${PHP_PKG} pdo ; then
418 return 420 return
419 fi 421 else
420
421 # Ok, maybe PDO was built as an external extension?
422 if ( built_with_use =${PHP_PKG} pdo-external || phpconfutils_built_with_use =${PHP_PKG} pdo-external ) && has_version 'dev-php5/pecl-pdo' ; then
423 return
424 fi
425
426 # Ok, as last resort, it suffices that pecl-pdo was installed to have PDO support
427 if has_version 'dev-php5/pecl-pdo' ; then
428 return
429 fi
430
431 # If we get here, then we don't have PDO support
432 eerror 422 eerror
433 eerror "No PDO extension for PHP found." 423 eerror "No PDO extension for PHP found."
434 eerror "Please note that PDO only exists for PHP 5." 424 eerror "Please note that PDO only exists for PHP 5."
435 eerror "Please install a PDO extension for PHP 5," 425 eerror "Please install a PDO extension for PHP 5."
436 eerror "you must install >=dev-lang/php-5.1 with" 426 eerror "You must install >=dev-lang/php-5.1 with USE=\"pdo\"."
437 eerror "either the 'pdo' or the 'pdo-external'"
438 eerror "USE flags turned on."
439 eerror 427 eerror
440 die "No PDO extension for PHP 5 found" 428 die "No PDO extension for PHP 5 found"
429 fi
441} 430}
442 431
443# @FUNCTION: require_php_cli 432# @FUNCTION: require_php_cli
444# @DESCRIPTION: 433# @DESCRIPTION:
445# Determines which installed PHP version has the CLI SAPI enabled. 434# Determines which installed PHP version has the CLI SAPI enabled.
456 local PHP_PACKAGE_FOUND="" 445 local PHP_PACKAGE_FOUND=""
457 446
458 # Detect which PHP version we have installed 447 # Detect which PHP version we have installed
459 if has_version '=dev-lang/php-4*' ; then 448 if has_version '=dev-lang/php-4*' ; then
460 PHP_PACKAGE_FOUND="1" 449 PHP_PACKAGE_FOUND="1"
461 pkg="`best_version '=dev-lang/php-4*'`" 450 pkg="$(best_version '=dev-lang/php-4*')"
462 if built_with_use =${pkg} cli || phpconfutils_built_with_use =${pkg} cli ; then 451 if built_with_use =${pkg} cli || phpconfutils_built_with_use =${pkg} cli ; then
463 PHP_VERSION="4" 452 PHP_VERSION="4"
464 fi 453 fi
465 fi 454 fi
466 455
467 if has_version '=dev-lang/php-5*' ; then 456 if has_version '=dev-lang/php-5*' ; then
468 PHP_PACKAGE_FOUND="1" 457 PHP_PACKAGE_FOUND="1"
469 pkg="`best_version '=dev-lang/php-5*'`" 458 pkg="$(best_version '=dev-lang/php-5*')"
470 if built_with_use =${pkg} cli || phpconfutils_built_with_use =${pkg} cli ; then 459 if built_with_use =${pkg} cli || phpconfutils_built_with_use =${pkg} cli ; then
471 PHP_VERSION="5" 460 PHP_VERSION="5"
472 fi 461 fi
473 fi 462 fi
474 463
500 local PHP_PACKAGE_FOUND="" 489 local PHP_PACKAGE_FOUND=""
501 490
502 # Detect which PHP version we have installed 491 # Detect which PHP version we have installed
503 if has_version '=dev-lang/php-4*' ; then 492 if has_version '=dev-lang/php-4*' ; then
504 PHP_PACKAGE_FOUND="1" 493 PHP_PACKAGE_FOUND="1"
505 pkg="`best_version '=dev-lang/php-4*'`" 494 pkg="$(best_version '=dev-lang/php-4*')"
506 if built_with_use =${pkg} cgi || phpconfutils_built_with_use =${pkg} cgi ; then 495 if built_with_use =${pkg} cgi || phpconfutils_built_with_use =${pkg} cgi ; then
507 PHP_VERSION="4" 496 PHP_VERSION="4"
508 fi 497 fi
509 fi 498 fi
510 499
511 if has_version '=dev-lang/php-5*' ; then 500 if has_version '=dev-lang/php-5*' ; then
512 PHP_PACKAGE_FOUND="1" 501 PHP_PACKAGE_FOUND="1"
513 pkg="`best_version '=dev-lang/php-5*'`" 502 pkg="$(best_version '=dev-lang/php-5*')"
514 if built_with_use =${pkg} cgi || phpconfutils_built_with_use =${pkg} cgi ; then 503 if built_with_use =${pkg} cgi || phpconfutils_built_with_use =${pkg} cgi ; then
515 PHP_VERSION="5" 504 PHP_VERSION="5"
516 fi 505 fi
517 fi 506 fi
518 507

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.20