ant-core-1.9.2.ebuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. # Don't depend on itself.
  5. JAVA_ANT_DISABLE_ANT_CORE_DEP="true"
  6. # Rewriting build.xml files for the testcases has no use at the moment.
  7. JAVA_PKG_BSFIX_ALL="no"
  8. JAVA_PKG_IUSE="doc source"
  9. inherit eutils java-pkg-2 java-ant-2 prefix versionator
  10. MY_P="apache-ant-${PV}"
  11. DESCRIPTION="Java-based build tool similar to 'make' that uses XML configuration files"
  12. HOMEPAGE="http://ant.apache.org/"
  13. SRC_URI="mirror://apache/ant/source/${MY_P}-src.tar.bz2
  14. https://dev.gentoo.org/~tomwij/files/dist/ant-${PV}-gentoo.tar.bz2"
  15. LICENSE="Apache-2.0"
  16. SLOT="0"
  17. KEYWORDS="amd64 ~arm ~arm64 ppc64 x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
  18. DEPEND="|| ( >=virtual/jdk-1.5 dev-java/gcj-jdk )
  19. !dev-java/ant-tasks
  20. !dev-java/ant-optional"
  21. RDEPEND="${DEPEND}"
  22. S="${WORKDIR}/${MY_P}"
  23. RESTRICT="test"
  24. src_prepare() {
  25. EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches/"
  26. eprefixify "${WORKDIR}/ant"
  27. # use our split-ant build.xml.
  28. mv -f "${WORKDIR}/build.xml" . || die
  29. # Fixes bug 556008.
  30. java-ant_xml-rewrite -f build.xml \
  31. -c -e javadoc \
  32. -a failonerror \
  33. -v "false"
  34. # See bug #196080 for more details.
  35. java-ant_bsfix_one build.xml
  36. java-pkg-2_src_prepare
  37. }
  38. src_compile() {
  39. export ANT_HOME=""
  40. local bsyscp
  41. # This ensures that when building ant with bootstrapped ant,
  42. # only the source is used for resolving references, and not
  43. # the classes in bootstrapped ant but jikes in kaffe has issues with this...
  44. if ! java-pkg_current-vm-matches kaffe; then
  45. bsyscp="-Dbuild.sysclasspath=ignore"
  46. fi
  47. CLASSPATH="$(java-config -t)" ./build.sh ${bsyscp} jars internal_dist \
  48. $(use_doc javadocs) || die "build failed"
  49. }
  50. src_install() {
  51. dodir /usr/share/ant/lib
  52. for jar in ant.jar ant-bootstrap.jar ant-launcher.jar ; do
  53. java-pkg_dojar build/lib/${jar}
  54. dosym /usr/share/${PN}/lib/${jar} /usr/share/ant/lib/${jar}
  55. done
  56. dobin "${WORKDIR}/ant"
  57. dodir /usr/share/${PN}/bin
  58. for each in antRun antRun.pl runant.pl runant.py complete-ant-cmd.pl ; do
  59. dobin "${S}/src/script/${each}"
  60. dosym /usr/bin/${each} /usr/share/${PN}/bin/${each}
  61. done
  62. dosym /usr/share/${PN}/bin /usr/share/ant/bin
  63. insinto /usr/share/${PN}
  64. doins -r dist/etc
  65. dosym /usr/share/${PN}/etc /usr/share/ant/etc
  66. echo "ANT_HOME=\"${EPREFIX}/usr/share/ant\"" > "${T}/20ant"
  67. doenvd "${T}/20ant"
  68. dodoc NOTICE README WHATSNEW KEYS
  69. if use doc; then
  70. dohtml -r manual/*
  71. java-pkg_dojavadoc --symlink manual/api build/javadocs
  72. fi
  73. use source && java-pkg_dosrc src/main/*
  74. }
  75. pkg_postinst() {
  76. if [[ -n ${REPLACING_VERSIONS} ]]; then
  77. if ! version_is_at_least 1.7.0 ${REPLACING_VERSIONS}; then
  78. elog "The way of packaging ant in Gentoo has changed significantly since"
  79. elog "the 1.7.0 version, For more information, please see:"
  80. elog "https://www.gentoo.org/proj/en/java/ant-guide.xml"
  81. fi
  82. if ! version_is_at_least 1.7.1 ${REPLACING_VERSIONS}; then
  83. elog "Since 1.7.1, the ant-tasks meta-ebuild has been removed and its USE"
  84. elog "flags have been moved to dev-java/ant."
  85. fi
  86. fi
  87. }