httpcomponents-core-4.4.1-r1.ebuild 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. JAVA_PKG_IUSE="source examples test"
  5. # "components"
  6. CMPT=${PN%%-*}
  7. # "core"
  8. CORE=${PN##*-}
  9. # "httpcore"
  10. HTTPCORE="http${CORE}"
  11. # "httpcore-nio"
  12. HTTPNIO="${HTTPCORE}-nio"
  13. inherit java-pkg-2 java-ant-2
  14. DESCRIPTION="A low level toolset of Java components focused on HTTP and associated protocols"
  15. HOMEPAGE="http://hc.apache.org/index.html"
  16. SRC_URI="mirror://apache/httpcomponents/${HTTPCORE}/source/${P}-src.tar.gz"
  17. LICENSE="Apache-2.0"
  18. SLOT="4.4"
  19. KEYWORDS="amd64 x86"
  20. RDEPEND=">=virtual/jre-1.6"
  21. DEPEND="
  22. test? (
  23. dev-java/commons-logging:0
  24. dev-java/ant-junit:0
  25. dev-java/mockito:0
  26. )
  27. >=virtual/jdk-1.6"
  28. JAVA_ANT_REWRITE_CLASSPATH="yes"
  29. EANT_BUILD_TARGET="package"
  30. EANT_GENTOO_CLASSPATH_EXTRA="${S}/${HTTPCORE}/target/${HTTPCORE}-${PV}.jar"
  31. java_prepare() {
  32. cp "${FILESDIR}"/${P}-${HTTPCORE}-build.xml ${HTTPCORE}/build.xml || die
  33. cp "${FILESDIR}"/${P}-${HTTPNIO}-build.xml ${HTTPNIO}/build.xml || die
  34. # Why have these classes been deprecated although other libraries are built
  35. # on them (i.e. httpcomponents-client) is mindboggling. See bug 553234.
  36. cp -r "${S}"/httpcore/src/main/java-deprecated/* \
  37. "${S}"/httpcore/src/main/java/* || die
  38. cp -r "${S}"/httpcore-nio/src/main/java-deprecated/* \
  39. "${S}"/httpcore-nio/src/main/java/* || die
  40. }
  41. src_compile() {
  42. # first, compile httpcore module
  43. EANT_BUILD_XML="${HTTPCORE}/build.xml" java-pkg-2_src_compile
  44. # then, httpnio module
  45. EANT_BUILD_XML="${HTTPNIO}/build.xml" java-pkg-2_src_compile
  46. }
  47. EANT_TEST_GENTOO_CLASSPATH="
  48. commons-logging
  49. mockito
  50. "
  51. src_test() {
  52. # run junit tests for httpcore module
  53. EANT_BUILD_XML="${HTTPCORE}/build.xml" java-pkg-2_src_test
  54. # run junit tests for httpcore-nio module
  55. EANT_BUILD_XML="${HTTPNIO}/build.xml" java-pkg-2_src_test
  56. }
  57. src_install() {
  58. java-pkg_newjar ${HTTPCORE}/target/${HTTPCORE}-${PV}.jar ${HTTPCORE}.jar
  59. java-pkg_newjar ${HTTPNIO}/target/${HTTPNIO}-${PV}.jar ${HTTPNIO}.jar
  60. use source && java-pkg_dosrc httpcore{,-nio}/src/main/java
  61. use examples && java-pkg_doexamples httpcore{,-nio}/src/examples
  62. dodoc {README,RELEASE_NOTES,NOTICE}.txt
  63. }