git: f42f0d485b31 - main - security/gost-engine: fix incomplete previous commit

From: Eugene Grosbein <eugen_at_FreeBSD.org>
Date: Sun, 26 Mar 2023 20:10:28 UTC
The branch main has been updated by eugen:

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

commit f42f0d485b31c2abc46744f8f764d63a53c5e494
Author:     Eugene Grosbein <eugen@FreeBSD.org>
AuthorDate: 2023-03-26 20:08:37 +0000
Commit:     Eugene Grosbein <eugen@FreeBSD.org>
CommitDate: 2023-03-26 20:08:37 +0000

    security/gost-engine: fix incomplete previous commit
    
    Add missing bits to previous commit.
    
    Fixes:  c5089dc1723f7793da0c4de44fb3d968679100e0
---
 security/gost-engine/Makefile  | 42 +++++++++++++++++++++++++++++++++---------
 security/gost-engine/pkg-plist |  4 ++--
 2 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/security/gost-engine/Makefile b/security/gost-engine/Makefile
index e19b4192e256..e6c2778e8ced 100644
--- a/security/gost-engine/Makefile
+++ b/security/gost-engine/Makefile
@@ -1,5 +1,4 @@
 PORTNAME=	gost-engine
-DISTVERSION=	g20220520
 CATEGORIES=	security
 
 MAINTAINER=	eugen@FreeBSD.org
@@ -9,20 +8,43 @@ WWW=		https://github.com/gost-engine/engine/blob/master/README.gost
 LICENSE=	OpenSSL
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-BROKEN_SSL=				libressl libressl-devel openssl30 openssl31
+FLAVORS=	base openssl30
+
+openssl30_PKGNAMESUFFIX=	-${FLAVOR}
+
+BROKEN_SSL=				libressl libressl-devel
 BROKEN_SSL_REASON_libressl=		needs features only available in OpenSSL 1.1.1+
 BROKEN_SSL_REASON_libressl-devel=	needs features only available in OpenSSL 1.1.1+
-BROKEN_SSL_REASON_openssl30=		for OpenSSL 1.1.1 only
-BROKEN_SSL_REASON_openssl31=		for OpenSSL 1.1.1 only
+BROKEN_SSL_REASON_base=			needs either ssl=${FLAVOR} or FLAVOR=base
+BROKEN_SSL_REASON_openssl30=		needs either ssl=${FLAVOR} or FLAVOR=openssl30
+#BROKEN_SSL_REASON_openssl31=		needs either ssl=${FLAVOR} or FLAVOR=openssl31
 
 BUILD_DEPENDS=  cmake>=3.18.1:devel/cmake
 
 USES=		cmake ssl
 USE_GITHUB=	yes
-GH_PROJECT=	engine
+GH_ACCOUNT=     gost-engine
+GH_PROJECT=     engine
+
+.if ${FLAVOR:U} == openssl30
+GH_TAGNAME=     2b22503
+GH_TUPLE+=      provider-corner:libprov:e9f3e6a:libprov
+GH_SUBDIR=      libprov:libprov
+DISTVERSION=	g20230106
+BROKEN_SSL+=	base # openssl31
+EDIR?=		lib/engines-12
+EDIRV?=		@comment unused
+DISTINFO_FILE=	${.CURDIR}/distinfo.${FLAVOR}
+.else
 GH_TAGNAME=	739f957
+DISTVERSION=	g20220520
+BROKEN_SSL+=	openssl30 # openssl31
+EDIR?=		lib/engines-1.1
+EDIRV?=		${EDIR}
+.endif
 
-ENGINESDIR?=	${PREFIX}/lib/engines-1.1
+ENGINESDIR?=	${PREFIX}/${EDIR}
+PLIST_SUB+=     EDIR="${EDIR}" EDIRV="${EDIRV}"
 
 CMAKE_ARGS+=	-DOPENSSL_ROOT_DIR=${OPENSSLBASE} \
 		-DOPENSSL_ENGINES_DIR=${ENGINESDIR}
@@ -33,6 +55,7 @@ OPTIONS_DEFINE=	DOCS
 
 .include <bsd.port.options.mk>
 
+.if ${FLAVOR:U} == base
 post-patch:
 	${REINPLACE_CMD} 's/-Werror //' ${WRKSRC}/CMakeLists.txt
 
@@ -40,13 +63,14 @@ post-install:
 	cd ${STAGEDIR}${PREFIX}/lib/engines-1.1 && \
 	  ${MV} gost.so.1.1 libgost.so.1.1 && ${LN} -s libgost.so.1.1 libgost.so && \
 	  ${RM} gost.so
+.endif
 
 post-install-DOCS-off:
-	( cd ${STAGEDIR}${PREFIX}/share/man/man1 && ${RM} gost12sum.1 gostsum.1 )
+	cd ${STAGEDIR}${PREFIX}/share/man/man1 && ${RM} gost12sum.1 gostsum.1
 
 post-install-DOCS-on:
 	${MKDIR} ${STAGEDIR}${DOCSDIR}
-	( cd ${WRKSRC} && ${INSTALL_MAN} INSTALL.md README.gost README.md \
-		${STAGEDIR}${DOCSDIR} )
+	cd ${WRKSRC} && ${INSTALL_MAN} INSTALL.md README.gost README.md \
+		${STAGEDIR}${DOCSDIR}
 
 .include <bsd.port.mk>
diff --git a/security/gost-engine/pkg-plist b/security/gost-engine/pkg-plist
index 72fe45771165..17b05cd8bd83 100644
--- a/security/gost-engine/pkg-plist
+++ b/security/gost-engine/pkg-plist
@@ -1,7 +1,7 @@
 bin/gost12sum
 bin/gostsum
-lib/engines-1.1/libgost.so
-lib/engines-1.1/libgost.so.1.1
+%%EDIR%%/libgost.so
+%%EDIRV%%/libgost.so.1.1
 %%PORTDOCS%%share/man/man1/gost12sum.1.gz
 %%PORTDOCS%%share/man/man1/gostsum.1.gz
 %%PORTDOCS%%%%DOCSDIR%%/INSTALL.md