/[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.1.1.1 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.1.1.1 2005/11/30 09:59:32 chriswhite 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# Maintained by the PHP Herd <php-bugs@gentoo.org> 6# Author: Luca Longinotti <chtekk@gentoo.org>
7# 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:
8# The php-lib-r1 eclass provides a unified interface for adding new 13# This eclass provides a unified interface for adding new PHP libraries.
9# PHP libraries. PHP libraries are PHP scripts designed for reuse inside 14# PHP libraries are PHP scripts designed for reuse inside other PHP scripts.
10# other PHP scripts.
11 15
12inherit depend.php 16inherit depend.php
13 17
14RESTRICT="${RESTRICT} nostrip"
15
16EXPORT_FUNCTIONS src_install 18EXPORT_FUNCTIONS src_install
17 19
18# ---begin ebuild configurable settings 20DEPEND="dev-lang/php"
21RDEPEND="${DEPEND}"
19 22
20# provide default extension name if necessary 23# @ECLASS-VARIABLE: PHP_LIB_NAME
24# @DESCRIPTION:
25# Defaults to ${PN} unless set manually in the ebuild.
21[ -z "${PHP_LIB_NAME}" ] && PHP_LIB_NAME="${PN}" 26[[ -z "${PHP_LIB_NAME}" ]] && PHP_LIB_NAME="${PN}"
22# ---end ebuild configurable settings
23 27
24DEPEND="${DEPEND} dev-lang/php" 28# @FUNCTION: php-lib-r1_src_install
25RDEPEND="${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.
26 33
27# you have to pass in a list of the PHP files to install
28#
29# $1 - directory in ${S} to insert from 34# $1 - directory in ${S} to insert from
30# $2 ... list of files to install 35# $2 ... list of files to install
31
32php-lib-r1_src_install() { 36php-lib-r1_src_install() {
33 has_php 37 has_php
34 38
35 # install to the correct phpX folder, if not specified 39 # install to the correct phpX folder, if not specified
36 # fall back to /usr/share/php 40 # fall back to /usr/share/php
37 if [ -n "${PHP_SHARED_CAT}" ] ; then 41 if [[ -n "${PHP_SHARED_CAT}" ]] ; then
38 PHP_LIB_DIR="/usr/share/${PHP_SHARED_CAT}/${PHP_LIB_NAME}" 42 PHP_LIB_DIR="/usr/share/${PHP_SHARED_CAT}/${PHP_LIB_NAME}"
39 else 43 else
40 PHP_LIB_DIR="/usr/share/php/${PHP_LIB_NAME}" 44 PHP_LIB_DIR="/usr/share/php/${PHP_LIB_NAME}"
41 fi 45 fi
42 46
45 S_DIR="$1" 49 S_DIR="$1"
46 shift 50 shift
47 51
48 for x in $@ ; do 52 for x in $@ ; do
49 SUBDIR="`dirname ${x}`" 53 SUBDIR="`dirname ${x}`"
50 insinto ${PHP_LIB_DIR}/${SUBDIR} 54 insinto "${PHP_LIB_DIR}/${SUBDIR}"
51 doins "${S_DIR}/${x}" 55 doins "${S_DIR}/${x}"
52 done 56 done
53} 57}

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

  ViewVC Help
Powered by ViewVC 1.1.20