zemberek-2.1.1.ebuild 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=2
  4. JAVA_PKG_IUSE="source doc test"
  5. inherit eutils java-pkg-2 java-ant-2
  6. DESCRIPTION="Zemberek NLP library"
  7. HOMEPAGE="https://github.com/ahmetaa/zemberek-nlp"
  8. SRC_URI="https://${PN}.googlecode.com/files/${P}-nolibs-src.zip"
  9. LICENSE="MPL-1.1"
  10. SLOT="0"
  11. KEYWORDS="amd64 ppc64 x86 ~x86-fbsd"
  12. LANGS="tr tk"
  13. S=${WORKDIR}/${P}-nolibs-src
  14. IUSE="l10n_tk +l10n_tr"
  15. RDEPEND=">=virtual/jre-1.5"
  16. DEPEND=">=virtual/jdk-1.5
  17. test?
  18. (
  19. dev-java/junit:4
  20. dev-java/ant-junit4
  21. dev-java/hamcrest-core
  22. )
  23. app-arch/unzip"
  24. java_prepare() {
  25. use test && java-pkg_jarfrom --build-only --into lib/gelistirme junit-4 junit.jar
  26. # Added hamcrest-core as a workaround
  27. # Issue spotted by Markus Meier <maekke@gentoo.org>
  28. # See https://bugs.gentoo.org/show_bug.cgi?id=253753#c3
  29. use test && java-pkg_jarfrom --build-only --into lib/gelistirme hamcrest-core
  30. epatch "${FILESDIR}"/${P}-classpathfix.patch
  31. }
  32. src_compile() {
  33. local anttargs langs="" jar
  34. for jar in ${LANGS}; do
  35. use l10n_${jar} && langs+=" ${jar}"
  36. done
  37. for jar in cekirdek demo ${langs}; do
  38. anttargs="${anttargs} jar-${jar}"
  39. done
  40. eant ${anttargs} $(use_doc javadocs)
  41. }
  42. src_install() {
  43. local sourcetrees="" langs="" jar
  44. for jar in ${LANGS}; do
  45. use l10n_${jar} && langs+=" ${jar}"
  46. done
  47. for jar in cekirdek demo ${langs}; do
  48. java-pkg_newjar dagitim/jar/zemberek-${jar}-${PV}.jar zemberek2-${jar}.jar
  49. sourcetrees="${sourcetrees} src/${jar}/net"
  50. done
  51. use source && java-pkg_dosrc ${sourcetrees}
  52. use doc && java-pkg_dojavadoc build/java-docs/api
  53. java-pkg_dolauncher zemberek-demo --main net.zemberek.demo.DemoMain
  54. dodoc dokuman/lisanslar/* || die
  55. dodoc surumler.txt || die
  56. }
  57. src_test() {
  58. ANT_TASKS="ant-junit4" eant unit-test
  59. }