dev-java/tomcat-servlet-api: x86 stable wrt bug #722654
[gentoo.git] / dev-java / eclipse-ecj / eclipse-ecj-4.4.2-r1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 JAVA_PKG_IUSE="doc source"
7
8 inherit java-pkg-2 java-pkg-simple
9
10 MY_PN="ecj"
11 DMF="R-${PV}-201502041700"
12
13 DESCRIPTION="Eclipse Compiler for Java"
14 HOMEPAGE="http://www.eclipse.org/"
15 SRC_URI="http://download.eclipse.org/eclipse/downloads/drops4/${DMF}/${MY_PN}src-${PV}.jar"
16
17 LICENSE="EPL-1.0"
18 KEYWORDS="amd64 ppc64 x86 ~amd64-linux ~x86-linux ~x86-solaris"
19 SLOT="4.4"
20 IUSE="+ant"
21
22 COMMON_DEP="
23         app-eselect/eselect-java"
24 RDEPEND="${COMMON_DEP}
25         >=virtual/jre-1.6"
26 DEPEND="${COMMON_DEP}
27         >=virtual/jdk-1.6
28         app-arch/unzip"
29 PDEPEND="
30         ant? ( ~dev-java/ant-eclipse-ecj-${PV} )"
31
32 JAVA_JAR_FILENAME="${MY_PN}.jar"
33
34 java_prepare() {
35         # These have their own package.
36         rm org/eclipse/jdt/core/JDTCompilerAdapter.java || die
37         rm -r org/eclipse/jdt/internal/antadapter || die
38
39         rm build.xml || die
40 }
41
42 src_compile() {
43         java-pkg-simple_src_compile
44         find org META-INF -type f ! -name "*.java" | xargs jar uvf "${JAVA_JAR_FILENAME}" || die "jar update failed"
45 }
46
47 src_install() {
48         java-pkg-simple_src_install
49         java-pkg_dolauncher ${MY_PN}-${SLOT} --main \
50                 org.eclipse.jdt.internal.compiler.batch.Main
51 }
52
53 pkg_postinst() {
54         einfo "To select between slots of ECJ..."
55         einfo " # eselect ecj"
56
57         eselect ecj update ecj-${SLOT}
58 }
59
60 pkg_postrm() {
61         eselect ecj update
62 }