1 |
# Copyright 1999-2010 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/net-p2p/vuze/vuze-4.3.0.6-r1.ebuild,v 1.1 2010/03/28 21:44:24 caster Exp $ |
4 |
|
5 |
EAPI=2 |
6 |
|
7 |
JAVA_PKG_IUSE="source" |
8 |
|
9 |
inherit eutils fdo-mime java-pkg-2 java-ant-2 |
10 |
|
11 |
PATCHSET_VER="4.2.0.8" |
12 |
|
13 |
DESCRIPTION="BitTorrent client in Java, formerly called Azureus" |
14 |
HOMEPAGE="http://www.vuze.com/" |
15 |
SRC_URI="mirror://sourceforge/azureus/Vuze_${PV}_source.zip |
16 |
mirror://gentoo/${PN}-${PATCHSET_VER}-gentoo-patches.tar.bz2" |
17 |
LICENSE="GPL-2 BSD" |
18 |
|
19 |
SLOT="0" |
20 |
KEYWORDS="amd64 ~ppc ~ppc64 x86" |
21 |
IUSE="" |
22 |
|
23 |
# bundles parts of commons-lang, but modified |
24 |
# bundles parts of http://www.programmers-friend.org/ |
25 |
RDEPEND=" |
26 |
dev-java/json-simple:0 |
27 |
dev-java/bcprov:1.3 |
28 |
>=dev-java/commons-cli-1.0:1 |
29 |
>=dev-java/log4j-1.2.8:0 |
30 |
dev-java/swt:3.5[cairo,xulrunner] |
31 |
!net-p2p/azureus-bin |
32 |
>=virtual/jre-1.5" |
33 |
|
34 |
DEPEND="${RDEPEND} |
35 |
app-arch/unzip |
36 |
dev-util/desktop-file-utils |
37 |
>=virtual/jdk-1.5" |
38 |
|
39 |
PDEPEND="~net-p2p/vuze-coreplugins-${PV}" |
40 |
|
41 |
src_unpack() { |
42 |
mkdir "${S}" && cd "${S}" || die |
43 |
default |
44 |
} |
45 |
|
46 |
java_prepare() { |
47 |
EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" epatch "${S}/${PN}-${PATCHSET_VER}-gentoo-patches/" |
48 |
|
49 |
### Removes OS X files and entries. |
50 |
rm -rv "org/gudy/azureus2/platform/macosx" \ |
51 |
"org/gudy/azureus2/ui/swt/osx" || die |
52 |
|
53 |
### Removes Windows files. |
54 |
rm -v ./org/gudy/azureus2/ui/swt/win32/Win32UIEnhancer.java || die |
55 |
|
56 |
### Removes test files. |
57 |
rm -rv "org/gudy/azureus2/ui/swt/test" \ |
58 |
org/gudy/azureus2/ui/console/multiuser/TestUserManager.java || die |
59 |
|
60 |
### Removes bouncycastle (we use our own bcprov). |
61 |
rm -rv "org/bouncycastle" || die |
62 |
|
63 |
### Removes bundled json |
64 |
rm -rv "org/json" || die |
65 |
|
66 |
mkdir -p build/libs || die |
67 |
} |
68 |
|
69 |
JAVA_ANT_REWRITE_CLASSPATH="true" |
70 |
EANT_GENTOO_CLASSPATH="swt-3.5,bcprov-1.3,json-simple,log4j,commons-cli-1" |
71 |
|
72 |
src_compile() { |
73 |
local mem |
74 |
use amd64 && mem="256" |
75 |
use x86 && mem="192" |
76 |
use ppc && mem="192" |
77 |
use ppc64 && mem="256" |
78 |
export ANT_OPTS="-Xmx${mem}m" |
79 |
java-pkg-2_src_compile |
80 |
} |
81 |
|
82 |
src_install() { |
83 |
java-pkg_dojar dist/*.jar || die "dojar failed" |
84 |
dodoc ChangeLog.txt || die |
85 |
|
86 |
java-pkg_dolauncher "${PN}" \ |
87 |
--main org.gudy.azureus2.ui.common.Main -pre "${FILESDIR}/${PN}-4.1.0.0-pre" \ |
88 |
--java_args '-Dazureus.install.path=/usr/share/vuze/ ${JAVA_OPTIONS}' \ |
89 |
--pkg_args '--ui=${UI}' |
90 |
dosym vuze /usr/bin/azureus |
91 |
|
92 |
# https://bugs.gentoo.org/show_bug.cgi?id=204132 |
93 |
java-pkg_register-environment-variable MOZ_PLUGIN_PATH /usr/lib/nsbrowser/plugins |
94 |
|
95 |
newicon "${S}"/org/gudy/azureus2/ui/icons/a32.png vuze.png |
96 |
domenu "${FILESDIR}/${PN}.desktop" |
97 |
|
98 |
use source && java-pkg_dosrc "${S}"/{com,edu,org} |
99 |
} |
100 |
|
101 |
pkg_postinst() { |
102 |
### |
103 |
### @Todo We should probably deactivate auto-update it by default, |
104 |
### or even remove the option - bug #218959 |
105 |
### |
106 |
ewarn "Running Vuze as root is not supported and may result in untracked" |
107 |
ewarn "updates to shared components and then collisions on updates via portage" |
108 |
|
109 |
elog "Vuze has been formerly called Azureus and many references to the old name remain." |
110 |
elog |
111 |
elog "Since version 4.1.0.0, plugins that are normally bundled by upstream" |
112 |
elog "(and auto-installed in each user's ~/.azureus if not bundled)" |
113 |
elog "are now installed into shared plugin directory by the vuze-coreplugins ebuild." |
114 |
elog |
115 |
elog "Vuze may warn that shared plugin dir is not writable, that's fine." |
116 |
elog "It may also attempt to update some these plugins and fail to write." |
117 |
elog "In that case look for or fill a bump bug in bugs.gentoo.org" |
118 |
elog |
119 |
elog "We plan to disable updater for shared components and plugins." |
120 |
elog "See progress in bug #218959, patches welcome." |
121 |
elog |
122 |
elog "After running Vuze for the first time, configuration" |
123 |
elog "options will be placed in '~/.azureus/gentoo.config'." |
124 |
elog "If you need to change some startup options, you should" |
125 |
elog "modify this file, rather than the startup script." |
126 |
elog "Using this config file you can start the console UI." |
127 |
elog |
128 |
elog "To switch from classic UI to Vuze use" |
129 |
elog "1: Tools > Options > Interface > Start > Display Vuze UI Chooser" |
130 |
elog "2: Toolbar (right-hand side)" |
131 |
elog |
132 |
elog "If you have problems starting Vuze, try starting it" |
133 |
elog "from the command line to look at debugging output." |
134 |
elog |
135 |
elog "If vuze crashes with sun-jdk or icedtea and crash log includes CompileTask" |
136 |
elog "add this line to the end of your ~/.axureus/gentoo.config file:" |
137 |
local opts='-XX:CompileCommand=exclude,com/aelitis/net/udp/uc/impl/PRUDPPacketHandlerImpl$5,runSupport' |
138 |
elog "JAVA_OPTIONS='${opts}'" |
139 |
elog "This is a workaround for a bug in the JDK, see https://bugs.gentoo.org/show_bug.cgi?id=259884" |
140 |
|
141 |
fdo-mime_desktop_database_update |
142 |
} |
143 |
|
144 |
pkg_postrm() { |
145 |
fdo-mime_desktop_database_update |
146 |
} |