weka-3.8.0.ebuild 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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="source"
  5. inherit java-pkg-2 java-ant-2 versionator
  6. MY_P="${PN}-$(replace_all_version_separators '-')"
  7. DESCRIPTION="A Java data mining package"
  8. SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip"
  9. HOMEPAGE="http://www.cs.waikato.ac.nz/ml/weka/"
  10. SLOT="0"
  11. LICENSE="GPL-2"
  12. KEYWORDS="~amd64 ~x86"
  13. DEPEND=">=virtual/jdk-1.7
  14. app-arch/unzip
  15. >=dev-java/javacup-0.11a_beta20060608:0"
  16. RDEPEND=">=virtual/jre-1.7
  17. >=dev-java/javacup-0.11a_beta20060608:0"
  18. IUSE=""
  19. S="${WORKDIR}/${MY_P}"
  20. PATCHES=("${FILESDIR}"/${P}-build.xml.patch)
  21. EANT_BUILD_TARGET="exejar"
  22. EANT_DOC_TARGET="docs"
  23. JAVA_ANT_IGNORE_SYSTEM_CLASSES="true"
  24. weka_get_max_memory() {
  25. if use amd64; then
  26. echo 512m
  27. else
  28. echo 256m
  29. fi
  30. }
  31. src_prepare() {
  32. unzip -qq "${PN}-src.jar" -d . || die "Failed to unpack the source"
  33. rm -v weka.jar || die
  34. rm -rf doc || die
  35. java-pkg_jar-from --into lib javacup
  36. sed -i -e "s/256m/$(weka_get_max_memory)/g" build.xml || die
  37. default
  38. }
  39. src_install() {
  40. java-pkg_dojar dist/${PN}.jar
  41. java-pkg_dolauncher weka --main "${PN}.gui.GUIChooser"
  42. # Really need a virtual to list all available drivers and pull the ones
  43. # instaled
  44. java-pkg_register-optional-dependency hsqldb,jdbc-mysql,mckoi-1
  45. use source && java-pkg_dosrc src/main/java/weka/
  46. dodoc README
  47. dodir /usr/share/${PN}/data/
  48. insinto /usr/share/${PN}/data/
  49. doins data/*
  50. }
  51. pkg_postinst() {
  52. elog "If you are upgrading from weka 3.7 to later"
  53. elog "and your package manager does not start please delete"
  54. elog "file installedPackageCache.ser from packages folder"
  55. elog "in wekafiles located in your user home."
  56. elog
  57. elog "rm \${HOME}/wekafiles/packages/installedPackageCache.ser"
  58. }