/[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.6
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2007 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.6 2007/09/01 15:58:17 jokey Exp $
4# 4#
5# Author: Stuart Herbert <stuart@gentoo.org> 5# Author: Stuart Herbert <stuart@gentoo.org>
6# 6# Author: Luca Longinotti <chtekk@gentoo.org>
7
8# @ECLASS: php-lib-r1.eclass
9# @MAINTAINER:
10# Gentoo PHP team <php-bugs@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
29#
30# $1 - directory in ${S} to insert from 34# $1 - directory in ${S} to insert from
31# $2 ... list of files to install 35# $2 ... list of files to install
32
33php-lib-r1_src_install() { 36php-lib-r1_src_install() {
34 has_php 37 has_php
35 38
36 # install to the correct phpX folder, if not specified 39 # install to the correct phpX folder, if not specified
37 # fall back to /usr/share/php 40 # fall back to /usr/share/php
38 if [ -n "${PHP_SHARED_CAT}" ] ; then 41 if [[ -n "${PHP_SHARED_CAT}" ]] ; then
39 PHP_LIB_DIR="/usr/share/${PHP_SHARED_CAT}/${PHP_LIB_NAME}" 42 PHP_LIB_DIR="/usr/share/${PHP_SHARED_CAT}/${PHP_LIB_NAME}"
40 else 43 else
41 PHP_LIB_DIR="/usr/share/php/${PHP_LIB_NAME}" 44 PHP_LIB_DIR="/usr/share/php/${PHP_LIB_NAME}"
42 fi 45 fi
43 46
46 S_DIR="$1" 49 S_DIR="$1"
47 shift 50 shift
48 51
49 for x in $@ ; do 52 for x in $@ ; do
50 SUBDIR="`dirname ${x}`" 53 SUBDIR="`dirname ${x}`"
51 insinto ${PHP_LIB_DIR}/${SUBDIR} 54 insinto "${PHP_LIB_DIR}/${SUBDIR}"
52 doins "${S_DIR}/${x}" 55 doins "${S_DIR}/${x}"
53 done 56 done
54} 57}

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

  ViewVC Help
Powered by ViewVC 1.1.20