Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Nov 2021 01:02:25 GMT
From:      Mateusz Piotrowski <0mp@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 9e1bda400030 - main - java/bouncycastle15: Make sure we don't miss jars with future updates
Message-ID:  <202111250102.1AP12P83016556@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by 0mp:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9e1bda4000302f091707973939503c8eb93d7762

commit 9e1bda4000302f091707973939503c8eb93d7762
Author:     Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2021-11-25 00:32:35 +0000
Commit:     Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2021-11-25 00:58:09 +0000

    java/bouncycastle15: Make sure we don't miss jars with future updates
    
    The do-install-* targets will now automatically install all the
    relevant files provided by the port.
    
    Also while here:
    
    - Replace PORTDOCS with pkg-plist entries for greater control over the
      docs.
    - Move ZIPSRC-only install targets to ZIPSRC_ALL_TARGET.
    - Sort pkg-plist.
    - Add a comment explaining why the port installs the bundled version of
      bcprov.jar.
    - Install additional documentation (docs and tls/docs).
    
    Sponsored by:   Modirum MDPay
    Sponsored by:   Klara, Inc.
---
 java/bouncycastle15/Makefile  | 51 ++++++++++++++++++++++++-------------------
 java/bouncycastle15/pkg-plist | 42 ++++++++++++++++++++++++++++++-----
 2 files changed, 66 insertions(+), 27 deletions(-)

diff --git a/java/bouncycastle15/Makefile b/java/bouncycastle15/Makefile
index d100078299fa..472af5a4a0d4 100644
--- a/java/bouncycastle15/Makefile
+++ b/java/bouncycastle15/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	bouncycastle
 PORTVERSION=	1.69
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	java security
 MASTER_SITES=	http://www.bouncycastle.org/download/ \
 		http://polydistortion.net/bc/download/
@@ -30,27 +30,23 @@ USE_JAVA=	yes
 MAKE_ARGS=	-f \
 		ant/jdk${JDKNVERSION}+.xml
 MAKE_ENV=	ANT_INCLUDE_SHARED_JARS=YES
-ALL_TARGET=	build-provider build zip-src
+ALL_TARGET=	build-provider build
 
 CONFLICTS_INSTALL=	bouncycastle-1.4*
 
 NO_ARCH=	yes
 
-PORTDOCS=	*
-
 OPTIONS_DEFINE=		DOCS ZIPSRC
 OPTIONS_DEFAULT=	ZIPSRC
 OPTIONS_SUB=		yes
 
-ZIPSRC_DESC=	Install bundled ZIP source files
+ZIPSRC_DESC=		Install bundled ZIP source files
+ZIPSRC_ALL_TARGET=	zip-src
 
+ARTIFACTSDIR=	${WRKSRC}/build/artifacts/jdk${JDKMVERSION}
 DVERSION=	${PORTVERSION:S/.//}
 JDKMVERSION=	1.5
 JDKNVERSION=	15
-JARS_SRC=	${JARS:Nbcjmail:Nbcprov-ext:Nbctest:Nbctls:Nbcutil}
-JARS_DOCS=	${JARS:Nbcprov-ext}
-JARS=		bcjmail bcmail bcpg bcpkix bcprov-ext bcprov bctest bctls \
-		bcutil
 
 .include <bsd.port.options.mk>
 
@@ -60,27 +56,38 @@ EXTRA_PATCHES+=	${FILESDIR}/armv6-patch-bc+-build.xml
 .endif
 
 do-install:
-.for jar in ${JARS}
-	${INSTALL_DATA} ${WRKSRC}/build/artifacts/jdk${JDKMVERSION}/jars/${jar}-jdk${JDKNVERSION}on-${DVERSION}.jar \
-	      ${STAGEDIR}${JAVAJARDIR}/${jar}.jar
-.endfor
+	for src in $$(${FIND} ${ARTIFACTSDIR}/jars -name "*-jdk${JDKNVERSION}on-${DVERSION}.jar"); do \
+		dst="$${src##*/}"; \
+		dst="$${dst%%-jdk*}.jar"; \
+		${INSTALL_DATA} "$$src" "${STAGEDIR}/${JAVAJARDIR}/$${dst}"; \
+	done
+# Install the bundlded version of bcprov.jar because we need a signed JAR.
+# See bfca5d2c6e01d757f1f37c141c22645c2835104b for details.
 	${INSTALL_DATA} ${WRKSRC}/jars/bcprov-jdk${JDKNVERSION}on-${DVERSION}.jar \
 		${STAGEDIR}${JAVAJARDIR}/bcprov.jar
 
 do-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/*.html ${STAGEDIR}${DOCSDIR}
-.for jar in ${JARS_DOCS}
-	@${MKDIR} ${STAGEDIR}${DOCSDIR}/${jar}
-	@cd ${WRKSRC}/build/artifacts/jdk${JDKMVERSION}/${jar}-jdk${JDKNVERSION}on-${DVERSION}/docs/ && \
-		${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/${jar}
-.endfor
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}/docs
+	(cd ${WRKSRC} && ${COPYTREE_SHARE} docs "${STAGEDIR}${DOCSDIR}")
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}/tls/docs
+	(cd ${WRKSRC} && ${COPYTREE_SHARE} tls/docs "${STAGEDIR}${DOCSDIR}")
+# Skip the lcrypto documentation since that JAR is not installed.
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	for src in $$(${FIND} ${ARTIFACTSDIR} -type d -name "docs"); do \
+		dst="$${src%%-jdk*}"; \
+		dst="$${dst##*/}"; \
+		case $${dst} in lcrypto) continue;; esac; \
+		(cd $${src} && ${COPYTREE_SHARE} . "${STAGEDIR}${DOCSDIR}/$${dst}"); \
+	done
 
 do-install-ZIPSRC-on:
 	@${MKDIR} ${STAGEDIR}${DATADIR}
