dev-java/jdom: Another rewrite of the v2 ebuild using Ant
authorJames Le Cuirot <chewi@gentoo.org>
Thu, 27 Aug 2015 22:51:36 +0000 (23:51 +0100)
committerJames Le Cuirot <chewi@gentoo.org>
Thu, 27 Aug 2015 22:52:25 +0000 (23:52 +0100)
Here comes a new challenger! I got sick of monsieurp and wltjr arguing
about this package so I decided to outdo them both. :) It was awkward
to build before because they had missed the build.xml file present on
GitHub.

 * All tests now pass.
 * RDEPEND on junit removed.
 * Unnecessary xml-commons-external dependency removed.
 * License changed as "JDOM" is basically just Apache-1.1.

Package-Manager: portage-2.2.20.1

dev-java/jdom/Manifest
dev-java/jdom/files/build-xml-2.patch [new file with mode: 0644]
dev-java/jdom/jdom-2.0.6-r1.ebuild [deleted file]
dev-java/jdom/jdom-2.0.6-r2.ebuild [deleted file]
dev-java/jdom/jdom-2.0.6-r3.ebuild [deleted file]
dev-java/jdom/jdom-2.0.6-r4.ebuild [new file with mode: 0644]

index a643f6e1ce3f0fc08426e1bc5a4285663599793b..3cbcf34ca8ba776d1aa56803e2b538cbd1076cbb 100644 (file)
@@ -1,3 +1,4 @@
+DIST JDOM-2.0.6.tar.gz 8344114 SHA256 81790196ecbd9cf62cb2aa2a9c14153d74dae3a0364a9a262f42098c6d3c165d SHA512 d585b39159f0887485b2e681609b51113de6bc7c43627c42d7e81eb06ac65c507b43cf3d81c5df4399b1e3abf454c8852264a84567940bc5ba0c358eb9c0c4a1 WHIRLPOOL 71df273140951ac9f5b2f9b06b7f8aa2fe43d05d93ceec9a508856a1cd5c571d897809d5b692fcf28ea0f45c203346b02745f170fac548b77e47904a3f8ce817
 DIST jdom-1.0.tar.gz 3571788 SHA256 fdb77a2c9f8f91a9bd898a0d99b941b79137b5ab692e35ca17dcb73a58b15f77 SHA512 0bf1df21cdacdddb1df8bdfc2c4aa307bb6516a7614eb7382e99a60d03d9fcf77333e84f37ed653f264e7e9cdecb91fb9e2e11fcf76d70b3068bf238be4d0b24 WHIRLPOOL 329163b0a6838322be5174e7a6eddcafeddecc54e541cbdb28748f99da88c79349f67bd79c88bda6944d142440df8d21b21cb0fbb2b1497a6fc84f30a531f8f3
 DIST jdom-1.1.3.tar.gz 4233403 SHA256 d471718c4ac7a1a2f10715b93cb3fcd2ecbab60384b73ad1c089712e47bd8d1f SHA512 a693fcc0d5c8ab3cf086a7904c7fb711e7deedca542089b84c6d011584e0d889495a58843033bff25272fdf130b1347419e31b9a4650c85ce9dfa19022dc0278 WHIRLPOOL b9f610001e152c41fcd3a0328b4ff563b33220f2cde8571ba09dd9063bc63fe51af80229c2bfdd7aeff4a0b354cd04a8d11f9fccb42b8620b2225c6f9ecd38e0
 DIST jdom-2.0.6.zip 7464948 SHA256 86b8683187ca28a935991cbffe5d1a9cfe88e5141e14905694a95e832f775b12 SHA512 dc84ede1eb05f7178a7f5b55f4035655096becee483966d7e0934484522c5981a1fdca836ae9ea6f3d2538c50b7a3cb9029264cd6427f5308d3ac7666e160cff WHIRLPOOL d568a18d8fc369ec0cf2954b16d2360ac934726c93ea31a59d75bc1913a9b1fba5d7cd02f6822ab21000b8df51380f2087e8690a3b66352e8d1267809091b374
