| 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.24 2008/02/11 20:47:35 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 | |
| … | |
… | |
| 630 | if [[ $# -lt 1 ]] ; then |
630 | if [[ $# -lt 1 ]] ; then |
| 631 | echo "$0: at least one argument needed" 1>&2 |
631 | echo "$0: at least one argument needed" 1>&2 |
| 632 | exit 1 |
632 | exit 1 |
| 633 | fi |
633 | fi |
| 634 | |
634 | |
| 635 | phpdocdir="${D}/usr/share/doc/${CATEGORY}/${PF}/" |
635 | phpdocdir="/usr/share/doc/${CATEGORY}/${PF}/" |
| 636 | |
|
|
| 637 | if [[ ! -d "${phpdocdir}" ]] ; then |
|
|
| 638 | install -d "${phpdocdir}" |
|
|
| 639 | fi |
|
|
| 640 | |
636 | |
| 641 | for x in $@ ; do |
637 | for x in $@ ; do |
| 642 | if [[ -s "${x}" ]] ; then |
638 | if [[ -s "${x}" ]] ; then |
| 643 | install -m0644 "${x}" "${phpdocdir}" |
639 | insinto "${phpdocdir}" |
|
|
640 | doins "${x}" |
| 644 | gzip -f -9 "${phpdocdir}/${x##*/}" |
641 | gzip -f -9 "${D}/${phpdocdir}/${x##*/}" |
| 645 | elif [[ ! -e "${x}" ]] ; then |
642 | elif [[ ! -e "${x}" ]] ; then |
| 646 | echo "dodoc-php: ${x} does not exist" 1>&2 |
643 | echo "dodoc-php: ${x} does not exist" 1>&2 |
| 647 | fi |
644 | fi |
| 648 | done |
645 | done |
| 649 | } |
646 | } |
|
|
647 | |
|
|
648 | # @FUNCTION: dohtml-php |
|
|
649 | # @USAGE: <list of html docs> |
|
|
650 | # @DESCRIPTION: |
|
|
651 | # Alternative to dohtml function for use in our PHP eclasses and ebuilds. |
|
|
652 | # Stored here because depend.php gets always sourced everywhere in the PHP |
|
|
653 | # ebuilds and eclasses. It simply is dohtml with a changed path to the docs. |
|
|
654 | # NOTE: No support for [-a|-A|-p|-x] options is provided! |
|
|
655 | dohtml-php() { |
|
|
656 | if [[ $# -lt 1 ]] ; then |
|
|
657 | echo "$0: at least one argument needed" 1>&2 |
|
|
658 | exit 1 |
|
|
659 | fi |
|
|
660 | |
|
|
661 | phphtmldir="/usr/share/doc/${CATEGORY}/${PF}/html" |
|
|
662 | |
|
|
663 | for x in $@ ; do |
|
|
664 | if [[ -s "${x}" ]] ; then |
|
|
665 | insinto "${phphtmldir}" |
|
|
666 | doins "${x}" |
|
|
667 | elif [[ ! -e "${x}" ]] ; then |
|
|
668 | echo "dohtml-php: ${x} does not exist" 1>&2 |
|
|
669 | fi |
|
|
670 | done |
|
|
671 | } |