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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 Revision 1.10
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2011 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.3 2005/10/31 14:08:42 chtekk Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/php-lib-r1.eclass,v 1.10 2011/08/22 04:46:32 vapier Exp $
4# 4
5# @ECLASS: php-lib-r1.eclass
6# @MAINTAINER:
7# Gentoo PHP team <php-bugs@gentoo.org>
8# @AUTHOR:
5# Author: Stuart Herbert <stuart@gentoo.org> 9# Author: Stuart Herbert <stuart@gentoo.org>
6# 10# Author: Luca Longinotti <chtekk@gentoo.org>
11# @BLURB: A unified interface for adding new PHP libraries.
12# @DESCRIPTION:
7# The php-lib eclass provides a unified interface for adding new 13# This eclass provides a unified interface for adding new PHP libraries.
8# PHP libraries. PHP libraries are PHP scripts designed for reuse inside 14# PHP libraries are PHP scripts designed for reuse inside other PHP scripts.
9# other PHP scripts.
10#
11# This eclass doesn't do a lot (yet)
12 15
13inherit depend.php 16inherit depend.php
14 17
15RESTRICT="${RESTRICT} nostrip"
16
17EXPORT_FUNCTIONS src_install 18EXPORT_FUNCTIONS src_install
18 19
19# ---begin ebuild configurable settings 20DEPEND="dev-lang/php"
21RDEPEND="${DEPEND}"
20 22
21# provide default extension name if necessary 23# @ECLASS-VARIABLE: PHP_LIB_NAME
24# @DESCRIPTION:
25# Defaults to ${PN} unless set manually in the ebuild.
22[ -z "${PHP_LIB_NAME}" ] && PHP_LIB_NAME="${PN}" 26[[ -z "${PHP_LIB_NAME}" ]] && PHP_LIB_NAME="${PN}"
23# ---end ebuild configurable settings
24 27
25DEPEND="${DEPEND} dev-lang/php" 28# @FUNCTION: php-lib-r1_src_install
26RDEPEND="${RDEPEND} ${DEPEND}" 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.
27 33
28# you have to pass in a list of the PHP files to install 34# @VARIABLE: DOCS
29# 35# @DESCRIPTION:
36# Set in ebuild if you wish to install additional, package-specific documentation.
37
30# $1 - directory in ${S} to insert from 38# $1 - directory in ${S} to insert from
31# $2 ... list of files to install 39# $2 ... list of files to install
32
33php-lib-r1_src_install() { 40php-lib-r1_src_install() {
34 has_php 41 has_php
35 42
36 # install to the correct phpX folder, if not specified 43 # install to the correct phpX folder, if not specified
37 # fall back to /usr/share/php 44 # fall back to /usr/share/php
38 if [ -n "${PHP_SHARED_CAT}" ] ; then 45 if [[ -n "${PHP_SHARED_CAT}" ]] ; then
39 PHP_LIB_DIR="/usr/share/${PHP_SHARED_CAT}/${PHP_LIB_NAME}" 46 PHP_LIB_DIR="/usr/share/${PHP_SHARED_CAT}/${PHP_LIB_NAME}"
40 else 47 else
41 PHP_LIB_DIR="/usr/share/php/${PHP_LIB_NAME}" 48 PHP_LIB_DIR="/usr/share/php/${PHP_LIB_NAME}"
42 fi 49 fi
43 50
45 52
46 S_DIR="$1" 53 S_DIR="$1"
47 shift 54 shift
48 55
49 for x in $@ ; do 56 for x in $@ ; do
50 SUBDIR="`dirname ${x}`" 57 SUBDIR="$(dirname ${x})"
51 insinto ${PHP_LIB_DIR}/${SUBDIR} 58 insinto "${PHP_LIB_DIR}/${SUBDIR}"
52 doins "${S_DIR}/${x}" 59 doins "${S_DIR}/${x}"
53 done 60 done
61
62 for doc in ${DOCS} ; do
63 [[ -s ${doc} ]] && dodoc-php ${doc}
64 done
54} 65}

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20