net-fs/openafs-kernel: remove vulnerable versions
[gentoo.git] / eclass / php-lib-r1.eclass
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 # @ECLASS: php-lib-r1.eclass
6 # @MAINTAINER:
7 # Gentoo PHP team <php-bugs@gentoo.org>
8 # @AUTHOR:
9 # Author: Stuart Herbert <stuart@gentoo.org>
10 # Author: Luca Longinotti <chtekk@gentoo.org>
11 # @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
16 EXPORT_FUNCTIONS src_install
17 # Silence repoman warnings
18 case "${EAPI:-0}" in
19         0|1|2|3|4)
20                 DEPEND="dev-lang/php"
21                 ;;
22         *)
23                 DEPEND="dev-lang/php:*"
24                 ;;
25 esac
26
27 RDEPEND="${DEPEND}"
28
29 # @ECLASS-VARIABLE: PHP_LIB_NAME
30 # @DESCRIPTION:
31 # Defaults to ${PN} unless set manually in the ebuild.
32 [[ -z "${PHP_LIB_NAME}" ]] && PHP_LIB_NAME="${PN}"
33
34 # @FUNCTION: php-lib-r1_src_install
35 # @USAGE: <directory to install from> <list of files>
36 # @DESCRIPTION:
37 # Takes care of install for PHP libraries.
38 # You have to pass in a list of the PHP files to install.
39
40 # @VARIABLE: DOCS
41 # @DESCRIPTION:
42 # Set in ebuild if you wish to install additional, package-specific documentation.
43
44 # $1 - directory in ${S} to insert from
45 # $2 ... list of files to install
46 php-lib-r1_src_install() {
47         local x
48
49         S_DIR="$1"
50         shift
51
52         for x in $@ ; do
53                 SUBDIR="$(dirname ${x})"
54                 insinto "/usr/share/php/${PHP_LIB_NAME}/${SUBDIR}"
55                 doins "${S_DIR}/${x}"
56         done
57
58         for doc in ${DOCS} ; do
59                 [[ -s ${doc} ]] && dodoc ${doc}
60         done
61 }