/[gentoo-x86]/eclass/depend.php.eclass
Gentoo

Diff of /eclass/depend.php.eclass

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

Revision 1.23 Revision 1.25
1# Copyright 1999-2007 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/depend.php.eclass,v 1.23 2008/01/06 19:30:24 swegener Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/depend.php.eclass,v 1.25 2008/02/26 16:26:08 armin76 Exp $
4 4
5# Author: Stuart Herbert <stuart@gentoo.org> 5# Author: Stuart Herbert <stuart@gentoo.org>
6# Author: Luca Longinotti <chtekk@gentoo.org> 6# Author: Luca Longinotti <chtekk@gentoo.org>
7# Author: Jakub Moc <jakub@gentoo.org> (documentation) 7# Author: Jakub Moc <jakub@gentoo.org> (documentation)
8 8
169# @DESCRIPTION: 169# @DESCRIPTION:
170# Call this function from your pkg_setup, src_compile, src_install etc. if you 170# Call this function from your pkg_setup, src_compile, src_install etc. if you
171# need to know which PHP version is being used and where the PHP binaries/data 171# need to know which PHP version is being used and where the PHP binaries/data
172# are installed. 172# are installed.
173has_php() { 173has_php() {
174 # If PHP_PKG is already set, then we have remembered our PHP settings
175 # from last time
176 if [[ -n ${PHP_PKG} ]] ; then
177 return
178 fi
179
180 if [[ -z ${PHP_VERSION} ]] ; then
181 # Detect which PHP version we have installed 174 # Detect which PHP version we have installed
182 if has_version '=dev-lang/php-5*' ; then 175 if has_version '=dev-lang/php-5*' ; then
183 PHP_VERSION="5" 176 PHP_VERSION="5"
184 elif has_version '=dev-lang/php-4*' ; then 177 elif has_version '=dev-lang/php-4*' ; then
185 PHP_VERSION="4" 178 PHP_VERSION="4"
186 else 179 else
187 die "Unable to find an installed dev-lang/php package" 180 die "Unable to find an installed dev-lang/php package"
188 fi
189 fi 181 fi
190 182
191 # If we get here, then PHP_VERSION tells us which version of PHP we 183 # If we get here, then PHP_VERSION tells us which version of PHP we
192 # want to use 184 # want to use
193 uses_php${PHP_VERSION} 185 uses_php${PHP_VERSION}
630if [[ $# -lt 1 ]] ; then 622if [[ $# -lt 1 ]] ; then
631 echo "$0: at least one argument needed" 1>&2 623 echo "$0: at least one argument needed" 1>&2
632 exit 1 624 exit 1
633fi 625fi
634 626
635phpdocdir="${D}/usr/share/doc/${CATEGORY}/${PF}/" 627phpdocdir="/usr/share/doc/${CATEGORY}/${PF}/"
636
637if [[ ! -d "${phpdocdir}" ]] ; then
638 install -d "${phpdocdir}"
639fi
640 628
641for x in $@ ; do 629for x in $@ ; do
642 if [[ -s "${x}" ]] ; then 630 if [[ -s "${x}" ]] ; then
643 install -m0644 "${x}" "${phpdocdir}" 631 insinto "${phpdocdir}"
632 doins "${x}"
644 gzip -f -9 "${phpdocdir}/${x##*/}" 633 gzip -f -9 "${D}/${phpdocdir}/${x##*/}"
645 elif [[ ! -e "${x}" ]] ; then 634 elif [[ ! -e "${x}" ]] ; then
646 echo "dodoc-php: ${x} does not exist" 1>&2 635 echo "dodoc-php: ${x} does not exist" 1>&2
647 fi 636 fi
648done 637done
649} 638}
639
640# @FUNCTION: dohtml-php
641# @USAGE: <list of html docs>
642# @DESCRIPTION:
643# Alternative to dohtml function for use in our PHP eclasses and ebuilds.
644# Stored here because depend.php gets always sourced everywhere in the PHP
645# ebuilds and eclasses. It simply is dohtml with a changed path to the docs.
646# NOTE: No support for [-a|-A|-p|-x] options is provided!
647dohtml-php() {
648if [[ $# -lt 1 ]] ; then
649 echo "$0: at least one argument needed" 1>&2
650 exit 1
651fi
652
653phphtmldir="/usr/share/doc/${CATEGORY}/${PF}/html"
654
655for x in $@ ; do
656 if [[ -s "${x}" ]] ; then
657 insinto "${phphtmldir}"
658 doins "${x}"
659 elif [[ ! -e "${x}" ]] ; then
660 echo "dohtml-php: ${x} does not exist" 1>&2
661 fi
662done
663}

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.25

  ViewVC Help
Powered by ViewVC 1.1.20