Index: java-utils-2.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v retrieving revision 1.98 diff -u -r1.98 java-utils-2.eclass --- java-utils-2.eclass 26 Nov 2007 21:00:59 -0000 1.98 +++ java-utils-2.eclass 28 Nov 2007 01:40:47 -0000 @@ -559,15 +559,27 @@ # # Installs javadoc documentation. This should be controlled by the doc use flag. # -# @param $1: - The javadoc root directory. +# @param $1: optional --symlink creates to symlink like this for html +# documentation bundles. +# @param $2: - The javadoc root directory. # # @example: # java-pkg_dojavadoc docs/api +# java-pkg_dojavadoc --symlink apidocs docs/api # # ------------------------------------------------------------------------------ java-pkg_dojavadoc() { debug-print-function ${FUNCNAME} $* + + # For html documentation bundles that link to Javadoc + local symlink + if [[ ${1} = --symlink ]]; then + symlink=${2} + shift 2 + fi + local dir="$1" + local dest=/usr/share/doc/${PF}/html # QA checks @@ -581,6 +593,11 @@ is-java-strict && die "${msg}" fi + if [[ -e ${D}/${dest}/api ]]; then + eerror "${dest} already exists. Will not overwrite." + die "${dest}" + fi + # Renaming to match our directory layout local dir_to_install="${dir}" @@ -592,7 +609,14 @@ # Actual installation - java-pkg_dohtml -r ${dir_to_install} + java-pkg_dohtml -r "${dir_to_install}" + + # Let's make a symlink to the directory we have everything else under + dosym ${dest} "${JAVA_PKG_SHAREPATH}/api" || die + + if [[ ${symlink} ]]; then + dosym ${dest}/{api,${symlink}} || die + fi } # ------------------------------------------------------------------------------