| 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/php-lib-r1.eclass,v 1.1 2005/09/04 10:54:53 stuart Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/php-lib-r1.eclass,v 1.3 2005/10/31 14:08:42 chtekk Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Stuart Herbert <stuart@gentoo.org> |
5 | # Author: Stuart Herbert <stuart@gentoo.org> |
| 6 | # |
6 | # |
| 7 | # The php-lib eclass provides a unified interface for adding new |
7 | # The php-lib eclass provides a unified interface for adding new |
| 8 | # PHP libraries. PHP libraries are PHP scripts designed for reuse inside |
8 | # PHP libraries. PHP libraries are PHP scripts designed for reuse inside |
| … | |
… | |
| 21 | # provide default extension name if necessary |
21 | # provide default extension name if necessary |
| 22 | [ -z "${PHP_LIB_NAME}" ] && PHP_LIB_NAME="${PN}" |
22 | [ -z "${PHP_LIB_NAME}" ] && PHP_LIB_NAME="${PN}" |
| 23 | # ---end ebuild configurable settings |
23 | # ---end ebuild configurable settings |
| 24 | |
24 | |
| 25 | DEPEND="${DEPEND} dev-lang/php" |
25 | DEPEND="${DEPEND} dev-lang/php" |
|
|
26 | RDEPEND="${RDEPEND} ${DEPEND}" |
| 26 | |
27 | |
| 27 | # you have to pass in a list of the PHP files to install |
28 | # you have to pass in a list of the PHP files to install |
| 28 | # |
29 | # |
| 29 | # $1 - directory in ${S} to insert from |
30 | # $1 - directory in ${S} to insert from |
| 30 | # $2 ... list of files to install |
31 | # $2 ... list of files to install |
| 31 | |
32 | |
| 32 | php-lib_src_install() { |
33 | php-lib-r1_src_install() { |
| 33 | has_php |
34 | has_php |
| 34 | |
35 | |
| 35 | # install to the correct phpX folder, if not specified |
36 | # install to the correct phpX folder, if not specified |
| 36 | # fall back to /usr/share/php |
37 | # fall back to /usr/share/php |
| 37 | if [ -z "${PHP_SHARED_CAT}" ] ; then |
38 | if [ -n "${PHP_SHARED_CAT}" ] ; then |
| 38 | PHP_LIB_DIR="/usr/share/${PHP_SHARED_CAT}/${PHP_LIB_NAME}" |
39 | PHP_LIB_DIR="/usr/share/${PHP_SHARED_CAT}/${PHP_LIB_NAME}" |
| 39 | else |
40 | else |
| 40 | PHP_LIB_DIR="/usr/share/php/${PHP_LIB_NAME}" |
41 | PHP_LIB_DIR="/usr/share/php/${PHP_LIB_NAME}" |
| 41 | fi |
42 | fi |
| 42 | |
43 | |
| … | |
… | |
| 46 | shift |
47 | shift |
| 47 | |
48 | |
| 48 | for x in $@ ; do |
49 | for x in $@ ; do |
| 49 | SUBDIR="`dirname ${x}`" |
50 | SUBDIR="`dirname ${x}`" |
| 50 | insinto ${PHP_LIB_DIR}/${SUBDIR} |
51 | insinto ${PHP_LIB_DIR}/${SUBDIR} |
| 51 | doins ${S_DIR}/${x} |
52 | doins "${S_DIR}/${x}" |
| 52 | done |
53 | done |
| 53 | } |
54 | } |