-.for jar in ${JARS_SRC}
-	${INSTALL_DATA} ${WRKSRC}/build/artifacts/jdk${JDKMVERSION}/${jar}-jdk${JDKNVERSION}on-${DVERSION}/src.zip \
-	      ${STAGEDIR}${DATADIR}/${jar}-src.zip
-.endfor
+	for src in $$(${FIND} ${ARTIFACTSDIR} -name "src.zip"); do \
+		dst="$${src%%-jdk*}"; \
+		dst="$${dst##*/}-src.zip"; \
+		${INSTALL_DATA} "$$src" "${STAGEDIR}/${DATADIR}/$${dst}"; \
+	done
 
 .include <bsd.port.mk>
diff --git a/java/bouncycastle15/pkg-plist b/java/bouncycastle15/pkg-plist
index 8d92c0b94dda..dfc1c81222a0 100644
--- a/java/bouncycastle15/pkg-plist
+++ b/java/bouncycastle15/pkg-plist
@@ -1,13 +1,45 @@
+%%ZIPSRC%%%%DATADIR%%/bcmail-src.zip
+%%ZIPSRC%%%%DATADIR%%/bcpg-src.zip
+%%ZIPSRC%%%%DATADIR%%/bcpkix-src.zip
+%%ZIPSRC%%%%DATADIR%%/bcprov-src.zip
+%%PORTDOCS%%%%DOCSDIR%%/CONTRIBUTORS.html
+%%PORTDOCS%%%%DOCSDIR%%/LICENSE.html
+%%PORTDOCS%%%%DOCSDIR%%/bcjmail/index.html
+%%PORTDOCS%%%%DOCSDIR%%/bcjmail/releasenotes.html
+%%PORTDOCS%%%%DOCSDIR%%/bcjmail/specifications.html
+%%PORTDOCS%%%%DOCSDIR%%/bcmail/index.html
+%%PORTDOCS%%%%DOCSDIR%%/bcmail/releasenotes.html
+%%PORTDOCS%%%%DOCSDIR%%/bcmail/specifications.html
+%%PORTDOCS%%%%DOCSDIR%%/bcpg/index.html
+%%PORTDOCS%%%%DOCSDIR%%/bcpg/releasenotes.html
+%%PORTDOCS%%%%DOCSDIR%%/bcpg/specifications.html
+%%PORTDOCS%%%%DOCSDIR%%/bcpkix/index.html
+%%PORTDOCS%%%%DOCSDIR%%/bcpkix/releasenotes.html
+%%PORTDOCS%%%%DOCSDIR%%/bcpkix/specifications.html
+%%PORTDOCS%%%%DOCSDIR%%/bcprov/index.html
+%%PORTDOCS%%%%DOCSDIR%%/bcprov/releasenotes.html
+%%PORTDOCS%%%%DOCSDIR%%/bcprov/specifications.html
+%%PORTDOCS%%%%DOCSDIR%%/bctest/index.html
+%%PORTDOCS%%%%DOCSDIR%%/bctest/releasenotes.html
+%%PORTDOCS%%%%DOCSDIR%%/bctest/specifications.html
+%%PORTDOCS%%%%DOCSDIR%%/bctls/index.html
+%%PORTDOCS%%%%DOCSDIR%%/bctls/releasenotes.html
+%%PORTDOCS%%%%DOCSDIR%%/bctls/specifications.html
+%%PORTDOCS%%%%DOCSDIR%%/bcutil/index.html
+%%PORTDOCS%%%%DOCSDIR%%/bcutil/releasenotes.html
+%%PORTDOCS%%%%DOCSDIR%%/bcutil/specifications.html
+%%PORTDOCS%%%%DOCSDIR%%/docs/index.html
+%%PORTDOCS%%%%DOCSDIR%%/docs/releasenotes.html
+%%PORTDOCS%%%%DOCSDIR%%/docs/specifications.html
+%%PORTDOCS%%%%DOCSDIR%%/index.html
+%%PORTDOCS%%%%DOCSDIR%%/tls/docs/GnuTLSSetup.html
+%%PORTDOCS%%%%DOCSDIR%%/tls/docs/OpenSSLSetup.html
 %%JAVAJARDIR%%/bcjmail.jar
 %%JAVAJARDIR%%/bcmail.jar
 %%JAVAJARDIR%%/bcpg.jar
 %%JAVAJARDIR%%/bcpkix.jar
-%%JAVAJARDIR%%/bcprov.jar
 %%JAVAJARDIR%%/bcprov-ext.jar
+%%JAVAJARDIR%%/bcprov.jar
 %%JAVAJARDIR%%/bctest.jar
 %%JAVAJARDIR%%/bctls.jar
 %%JAVAJARDIR%%/bcutil.jar
-%%ZIPSRC%%%%DATADIR%%/bcmail-src.zip
-%%ZIPSRC%%%%DATADIR%%/bcpg-src.zip
-%%ZIPSRC%%%%DATADIR%%/bcpkix-src.zip
-%%ZIPSRC%%%%DATADIR%%/bcprov-src.zip



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202111250102.1AP12P83016556>