diff options
author | Volkmar W. Pogatzki <gentoo@pogatzki.net> | 2023-09-20 08:16:58 +0200 |
---|---|---|
committer | Miroslav Šulc <fordfrog@gentoo.org> | 2023-09-23 08:48:41 +0200 |
commit | 041a879a0864c0036629b93b728d657e2481ba6a (patch) | |
tree | 018235f3463c88d28cb7afcd7964069388119243 /dev-java | |
parent | sec-keys/openpgp-keys-apache-creadur: new package, add 20230123 (diff) | |
download | gentoo-041a879a0864c0036629b93b728d657e2481ba6a.tar.gz gentoo-041a879a0864c0036629b93b728d657e2481ba6a.tar.bz2 gentoo-041a879a0864c0036629b93b728d657e2481ba6a.zip |
dev-java/apache-rat: new package, add 0.15
remaned from dev-java/rat
also replaces dev-java/apache-rat-{core.tasks}
Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
Closes: https://github.com/gentoo/gentoo/pull/32959
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java')
-rw-r--r-- | dev-java/apache-rat/Manifest | 2 | ||||
-rw-r--r-- | dev-java/apache-rat/apache-rat-0.15.ebuild | 116 | ||||
-rw-r--r-- | dev-java/apache-rat/files/apache-rat-0.15-fix-tests.patch | 39 | ||||
-rw-r--r-- | dev-java/apache-rat/metadata.xml | 11 |
4 files changed, 168 insertions, 0 deletions
diff --git a/dev-java/apache-rat/Manifest b/dev-java/apache-rat/Manifest new file mode 100644 index 000000000000..586027309acd --- /dev/null +++ b/dev-java/apache-rat/Manifest @@ -0,0 +1,2 @@ +DIST apache-rat-0.15-src.tar.bz2 203040 BLAKE2B 0727fb932cfbab7080eba5115bee69e5c46155a231509109a5c7aecf40ed539d4357f2d9b31342717306221891e4a411e01077ae55a0988abe4926e40f1fafc4 SHA512 7f9fb219a5ce0b95909f006140b20e7621d9f5ce583c42a57e2783ec40fd842e75b546843ab033a99bf5108d0d8369a0ab1aac80e33af9685f651fed3dd603ee +DIST apache-rat-0.15-src.tar.bz2.asc 833 BLAKE2B b87e059a5a83d3d728c28c25926129743fdfb6a5c7cf2e258892d86711e7f5890d140ca1cfa5fc1012d56b6321ec2c93903ec30854bd3536216c8f1fd269f504 SHA512 f5abcb3df5d23834deab8c3c1a476100324452cba88e9185fb398dd6118c3c8ff8dc00c4c9f8166245833d6e602c51bc8cdf20361813bbe1e720022766412b8d diff --git a/dev-java/apache-rat/apache-rat-0.15.ebuild b/dev-java/apache-rat/apache-rat-0.15.ebuild new file mode 100644 index 000000000000..b46a32ee2f36 --- /dev/null +++ b/dev-java/apache-rat/apache-rat-0.15.ebuild @@ -0,0 +1,116 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# javadoc is broken for java 17, see https://bugs.gentoo.org/914458 +JAVA_PKG_IUSE="doc source test" +MAVEN_PROVIDES=" + org.apache.rat:apache-rat-core:${PV} + org.apache.rat:apache-rat-tasks:${PV} +" +JAVA_TESTING_FRAMEWORKS="junit-4" + +inherit java-pkg-2 java-pkg-simple verify-sig + +DESCRIPTION="Apache Rat is a release audit tool, focused on licenses" +HOMEPAGE="https://creadur.apache.org/rat/" +SRC_URI="mirror://apache//creadur/${P}/${P}-src.tar.bz2 + verify-sig? ( https://archive.apache.org/dist/creadur/${P}/${P}-src.tar.bz2.asc )" +S="${WORKDIR}/${P}" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +CP_DEPEND=" + dev-java/ant-core:0 + dev-java/commons-cli:1 + dev-java/commons-collections:4 + dev-java/commons-compress:0 + dev-java/commons-io:1 + dev-java/commons-lang:3.6 +" + +DEPEND="${CP_DEPEND} + >=virtual/jdk-1.8:* + test? ( dev-java/ant-testutil:0 )" +RDEPEND="${CP_DEPEND} + >=virtual/jre-1.8:*" + +BDEPEND="verify-sig? ( sec-keys/openpgp-keys-apache-creadur )" +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/creadur.apache.org.asc" + +DOCS=( NOTICE README.md README.txt RELEASE-NOTES.txt RELEASE_NOTES.txt ) + +PATCHES=( "${FILESDIR}/apache-rat-0.15-fix-tests.patch" ) + +src_prepare() { + default #780585 + java-pkg-2_src_prepare +} + +src_compile() { + einfo "Compiling apache-rat-core.jar" + JAVA_JAR_FILENAME="${PN}-core.jar" + JAVA_RESOURCE_DIRS="${PN}-core/src/main/resources" + JAVA_SRC_DIR="${PN}-core/src/main/java" + java-pkg-simple_src_compile + JAVA_GENTOO_CLASSPATH_EXTRA+=":${PN}-core.jar" + rm -r target || die + + einfo "Compiling apache-rat-tasks.jar" + JAVA_JAR_FILENAME="${PN}-tasks.jar" + JAVA_RESOURCE_DIRS="${PN}-tasks/src/main/resources" + JAVA_SRC_DIR="${PN}-tasks/src/main/java" + java-pkg-simple_src_compile + JAVA_GENTOO_CLASSPATH_EXTRA+=":${PN}-tasks.jar" + rm -r target || die + + # javadoc is broken for java 17, see https://bugs.gentoo.org/914458 + if use doc; then + einfo "Compiling javadocs" + ejavadoc \ + -verbose \ + -classpath "$(java-pkg_getjars \ + --build-only ant-core)":"$(java-pkg_getjars \ + --build-only commons-cli-1)":"$(java-pkg_getjars \ + --build-only commons-collections-4)":"$(java-pkg_getjars \ + --build-only commons-compress):$(java-pkg_getjars \ + --build-only commons-io-1):$(java-pkg_getjars \ + --build-only commons-lang-3.6)" \ + -sourcepath "${PN}-core/src/main/java:${PN}-tasks/src/main/java" \ + -d javadoc -subpackages org.apache.rat org.apache.rat.anttasks + fi +} + +src_test() { + JAVA_TEST_GENTOO_CLASSPATH="ant-testutil,junit-4" + + einfo "Testing apache-rat-core" + cp -r "${PN}"-core/src/{main,test} src || die + JAVA_TEST_RESOURCE_DIRS="src/test/resources" + JAVA_TEST_SRC_DIR="src/test/java" + java-pkg-simple_src_test + rm -r src/{main,test} || die + + einfo "Testing apache-rat-tasks" + cp -r "${PN}"-tasks/src/{main,test} src || die + mkdir -p target/it-sources || die + JAVA_TEST_RESOURCE_DIRS="src/test/resources" + JAVA_TEST_SRC_DIR="src/test/java" + java-pkg-simple_src_test +} + +src_install() { + java-pkg_dojar "${PN}-core.jar" + java-pkg_dojar "${PN}-tasks.jar" + java-pkg_dolauncher "${PN}" --main org.apache.rat.Report + + use doc && java-pkg_dojavadoc javadoc + + if use source; then + java-pkg_dosrc "${PN}-core/src/main/java/*" + java-pkg_dosrc "${PN}-tasks/src/main/java/*" + fi +} diff --git a/dev-java/apache-rat/files/apache-rat-0.15-fix-tests.patch b/dev-java/apache-rat/files/apache-rat-0.15-fix-tests.patch new file mode 100644 index 000000000000..b9cb73648008 --- /dev/null +++ b/dev-java/apache-rat/files/apache-rat-0.15-fix-tests.patch @@ -0,0 +1,39 @@ +--- a/apache-rat-tasks/src/test/resources/antunit/report-junit.xml ++++ b/apache-rat-tasks/src/test/resources/antunit/report-junit.xml +@@ -48,7 +48,7 @@ + <target name="all"/> + + <target name="testWithReportSentToFile"> +- <property name="report.file" location="${output.dir}/selftest.report"/> ++ <property name="report.file" location="../../../../target/anttasks/selftest.report"/> + <rat:report reportFile="${report.file}"> + <file file="${ant.file}"/> + </rat:report> +@@ -88,22 +88,22 @@ + <target name="testAddLicenseHeaders"> + <delete dir="${output.dir}/it-sources"/> + <mkdir dir="${output.dir}/it-sources"/> +- <copy file="src/test/resources/antunit/index.apt" tofile="${output.dir}/it-sources/index.apt"/> ++ <copy file="index.apt" tofile="../../../../target/anttasks/it-sources/index.apt"/> + <rat:report addLicenseHeaders="true"> +- <file file="${output.dir}/it-sources/index.apt"/> ++ <file file="../../../../target/anttasks/it-sources/index.apt"/> + </rat:report> + </target> + + <target name="testISO88591"> + <rat:report format="xml"> +- <file file="src/test/resources/org/example/iso-8859-1.html"/> ++ <file file="../../../../src/test/resources/org/example/iso-8859-1.html"/> + </rat:report> + </target> + + <target name="testISO88591WithReportFile"> +- <property name="report.file" location="${output.dir}/selftest.report"/> ++ <property name="report.file" location="../../../../target/anttasks/selftest.report"/> + <rat:report reportFile="${report.file}" format="xml"> +- <file file="src/test/resources/org/example/iso-8859-1.html"/> ++ <file file="../../../../src/test/resources/org/example/iso-8859-1.html"/> + </rat:report> + </target> + </project> diff --git a/dev-java/apache-rat/metadata.xml b/dev-java/apache-rat/metadata.xml new file mode 100644 index 000000000000..7c36c1b69ae5 --- /dev/null +++ b/dev-java/apache-rat/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>java@gentoo.org</email> + <name>Java</name> + </maintainer> + <upstream> + <remote-id type="github">apache/creadur-rat</remote-id> + </upstream> +</pkgmetadata> |