summaryrefslogtreecommitdiff
blob: c3ae956f568b923d915fc86faa4e5c03b4145928 (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
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

RHINO_JAR="lib/rhino-1.7R2.jar"
JAVA_PKG_IUSE="doc source"

inherit java-pkg-2 java-pkg-simple

DESCRIPTION="JavaScript and CSS compressor"
HOMEPAGE="http://yui.github.io/yuicompressor/"
SRC_URI="https://github.com/yui/yuicompressor/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"

CDEPEND="
	dev-java/jargs:0"

DEPEND="
	${CDEPEND}
	>=virtual/jdk-1.6"

RDEPEND="
	${CDEPEND}
	>=virtual/jre-1.6"

S="${WORKDIR}/${P}"
JAVA_GENTOO_CLASSPATH="jargs"
JAVA_GENTOO_CLASSPATH_EXTRA="${S}/${RHINO_JAR}"
JAVA_SRC_DIR="src"

java_prepare() {
	# Rhino must stay bundled for now.
	rm -v lib/jargs*.jar || die

	# Normally build.xml does this.
	sed -i "s/@VERSION@/${PV}/g" \
		src/com/yahoo/platform/yui/compressor/YUICompressor.java || die
}

src_install() {
	java-pkg-simple_src_install
	java-pkg_newjar ${RHINO_JAR} rhino.jar # Install this last!!
	java-pkg_dolauncher ${PN} --main com.yahoo.platform.yui.compressor.Bootstrap
}