summaryrefslogtreecommitdiff
blob: 86dd36a48fced9f1b818a38fe7a7d8959b8631c2 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-p2p/frostwire/frostwire-4.13.5-r1.ebuild,v 1.2 2008/05/14 04:29:09 wltjr Exp $

EAPI=1
JAVA_PKG_IUSE="source"

inherit java-pkg-2 java-ant-2

DESCRIPTION="Frostwire Java Gnutella client"
HOMEPAGE="http://www.frostwire.com"
SRC_URI="http://www.frostwire.com/frostwire/${PV}/${P}.src.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
#IUSE="gtk"
IUSE=""

#	dev-java/commons-httpclient
#	dev-java/commons-pool
COMMON_DEP="
	dev-java/commons-logging
	dev-java/commons-net
	dev-java/icu4j
	dev-java/jgoodies-looks:1.2
	dev-java/jmdns
	dev-java/jython
	dev-java/log4j
	dev-java/xml-commons-external"

DEPEND=">=virtual/jdk-1.5
	${COMMON_DEP}"

RDEPEND=">=virtual/jre-1.5
	dev-java/asm
	${COMMON_DEP}"

S="${WORKDIR}/${P}.src"

PREFIX="/usr/share/${PN}"

src_unpack() {
	unpack ${A}
	cd "${S}"

#Todo
#	java-ant_rewrite-classpath

	find . '(' -name '*.bat' -o -name '*.exe' ')' -delete
#	find ${S} '(' -name '*.class' -o -name '*.jar' ')' -print -delete

# Tried to remove but seem to be required :(
#	rm -fR lib/jars/osx lib/jars/windows

	cd lib/jars
	rm -fR commons-logging.jar commons-net.jar \
		log4j.jar icu4j.jar jmdns.jar

# Seems to want a modified version of commons-httpclient
#	java-pkg_jar-from commons-httpclient
	java-pkg_jar-from commons-logging

# Seems to want a modified version of commons-pool
#	java-pkg_jar-from commons-pool
	java-pkg_jar-from commons-net
	java-pkg_jar-from log4j
	java-pkg_jar-from icu4j
	java-pkg_jar-from jmdns
	java-pkg_jar-from jgoodies-looks-1.2
	java-pkg_jar-from jython

# bye bye hashes, crude but effective :)
	cat /dev/null > "${S}/lib/jars/hashes"

}

src_compile() {
	cd "${S}/core"
	eant
	cd "${S}/gui"
	eant
	eant FrostWireJar

	# Make themes.jar
	cd "${S}/lib/themes"
	sh makeThemesJar.sh

	# temp fix/hack for bug #215423 till bug #180755 is resolved
	# bit noisy when not found, but better than command not found :)
	[ ! -p native2ascii > /dev/null ] && export PATH="${PATH}:$(java-config -O)/bin"

	# Make message bundles
	cd "${S}/lib/native_encoded_messagebundles"
	python create_iso88591_bundles.py
	cd "${S}/lib/messagebundles"
	jar -cf MessagesBundles.jar resources totd xml *.properties
}

src_install() {
	java-pkg_dojar "${S}/gui/lib/FrostWire.jar"
	java-pkg_dojar "${S}/lib/jars/other/themes.jar"
	java-pkg_dojar "${S}/lib/jars/id3v2.jar"
	java-pkg_dojar "${S}/lib/messagebundles/MessagesBundles.jar"

# Install resources for Frostwire. Don't let the jars deceive ya :)
# These are directly required, not sure of source atm
	insinto	${PREFIX}
	doins "${S}/gui/xml.war"
	doins "${S}/gui/update.ver"
	doins "${S}/lib/messagebundles/MessagesBundle.properties"
	cd "${D}/usr/share/${PN}"
	ln -s lib/id3v2.jar
	ln -s lib/MessagesBundles.jar
	ln -s lib/themes.jar

# Bundled jars, yeah I know throw up in your mouth some
# but registering them you say, only doing so for launcher
	bjs="clink.jar daap.jar commons-httpclient.jar commons-pool.jar \
		jcraft.jar jdic.jar jl011.jar mp3sp14.jar ProgressTabs.jar \
		tritonus.jar vorbis.jar linux/jdic_stub.jar i18n.jar"
	for bj in ${bjs} ; do
		java-pkg_dojar "${S}/lib/jars/${bj}"
	done

	touch "${D}/${PREFIX}/hashes"

	java-pkg_dolauncher ${PN} \
		--main com.limegroup.gnutella.gui.Main \
		--java_args "-Xms64m -Xmx128m -ea -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog" \
		--pwd /usr/share/${PN}

	sizes="16x16 32x32 48x48 64x64"
	for size in ${sizes} ; do
		insinto /usr/share/icons/hicolor/${size}/apps
		doins "${S}/lib/icons/hicolor/${size}/apps/${PN}.png"
	done

	make_desktop_entry frostwire FrostWire
}