summaryrefslogtreecommitdiff
blob: 080cdbb0ce1d0f4b52a473fa91eef0264f51bf55 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-misc/bfm/bfm-1.2.ebuild,v 1.3 2005/04/04 17:04:20 luckyduck Exp $

inherit java-pkg

DESCRIPTION="File manager and first person shooter written in Java3D, you remove files by shooting at them"
HOMEPAGE="http://bfm.webhop.net"
SRC_URI="http://bfm.webhop.net/releases/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="doc jikes source"

DEPEND=">=virtual/jre-1.4
	|| ( >=dev-java/blackdown-java3d-bin-1.3.1-r1
		>=dev-java/sun-java3d-bin-1.3 )
	dev-java/ant-core
	jikes? ( dev-java/jikes )
	source? ( app-arch/zip )"
RDEPEND=">=virtual/jre-1.4"

src_unpack() {
	unpack ${A}

	cd ${S}
	cp ${FILESDIR}/${PV}-build.xml ./build.xml

	mkdir ${S}/lib && cd ${S}/lib
	if has_version sun-java3d-bin; then
		java-pkg_jar-from sun-java3d-bin
	elif has_version blackdown-java3d-bin; then
		java-pkg_jar-from blackdown-java3d-bin
	fi
}

src_compile() {
	local antflags="jar"
	use doc && antflags="${antflags} docs"
	use jikes && antflags="${antflags} -Dbuild.compiler=jikes"
	ant ${antflags} || die "compilation failed"
}

src_install() {
	java-pkg_dojar dist/${PN}.jar

	local java3d=""
	if has_version blackdown-java3d-bin; then
		java3d="blackdown-java3d-bin"
	elif has_version sun-java3d-bin; then
		java3d="sun-java3d-bin"
	fi

	echo "#!/bin/sh" > ${PN}
	echo "\$(java-config -J) -Djava.library.path=\$(java-config -i ${java3d}) -cp \$(java-config -p bfm,${java3d}) Bfm"  \"\$@\">> ${PN}

	dobin ${PN}

	insinto /etc/bfm
	doins ${S}/bfm.conf

	if use doc; then
		dodoc README ChangeLog bindings NEWS
		java-pkg_dohtml -r docs/*
	fi
	use source && java-pkg_dosrc src/*
}

pkg_postinst() {
	einfo ""
	einfo "Bfm - The Brutal File Manager has been successfully installed!"
	einfo ""
	einfo "A system wide config file has been installed to /etc/bfm/bfm.conf"
	einfo "Copy the file to ~/.bfm/bfm.conf to set local settings"
	einfo ""
	ewarn ""
	ewarn "Be sure to run bfm in safe mode if you don't want to delete files"
	ewarn ""
}