maven-bin-3.1.1.ebuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit java-pkg-2
  5. MY_PN=apache-${PN%%-bin}
  6. MY_PV=${PV/_alpha/-alpha-}
  7. MY_P="${MY_PN}-${MY_PV}"
  8. MY_MV="${PV%%.*}"
  9. DESCRIPTION="Project Management and Comprehension Tool for Java"
  10. SRC_URI="mirror://apache/maven/maven-${MY_MV}/${PV}/binaries/${MY_P}-bin.tar.gz"
  11. HOMEPAGE="http://maven.apache.org/"
  12. LICENSE="Apache-2.0"
  13. SLOT="3.1"
  14. KEYWORDS="amd64 x86"
  15. # TODO: Needs further resolution:
  16. #
  17. # - https://bugs.gentoo.org/show_bug.cgi?id=472850
  18. # - https://bugs.gentoo.org/show_bug.cgi?id=477436
  19. #
  20. DEPEND="app-eselect/eselect-java
  21. || ( dev-java/commons-logging:0 dev-java/log4j:0 dev-java/avalon-logkit:2.0 )
  22. dev-java/aopalliance:1
  23. dev-java/avalon-framework:4.1
  24. dev-java/commons-cli:1
  25. dev-java/commons-io:1
  26. dev-java/javax-inject:0
  27. dev-java/jsoup:0
  28. dev-java/jsr250:0
  29. dev-java/juel:0
  30. dev-java/osgi-core-api:0
  31. java-virtuals/interceptor-api:0
  32. java-virtuals/servlet-api:2.4"
  33. RDEPEND=">=virtual/jdk-1.5
  34. ${DEPEND}"
  35. S="${WORKDIR}/${MY_P}"
  36. MAVEN=${PN}-${SLOT}
  37. MAVEN_SHARE="/usr/share/${MAVEN}"
  38. java_prepare() {
  39. rm -v bin/*.bat lib/{aopalliance,commons-cli,javax.inject,jsr250}-*.jar || die
  40. chmod 644 boot/*.jar lib/*.jar conf/settings.xml || die
  41. # Symlink jars.
  42. cd lib || die
  43. java-pkg_jar-from aopalliance-1,avalon-framework-4.1,commons-cli-1,commons-io-1,interceptor-api,javax-inject,jsoup,jsr250,juel,osgi-core-api,servlet-api-2.4
  44. has_version dev-java/commons-logging:0 && java-pkg_jar-from commons-logging
  45. has_version dev-java/avalon-logkit:2.0 && java-pkg_jar-from avalon-logkit-2.0
  46. has_version dev-java/log4j:0 && java-pkg_jar-from log4j
  47. }
  48. # TODO: We should use jars from packages, instead of what is bundled.
  49. src_install() {
  50. dodir "${MAVEN_SHARE}"
  51. cp -Rp bin boot conf lib "${ED}/${MAVEN_SHARE}" || die "failed to copy"
  52. java-pkg_regjar "${ED}/${MAVEN_SHARE}"/boot/*.jar
  53. java-pkg_regjar "${ED}/${MAVEN_SHARE}"/lib/*.jar
  54. dodoc NOTICE README.txt
  55. dodir /usr/bin
  56. dosym "${MAVEN_SHARE}/bin/mvn" /usr/bin/mvn-${SLOT}
  57. # See bug #342901.
  58. echo "CONFIG_PROTECT=\"${MAVEN_SHARE}/conf\"" > "${T}/25${MAVEN}" || die
  59. doenvd "${T}/25${MAVEN}"
  60. }
  61. pkg_postinst() {
  62. eselect maven update mvn-${SLOT}
  63. }
  64. pkg_postrm() {
  65. eselect maven update
  66. }