commit:     6f7fce2e9d4e9fc74b1ecec97f3c728259361f49
Author:     Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
AuthorDate: Sun Aug 13 13:20:53 2023 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Mon Aug 14 06:15:08 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f7fce2e

dev-java/tomcat-native: switch to java-pkg-simple

- Uses junit:4 instead of junit:0
- Skips 1 failing test which didn't seem to run with versions
  based on java-ant-2.eclass.

Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
Closes: https://github.com/gentoo/gentoo/pull/32280
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 dev-java/tomcat-native/tomcat-native-1.2.38.ebuild | 85 +++++++++++++++-------
 1 file changed, 59 insertions(+), 26 deletions(-)

diff --git a/dev-java/tomcat-native/tomcat-native-1.2.38.ebuild 
b/dev-java/tomcat-native/tomcat-native-1.2.38.ebuild
index c1cd66702c54..ad19397c09bf 100644
--- a/dev-java/tomcat-native/tomcat-native-1.2.38.ebuild
+++ b/dev-java/tomcat-native/tomcat-native-1.2.38.ebuild
@@ -3,7 +3,10 @@
 
 EAPI=8
 
-inherit java-pkg-2 java-ant-2 verify-sig
+JAVA_PKG_IUSE="doc source test"
+JAVA_TESTING_FRAMEWORKS="junit-4"
+
+inherit autotools java-pkg-2 java-pkg-simple verify-sig
 
 DESCRIPTION="Allows Tomcat to use certain native resources for better 
performance"
 HOMEPAGE="https://tomcat.apache.org/native-doc/";
@@ -11,55 +14,85 @@ 
SRC_URI="mirror://apache/tomcat/tomcat-connectors/native/${PV}/source/${P}-src.t
        verify-sig? (
                
https://downloads.apache.org/tomcat/tomcat-connectors/native/${PV}/source/tomcat-native-${PV}-src.tar.gz.asc
        )"
+S=${WORKDIR}/${P}-src/native
 
 KEYWORDS="~amd64 ~x86"
 LICENSE="Apache-2.0"
 SLOT="0"
-IUSE="static-libs test"
-RESTRICT="!test? ( test )"
+IUSE="static-libs"
+
+DEPEND="
+       >=virtual/jdk-1.8:*
+"
+RDEPEND="
+       dev-libs/apr:1=
+       dev-libs/openssl:0/3
+       >=virtual/jre-1.8:*
+"
+BDEPEND="verify-sig? ( sec-keys/openpgp-keys-apache-tomcat-connectors )"
+VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/tomcat-connectors.apache.org.asc"
 
-RDEPEND="dev-libs/apr:1=
-       dev-libs/openssl:0=
-       >=virtual/jre-1.8:*"
+JAVA_RESOURCE_DIRS="../resources"
+JAVA_SRC_DIR="../java"
+JAVA_TEST_GENTOO_CLASSPATH="junit-4"
+JAVA_TEST_SRC_DIR="../test"
 
-DEPEND=">=virtual/jdk-1.8:*
-       test? ( dev-java/ant-junit:0 )"
+PATCHES=(
+       "${FILESDIR}"/tomcat-native-2.0.3-slibtool.patch #778914
+)
 
-BDEPEND="verify-sig? ( sec-keys/openpgp-keys-apache-tomcat-connectors )"
-VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/tomcat-connectors.apache.org.asc"
+DOCS=( ../{CHANGELOG.txt,NOTICE,README.txt} )
 
-S=${WORKDIR}/${P}-src
+src_prepare() {
+       java-pkg-2_src_prepare
+       mkdir -p "${JAVA_RESOURCE_DIRS}/META-INF" || die
+       sed -ne '/attribute name/s:^.*name="\(.*\)" value="\(.*\)".*$:\1\: 
\2:p' \
+               ../build.xml \
+               | sed "s:\${version}:${PV}:" \
+               > "${JAVA_RESOURCE_DIRS}/META-INF/MANIFEST.MF" || die
+       default
 
-JAVA_ANT_REWRITE_CLASSPATH="yes"
+       # Needed for the slibtool patch
+       sed -i 's/configure.in/configure.ac/' configure.in || die
+       eautoreconf
+
+       # There was 1 failure:
+       # 1) testInfoGet(org.apache.tomcat.jni.TestFile)
+       # java.lang.AssertionError: File 
test/org/apache/tomcat/jni/TestFile.java does not exist!
+       #         at org.junit.Assert.fail(Assert.java:89)
+       #         at org.junit.Assert.assertTrue(Assert.java:42)
+       #         at 
org.apache.tomcat.jni.TestFile.testInfoGet(TestFile.java:29)
+       # 
+       # FAILURES!!!
+       # Tests run: 1,  Failures: 1
+       rm ../test/org/apache/tomcat/jni/TestFile.java || die
+}
 
 src_configure() {
        local myeconfargs=(
                --with-apr="${EPREFIX}"/usr/bin/apr-1-config
                --with-ssl="${EPREFIX}"/usr
        )
-
-       cd native || die
        econf "${myeconfargs[@]}"
 }
 
 src_compile() {
-       eant jar
-
-       cd native || die
+       java-pkg-simple_src_compile
        default
 }
 
-src_install() {
-       java-pkg_newjar "dist/${P}.jar" "${PN}.jar"
-
-       cd native || die
-       default
-
-       ! use static-libs && find "${D}" -name '*.la' -delete || die
+src_test() {
+       JAVA_TEST_EXTRA_ARGS=( -Djava.library.path=".libs" )
+#      jar cf test.jar ../test/org/apache/tomcat/jni/TestFile.java || die
+#      JAVA_GENTOO_CLASSPATH_EXTRA="test.jar"
+       java-pkg-simple_src_test
 }
 
-src_test() {
-       java-pkg-2_src_test
+src_install() {
+       java-pkg-simple_src_install
+       java-pkg_doso .libs/*.so*
+       dodoc -r ../docs
+       ! use static-libs && find "${D}" -name '*.la' -delete || die
 }
 
 pkg_postinst() {

Reply via email to