| 1 |
# Copyright 1999-2012 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.7.0.2.ebuild,v 1.3 2012/06/05 15:04:15 sera Exp $
|
| 4 |
|
| 5 |
EAPI=2
|
| 6 |
|
| 7 |
JAVA_PKG_IUSE="source"
|
| 8 |
|
| 9 |
inherit eutils fdo-mime java-pkg-2 java-ant-2 versionator
|
| 10 |
|
| 11 |
MY_PV=$(replace_all_version_separators "")
|
| 12 |
|
| 13 |
PATCHSET_VER="4.5.0.2"
|
| 14 |
PATCHSET_DIR="${PN}-${PATCHSET_VER}-gentoo-patches"
|
| 15 |
PATCHSET="${PATCHSET_DIR}.tar.bz2"
|
| 16 |
SRC_TARBALL="Vuze_${MY_PV}_source.zip"
|
| 17 |
|
| 18 |
DESCRIPTION="BitTorrent client in Java, formerly called Azureus"
|
| 19 |
HOMEPAGE="http://www.vuze.com/"
|
| 20 |
SRC_URI="mirror://sourceforge/azureus/${PN}/Vuze_${MY_PV}/${SRC_TARBALL}
|
| 21 |
mirror://gentoo/${PATCHSET}"
|
| 22 |
LICENSE="GPL-2 BSD"
|
| 23 |
|
| 24 |
SLOT="0"
|
| 25 |
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
|
| 26 |
IUSE=""
|
| 27 |
|
| 28 |
# bundles parts of commons-lang, but modified
|
| 29 |
# bundles parts of http://www.programmers-friend.org/
|
| 30 |
RDEPEND="
|
| 31 |
dev-java/json-simple:0
|
| 32 |
dev-java/bcprov:1.3
|
| 33 |
>=dev-java/commons-cli-1.0:1
|
| 34 |
>=dev-java/log4j-1.2.8:0
|
| 35 |
dev-java/swt:3.7[cairo]
|
| 36 |
!net-p2p/azureus-bin
|
| 37 |
>=virtual/jre-1.5"
|
| 38 |
|
| 39 |
DEPEND="${RDEPEND}
|
| 40 |
app-arch/unzip
|
| 41 |
dev-util/desktop-file-utils
|
| 42 |
>=virtual/jdk-1.5"
|
| 43 |
|
| 44 |
PDEPEND="~net-p2p/vuze-coreplugins-${PV}"
|
| 45 |
|
| 46 |
src_unpack() {
|
| 47 |
unpack ${PATCHSET}
|
| 48 |
mkdir "${S}" && cd "${S}" || die
|
| 49 |
unpack ${SRC_TARBALL}
|
| 50 |
# this is no longer needed
|
| 51 |
rm "${WORKDIR}/${PATCHSET_DIR}/0006-Remove-the-use-of-windows-only-Tree2-widget.patch" || die
|
| 52 |
}
|
| 53 |
|
| 54 |
java_prepare() {
|
| 55 |
# build.xml disappeared from 4.4.0.0 although it was there in 4.3.1.4
|
| 56 |
# hopefully that's just a packaging mistake
|
| 57 |
[[ -f build.xml ]] && die "upstream has build.xml again, don't overwrite"
|
| 58 |
cp "${FILESDIR}/build.xml" . || die "failed to copy build.xml"
|
| 59 |
|
| 60 |
EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PATCHSET_DIR}/"
|
| 61 |
|
| 62 |
### Removes OS X files and entries.
|
| 63 |
rm -rv "org/gudy/azureus2/platform/macosx" \
|
| 64 |
"org/gudy/azureus2/ui/swt/osx" || die
|
| 65 |
|
| 66 |
### Removes Windows files.
|
| 67 |
rm -v ./org/gudy/azureus2/ui/swt/win32/Win32UIEnhancer.java || die
|
| 68 |
|
| 69 |
### Removes test files.
|
| 70 |
rm -rv org/gudy/azureus2/ui/console/multiuser/TestUserManager.java || die
|
| 71 |
|
| 72 |
### Removes bouncycastle (we use our own bcprov).
|
| 73 |
rm -rv "org/bouncycastle" || die
|
| 74 |
|
| 75 |
### Removes bundled json
|
| 76 |
rm -rv "org/json" || die
|
| 77 |
|
| 78 |
### The Tree2 file does not compile against Linux SWT and is used only on Windows.
|
| 79 |
### It's runtime-conditional use is thus patched out in the patchset.
|
| 80 |
rm -rf "org/eclipse" || die
|
| 81 |
|
| 82 |
mkdir -p build/libs || die
|
| 83 |
}
|
| 84 |
|
| 85 |
JAVA_ANT_REWRITE_CLASSPATH="true"
|
| 86 |
EANT_GENTOO_CLASSPATH="swt-3.7,bcprov-1.3,json-simple,log4j,commons-cli-1"
|
| 87 |
|
| 88 |
src_compile() {
|
| 89 |
local mem
|
| 90 |
use amd64 && mem="320"
|
| 91 |
use x86 && mem="192"
|
| 92 |
use ppc && mem="192"
|
| 93 |
use ppc64 && mem="256"
|
| 94 |
use sparc && mem="320"
|
| 95 |
export ANT_OPTS="-Xmx${mem}m"
|
| 96 |
java-pkg-2_src_compile
|
| 97 |
|
| 98 |
# bug #302058 - build.xml excludes .txt but upstream jar has it...
|
| 99 |
jar uf dist/Azureus2.jar ChangeLog.txt || die
|
| 100 |
}
|
| 101 |
|
| 102 |
src_install() {
|
| 103 |
java-pkg_dojar dist/Azureus2.jar
|
| 104 |
dodoc ChangeLog.txt || die
|
| 105 |
|
| 106 |
java-pkg_dolauncher "${PN}" \
|
| 107 |
--main org.gudy.azureus2.ui.common.Main -pre "${FILESDIR}/${PN}-4.1.0.0-pre" \
|
| 108 |
--java_args '-Dazureus.install.path=/usr/share/vuze/ ${JAVA_OPTIONS}' \
|
| 109 |
--pkg_args '--ui=${UI}'
|
| 110 |
dosym vuze /usr/bin/azureus
|
| 111 |
|
| 112 |
# https://bugs.gentoo.org/show_bug.cgi?id=204132
|
| 113 |
java-pkg_register-environment-variable MOZ_PLUGIN_PATH /usr/lib/nsbrowser/plugins
|
| 114 |
|
| 115 |
newicon "${S}"/org/gudy/azureus2/ui/icons/a32.png vuze.png
|
| 116 |
domenu "${FILESDIR}/${PN}.desktop"
|
| 117 |
|
| 118 |
use source && java-pkg_dosrc "${S}"/{com,edu,org}
|
| 119 |
}
|
| 120 |
|
| 121 |
pkg_postinst() {
|
| 122 |
ewarn "Running Vuze as root is not supported and may result in untracked"
|
| 123 |
ewarn "updates to shared components and then collisions on updates via ebuilds"
|
| 124 |
|
| 125 |
elog "Vuze has been formerly called Azureus and many references to the old name remain."
|
| 126 |
elog
|
| 127 |
elog "After running Vuze for the first time, configuration"
|
| 128 |
elog "options will be placed in '~/.azureus/gentoo.config'."
|
| 129 |
elog "If you need to change some startup options, you should"
|
| 130 |
elog "modify this file, rather than the startup script."
|
| 131 |
elog "Using this config file you can start the console UI."
|
| 132 |
elog
|
| 133 |
|
| 134 |
if ! has_version dev-java/swt:3.7[webkit]; then
|
| 135 |
elog
|
| 136 |
elog "Your dev-java/swt:3.7 was built without webkit support. Features such as Vuze HD Network will not work."
|
| 137 |
elog "Rebuild swt with USE=webkit (needs net-libs/webkit-gtk:2) to use these features."
|
| 138 |
fi
|
| 139 |
|
| 140 |
fdo-mime_desktop_database_update
|
| 141 |
}
|
| 142 |
|
| 143 |
pkg_postrm() {
|
| 144 |
fdo-mime_desktop_database_update
|
| 145 |
}
|