/[gentoo-x86]/eclass/depend.php.eclass
Gentoo

Contents of /eclass/depend.php.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.34 - (hide annotations) (download)
Wed Jun 17 20:11:28 2015 UTC (3 years, 1 month ago) by grknight
Branch: MAIN
Changes since 1.33: +2 -1 lines
Add require_php_cli to the list of deprecated functions to be removed from depend.php.eclass

1 grknight 1.33 # Copyright 1999-2015 Gentoo Foundation
2 stuart 1.1 # Distributed under the terms of the GNU General Public License v2
3 grknight 1.34 # $Header: /var/cvsroot/gentoo-x86/eclass/depend.php.eclass,v 1.33 2015/06/17 18:54:44 grknight Exp $
4 jokey 1.21
5 vapier 1.30 # @ECLASS: depend.php.eclass
6     # @MAINTAINER:
7     # Gentoo PHP team <php-bugs@gentoo.org>
8     # @AUTHOR:
9 jokey 1.21 # Author: Stuart Herbert <stuart@gentoo.org>
10     # Author: Luca Longinotti <chtekk@gentoo.org>
11     # Author: Jakub Moc <jakub@gentoo.org> (documentation)
12 mabi 1.26 # @BLURB: Functions to allow ebuilds to depend on php5 and check for specific features.
13 jokey 1.21 # @DESCRIPTION:
14 mabi 1.26 # This eclass provides functions that allow ebuilds to depend on php5 and check
15 jokey 1.21 # for specific PHP features, SAPIs etc. Also provides dodoc-php wrapper to install
16     # documentation for PHP packages to php-specific location.
17 chtekk 1.18
18 zmedico 1.32 inherit eutils multilib phpconfutils
19 stuart 1.1
20 trapni 1.4 # PHP5-only depend functions
21 jokey 1.21
22     # @FUNCTION: need_php5_cli
23     # @DESCRIPTION:
24     # Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP5
25     # with cli SAPI.
26 chtekk 1.12 need_php5_cli() {
27 grknight 1.33 eqawarn "(need_php5_cli) Deprecated function call. Set to be removed on 2015-07-17"
28 olemarkus 1.29 DEPEND="${DEPEND} =dev-lang/php-5*"
29     RDEPEND="${RDEPEND} =dev-lang/php-5*"
30 chtekk 1.12 PHP_VERSION="5"
31 stuart 1.1 }
32    
33 jokey 1.21 # @FUNCTION: need_php5_httpd
34     # @DESCRIPTION:
35     # Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP5
36     # with either cgi or apache2 SAPI.
37 chtekk 1.12 need_php5_httpd() {
38 grknight 1.33 eqawarn "(need_php5_httpd) Deprecated function call. Set to be removed on 2015-07-17"
39 stuart 1.1 DEPEND="${DEPEND} =virtual/httpd-php-5*"
40     RDEPEND="${RDEPEND} =virtual/httpd-php-5*"
41 chtekk 1.12 PHP_VERSION="5"
42 stuart 1.1 }
43    
44 jokey 1.21 # @FUNCTION: need_php5
45     # @DESCRIPTION:
46     # Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP5
47     # (with any SAPI).
48 chtekk 1.12 need_php5() {
49 stuart 1.1 DEPEND="${DEPEND} =dev-lang/php-5*"
50     RDEPEND="${RDEPEND} =dev-lang/php-5*"
51 chtekk 1.12 PHP_VERSION="5"
52 stuart 1.1 PHP_SHARED_CAT="php5"
53     }
54    
55     # common settings go in here
56 chtekk 1.12 uses_php5() {
57 stuart 1.1 # cache this
58     libdir=$(get_libdir)
59    
60     PHPIZE="/usr/${libdir}/php5/bin/phpize"
61     PHPCONFIG="/usr/${libdir}/php5/bin/php-config"
62     PHPCLI="/usr/${libdir}/php5/bin/php"
63     PHPCGI="/usr/${libdir}/php5/bin/php-cgi"
64 armin76 1.22 PHP_PKG="$(best_version =dev-lang/php-5*)"
65 stuart 1.1 PHPPREFIX="/usr/${libdir}/php5"
66 armin76 1.22 EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)"
67 stuart 1.1
68     einfo
69     einfo "Using ${PHP_PKG}"
70     einfo
71     }
72    
73 trapni 1.4 # general PHP depend functions
74 jokey 1.21
75     # @FUNCTION: need_php_cli
76     # @DESCRIPTION:
77     # Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP
78     # (any version) with cli SAPI.
79 chtekk 1.12 need_php_cli() {
80 grknight 1.33 eqawarn "(need_php_cli) Deprecated function call. Set to be removed on 2015-07-17"
81 olemarkus 1.29 DEPEND="${DEPEND} dev-lang/php"
82     RDEPEND="${RDEPEND} dev-lang/php"
83 trapni 1.4 }
84    
85 jokey 1.21 # @FUNCTION: need_php_httpd
86     # @DESCRIPTION:
87     # Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP
88     # (any version) with either cgi or apache2 SAPI.
89 chtekk 1.12 need_php_httpd() {
90 trapni 1.4 DEPEND="${DEPEND} virtual/httpd-php"
91     RDEPEND="${RDEPEND} virtual/httpd-php"
92     }
93    
94 jokey 1.21 # @FUNCTION: need_php
95     # @DESCRIPTION:
96     # Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP
97     # (any version with any SAPI).
98 chtekk 1.12 need_php() {
99 stuart 1.1 DEPEND="${DEPEND} dev-lang/php"
100     RDEPEND="${RDEPEND} dev-lang/php"
101     PHP_SHARED_CAT="php"
102     }
103    
104 jokey 1.21 # @FUNCTION: need_php_by_category
105     # @DESCRIPTION:
106     # Set this after setting DEPEND/RDEPEND in your ebuild to depend on PHP version
107 mabi 1.26 # determined by ${CATEGORY} - any PHP version or PHP5 for dev-php or
108 jokey 1.21 # dev-php5, respectively.
109 chtekk 1.12 need_php_by_category() {
110 grknight 1.33 eqawarn "(need_php_by_category) Deprecated function call. Set to be removed on 2015-07-17"
111 stuart 1.1 case "${CATEGORY}" in
112     dev-php) need_php ;;
113 chtekk 1.18 *) die "Version of PHP required by packages in category ${CATEGORY} unknown"
114 stuart 1.1 esac
115     }
116    
117 chtekk 1.12
118 jokey 1.21 # @FUNCTION: has_php
119     # @DESCRIPTION:
120     # Call this function from your pkg_setup, src_compile, src_install etc. if you
121 swegener 1.23 # need to know which PHP version is being used and where the PHP binaries/data
122 jokey 1.21 # are installed.
123 chtekk 1.12 has_php() {
124 armin76 1.25 # Detect which PHP version we have installed
125     if has_version '=dev-lang/php-5*' ; then
126     PHP_VERSION="5"
127     else
128     die "Unable to find an installed dev-lang/php package"
129 chtekk 1.12 fi
130    
131     # If we get here, then PHP_VERSION tells us which version of PHP we
132     # want to use
133     uses_php${PHP_VERSION}
134     }
135    
136 jokey 1.21 # @FUNCTION: require_php_sapi_from
137     # @USAGE: <list of SAPIs>
138     # @DESCRIPTION:
139 chtekk 1.12 # Call this function from pkg_setup if your package only works with
140 jokey 1.21 # specific SAPI(s) and specify a list of PHP SAPI USE flags that are
141     # required (one or more from cli, cgi, apache2) as arguments.
142     # Returns if any of the listed SAPIs have been installed, dies if none
143     # of them is available.
144     #
145     # Unfortunately, if you want to be really sure that the required SAPI is
146     # provided by PHP, you will have to use this function or similar ones (like
147     # require_php_cli or require_php_cgi) in pkg_setup until we are able to
148 swegener 1.23 # depend on USE flags being enabled. The above described need_php[45]_cli
149 jokey 1.21 # and need_php[45]_httpd functions cannot guarantee these requirements.
150     # See Bug 2272 for details.
151 chtekk 1.12 require_php_sapi_from() {
152 grknight 1.33 eqawarn "(require_php_sapi_from) Deprecated function call. Set to be removed on 2015-07-17"
153 stuart 1.1 has_php
154    
155 chtekk 1.12 local has_sapi="0"
156 stuart 1.1 local x
157    
158     einfo "Checking for compatible SAPI(s)"
159    
160     for x in $@ ; do
161 chtekk 1.13 if built_with_use =${PHP_PKG} ${x} || phpconfutils_built_with_use =${PHP_PKG} ${x} ; then
162 stuart 1.1 einfo " Discovered compatible SAPI ${x}"
163 chtekk 1.12 has_sapi="1"
164 stuart 1.1 fi
165     done
166    
167 chtekk 1.12 if [[ "${has_sapi}" == "1" ]] ; then
168 stuart 1.1 return
169     fi
170    
171     eerror
172     eerror "${PHP_PKG} needs to be re-installed with one of the following"
173     eerror "USE flags enabled:"
174     eerror
175     eerror " $@"
176     eerror
177 chtekk 1.12 die "No compatible PHP SAPIs found"
178 stuart 1.1 }
179    
180 jokey 1.21 # @FUNCTION: require_php_with_use
181     # @USAGE: <list of USE flags>
182     # @DESCRIPTION:
183 chtekk 1.12 # Call this function from pkg_setup if your package requires PHP compiled
184 jokey 1.21 # with specific USE flags. Returns if all of the listed USE flags are enabled.
185     # Dies if any of the listed USE flags are disabled.
186 stuart 1.1
187 jokey 1.21 # @VARIABLE: PHPCHECKNODIE
188     # @DESCRIPTION:
189     # You can set PHPCHECKNODIE to non-empty value in your ebuild to chain multiple
190     # require_php_with_(any)_use checks without making the ebuild die on every failure.
191 swegener 1.23 # This is useful in cases when certain PHP features are only required if specific
192 jokey 1.21 # USE flag(s) are enabled for that ebuild.
193     # @CODE
194     # Example:
195     #
196     # local flags="pcre session snmp sockets wddx"
197     # use mysql && flags="${flags} mysql"
198     # use postgres && flags="${flags} postgres"
199     # if ! PHPCHECKNODIE="yes" require_php_with_use ${flags} \
200     # || ! PHPCHECKNODIE="yes" require_php_with_any_use gd gd-external ; then
201     # die "Re-install ${PHP_PKG} with ${flags} and either gd or gd-external"
202     # fi
203     # @CODE
204 chtekk 1.12 require_php_with_use() {
205 stuart 1.1 has_php
206    
207 chtekk 1.11 local missing_use=""
208 stuart 1.1 local x
209    
210 chtekk 1.14 einfo "Checking for required PHP feature(s) ..."
211 stuart 1.1
212     for x in $@ ; do
213 olemarkus 1.27 case $x in
214 olemarkus 1.28 pcre|spl|reflection|mhash)
215     eqawarn "require_php_with_use MUST NOT check for the pcre, spl, mhash or reflection USE flag."
216 olemarkus 1.27 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 chtekk 1.12 if ! built_with_use =${PHP_PKG} ${x} && ! phpconfutils_built_with_use =${PHP_PKG} ${x} ; then
223 chtekk 1.14 einfo " Discovered missing USE flag: ${x}"
224 stuart 1.1 missing_use="${missing_use} ${x}"
225     fi
226     done
227    
228 chtekk 1.15 if [[ -z "${missing_use}" ]] ; then
229     if [[ -z "${PHPCHECKNODIE}" ]] ; then
230     return
231     else
232     return 0
233     fi
234 stuart 1.1 fi
235    
236 chtekk 1.15 if [[ -z "${PHPCHECKNODIE}" ]] ; then
237     eerror
238     eerror "${PHP_PKG} needs to be re-installed with all of the following"
239     eerror "USE flags enabled:"
240     eerror
241     eerror " $@"
242     eerror
243     die "Missing PHP USE flags found"
244     else
245     return 1
246     fi
247 stuart 1.1 }
248    
249 jokey 1.21 # @FUNCTION: require_php_with_any_use
250     # @USAGE: <list of USE flags>
251     # @DESCRIPTION:
252     # Call this function from pkg_setup if your package requires PHP compiled with
253     # any of specified USE flags. Returns if any of the listed USE flags are enabled.
254     # Dies if all of the listed USE flags are disabled.
255 chtekk 1.12 require_php_with_any_use() {
256 grknight 1.33 eqawarn "(require_php_with_any_use) Deprecated function call. Set to be removed on 2015-07-17"
257 chtekk 1.12 has_php
258 stuart 1.1
259 chtekk 1.12 local missing_use=""
260     local x
261 hollow 1.3
262 chtekk 1.14 einfo "Checking for required PHP feature(s) ..."
263 stuart 1.1
264 chtekk 1.12 for x in $@ ; do
265     if built_with_use =${PHP_PKG} ${x} || phpconfutils_built_with_use =${PHP_PKG} ${x} ; then
266     einfo " USE flag ${x} is enabled, ok ..."
267     return
268 stuart 1.1 else
269 chtekk 1.12 missing_use="${missing_use} ${x}"
270 stuart 1.1 fi
271 chtekk 1.12 done
272    
273 chtekk 1.15 if [[ -z "${missing_use}" ]] ; then
274     if [[ -z "${PHPCHECKNODIE}" ]] ; then
275     return
276     else
277     return 0
278     fi
279 stuart 1.1 fi
280    
281 chtekk 1.15 if [[ -z "${PHPCHECKNODIE}" ]] ; then
282     eerror
283     eerror "${PHP_PKG} needs to be re-installed with any of the following"
284     eerror "USE flags enabled:"
285     eerror
286     eerror " $@"
287     eerror
288     die "Missing PHP USE flags found"
289     else
290     return 1
291     fi
292 stuart 1.1 }
293    
294     # ========================================================================
295     # has_*() functions
296     #
297 chtekk 1.12 # These functions return 0 if the condition is satisfied, 1 otherwise
298 stuart 1.1 # ========================================================================
299    
300 jokey 1.21 # @FUNCTION: has_zts
301     # @DESCRIPTION:
302     # Check if our PHP was compiled with ZTS (Zend Thread Safety) enabled.
303     # @RETURN: 0 if true, 1 otherwise
304 chtekk 1.12 has_zts() {
305 grknight 1.33 eqawarn "(has_zts) Deprecated function call. Set to be removed on 2015-07-17"
306 stuart 1.1 has_php
307    
308 chtekk 1.13 if built_with_use =${PHP_PKG} apache2 threads || phpconfutils_built_with_use =${PHP_PKG} apache2 threads ; then
309 stuart 1.1 return 0
310     fi
311    
312     return 1
313     }
314    
315 jokey 1.21 # @FUNCTION: has_debug
316     # @DESCRIPTION:
317     # Check if our PHP was built with debug support enabled.
318     # @RETURN: 0 if true, 1 otherwise
319 chtekk 1.18 has_debug() {
320 grknight 1.33 eqawarn "(has_debug) Deprecated function call. Set to be removed on 2015-07-17"
321 hollow 1.3 has_php
322    
323 chtekk 1.18 if built_with_use =${PHP_PKG} debug || phpconfutils_built_with_use =${PHP_PKG} debug ; then
324 hollow 1.3 return 0
325     fi
326    
327     return 1
328     }
329    
330 jokey 1.21 # @FUNCTION: has_concurrentmodphp
331     # @DESCRIPTION:
332     # Check if our PHP was built with the concurrentmodphp support enabled.
333     # @RETURN: 0 if true, 1 otherwise
334 chtekk 1.18 has_concurrentmodphp() {
335 grknight 1.33 eqawarn "(has_concurrentmodphp) Deprecated function call. Set to be removed on 2015-07-17"
336 chtekk 1.12 has_php
337    
338 chtekk 1.18 if built_with_use =${PHP_PKG} apache2 concurrentmodphp || phpconfutils_built_with_use =${PHP_PKG} apache2 concurrentmodphp ; then
339 chtekk 1.12 return 0
340     fi
341    
342     return 1
343     }
344    
345 stuart 1.1 # ========================================================================
346     # require_*() functions
347     #
348 chtekk 1.12 # These functions die() if PHP was built without the required features
349 stuart 1.1 # ========================================================================
350    
351 jokey 1.21 # @FUNCTION: require_pdo
352     # @DESCRIPTION:
353     # Require a PHP built with PDO support (PHP5 only).
354 armin76 1.22 # 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.
357 jokey 1.21 # @RETURN: die if feature is missing
358 chtekk 1.12 require_pdo() {
359 grknight 1.33 eqawarn "(require_pdo) Deprecated function call. Set to be removed on 2015-07-17"
360 stuart 1.1 has_php
361    
362 chtekk 1.12 # Was PHP5 compiled with internal PDO support?
363 chtekk 1.13 if built_with_use =${PHP_PKG} pdo || phpconfutils_built_with_use =${PHP_PKG} pdo ; then
364 stuart 1.1 return
365 armin76 1.22 else
366     eerror
367     eerror "No PDO extension for PHP found."
368     eerror "Please note that PDO only exists for PHP 5."
369     eerror "Please install a PDO extension for PHP 5."
370     eerror "You must install >=dev-lang/php-5.1 with USE=\"pdo\"."
371     eerror
372     die "No PDO extension for PHP 5 found"
373 stuart 1.1 fi
374     }
375    
376 jokey 1.21 # @FUNCTION: require_php_cli
377     # @DESCRIPTION:
378     # Determines which installed PHP version has the CLI SAPI enabled.
379     # Useful for PEAR stuff, or anything which needs to run PHP script
380     # depending on the CLI SAPI.
381     # @RETURN: die if feature is missing
382 chtekk 1.12 require_php_cli() {
383 grknight 1.34 eqawarn "(require_php_cli) Deprecated function call. Set to be removed on 2015-07-17"
384 chtekk 1.12 # If PHP_PKG is set, then we have remembered our PHP settings
385 stuart 1.1 # from last time
386 chtekk 1.11 if [[ -n ${PHP_PKG} ]] ; then
387 stuart 1.1 return
388     fi
389    
390 chtekk 1.12 local PHP_PACKAGE_FOUND=""
391    
392 sebastian 1.10 if has_version '=dev-lang/php-5*' ; then
393 chtekk 1.12 PHP_PACKAGE_FOUND="1"
394 armin76 1.22 pkg="$(best_version '=dev-lang/php-5*')"
395 chtekk 1.13 if built_with_use =${pkg} cli || phpconfutils_built_with_use =${pkg} cli ; then
396 chtekk 1.12 PHP_VERSION="5"
397 stuart 1.1 fi
398 sebastian 1.10 fi
399    
400 chtekk 1.11 if [[ -z ${PHP_PACKAGE_FOUND} ]] ; then
401 stuart 1.1 die "Unable to find an installed dev-lang/php package"
402     fi
403    
404 chtekk 1.11 if [[ -z ${PHP_VERSION} ]] ; then
405 hoffie 1.20 die "No PHP CLI installed. Re-emerge dev-lang/php with USE=cli."
406 stuart 1.1 fi
407    
408 chtekk 1.12 # If we get here, then PHP_VERSION tells us which version of PHP we
409 stuart 1.1 # want to use
410 hollow 1.3 uses_php${PHP_VERSION}
411     }
412    
413 jokey 1.21 # @FUNCTION: require_php_cgi
414     # @DESCRIPTION:
415     # Determines which installed PHP version has the CGI SAPI enabled.
416     # Useful for anything which needs to run PHP scripts depending on the CGI SAPI.
417     # @RETURN: die if feature is missing
418 chtekk 1.12 require_php_cgi() {
419     # If PHP_PKG is set, then we have remembered our PHP settings
420 hollow 1.3 # from last time
421 chtekk 1.11 if [[ -n ${PHP_PKG} ]] ; then
422 hollow 1.3 return
423     fi
424    
425 chtekk 1.12 local PHP_PACKAGE_FOUND=""
426    
427 sebastian 1.9 if has_version '=dev-lang/php-5*' ; then
428 chtekk 1.12 PHP_PACKAGE_FOUND="1"
429 armin76 1.22 pkg="$(best_version '=dev-lang/php-5*')"
430 chtekk 1.13 if built_with_use =${pkg} cgi || phpconfutils_built_with_use =${pkg} cgi ; then
431 chtekk 1.12 PHP_VERSION="5"
432 hollow 1.3 fi
433 sebastian 1.9 fi
434 chtekk 1.11
435     if [[ -z ${PHP_PACKAGE_FOUND} ]] ; then
436 hollow 1.3 die "Unable to find an installed dev-lang/php package"
437     fi
438    
439 chtekk 1.11 if [[ -z ${PHP_VERSION} ]] ; then
440 hoffie 1.20 die "No PHP CGI installed. Re-emerge dev-lang/php with USE=cgi."
441 hollow 1.3 fi
442    
443 chtekk 1.12 # If we get here, then PHP_VERSION tells us which version of PHP we
444 hollow 1.3 # want to use
445 stuart 1.1 uses_php${PHP_VERSION}
446     }
447    
448 jokey 1.21 # @FUNCTION: require_sqlite
449     # @DESCRIPTION:
450 chtekk 1.12 # Require a PHP built with SQLite support
451 jokey 1.21 # @RETURN: die if feature is missing
452 chtekk 1.12 require_sqlite() {
453 grknight 1.33 eqawarn "(require_sqlite) Deprecated function call. Set to be removed on 2015-07-17"
454 stuart 1.1 has_php
455    
456 chtekk 1.12 # Has our PHP been built with SQLite support?
457     if built_with_use =${PHP_PKG} sqlite || phpconfutils_built_with_use =${PHP_PKG} sqlite ; then
458 stuart 1.1 return
459     fi
460    
461 chtekk 1.12 # If we get here, then we don't have any SQLite support for PHP installed
462 stuart 1.1 eerror
463 chtekk 1.12 eerror "No SQLite extension for PHP found."
464     eerror "Please install an SQLite extension for PHP,"
465 stuart 1.1 eerror "this is done best by simply adding the"
466     eerror "'sqlite' USE flag when emerging dev-lang/php."
467     eerror
468 chtekk 1.12 die "No SQLite extension for PHP found"
469 stuart 1.1 }
470 hollow 1.3
471 jokey 1.21 # @FUNCTION: require_gd
472     # @DESCRIPTION:
473 chtekk 1.12 # Require a PHP built with GD support
474 jokey 1.21 # @RETURN: die if feature is missing
475 chtekk 1.12 require_gd() {
476 grknight 1.33 eqawarn "(require_gd) Deprecated function call. Set to be removed on 2015-07-17"
477 hollow 1.3 has_php
478    
479 chtekk 1.12 # Do we have the internal GD support installed?
480     if built_with_use =${PHP_PKG} gd || phpconfutils_built_with_use =${PHP_PKG} gd ; then
481 hollow 1.3 return
482     fi
483    
484 chtekk 1.12 # Ok, maybe GD was built using the external library support?
485     if built_with_use =${PHP_PKG} gd-external || phpconfutils_built_with_use =${PHP_PKG} gd-external ; then
486 hollow 1.3 return
487     fi
488    
489 chtekk 1.12 # If we get here, then we have no GD support
490 hollow 1.3 eerror
491     eerror "No GD support for PHP found."
492     eerror "Please install the GD support for PHP,"
493     eerror "you must install dev-lang/php with either"
494     eerror "the 'gd' or the 'gd-external' USE flags"
495     eerror "turned on."
496     eerror
497     die "No GD support found for PHP"
498     }
499 chtekk 1.6
500     # ========================================================================
501     # Misc functions
502     #
503     # These functions provide miscellaneous checks and functionality.
504     # ========================================================================
505    
506 jokey 1.21 # @FUNCTION: php_binary_extension
507     # @DESCRIPTION:
508     # Executes some checks needed when installing a binary PHP extension.
509 chtekk 1.6 php_binary_extension() {
510 grknight 1.33 eqawarn "(php_binary_extension) Deprecated function call. Set to be removed on 2015-07-17"
511 chtekk 1.6 has_php
512    
513 chtekk 1.12 local PUSE_ENABLED=""
514    
515     # Binary extensions do not support the change of PHP
516 chtekk 1.6 # API version, so they can't be installed when USE flags
517 chtekk 1.16 # are enabled which change the PHP API version, they also
518     # don't provide correctly versioned symbols for our use
519 chtekk 1.6
520 chtekk 1.18 if has_debug ; then
521 chtekk 1.6 eerror
522     eerror "You cannot install binary PHP extensions"
523     eerror "when the 'debug' USE flag is enabled!"
524     eerror "Please reemerge dev-lang/php with the"
525     eerror "'debug' USE flag turned off."
526     eerror
527 chtekk 1.12 PUSE_ENABLED="1"
528     fi
529    
530 chtekk 1.18 if has_concurrentmodphp ; then
531 chtekk 1.16 eerror
532     eerror "You cannot install binary PHP extensions when"
533     eerror "the 'concurrentmodphp' USE flag is enabled!"
534     eerror "Please reemerge dev-lang/php with the"
535     eerror "'concurrentmodphp' USE flag turned off."
536     eerror
537     PUSE_ENABLED="1"
538     fi
539    
540 chtekk 1.12 if [[ -n ${PUSE_ENABLED} ]] ; then
541 chtekk 1.18 die "'debug' and/or 'concurrentmodphp' USE flags turned on!"
542 chtekk 1.6 fi
543     }
544    
545 jokey 1.21 # @FUNCTION: dodoc-php
546     # @USAGE: <list of docs>
547     # @DESCRIPTION:
548     # Alternative to dodoc function for use in our PHP eclasses and ebuilds.
549 swegener 1.23 # Stored here because depend.php gets always sourced everywhere in the PHP
550 jokey 1.21 # ebuilds and eclasses. It simply is dodoc with a changed path to the docs.
551     # NOTE: No support for docinto is provided!
552 chtekk 1.12 dodoc-php() {
553     if [[ $# -lt 1 ]] ; then
554 chtekk 1.6 echo "$0: at least one argument needed" 1>&2
555     exit 1
556     fi
557    
558 armin76 1.24 phpdocdir="/usr/share/doc/${CATEGORY}/${PF}/"
559 chtekk 1.6
560 armin76 1.24 for x in $@ ; do
561     if [[ -s "${x}" ]] ; then
562     insinto "${phpdocdir}"
563     doins "${x}"
564     gzip -f -9 "${D}/${phpdocdir}/${x##*/}"
565     elif [[ ! -e "${x}" ]] ; then
566     echo "dodoc-php: ${x} does not exist" 1>&2
567     fi
568     done
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!
578     dohtml-php() {
579     if [[ $# -lt 1 ]] ; then
580     echo "$0: at least one argument needed" 1>&2
581     exit 1
582 chtekk 1.6 fi
583    
584 armin76 1.24 phphtmldir="/usr/share/doc/${CATEGORY}/${PF}/html"
585    
586 chtekk 1.12 for x in $@ ; do
587     if [[ -s "${x}" ]] ; then
588 armin76 1.24 insinto "${phphtmldir}"
589     doins "${x}"
590 chtekk 1.12 elif [[ ! -e "${x}" ]] ; then
591 armin76 1.24 echo "dohtml-php: ${x} does not exist" 1>&2
592 chtekk 1.6 fi
593     done
594     }

  ViewVC Help
Powered by ViewVC 1.1.20