jackson-dataformat-yaml-2.8.5.ebuild 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. JAVA_PKG_IUSE="doc source"
  5. inherit java-pkg-2 java-pkg-simple
  6. DESCRIPTION="YAML data format extension for Jackson"
  7. HOMEPAGE="https://github.com/FasterXML/jackson-dataformat-yaml"
  8. SRC_URI="https://github.com/FasterXML/${PN}/archive/${P}.tar.gz"
  9. LICENSE="Apache-2.0"
  10. SLOT="2"
  11. KEYWORDS="~amd64 ~x86"
  12. IUSE="test"
  13. CP_DEPEND="~dev-java/jackson-${PV}:${SLOT}
  14. ~dev-java/jackson-databind-${PV}:${SLOT}
  15. >=dev-java/snakeyaml-1.16:0"
  16. RDEPEND=">=virtual/jre-1.7
  17. ${CP_DEPEND}"
  18. DEPEND=">=virtual/jdk-1.7
  19. ${CP_DEPEND}
  20. test? (
  21. ~dev-java/jackson-annotations-${PV}:${SLOT}
  22. dev-java/junit:4
  23. )"
  24. S="${WORKDIR}/${PN}-${P}"
  25. JAVA_SRC_DIR="src/main/java"
  26. src_prepare() {
  27. default
  28. sed -e 's:@package@:com.fasterxml.jackson.dataformat.yaml:g' \
  29. -e "s:@projectversion@:${PV}:g" \
  30. -e 's:@projectgroupid@:com.fasterxml.jackson.dataformat:g' \
  31. -e 's:@projectartifactid@:jackson-dataformat-yaml:g' \
  32. "${JAVA_SRC_DIR}/com/fasterxml/jackson/dataformat/yaml/PackageVersion.java.in" \
  33. > "${JAVA_SRC_DIR}/com/fasterxml/jackson/dataformat/yaml/PackageVersion.java" || die
  34. # Requires OPS4J Pax Exam, which isn't packaged yet.
  35. rm "src/test/java/com/fasterxml/jackson/dataformat/yaml/failsafe/OSGiIT.java" || die
  36. java-pkg-2_src_prepare
  37. }
  38. src_compile() {
  39. java-pkg-simple_src_compile
  40. java-pkg_addres ${PN}.jar src/main/resources
  41. }
  42. src_install() {
  43. java-pkg-simple_src_install
  44. dodoc README.md release-notes/{CREDITS,VERSION}
  45. }
  46. src_test() {
  47. cd src/test/java || die
  48. local CP=".:../resources:${S}/${PN}.jar:$(java-pkg_getjars jackson-annotations-${SLOT},junit-4,${JAVA_GENTOO_CLASSPATH})"
  49. local TESTS=$(find * -name "*Test*.java" ! -name "*TestBase*" ! -path "*/failing/*")
  50. TESTS="${TESTS//.java}"
  51. TESTS="${TESTS//\//.}"
  52. ejavac -cp "${CP}" -d . $(find * -name "*.java")
  53. ejunit4 -classpath "${CP}" ${TESTS}
  54. }