dev-java/ant-testutil-1.{9.13,10.5}: removed obsolete
[gentoo.git] / dev-java / ant-core / ant-core-1.9.13-r2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 # Don't depend on itself.
7 JAVA_ANT_DISABLE_ANT_CORE_DEP="true"
8
9 # Rewriting build.xml files for the testcases has no use at the moment.
10 JAVA_PKG_BSFIX_ALL="no"
11 JAVA_PKG_IUSE="doc source"
12
13 inherit eutils java-pkg-2 java-ant-2 prefix eapi7-ver
14
15 MY_P="apache-ant-${PV}"
16
17 DESCRIPTION="Java-based build tool similar to 'make' that uses XML configuration files"
18 HOMEPAGE="https://ant.apache.org/"
19 SRC_URI="https://archive.apache.org/dist/ant/source/${MY_P}-src.tar.bz2
20         https://dev.gentoo.org/~fordfrog/distfiles/ant-${PV}-r1-gentoo.tar.bz2"
21
22 LICENSE="Apache-2.0"
23 SLOT="0"
24 KEYWORDS="amd64 ~arm ~arm64 ppc64 x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
25
26 DEPEND=">=virtual/jdk-1.8:*
27         !dev-java/ant-tasks
28         !dev-java/ant-optional"
29 RDEPEND="${DEPEND}"
30
31 S="${WORKDIR}/${MY_P}"
32
33 RESTRICT="test"
34
35 src_prepare() {
36         epatch "${WORKDIR}/${PV}-build.patch"
37         epatch "${WORKDIR}/${PV}-launch.patch"
38
39         eprefixify "${S}/src/script/ant"
40
41         # Fixes bug 556008.
42         java-ant_xml-rewrite -f build.xml \
43                 -c -e javadoc \
44                 -a failonerror \
45                 -v "false"
46
47         # See bug #196080 for more details.
48         java-ant_bsfix_one build.xml
49         java-pkg-2_src_prepare
50 }
51
52 src_compile() {
53         export ANT_HOME=""
54         # Avoid error message that package ant-core was not found
55         export ANT_TASKS="none"
56
57         local bsyscp
58
59         # This ensures that when building ant with bootstrapped ant,
60         # only the source is used for resolving references, and not
61         # the classes in bootstrapped ant but jikes in kaffe has issues with this...
62         if ! java-pkg_current-vm-matches kaffe; then
63                 bsyscp="-Dbuild.sysclasspath=ignore"
64         fi
65
66         CLASSPATH="$(java-config -t)" ./build.sh ${bsyscp} jars dist-internal \
67                 $(use_doc javadocs) || die "build failed"
68 }
69
70 src_install() {
71         dodir /usr/share/ant/lib
72
73         for jar in ant.jar ant-bootstrap.jar ant-launcher.jar ; do
74                 java-pkg_dojar build/lib/${jar}
75                 dosym ../../${PN}/lib/${jar} /usr/share/ant/lib/${jar}
76         done
77
78         dobin src/script/ant
79
80         dodir /usr/share/${PN}/bin
81         for each in antRun antRun.pl runant.pl runant.py ; do
82                 dobin "${S}/src/script/${each}"
83                 dosym ../../../bin/${each} /usr/share/${PN}/bin/${each}
84         done
85         dosym ../${PN}/bin /usr/share/ant/bin
86
87         insinto /usr/share/${PN}
88         doins -r dist/etc
89         dosym ../${PN}/etc /usr/share/ant/etc
90
91         echo "ANT_HOME=\"${EPREFIX}/usr/share/ant\"" > "${T}/20ant"
92         doenvd "${T}/20ant"
93
94         dodoc NOTICE README WHATSNEW KEYS
95
96         if use doc; then
97                 dohtml -r manual/*
98                 java-pkg_dojavadoc --symlink manual/api build/javadocs
99         fi
100
101         use source && java-pkg_dosrc src/main/*
102 }