#!/bin/bash
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-src/portage/bin/dodoc,v 1.5 2003/04/27 21:16:47 carpaski Exp $

for x in "$@" ; do
	if [ -s "${x}" ] ; then
		if [ ! -d "${D}usr/share/doc/${PF}" ] ; then
			install -d "${D}usr/share/doc/${PF}"
		fi
		if [ -z "${DOCDESTTREE}" ] ; then
			install -m0644 "${x}" "${D}usr/share/doc/${PF}"
			gzip -f -9 "${D}usr/share/doc/${PF}/${x##*/}"
		else
			install -m0644 "${x}" "${D}usr/share/doc/${PF}/${DOCDESTTREE}"
			gzip -f -9 "${D}usr/share/doc/${PF}/${DOCDESTTREE}/${x##*/}"
		fi
	else
		echo "${0}: ${x} does not exist."
	fi
done
