java-pkg-opt-2.eclass 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Copyright 2004-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # @ECLASS: java-pkg-opt-2.eclass
  4. # @MAINTAINER:
  5. # java@gentoo.org
  6. # @AUTHOR:
  7. # Thomas Matthijs <axxo@gentoo.org>
  8. # @BLURB: Eclass for package with optional Java support
  9. # @DESCRIPTION:
  10. # Inherit this eclass instead of java-pkg-2 if you only need optional Java
  11. # support.
  12. inherit java-utils-2
  13. # @ECLASS-VARIABLE: JAVA_PKG_OPT_USE
  14. # @DESCRIPTION:
  15. # USE flag to control if optional Java stuff is build. Defaults to 'java'.
  16. JAVA_PKG_OPT_USE=${JAVA_PKG_OPT_USE:-java}
  17. DEPEND="${JAVA_PKG_OPT_USE}? ( ${JAVA_PKG_E_DEPEND} )"
  18. RDEPEND="${DEPEND}"
  19. # See java-pkg-2.eclass for JAVA_PKG_IUSE documentation
  20. IUSE="${JAVA_PKG_IUSE} ${JAVA_PKG_OPT_USE}"
  21. case "${EAPI:-0}" in
  22. 0|1) EXPORT_FUNCTIONS pkg_setup pkg_preinst ;;
  23. *) EXPORT_FUNCTIONS pkg_setup src_prepare pkg_preinst ;;
  24. esac
  25. # @FUNCTION: java-pkg-opt-2_pkg_setup
  26. # @DESCRIPTION:
  27. # default pkg_setup, wrapper for java-utils-2_pkg_init
  28. java-pkg-opt-2_pkg_setup() {
  29. use ${JAVA_PKG_OPT_USE} && java-pkg_init
  30. }
  31. # @FUNCTION: java-pkg-opt-2_src_prepare
  32. # @DESCRIPTION:
  33. # default src_prepare, wrapper for java-utils-2_src_prepare
  34. java-pkg-opt-2_src_prepare() {
  35. use ${JAVA_PKG_OPT_USE} && java-utils-2_src_prepare
  36. }
  37. # @FUNCTION: java-pkg-opt-2_pkg_preinst
  38. # @DESCRIPTION:
  39. # default pkg_preinst, wrapper for java-utils-2_pkg_preinst
  40. java-pkg-opt-2_pkg_preinst() {
  41. use ${JAVA_PKG_OPT_USE} && java-utils-2_pkg_preinst
  42. }