--- sys-devel/gettext/gettext-0.18.1.1-r1.ebuild 2010-12-04 16:35:26.000000000 +0100 +++ sys-devel/gettext/gettext-0.18.1.1-r1.ebuild 2011-04-02 20:25:00.572299335 +0200 @@ -4,7 +4,7 @@ EAPI="2" -inherit flag-o-matic eutils multilib toolchain-funcs mono libtool +inherit flag-o-matic eutils multilib toolchain-funcs mono libtool java-pkg-opt-2 DESCRIPTION="GNU locale utilities" HOMEPAGE="http://www.gnu.org/software/gettext/" @@ -13,18 +13,21 @@ LICENSE="GPL-3 LGPL-2" SLOT="0" KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd" -IUSE="acl doc emacs +git nls nocxx openmp elibc_glibc" +IUSE="acl doc emacs +git java nls nocxx openmp elibc_glibc" DEPEND="virtual/libiconv dev-libs/libxml2 sys-libs/ncurses dev-libs/expat - acl? ( virtual/acl )" + acl? ( virtual/acl ) + java? ( >=virtual/jdk-1.4 )" RDEPEND="${DEPEND} - git? ( dev-vcs/git )" + git? ( dev-vcs/git ) + java? ( >=virtual/jre-1.4 )" PDEPEND="emacs? ( app-emacs/po-mode )" src_prepare() { + java-pgk-opt-2_src_prepare epunt_cxx } @@ -48,7 +51,7 @@ --docdir="/usr/share/doc/${PF}" \ --without-emacs \ --without-lispdir \ - --disable-java \ + $(use_enable java) \ --with-included-glib \ --with-included-libcroco \ --with-included-libunistring \ @@ -79,6 +82,16 @@ gen_usr_ldscript ${libname} fi + if use java ; then + java-pkg_dojar "${D}"/usr/share/${PN}/*.jar + rm -f "${D}"/usr/share/${PN}/*.jar + rm -f "${D}"/usr/share/${PN}/*.class + if use doc ; then + java-pkg_dojavadoc "${D}"/usr/share/doc/${PF}/javadoc2 + rm -rf "${D}"/usr/share/doc/${PF}/javadoc2 + fi + fi + if use doc ; then dohtml "${D}"/usr/share/doc/${PF}/*.html else @@ -94,6 +107,8 @@ # need to keep the linked version or the system # could die (things like sed link against it :/) preserve_old_lib /{,usr/}$(get_libdir)/libintl$(get_libname 7) + + java-pkg-opt_pkg_preinst } pkg_postinst() {