/[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.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.21 2007/09/01 15:58:17 jokey 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 php[45] 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 php[45] 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
21# PHP4-only depend functions
22
23# @FUNCTION: need_php4_cli
24# @DESCRIPTION:
25# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP4
26# with cli SAPI.
27need_php4_cli() {
28 DEPEND="${DEPEND} =virtual/php-4*"
29 RDEPEND="${RDEPEND} =virtual/php-4*"
30 PHP_VERSION="4"
31}
32
33# @FUNCTION: need_php4_httpd
34# @DESCRIPTION:
35# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP4
36# with either cgi or apache2 SAPI.
37need_php4_httpd() {
38 DEPEND="${DEPEND} =virtual/httpd-php-4*"
39 RDEPEND="${RDEPEND} =virtual/httpd-php-4*"
40 PHP_VERSION="4"
41}
42
43# @FUNCTION: need_php4
44# @DESCRIPTION:
45# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP4
46# (with any SAPI).
47need_php4() {
48 DEPEND="${DEPEND} =dev-lang/php-4*"
49 RDEPEND="${RDEPEND} =dev-lang/php-4*"
50 PHP_VERSION="4"
51 PHP_SHARED_CAT="php4"
52}
53
54# common settings go in here
55uses_php4() {
56 # cache this
57 libdir=$(get_libdir)
58
59 PHPIZE="/usr/${libdir}/php4/bin/phpize"
60 PHPCONFIG="/usr/${libdir}/php4/bin/php-config"
61 PHPCLI="/usr/${libdir}/php4/bin/php"
62 PHPCGI="/usr/${libdir}/php4/bin/php-cgi"
63 PHP_PKG="`best_version =dev-lang/php-4*`"
64 PHPPREFIX="/usr/${libdir}/php4"
65 EXT_DIR="`${PHPCONFIG} --extension-dir 2>/dev/null`"
66
67 einfo
68 einfo "Using ${PHP_PKG}"
69 einfo
70}
71 19
72# PHP5-only depend functions 20# PHP5-only depend functions
73 21
74# @FUNCTION: need_php5_cli 22# @FUNCTION: need_php5_cli
75# @DESCRIPTION: 23# @DESCRIPTION:
76# 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
77# with cli SAPI. 25# with cli SAPI.
78need_php5_cli() { 26need_php5_cli() {
27 eqawarn "(need_php5_cli) Deprecated function call. Set to be removed on 2015-07-17"
79 DEPEND="${DEPEND} =virtual/php-5*" 28 DEPEND="${DEPEND} =dev-lang/php-5*"
80 RDEPEND="${RDEPEND} =virtual/php-5*" 29 RDEPEND="${RDEPEND} =dev-lang/php-5*"
81 PHP_VERSION="5" 30 PHP_VERSION="5"
82} 31}
83 32
84# @FUNCTION: need_php5_httpd 33# @FUNCTION: need_php5_httpd
85# @DESCRIPTION: 34# @DESCRIPTION:
86# 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
87# with either cgi or apache2 SAPI. 36# with either cgi or apache2 SAPI.
88need_php5_httpd() { 37need_php5_httpd() {
38 eqawarn "(need_php5_httpd) Deprecated function call. Set to be removed on 2015-07-17"
89 DEPEND="${DEPEND} =virtual/httpd-php-5*" 39 DEPEND="${DEPEND} =virtual/httpd-php-5*"
90 RDEPEND="${RDEPEND} =virtual/httpd-php-5*" 40 RDEPEND="${RDEPEND} =virtual/httpd-php-5*"
91 PHP_VERSION="5" 41 PHP_VERSION="5"
92} 42}
93 43
109 59
110 PHPIZE="/usr/${libdir}/php5/bin/phpize" 60 PHPIZE="/usr/${libdir}/php5/bin/phpize"
111 PHPCONFIG="/usr/${libdir}/php5/bin/php-config" 61 PHPCONFIG="/usr/${libdir}/php5/bin/php-config"
112 PHPCLI="/usr/${libdir}/php5/bin/php" 62 PHPCLI="/usr/${libdir}/php5/bin/php"
113 PHPCGI="/usr/${libdir}/php5/bin/php-cgi" 63 PHPCGI="/usr/${libdir}/php5/bin/php-cgi"
114 PHP_PKG="`best_version =dev-lang/php-5*`" 64 PHP_PKG="$(best_version =dev-lang/php-5*)"
115 PHPPREFIX="/usr/${libdir}/php5" 65 PHPPREFIX="/usr/${libdir}/php5"
116 EXT_DIR="`${PHPCONFIG} --extension-dir 2>/dev/null`" 66 EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)"
117 67
118 einfo 68 einfo
119 einfo "Using ${PHP_PKG}" 69 einfo "Using ${PHP_PKG}"
120 einfo 70 einfo
121} 71}
125# @FUNCTION: need_php_cli 75# @FUNCTION: need_php_cli
126# @DESCRIPTION: 76# @DESCRIPTION:
127# 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
128# (any version) with cli SAPI. 78# (any version) with cli SAPI.
129need_php_cli() { 79need_php_cli() {
80 eqawarn "(need_php_cli) Deprecated function call. Set to be removed on 2015-07-17"
130 DEPEND="${DEPEND} virtual/php" 81 DEPEND="${DEPEND} dev-lang/php"
131 RDEPEND="${RDEPEND} virtual/php" 82 RDEPEND="${RDEPEND} dev-lang/php"
132} 83}
133 84
134# @FUNCTION: need_php_httpd 85# @FUNCTION: need_php_httpd
135# @DESCRIPTION: 86# @DESCRIPTION:
136# 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
151} 102}
152 103
153# @FUNCTION: need_php_by_category 104# @FUNCTION: need_php_by_category
154# @DESCRIPTION: 105# @DESCRIPTION:
155# 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
156# determined by ${CATEGORY} - any PHP version, PHP4 or PHP5 for dev-php, dev-php4 and 107# determined by ${CATEGORY} - any PHP version or PHP5 for dev-php or
157# dev-php5, respectively. 108# dev-php5, respectively.
158need_php_by_category() { 109need_php_by_category() {
110 eqawarn "(need_php_by_category) Deprecated function call. Set to be removed on 2015-07-17"
159 case "${CATEGORY}" in 111 case "${CATEGORY}" in
160 dev-php) need_php ;; 112 dev-php) need_php ;;
161 dev-php4) need_php4 ;;
162 dev-php5) need_php5 ;;
163 *) die "Version of PHP required by packages in category ${CATEGORY} unknown" 113 *) die "Version of PHP required by packages in category ${CATEGORY} unknown"
164 esac 114 esac
165} 115}
166 116
167 117
168# @FUNCTION: has_php 118# @FUNCTION: has_php
169# @DESCRIPTION: 119# @DESCRIPTION:
170# Call this function from your pkg_setup, src_compile, src_install etc. if you 120# Call this function from your pkg_setup, src_compile, src_install etc. if you
171# need to know which PHP version is being used and where the PHP binaries/data 121# need to know which PHP version is being used and where the PHP binaries/data
172# are installed. 122# are installed.
173has_php() { 123has_php() {
174 # If PHP_PKG is already set, then we have remembered our PHP settings
175 # from last time
176 if [[ -n ${PHP_PKG} ]] ; then
177 return
178 fi
179
180 if [[ -z ${PHP_VERSION} ]] ; then
181 # Detect which PHP version we have installed 124 # Detect which PHP version we have installed
182 if has_version '=dev-lang/php-5*' ; then 125 if has_version '=dev-lang/php-5*' ; then
183 PHP_VERSION="5" 126 PHP_VERSION="5"
184 elif has_version '=dev-lang/php-4*' ; then
185 PHP_VERSION="4"
186 else 127 else
187 die "Unable to find an installed dev-lang/php package" 128 die "Unable to find an installed dev-lang/php package"
188 fi
189 fi 129 fi
190 130
191 # If we get here, then PHP_VERSION tells us which version of PHP we 131 # If we get here, then PHP_VERSION tells us which version of PHP we
192 # want to use 132 # want to use
193 uses_php${PHP_VERSION} 133 uses_php${PHP_VERSION}
203# of them is available. 143# of them is available.
204# 144#
205# Unfortunately, if you want to be really sure that the required SAPI is 145# Unfortunately, if you want to be really sure that the required SAPI is
206# provided by PHP, you will have to use this function or similar ones (like 146# provided by PHP, you will have to use this function or similar ones (like
207# 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
208# 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
209# and need_php[45]_httpd functions cannot guarantee these requirements. 149# and need_php[45]_httpd functions cannot guarantee these requirements.
210# See Bug 2272 for details. 150# See Bug 2272 for details.
211require_php_sapi_from() { 151require_php_sapi_from() {
152 eqawarn "(require_php_sapi_from) Deprecated function call. Set to be removed on 2015-07-17"
212 has_php 153 has_php
213 154
214 local has_sapi="0" 155 local has_sapi="0"
215 local x 156 local x
216 157
217 einfo "Checking for compatible SAPI(s)" 158 einfo "Checking for compatible SAPI(s)"
218 159
219 for x in $@ ; do 160 for x in $@ ; do
220 if built_with_use =${PHP_PKG} ${x} || phpconfutils_built_with_use =${PHP_PKG} ${x} ; then 161 if built_with_use =${PHP_PKG} ${x} ; then
221 einfo " Discovered compatible SAPI ${x}" 162 einfo " Discovered compatible SAPI ${x}"
222 has_sapi="1" 163 has_sapi="1"
223 fi 164 fi
224 done 165 done
225 166
245 186
246# @VARIABLE: PHPCHECKNODIE 187# @VARIABLE: PHPCHECKNODIE
247# @DESCRIPTION: 188# @DESCRIPTION:
248# You can set PHPCHECKNODIE to non-empty value in your ebuild to chain multiple 189# You can set PHPCHECKNODIE to non-empty value in your ebuild to chain multiple
249# require_php_with_(any)_use checks without making the ebuild die on every failure. 190# require_php_with_(any)_use checks without making the ebuild die on every failure.
250# This is useful in cases when certain PHP features are only required if specific 191# This is useful in cases when certain PHP features are only required if specific
251# USE flag(s) are enabled for that ebuild. 192# USE flag(s) are enabled for that ebuild.
252# @CODE 193# @CODE
253# Example: 194# Example:
254# 195#
255# local flags="pcre session snmp sockets wddx" 196# local flags="pcre session snmp sockets wddx"
267 local x 208 local x
268 209
269 einfo "Checking for required PHP feature(s) ..." 210 einfo "Checking for required PHP feature(s) ..."
270 211
271 for x in $@ ; do 212 for x in $@ ; do
272 if ! built_with_use =${PHP_PKG} ${x} && ! phpconfutils_built_with_use =${PHP_PKG} ${x} ; then 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
222 if ! built_with_use =${PHP_PKG} ${x} ; then
273 einfo " Discovered missing USE flag: ${x}" 223 einfo " Discovered missing USE flag: ${x}"
274 missing_use="${missing_use} ${x}" 224 missing_use="${missing_use} ${x}"
275 fi 225 fi
276 done 226 done
277 227
301# @DESCRIPTION: 251# @DESCRIPTION:
302# 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
303# 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.
304# Dies if all of the listed USE flags are disabled. 254# Dies if all of the listed USE flags are disabled.
305require_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"
306 has_php 257 has_php
307 258
308 local missing_use="" 259 local missing_use=""
309 local x 260 local x
310 261
311 einfo "Checking for required PHP feature(s) ..." 262 einfo "Checking for required PHP feature(s) ..."
312 263
313 for x in $@ ; do 264 for x in $@ ; do
314 if built_with_use =${PHP_PKG} ${x} || phpconfutils_built_with_use =${PHP_PKG} ${x} ; then 265 if built_with_use =${PHP_PKG} ${x} ; then
315 einfo " USE flag ${x} is enabled, ok ..." 266 einfo " USE flag ${x} is enabled, ok ..."
316 return 267 return
317 else 268 else
318 missing_use="${missing_use} ${x}" 269 missing_use="${missing_use} ${x}"
319 fi 270 fi
349# @FUNCTION: has_zts 300# @FUNCTION: has_zts
350# @DESCRIPTION: 301# @DESCRIPTION:
351# 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.
352# @RETURN: 0 if true, 1 otherwise 303# @RETURN: 0 if true, 1 otherwise
353has_zts() { 304has_zts() {
305 eqawarn "(has_zts) Deprecated function call. Set to be removed on 2015-07-17"
354 has_php 306 has_php
355 307
356 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
357 return 0 309 return 0
358 fi 310 fi
359 311
360 return 1 312 return 1
361} 313}
363# @FUNCTION: has_debug 315# @FUNCTION: has_debug
364# @DESCRIPTION: 316# @DESCRIPTION:
365# Check if our PHP was built with debug support enabled. 317# Check if our PHP was built with debug support enabled.
366# @RETURN: 0 if true, 1 otherwise 318# @RETURN: 0 if true, 1 otherwise
367has_debug() { 319has_debug() {
320 eqawarn "(has_debug) Deprecated function call. Set to be removed on 2015-07-17"
368 has_php 321 has_php
369 322
370 if built_with_use =${PHP_PKG} debug || phpconfutils_built_with_use =${PHP_PKG} debug ; then 323 if built_with_use =${PHP_PKG} debug ; then
371 return 0 324 return 0
372 fi 325 fi
373 326
374 return 1 327 return 1
375} 328}
377# @FUNCTION: has_concurrentmodphp 330# @FUNCTION: has_concurrentmodphp
378# @DESCRIPTION: 331# @DESCRIPTION:
379# Check if our PHP was built with the concurrentmodphp support enabled. 332# Check if our PHP was built with the concurrentmodphp support enabled.
380# @RETURN: 0 if true, 1 otherwise 333# @RETURN: 0 if true, 1 otherwise
381has_concurrentmodphp() { 334has_concurrentmodphp() {
335 eqawarn "(has_concurrentmodphp) Deprecated function call. Set to be removed on 2015-07-17"
382 has_php 336 has_php
383 337
384 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
385 return 0 339 return 0
386 fi 340 fi
387 341
388 return 1 342 return 1
389} 343}
395# ======================================================================== 349# ========================================================================
396 350
397# @FUNCTION: require_pdo 351# @FUNCTION: require_pdo
398# @DESCRIPTION: 352# @DESCRIPTION:
399# Require a PHP built with PDO support (PHP5 only). 353# Require a PHP built with PDO support (PHP5 only).
354# This function is now redundant and DEPRECATED since
355# pdo-external use flag and pecl-pdo-* ebuilds were removed.
356# You should use require_php_with_use pdo instead now.
400# @RETURN: die if feature is missing 357# @RETURN: die if feature is missing
401require_pdo() { 358require_pdo() {
359 eqawarn "(require_pdo) Deprecated function call. Set to be removed on 2015-07-17"
402 has_php 360 has_php
403
404 # Do we have PHP5 installed?
405 if [[ "${PHP_VERSION}" == "4" ]] ; then
406 eerror
407 eerror "This package requires PDO."
408 eerror "PDO is only available for PHP 5."
409 eerror "You must install >=dev-lang/php-5.1 with"
410 eerror "either the 'pdo' or the 'pdo-external'"
411 eerror "USE flags turned on."
412 eerror
413 die "PHP 5 not installed"
414 fi
415 361
416 # Was PHP5 compiled with internal PDO support? 362 # Was PHP5 compiled with internal PDO support?
417 if built_with_use =${PHP_PKG} pdo || phpconfutils_built_with_use =${PHP_PKG} pdo ; then 363 if built_with_use =${PHP_PKG} pdo ; then
418 return 364 return
419 fi 365 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 366 eerror
433 eerror "No PDO extension for PHP found." 367 eerror "No PDO extension for PHP found."
434 eerror "Please note that PDO only exists for PHP 5." 368 eerror "Please note that PDO only exists for PHP 5."
435 eerror "Please install a PDO extension for PHP 5," 369 eerror "Please install a PDO extension for PHP 5."
436 eerror "you must install >=dev-lang/php-5.1 with" 370 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 371 eerror
440 die "No PDO extension for PHP 5 found" 372 die "No PDO extension for PHP 5 found"
373 fi
441} 374}
442 375
443# @FUNCTION: require_php_cli 376# @FUNCTION: require_php_cli
444# @DESCRIPTION: 377# @DESCRIPTION:
445# Determines which installed PHP version has the CLI SAPI enabled. 378# Determines which installed PHP version has the CLI SAPI enabled.
446# 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
447# depending on the CLI SAPI. 380# depending on the CLI SAPI.
448# @RETURN: die if feature is missing 381# @RETURN: die if feature is missing
449require_php_cli() { 382require_php_cli() {
383 eqawarn "(require_php_cli) Deprecated function call. Set to be removed on 2015-07-17"
450 # 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
451 # from last time 385 # from last time
452 if [[ -n ${PHP_PKG} ]] ; then 386 if [[ -n ${PHP_PKG} ]] ; then
453 return 387 return
454 fi 388 fi
455 389
456 local PHP_PACKAGE_FOUND="" 390 local PHP_PACKAGE_FOUND=""
457 391
458 # Detect which PHP version we have installed
459 if has_version '=dev-lang/php-4*' ; then
460 PHP_PACKAGE_FOUND="1"
461 pkg="`best_version '=dev-lang/php-4*'`"
462 if built_with_use =${pkg} cli || phpconfutils_built_with_use =${pkg} cli ; then
463 PHP_VERSION="4"
464 fi
465 fi
466
467 if has_version '=dev-lang/php-5*' ; then 392 if has_version '=dev-lang/php-5*' ; then
468 PHP_PACKAGE_FOUND="1" 393 PHP_PACKAGE_FOUND="1"
469 pkg="`best_version '=dev-lang/php-5*'`" 394 pkg="$(best_version '=dev-lang/php-5*')"
470 if built_with_use =${pkg} cli || phpconfutils_built_with_use =${pkg} cli ; then 395 if built_with_use =${pkg} cli ; then
471 PHP_VERSION="5" 396 PHP_VERSION="5"
472 fi 397 fi
473 fi 398 fi
474 399
475 if [[ -z ${PHP_PACKAGE_FOUND} ]] ; then 400 if [[ -z ${PHP_PACKAGE_FOUND} ]] ; then
497 return 422 return
498 fi 423 fi
499 424
500 local PHP_PACKAGE_FOUND="" 425 local PHP_PACKAGE_FOUND=""
501 426
502 # Detect which PHP version we have installed
503 if has_version '=dev-lang/php-4*' ; then
504 PHP_PACKAGE_FOUND="1"
505 pkg="`best_version '=dev-lang/php-4*'`"
506 if built_with_use =${pkg} cgi || phpconfutils_built_with_use =${pkg} cgi ; then
507 PHP_VERSION="4"
508 fi
509 fi
510
511 if has_version '=dev-lang/php-5*' ; then 427 if has_version '=dev-lang/php-5*' ; then
512 PHP_PACKAGE_FOUND="1" 428 PHP_PACKAGE_FOUND="1"
513 pkg="`best_version '=dev-lang/php-5*'`" 429 pkg="$(best_version '=dev-lang/php-5*')"
514 if built_with_use =${pkg} cgi || phpconfutils_built_with_use =${pkg} cgi ; then 430 if built_with_use =${pkg} cgi ; then
515 PHP_VERSION="5" 431 PHP_VERSION="5"
516 fi 432 fi
517 fi 433 fi
518 434
519 if [[ -z ${PHP_PACKAGE_FOUND} ]] ; then 435 if [[ -z ${PHP_PACKAGE_FOUND} ]] ; then
532# @FUNCTION: require_sqlite 448# @FUNCTION: require_sqlite
533# @DESCRIPTION: 449# @DESCRIPTION:
534# Require a PHP built with SQLite support 450# Require a PHP built with SQLite support
535# @RETURN: die if feature is missing 451# @RETURN: die if feature is missing
536require_sqlite() { 452require_sqlite() {
453 eqawarn "(require_sqlite) Deprecated function call. Set to be removed on 2015-07-17"
537 has_php 454 has_php
538 455
539 # Has our PHP been built with SQLite support? 456 # Has our PHP been built with SQLite support?
540 if built_with_use =${PHP_PKG} sqlite || phpconfutils_built_with_use =${PHP_PKG} sqlite ; then 457 if built_with_use =${PHP_PKG} sqlite ; then
541 return
542 fi
543
544 # Do we have pecl-sqlite installed for PHP4?
545 if [[ "${PHP_VERSION}" == "4" ]] ; then
546 if has_version 'dev-php4/pecl-sqlite' ; then
547 return 458 return
548 fi
549 fi 459 fi
550 460
551 # 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
552 eerror 462 eerror
553 eerror "No SQLite extension for PHP found." 463 eerror "No SQLite extension for PHP found."
561# @FUNCTION: require_gd 471# @FUNCTION: require_gd
562# @DESCRIPTION: 472# @DESCRIPTION:
563# Require a PHP built with GD support 473# Require a PHP built with GD support
564# @RETURN: die if feature is missing 474# @RETURN: die if feature is missing
565require_gd() { 475require_gd() {
476 eqawarn "(require_gd) Deprecated function call. Set to be removed on 2015-07-17"
566 has_php 477 has_php
567 478
568 # Do we have the internal GD support installed? 479 # Do we have the internal GD support installed?
569 if built_with_use =${PHP_PKG} gd || phpconfutils_built_with_use =${PHP_PKG} gd ; then 480 if built_with_use =${PHP_PKG} gd ; then
570 return 481 return
571 fi 482 fi
572 483
573 # Ok, maybe GD was built using the external library support? 484 # Ok, maybe GD was built using the external library support?
574 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
575 return 486 return
576 fi 487 fi
577 488
578 # If we get here, then we have no GD support 489 # If we get here, then we have no GD support
579 eerror 490 eerror
594 505
595# @FUNCTION: php_binary_extension 506# @FUNCTION: php_binary_extension
596# @DESCRIPTION: 507# @DESCRIPTION:
597# Executes some checks needed when installing a binary PHP extension. 508# Executes some checks needed when installing a binary PHP extension.
598php_binary_extension() { 509php_binary_extension() {
510 eqawarn "(php_binary_extension) Deprecated function call. Set to be removed on 2015-07-17"
599 has_php 511 has_php
600 512
601 local PUSE_ENABLED="" 513 local PUSE_ENABLED=""
602 514
603 # Binary extensions do not support the change of PHP 515 # Binary extensions do not support the change of PHP
632 544
633# @FUNCTION: dodoc-php 545# @FUNCTION: dodoc-php
634# @USAGE: <list of docs> 546# @USAGE: <list of docs>
635# @DESCRIPTION: 547# @DESCRIPTION:
636# Alternative to dodoc function for use in our PHP eclasses and ebuilds. 548# Alternative to dodoc function for use in our PHP eclasses and ebuilds.
637# Stored here because depend.php gets always sourced everywhere in the PHP 549# Stored here because depend.php gets always sourced everywhere in the PHP
638# ebuilds and eclasses. It simply is dodoc with a changed path to the docs. 550# ebuilds and eclasses. It simply is dodoc with a changed path to the docs.
639# NOTE: No support for docinto is provided! 551# NOTE: No support for docinto is provided!
640dodoc-php() { 552dodoc-php() {
641if [[ $# -lt 1 ]] ; then 553if [[ $# -lt 1 ]] ; then
642 echo "$0: at least one argument needed" 1>&2 554 echo "$0: at least one argument needed" 1>&2
643 exit 1 555 exit 1
644fi 556fi
645 557
646phpdocdir="${D}/usr/share/doc/${CATEGORY}/${PF}/" 558phpdocdir="/usr/share/doc/${CATEGORY}/${PF}/"
647
648if [[ ! -d "${phpdocdir}" ]] ; then
649 install -d "${phpdocdir}"
650fi
651 559
652for x in $@ ; do 560for x in $@ ; do
653 if [[ -s "${x}" ]] ; then 561 if [[ -s "${x}" ]] ; then
654 install -m0644 "${x}" "${phpdocdir}" 562 insinto "${phpdocdir}"
563 doins "${x}"
655 gzip -f -9 "${phpdocdir}/${x##*/}" 564 gzip -f -9 "${D}/${phpdocdir}/${x##*/}"
656 elif [[ ! -e "${x}" ]] ; then 565 elif [[ ! -e "${x}" ]] ; then
657 echo "dodoc-php: ${x} does not exist" 1>&2 566 echo "dodoc-php: ${x} does not exist" 1>&2
658 fi 567 fi
659done 568done
660} 569}
570
571# @FUNCTION: dohtml-php
572# @USAGE: <list of html docs>
573# @DESCRIPTION:
574# Alternative to dohtml function for use in our PHP eclasses and ebuilds.
575# Stored here because depend.php gets always sourced everywhere in the PHP
576# ebuilds and eclasses. It simply is dohtml with a changed path to the docs.
577# NOTE: No support for [-a|-A|-p|-x] options is provided!
578dohtml-php() {
579if [[ $# -lt 1 ]] ; then
580 echo "$0: at least one argument needed" 1>&2
581 exit 1
582fi
583
584phphtmldir="/usr/share/doc/${CATEGORY}/${PF}/html"
585
586for x in $@ ; do
587 if [[ -s "${x}" ]] ; then
588 insinto "${phphtmldir}"
589 doins "${x}"
590 elif [[ ! -e "${x}" ]] ; then
591 echo "dohtml-php: ${x} does not exist" 1>&2
592 fi
593done
594}

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

  ViewVC Help
Powered by ViewVC 1.1.20