/[gentoo-x86]/eclass/php-lib-r1.eclass
Gentoo

Contents of /eclass/php-lib-r1.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations) (download)
Tue Apr 14 18:32:51 2015 UTC (5 weeks, 3 days ago) by grknight
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +11 -3 lines
Specify :* as slot by default to silence repoman warnings

1 # Copyright 1999-2015 Gentoo Foundation
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.11 2012/02/12 21:48:58 mabi Exp $
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 inherit depend.php
17
18 EXPORT_FUNCTIONS src_install
19 # Silence repoman warnings
20 case "${EAPI:-0}" in
21 0|1|2|3|4)
22 DEPEND="dev-lang/php"
23 ;;
24 *)
25 DEPEND="dev-lang/php:*"
26 ;;
27 esac
28
29 RDEPEND="${DEPEND}"
30
31 # @ECLASS-VARIABLE: PHP_LIB_NAME
32 # @DESCRIPTION:
33 # Defaults to ${PN} unless set manually in the ebuild.
34 [[ -z "${PHP_LIB_NAME}" ]] && PHP_LIB_NAME="${PN}"
35
36 # @FUNCTION: php-lib-r1_src_install
37 # @USAGE: <directory to install from> <list of files>
38 # @DESCRIPTION:
39 # Takes care of install for PHP libraries.
40 # You have to pass in a list of the PHP files to install.
41
42 # @VARIABLE: DOCS
43 # @DESCRIPTION:
44 # Set in ebuild if you wish to install additional, package-specific documentation.
45
46 # $1 - directory in ${S} to insert from
47 # $2 ... list of files to install
48 php-lib-r1_src_install() {
49 local x
50
51 S_DIR="$1"
52 shift
53
54 for x in $@ ; do
55 SUBDIR="$(dirname ${x})"
56 insinto "/usr/share/php/${PHP_LIB_NAME}/${SUBDIR}"
57 doins "${S_DIR}/${x}"
58 done
59
60 for doc in ${DOCS} ; do
61 [[ -s ${doc} ]] && dodoc-php ${doc}
62 done
63 }

  ViewVC Help
Powered by ViewVC 1.1.20