Index: java-pkg.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/java-pkg.eclass,v retrieving revision 1.32 diff -u -3 -p -w -b -B -r1.32 java-pkg.eclass --- java-pkg.eclass 6 Dec 2005 20:10:50 -0000 1.32 +++ java-pkg.eclass 10 Mar 2006 03:45:05 -0000 @@ -68,6 +68,14 @@ java-pkg_do_write_() echo "DEPEND=${pkgs}" >> "${package_env}" fi + if [ -n "${JAVADOC_PATH}" ] ; then + echo "JAVADOC_PATH=${JAVADOC_PATH}" >> "${package_env}" + fi + + if [ -n "${JAVA_SOURCES}" ] ; then + echo "JAVA_SOURCES=${JAVA_SOURCES}" >> "${package_env}" + fi + # Strip unnecessary leading and trailing colons sed -e "s/=:/=/" -e "s/:$//" -i "${package_env}" } @@ -331,6 +340,10 @@ java-pkg_getjars() java-pkg_dohtml() { dohtml -f package-list $@ + # this probably shouldn't be here but it provides + # a reasonable way to catch # docs for all of the + # old ebuilds. + java-pkg_recordjavadoc } java-pkg_jarinto() @@ -366,4 +379,24 @@ java-pkg_dosrc() { dodir ${target} install ${INSOPTIONS} "${T}/${PN}-src.zip" "${D}${target}" \ || die "failed to install sources" + # Record the existence of the sources in the package.env + JAVA_SOURCES="${target}${PN}-src.zip" + java-pkg_do_write_ +} + +# Scan for JavaDocs, and record their existence in the package.env file +java-pkg_recordjavadoc() +{ + java-pkg_do_init_ + # the find statement is important + # as some packages include multiple trees of javadoc + JAVADOC_PATH="$(find ${D}/usr/share/doc/ -name allclasses-frame.html -printf '%h:')" + # remove $D - TODO: check this is ok with all cases of the above + JAVADOC_PATH="${JAVADOC_PATH//${D}}" + if [ -n "${JAVADOC_PATH}" ] ; then + debug-print "JavaDocs found in ${JAVADOC_PATH%:}" + java-pkg_do_write_ + else + debug-print "No JavaDocs found" + fi }