I just finished writing patches that should enable you to use the following DEPEND: C_DEP=" dev-java/sun-jaf !java5? ( dev-libs/cyrus-sasl )" DEPEND=" java5? ( >=virtual/jdk-1.5 ) !java5? ( >=virtual/jdk-1.4 ) dev-java/ant-core ${C_DEP} source? ( app-arch/zip )" RDEPEND=" java5? ( >=virtual/jre-1.5 ) !java5? ( >=virtual/jre-1.4 ) ${C_DEP}" http://dev.gentoo.org/~betelgeuse/patches/java-util-2.eclass-use.patch http://dev.gentoo.org/~betelgeuse/patches/versionmanager-use-flags.patch Of course we could do the parsing using our own code instead of using portage directly. IMHO it would be the best to have some kind of API ebuilds could use against the package manager to do these kinds of things. It's a bit hackish so I don't know yet if I will commit these. Regards, Petteri