summaryrefslogtreecommitdiff
blob: 4890a1bb1080e33485373b531f7c851d9469612d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-util/weka/weka-3.4.1-r1.ebuild,v 1.2 2004/10/16 18:17:32 axxo Exp $

inherit java-pkg

DESCRIPTION="A Java data mining package"
SRC_URI="mirror://sourceforge/${PN}/${PN}-${PV//./-}.zip"
HOMEPAGE="http://www.cs.waikato.ac.nz/ml/weka/"
SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~x86"
DEPEND=">=virtual/jdk-1.4.1"
IUSE="doc"

S=${WORKDIR}/${PN}-3-4


src_unpack() {
	unpack ${A}
	cd ${S}
	mkdir build
	jar xf weka.jar || die "failed to unpack"

	find weka/ -type f -name '*.class' -exec rm -f {} \; || die "failed to	remove classes"
	cp -r weka build || die "failed to copy"

	rm -rf weka
	jar xf weka-src.jar || die "failed to unpack"

	rm -f *.jar
}

src_compile() {
	javac -nowarn -classpath . $(find weka -name '*.java') -d build || die "failed to compile"
	jar cf ${PN}.jar -C build .
}

src_install() {
	java-pkg_dojar ${PN}.jar || die "failed installing"

	mkdir bin
	echo "#!/bin/sh" > bin/${PN}
	echo "java -classpath \$(java-config -p weka) weka.gui.GUIChooser" >> bin/${PN}
	dobin bin/${PN}

	dodir /usr/share/${PN}/data/
	cp data/* ${D}/usr/share/${PN}/data/ || die "failed to copy data"
	use doc && java-pkg_dohtml -r doc/*
	dodoc README* COPYING CHANGELOG-${PV//./-}
	cp *.pdf ${D}/usr/share/doc/${PF}/ || die "failed to copy docs"
}