| 1 |
vapier |
1.10 |
# Copyright 1999-2011 Gentoo Foundation
|
| 2 |
stuart |
1.1 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
mabi |
1.11 |
# $Header: /var/cvsroot/gentoo-x86/eclass/php-lib-r1.eclass,v 1.10 2011/08/22 04:46:32 vapier Exp $
|
| 4 |
jokey |
1.6 |
|
| 5 |
|
|
# @ECLASS: php-lib-r1.eclass
|
| 6 |
|
|
# @MAINTAINER:
|
| 7 |
|
|
# Gentoo PHP team <php-bugs@gentoo.org>
|
| 8 |
vapier |
1.10 |
# @AUTHOR:
|
| 9 |
|
|
# Author: Stuart Herbert <stuart@gentoo.org>
|
| 10 |
|
|
# Author: Luca Longinotti <chtekk@gentoo.org>
|
| 11 |
jokey |
1.6 |
# @BLURB: A unified interface for adding new PHP libraries.
|
| 12 |
|
|
# @DESCRIPTION:
|
| 13 |
|
|
# This eclass provides a unified interface for adding new PHP libraries.
|
| 14 |
|
|
# PHP libraries are PHP scripts designed for reuse inside other PHP scripts.
|
| 15 |
stuart |
1.1 |
|
| 16 |
|
|
inherit depend.php
|
| 17 |
|
|
|
| 18 |
|
|
EXPORT_FUNCTIONS src_install
|
| 19 |
|
|
|
| 20 |
chtekk |
1.5 |
DEPEND="dev-lang/php"
|
| 21 |
|
|
RDEPEND="${DEPEND}"
|
| 22 |
stuart |
1.1 |
|
| 23 |
jokey |
1.6 |
# @ECLASS-VARIABLE: PHP_LIB_NAME
|
| 24 |
|
|
# @DESCRIPTION:
|
| 25 |
|
|
# Defaults to ${PN} unless set manually in the ebuild.
|
| 26 |
chtekk |
1.5 |
[[ -z "${PHP_LIB_NAME}" ]] && PHP_LIB_NAME="${PN}"
|
| 27 |
stuart |
1.1 |
|
| 28 |
jokey |
1.6 |
# @FUNCTION: php-lib-r1_src_install
|
| 29 |
|
|
# @USAGE: <directory to install from> <list of files>
|
| 30 |
|
|
# @DESCRIPTION:
|
| 31 |
|
|
# Takes care of install for PHP libraries.
|
| 32 |
|
|
# You have to pass in a list of the PHP files to install.
|
| 33 |
|
|
|
| 34 |
jokey |
1.7 |
# @VARIABLE: DOCS
|
| 35 |
|
|
# @DESCRIPTION:
|
| 36 |
|
|
# Set in ebuild if you wish to install additional, package-specific documentation.
|
| 37 |
|
|
|
| 38 |
stuart |
1.1 |
# $1 - directory in ${S} to insert from
|
| 39 |
|
|
# $2 ... list of files to install
|
| 40 |
hollow |
1.2 |
php-lib-r1_src_install() {
|
| 41 |
stuart |
1.1 |
local x
|
| 42 |
|
|
|
| 43 |
|
|
S_DIR="$1"
|
| 44 |
|
|
shift
|
| 45 |
|
|
|
| 46 |
|
|
for x in $@ ; do
|
| 47 |
jokey |
1.8 |
SUBDIR="$(dirname ${x})"
|
| 48 |
mabi |
1.11 |
insinto "/usr/share/php/${PHP_LIB_NAME}/${SUBDIR}"
|
| 49 |
chtekk |
1.3 |
doins "${S_DIR}/${x}"
|
| 50 |
stuart |
1.1 |
done
|
| 51 |
jokey |
1.7 |
|
| 52 |
swegener |
1.9 |
for doc in ${DOCS} ; do
|
| 53 |
|
|
[[ -s ${doc} ]] && dodoc-php ${doc}
|
| 54 |
|
|
done
|
| 55 |
stuart |
1.1 |
}
|