| 1 | # Copyright 1999-2005 Gentoo Foundation |
1 | # Copyright 1999-2005 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.8 2006/01/01 01:14:59 swegener Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/depend.php.eclass,v 1.9 2006/01/21 09:02:44 sebastian Exp $ |
| 4 | # |
4 | # |
| 5 | # ======================================================================== |
5 | # ======================================================================== |
| 6 | # |
6 | # |
| 7 | # depend.php.eclass |
7 | # depend.php.eclass |
| 8 | # functions to allow ebuilds to depend on php4 and/or php5 |
8 | # functions to allow ebuilds to depend on php4 and/or php5 |
| … | |
… | |
| 379 | return |
379 | return |
| 380 | fi |
380 | fi |
| 381 | |
381 | |
| 382 | # detect which PHP version installed |
382 | # detect which PHP version installed |
| 383 | if has_version '=dev-lang/php-4*' ; then |
383 | if has_version '=dev-lang/php-4*' ; then |
|
|
384 | PHP_PACKAGE_FOUND=1 |
| 384 | pkg="`best_version '=dev-lang/php-4*'`" |
385 | pkg="`best_version '=dev-lang/php-4*'`" |
| 385 | if built_with_use =${pkg} cgi ; then |
386 | if built_with_use =${pkg} cgi ; then |
| 386 | PHP_VERSION=4 |
387 | PHP_VERSION=4 |
| 387 | fi |
388 | fi |
|
|
389 | fi |
|
|
390 | |
| 388 | elif has_version '=dev-lang/php-5*' ; then |
391 | if has_version '=dev-lang/php-5*' ; then |
|
|
392 | PHP_PACKAGE_FOUND=1 |
| 389 | pkg="`best_version '=dev-lang/php-5*'`" |
393 | pkg="`best_version '=dev-lang/php-5*'`" |
| 390 | if built_with_use =${pkg} cgi ; then |
394 | if built_with_use =${pkg} cgi ; then |
| 391 | PHP_VERSION=5 |
395 | PHP_VERSION=5 |
| 392 | fi |
396 | fi |
| 393 | else |
397 | fi |
|
|
398 | |
|
|
399 | if [[ -z ${PHP_PACKAGE_FOUND} ]]; then |
| 394 | die "Unable to find an installed dev-lang/php package" |
400 | die "Unable to find an installed dev-lang/php package" |
| 395 | fi |
401 | fi |
| 396 | |
402 | |
| 397 | if [[ -z ${PHP_VERSION} ]]; then |
403 | if [[ -z ${PHP_VERSION} ]]; then |
| 398 | die "No PHP CGI installed" |
404 | die "No PHP CGI installed" |