diff --git a/dev-java/jdom/files/build-xml-2.patch b/dev-java/jdom/files/build-xml-2.patch
new file mode 100644 (file)
index 0000000..2e3cb94
--- /dev/null
@@ -0,0 +1,36 @@
+--- build.xml.orig     2015-02-15 02:58:04.000000000 +0000
++++ build.xml  2015-08-27 23:11:09.807800249 +0100
+@@ -267,7 +267,7 @@
+               </javac>\r
+       </target>\r
+       \r
+-      <target name="compile" depends="compile.core, compile.junit, compile.contrib, compile.samples"\r
++      <target name="compile" depends="compile.core, compile.contrib, compile.samples"\r
+                       description="Compiles all JDOM code (core, samples, junit, contrib)" />\r
\r
+       <!-- =================================================================== -->\r
+@@ -296,7 +296,7 @@
+       <!-- =================================================================== -->\r
+       <!-- Creates the jars                                           -->\r
+       <!-- =================================================================== -->\r
+-      <target name="jars" depends="compile, javadoc"\r
++      <target name="jars" depends="compile"\r
+           description="Builds the Jars">\r
+               <fixcrlf srcdir="." includes="**/*.bat" excludes="build*.*" eol="crlf"/>\r
+               <fixcrlf srcdir="." includes="**/*.sh" excludes="build*.*" eol="lf"/>\r
+@@ -320,6 +320,7 @@
+                       <fileset dir="${contrib.build}" includes="**/*" />\r
+                       <fileset dir="${metainf.build}" excludes="**/MANIFEST.MF" />\r
+               </jar>\r
++<!--\r
+               <jar jarfile="${package}/${jarbase}-junit.jar" >\r
+                       <fileset dir="${junit.build}" includes="**/*" />\r
+                       <fileset dir="${metainf.build}" excludes="**/MANIFEST.MF" />\r
+@@ -332,6 +333,7 @@
+                       <fileset dir="${contrib.src}" includes="**/*" />\r
+               </jar>\r
+                   \r
++-->\r
+       </target>\r
+       \r
+       <target name="androidtests" depends="jars">\r
diff --git a/dev-java/jdom/jdom-2.0.6-r1.ebuild b/dev-java/jdom/jdom-2.0.6-r1.ebuild
deleted file mode 100644 (file)
index 737403e..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-JAVA_PKG_IUSE="source test doc"
-
-inherit java-pkg-2 java-pkg-simple
-
-DESCRIPTION="Java API to manipulate XML data"
-SRC_URI="http://www.jdom.org/dist/binary/${P}.zip"
-HOMEPAGE="http://www.jdom.org"
-LICENSE="JDOM"
-SLOT="2"
-KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
-
-CDEPEND="dev-java/iso-relax:0
-       dev-java/jaxen:1.1
-       dev-java/xalan:0
-       dev-java/junit:4
-       dev-java/xml-commons-external:1.4"
-RDEPEND="${CDEPEND}
-       >=virtual/jre-1.6"
-DEPEND="${CDEPEND}
-       app-arch/unzip
-       >=virtual/jdk-1.6"
-IUSE=""
-
-S="${WORKDIR}"
-
-JAVA_GENTOO_CLASSPATH="xalan,junit-4,jaxen-1.1,iso-relax,xml-commons-external-1.4"
-JAVA_SRC_DIR="org"
-
-src_unpack() {
-       default
-       cd "${S}"
-       unpack ./"${P}-sources".jar
-}
-
-java_prepare() {
-       find "${S}"/lib -type f -delete || die
-}
-
-src_compile() {
-       java-pkg-simple_src_compile
-}
-
-src_install() {
-       java-pkg-simple_src_install
-       use source && java-pkg_dosrc org
-}
-
-src_test() {
-       local DIR="org/jdom2/test"
-       local CP="${DIR}:${PN}.jar:$(java-pkg_getjars junit-4,${JAVA_GENTOO_CLASSPATH})"
-
-       local TESTS=$(find "${DIR}" -name "*Test.java" ! -name "Abstract*")
-       TESTS="${TESTS//src\/test\/java\/}"
-       TESTS="${TESTS//.java}"
-       TESTS="${TESTS//\//.}"
-
-       ejavac -classpath "${CP}" -d "${DIR}" $(find "${DIR}" -name "*.java")
-       ejunit4 -classpath "${CP}" ${TESTS}
-}
diff --git a/dev-java/jdom/jdom-2.0.6-r2.ebuild b/dev-java/jdom/jdom-2.0.6-r2.ebuild
deleted file mode 100644 (file)
index c3bc88d..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-JAVA_PKG_IUSE="source test doc"
-
-inherit java-pkg-2 java-pkg-simple
-
-DESCRIPTION="Java API to manipulate XML data"
-SRC_URI="http://www.jdom.org/dist/binary/${P}.zip"
-HOMEPAGE="http://www.jdom.org"
-LICENSE="JDOM"
-SLOT="2"
-KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
-
-CDEPEND="
-       test? (
-               dev-java/junit:4
-       )
-       dev-java/xalan:0
-       dev-java/jaxen:1.1
-       dev-java/iso-relax:0
-       dev-java/xml-commons-external:1.4"
-RDEPEND=">=virtual/jre-1.6
-       ${CDEPEND}"
-DEPEND=">=virtual/jdk-1.6
-       app-arch/unzip
-       ${CDEPEND}"
-IUSE=""
-
-S="${WORKDIR}"
-
-JAVA_GENTOO_CLASSPATH="xalan,jaxen-1.1,iso-relax,xml-commons-external-1.4"
-JAVA_SRC_DIR="org"
-
-src_unpack() {
-       default
-       cd "${S}"
-       unpack ./"${P}-sources".jar
-}
-
-java_prepare() {
-       find "${S}"/lib -type f -delete || die
-       if ! use test; then
-               local UNIT_TESTS=(
-                       "${S}"/org/jdom2/test
-                       "${S}"/org/jdom2/Test*.java
-                       "${S}"/org/jdom2/contrib/android/TranslateTests.java
-                       "${S}"/org/jdom2/input/sax/TestTextBuffer.java
-               )
-
-               rm -rf "${UNIT_TESTS[@]}" || die
-       else
-               JAVA_GENTOO_CLASSPATH+=",junit-4"
-       fi
-}
-
-src_compile() {
-       java-pkg-simple_src_compile
-}
-
-src_install() {
-       java-pkg-simple_src_install
-       use source && java-pkg_dosrc org
-}
-
-src_test() {
-       local DIR="org/jdom2/test"
-       local CP="${DIR}:${PN}.jar:$(java-pkg_getjars junit-4,${JAVA_GENTOO_CLASSPATH})"
-
-       local TESTS=$(find "${DIR}" -name "*Test.java" ! -name "Abstract*")
-       TESTS="${TESTS//src\/test\/java\/}"
-       TESTS="${TESTS//.java}"
-       TESTS="${TESTS//\//.}"
-
-       ejavac -classpath "${CP}" -d "${DIR}" $(find "${DIR}" -name "*.java")
-       ejunit4 -classpath "${CP}" ${TESTS}
-}
diff --git a/dev-java/jdom/jdom-2.0.6-r3.ebuild b/dev-java/jdom/jdom-2.0.6-r3.ebuild
deleted file mode 100644 (file)
index be6ed0e..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-JAVA_PKG_IUSE="source test doc"
-
-inherit java-pkg-2 java-pkg-simple
-
-DESCRIPTION="Java API to manipulate XML data"
-SRC_URI="http://www.jdom.org/dist/binary/${P}.zip"
-HOMEPAGE="http://www.jdom.org"
-LICENSE="JDOM"
-SLOT="2"
-KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
-
-CDEPEND="
-       test? (
-               dev-java/junit:4
-       )
-       dev-java/xalan:0
-       dev-java/jaxen:1.1
-       dev-java/iso-relax:0
-       dev-java/xml-commons-external:1.4"
-RDEPEND=">=virtual/jre-1.6
-       ${CDEPEND}"
-DEPEND=">=virtual/jdk-1.6
-       app-arch/unzip
-       ${CDEPEND}"
-IUSE=""
-
-S="${WORKDIR}"
-
-JAVA_GENTOO_CLASSPATH="xalan,jaxen-1.1,iso-relax,xml-commons-external-1.4"
-JAVA_SRC_DIR="org"
-
-# Dubious tests:
-# They either do not pass or don't have runnable methods (i.e. tests)
-UNIT_TESTS=(
-       org/jdom2/test/cases/input/sax/TestXMLReaderSAX2Factory.java
-       org/jdom2/test/cases/input/sax/TestXMLReaderSingletons.java
-       org/jdom2/test/cases/input/sax/TestXMLReaderXSDFactory.java
-       org/jdom2/test/cases/input/sax/TestXMLReaderJAXPFactory.java
-       org/jdom2/test/cases/input/sax/TestXMLReaderSchemaFactory.java
-       org/jdom2/test/cases/input/TestSAXComplexSchema.java
-       org/jdom2/test/cases/input/TestSAXBuilder.java
-       org/jdom2/test/cases/input/TestSAXHandler.java
-       org/jdom2/test/cases/input/TestDOMBuilder.java
-       org/jdom2/test/cases/input/TestDTDParser.java
-       org/jdom2/test/cases/input/TestJDOMParseExceptn.java
-       org/jdom2/test/cases/input/TestStAXEventBuilder.java
-       org/jdom2/test/cases/input/TestBuilderErrorHandler.java
-       org/jdom2/test/cases/input/TestStAXStreamBuilder.java
-       org/jdom2/test/cases/input/HelpTestDOMBuilder.java
-       org/jdom2/test/cases/special/TestIssue008ExpandEntity.java
-       org/jdom2/test/cases/located/TestLocatedJDOMFactory.java
-       org/jdom2/test/cases/xpath/TestJaxenXPathHelper.java
-       org/jdom2/test/cases/xpath/TestDefaultXPathHelper.java
-)
-
-src_unpack() {
-       default
-       cd "${S}"
-       unpack ./"${P}-sources".jar
-}
-
-java_prepare() {
-       find "${S}"/lib -type f -delete || die
-       if use test; then
-               JAVA_GENTOO_CLASSPATH+=",junit-4"
-       else
-               # Override the array with different files.
-               UNIT_TESTS=(
-                       org/jdom2/test
-                       org/jdom2/Test*.java
-                       org/jdom2/contrib/android/TranslateTests.java
-                       org/jdom2/input/sax/TestTextBuffer.java
-               )
-       fi
-
-       rm -rf "${UNIT_TESTS[@]}" || die
-}
-
-src_compile() {
-       java-pkg-simple_src_compile
-}
-
-src_install() {
-       java-pkg-simple_src_install
-       use source && java-pkg_dosrc org
-}
-
-src_test() {
-       local DIR="org/jdom2/test"
-       local CP="${DIR}:${PN}.jar:$(java-pkg_getjars junit-4,${JAVA_GENTOO_CLASSPATH})"
-       local TESTS=()
-
-       while read -d $'\0' -r file; do
-               basefile=$(basename ${file})
-               {
-                       # Skip if starts with Abstract
-                       [[ ${basefile} =~ ^Abstract ]] || \
-                       # Skip if doesn't starts with Test
-                       [[ ! ${basefile} =~ ^Test ]] || \
-                       # Skip if doesn't end with the .java extension
-                       [[ ! ${basefile} =~ \.java$ ]]
-               } && continue
-               TESTS+=(${file})
-       done < <(find "${DIR}" -type f -print0)
-
-       # Turn ${TESTS[@}} array into a string
-       TESTS="${TESTS[@]}"
-       TESTS="${TESTS//src\/test\/java\/}"
-       TESTS="${TESTS//.java}"
-       TESTS="${TESTS//\//.}"
-
-       ejunit4 -classpath "${CP}" ${TESTS}
-}
diff --git a/dev-java/jdom/jdom-2.0.6-r4.ebuild b/dev-java/jdom/jdom-2.0.6-r4.ebuild
new file mode 100644 (file)
index 0000000..17153ec
--- /dev/null
@@ -0,0 +1,56 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+MY_P="JDOM-${PV}"
+JAVA_PKG_IUSE="doc source"
+
+inherit eutils java-pkg-2 java-ant-2
+
+DESCRIPTION="Java API to manipulate XML data"
+SRC_URI="https://github.com/hunterhacker/${PN}/archive/${MY_P}.tar.gz"
+HOMEPAGE="http://www.jdom.org"
+LICENSE="Apache-1.1"
+SLOT="2"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE="test"
+
+CDEPEND="dev-java/iso-relax:0
+       dev-java/jaxen:1.1
+       dev-java/xalan:0"
+
+RDEPEND="${CDEPEND}
+       >=virtual/jre-1.6"
+
+DEPEND="${CDEPEND}
+       >=virtual/jdk-1.6
+       test? ( dev-java/ant-junit:0 )"
+
+JAVA_ANT_REWRITE_CLASSPATH="true"
+EANT_BUILD_TARGET="jars"
+EANT_TEST_TARGET="junit"
+EANT_GENTOO_CLASSPATH="iso-relax,jaxen-1.1,xalan"
+S="${WORKDIR}/${PN}-${MY_P}"
+
+java_prepare() {
+       epatch "${FILESDIR}/build-xml-2.patch"
+       find -name "*.jar" -delete || die
+
+       # Remove Android stuff to avoid junit RDEPEND.
+       rm -vr contrib/src/java/org/jdom2/contrib/android || die
+}
+
+src_install() {
+       java-pkg_newjar build/package/${PN}-${SLOT}.x-????.??.??.??.??.jar ${PN}.jar
+       java-pkg_newjar build/package/${PN}-${SLOT}.x-????.??.??.??.??-contrib.jar ${PN}-contrib.jar
+
+       dodoc {CHANGES,COMMITTERS,README,TODO}.txt
+       use doc && java-pkg_dojavadoc build/apidocs
+       use source && java-pkg_dosrc {contrib,core}/src/java/*
+}
+
+src_test() {
+       java-pkg-2_src_test
+}