Set appropriate maintainer types in metadata.xml (GLEP 67)
[gentoo.git] / dev-java / commons-compress / commons-compress-1.10.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6 JAVA_PKG_IUSE="doc source test"
7
8 inherit java-pkg-2 java-ant-2
9
10 DESCRIPTION="Commons Compress defines an API for working with ar, cpio, tar, zip, gzip and bzip2 files"
11 HOMEPAGE="https://commons.apache.org/proper/commons-compress/"
12 LICENSE="Apache-2.0"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE=""
16
17 CDEPEND="dev-java/xz-java:0"
18
19 RDEPEND=">=virtual/jre-1.6
20         ${CDEPEND}"
21 DEPEND=">=virtual/jdk-1.6
22         ${CDEPEND}
23         test? (
24                 dev-java/junit:4
25                 dev-java/ant-junit:0
26                 dev-java/hamcrest-core:1.3
27         )"
28
29 S="${WORKDIR}/${P}-src"
30
31 JAVA_ANT_BSFIX_EXTRA_ARGS="--maven-cleaning"
32 EANT_GENTOO_CLASSPATH="xz-java"
33 EANT_BUILD_TARGET="compile package"
34 EANT_TEST_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH},junit-4,hamcrest-core-1.3"
35
36 # Dubious tests.
37 JAVA_RM_FILES=(
38         src/test/java/org/apache/commons/compress/archivers/zip/X5455_ExtendedTimestampTest.java
39 )
40
41 java_prepare() {
42         cp "${FILESDIR}"/build.xml . || die "Failed to copy build.xml"
43
44         # osgi stuff mvn ant:ant doesn't handle
45         mkdir -p target/osgi || die "Failed to create target dir"
46         cp "${FILESDIR}"/MANIFEST.MF target/osgi/ || die "Failed to copy manifest"
47
48         if ! use test; then
49                 find -name "*.jar" -delete || die "Failed to remove test resources"
50         fi
51 }
52
53 src_test() {
54         EANT_TEST_TARGET="compile-tests test" \
55                 java-pkg-2_src_test
56 }
57
58 src_install() {
59         java-pkg_newjar "target/${PN}-1.1.jar"
60         use doc && java-pkg_dojavadoc target/site/apidocs
61         use source && java-pkg_dosrc src/main/java/*
62 }