summaryrefslogtreecommitdiff
blob: 9a01e99e53987094808512ec5c238a735c97e190 (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
53
54
55
56
57
58
59
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

JAVA_PKG_IUSE="doc examples source"
EANT_BUILD_TARGET="ready-to-run"
EANT_DOC_TARGET="doc-core"

inherit eutils java-pkg-2 java-ant-2

DOC_PV="2.0.1"

DESCRIPTION="An integrated Java environment for introductory teaching"
HOMEPAGE="http://bluej.org/"
SRC_URI="http://www.bluej.org/download/files/source/BlueJ-source-${PV//./}.zip
doc? ( http://bluej.org/download/files/${PN}-ref-manual.pdf
		http://bluej.org/tutorial/tutorial-${DOC_PV//.}.pdf -> ${PN}-tutorial-${DOC_PV}.pdf
		http://bluej.org/tutorial/testing-tutorial.pdf -> ${PN}-testing-tutorial.pdf )"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"

RDEPEND=">=virtual/jdk-1.5.0"
DEPEND="${RDEPEND}
	app-arch/unzip"

S=${WORKDIR}

java_prepare() {
	sed -i \
		-e "s:^build_java_home=.*$:build_java_home=$(java-config -O):" \
		-e "/^bluej_home/d" \
		build.properties || die
}

src_install() {
	insinto /usr/share/${PN}
	doins -r lib icons

	# fix config location and set symlink
	dodir /etc
	mv "${D}"/{usr/share/${PN}/lib,etc}/${PN}.defs
	dosym /{etc,usr/share/${PN}/lib}/${PN}.defs

	use source && java-pkg_dosrc src/${PN}/*

	insinto /usr/share/doc/${PF}
	use examples && { doins -r examples
		docompress -x /usr/share/doc/${P}/examples ; }
	use doc && { doins "${DISTDIR}"/${PN}-*.pdf
		dohtml -r doc/all/* ; }

	newbin "${FILESDIR}"/${PN}.wrapper ${PN}

	make_desktop_entry ${PN} Blue-J
}