/[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.14 Revision 1.17
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.14 2006/05/05 21:42:16 chtekk Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/depend.php.eclass,v 1.17 2007/02/02 19:09:33 chtekk 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
48 PHPCONFIG="/usr/${libdir}/php4/bin/php-config" 48 PHPCONFIG="/usr/${libdir}/php4/bin/php-config"
49 PHPCLI="/usr/${libdir}/php4/bin/php" 49 PHPCLI="/usr/${libdir}/php4/bin/php"
50 PHPCGI="/usr/${libdir}/php4/bin/php-cgi" 50 PHPCGI="/usr/${libdir}/php4/bin/php-cgi"
51 PHP_PKG="`best_version =dev-lang/php-4*`" 51 PHP_PKG="`best_version =dev-lang/php-4*`"
52 PHPPREFIX="/usr/${libdir}/php4" 52 PHPPREFIX="/usr/${libdir}/php4"
53 EXT_DIR="`${PHPCONFIG} --extension-dir 2>/dev/null`"
53 54
54 einfo 55 einfo
55 einfo "Using ${PHP_PKG}" 56 einfo "Using ${PHP_PKG}"
56 einfo 57 einfo
57} 58}
85 PHPCONFIG="/usr/${libdir}/php5/bin/php-config" 86 PHPCONFIG="/usr/${libdir}/php5/bin/php-config"
86 PHPCLI="/usr/${libdir}/php5/bin/php" 87 PHPCLI="/usr/${libdir}/php5/bin/php"
87 PHPCGI="/usr/${libdir}/php5/bin/php-cgi" 88 PHPCGI="/usr/${libdir}/php5/bin/php-cgi"
88 PHP_PKG="`best_version =dev-lang/php-5*`" 89 PHP_PKG="`best_version =dev-lang/php-5*`"
89 PHPPREFIX="/usr/${libdir}/php5" 90 PHPPREFIX="/usr/${libdir}/php5"
91 EXT_DIR="`${PHPCONFIG} --extension-dir 2>/dev/null`"
90 92
91 einfo 93 einfo
92 einfo "Using ${PHP_PKG}" 94 einfo "Using ${PHP_PKG}"
93 einfo 95 einfo
94} 96}
202 einfo " Discovered missing USE flag: ${x}" 204 einfo " Discovered missing USE flag: ${x}"
203 missing_use="${missing_use} ${x}" 205 missing_use="${missing_use} ${x}"
204 fi 206 fi
205 done 207 done
206 208
207 if [[ -z ${missing_use} ]] ; then 209 if [[ -z "${missing_use}" ]] ; then
210 if [[ -z "${PHPCHECKNODIE}" ]] ; then
208 return 211 return
212 else
213 return 0
209 fi 214 fi
215 fi
210 216
217 if [[ -z "${PHPCHECKNODIE}" ]] ; then
211 eerror 218 eerror
212 eerror "${PHP_PKG} needs to be re-installed with all of the following" 219 eerror "${PHP_PKG} needs to be re-installed with all of the following"
213 eerror "USE flags enabled:" 220 eerror "USE flags enabled:"
214 eerror 221 eerror
215 eerror " $@" 222 eerror " $@"
216 eerror 223 eerror
217 die "Missing PHP USE flags found" 224 die "Missing PHP USE flags found"
225 else
226 return 1
227 fi
218} 228}
219 229
220# Call this function from pkg_setup if your package requires PHP compiled 230# Call this function from pkg_setup if your package requires PHP compiled
221# with any of specified USE flags 231# with any of specified USE flags
222# 232#
240 else 250 else
241 missing_use="${missing_use} ${x}" 251 missing_use="${missing_use} ${x}"
242 fi 252 fi
243 done 253 done
244 254
245 if [[ -z ${missing_use} ]] ; then 255 if [[ -z "${missing_use}" ]] ; then
256 if [[ -z "${PHPCHECKNODIE}" ]] ; then
246 return 257 return
258 else
259 return 0
247 fi 260 fi
261 fi
248 262
263 if [[ -z "${PHPCHECKNODIE}" ]] ; then
249 eerror 264 eerror
250 eerror "${PHP_PKG} needs to be re-installed with any of the following" 265 eerror "${PHP_PKG} needs to be re-installed with any of the following"
251 eerror "USE flags enabled:" 266 eerror "USE flags enabled:"
252 eerror 267 eerror
253 eerror " $@" 268 eerror " $@"
254 eerror 269 eerror
255 die "Missing PHP USE flags found" 270 die "Missing PHP USE flags found"
271 else
272 return 1
273 fi
256} 274}
257 275
258# ======================================================================== 276# ========================================================================
259# has_*() functions 277# has_*() functions
260# 278#
503 521
504 local PUSE_ENABLED="" 522 local PUSE_ENABLED=""
505 523
506 # Binary extensions do not support the change of PHP 524 # Binary extensions do not support the change of PHP
507 # API version, so they can't be installed when USE flags 525 # API version, so they can't be installed when USE flags
508 # are enabled wich change the PHP API version 526 # are enabled which change the PHP API version, they also
527 # don't provide correctly versioned symbols for our use
509 528
510 if built_with_use =${PHP_PKG} hardenedphp || phpconfutils_built_with_use =${PHP_PKG} hardenedphp ; then 529 if built_with_use =${PHP_PKG} hardenedphp || phpconfutils_built_with_use =${PHP_PKG} hardenedphp ; then
511 eerror 530 eerror
512 eerror "You cannot install binary PHP extensions" 531 eerror "You cannot install binary PHP extensions"
513 eerror "when the 'hardenedphp' USE flag is enabled!" 532 eerror "when the 'hardenedphp' USE flag is enabled!"
525 eerror "'debug' USE flag turned off." 544 eerror "'debug' USE flag turned off."
526 eerror 545 eerror
527 PUSE_ENABLED="1" 546 PUSE_ENABLED="1"
528 fi 547 fi
529 548
549 if built_with_use =${PHP_PKG} concurrentmodphp || phpconfutils_built_with_use =${PHP_PKG} concurrentmodphp ; then
550 eerror
551 eerror "You cannot install binary PHP extensions when"
552 eerror "the 'concurrentmodphp' USE flag is enabled!"
553 eerror "Please reemerge dev-lang/php with the"
554 eerror "'concurrentmodphp' USE flag turned off."
555 eerror
556 PUSE_ENABLED="1"
557 fi
558
530 if [[ -n ${PUSE_ENABLED} ]] ; then 559 if [[ -n ${PUSE_ENABLED} ]] ; then
531 die "'hardenedphp' and/or 'debug' USE flags turned on" 560 die "'hardenedphp' and/or 'debug' and/or 'concurrentmodphp' USE flags turned on!"
532 fi 561 fi
533} 562}
534 563
535# Alternative to dodoc function for use in our PHP eclasses and 564# Alternative to dodoc function for use in our PHP eclasses and
536# ebuilds. 565# ebuilds.

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.20