Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Mar 2019 12:42:37 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r496141 - in head/security/openssl_tpm_engine: . files
Message-ID:  <201903181242.x2ICgbAc008590@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Mon Mar 18 12:42:37 2019
New Revision: 496141
URL: https://svnweb.freebsd.org/changeset/ports/496141

Log:
  Add a workaround for shlib name depending on OpenSSL's version.

Modified:
  head/security/openssl_tpm_engine/Makefile
  head/security/openssl_tpm_engine/files/patch-dist-openssl.cnf.sample

Modified: head/security/openssl_tpm_engine/Makefile
==============================================================================
--- head/security/openssl_tpm_engine/Makefile	Mon Mar 18 12:32:49 2019	(r496140)
+++ head/security/openssl_tpm_engine/Makefile	Mon Mar 18 12:42:37 2019	(r496141)
@@ -4,7 +4,7 @@
 PORTNAME=	openssl_tpm_engine
 PORTVERSION=	0.5.0
 DISTVERSIONPREFIX=	v
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	security
 
 MAINTAINER=	hrs@FreeBSD.org
@@ -24,8 +24,7 @@ GH_ACCOUNT=	mgerstner
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--with-openssl="${OPENSSLBASE}"
 SUB_FILES=	pkg-message
-PLIST_FILES=	bin/create_tpm_key \
-		lib/openssl/engines/tpm.so
+PLIST_FILES=	bin/create_tpm_key
 INSTALL_TARGET=	install-strip
 PORTEXAMPLES=	openssl.cnf.sample
 
@@ -38,8 +37,24 @@ IGNORE=	Detected LibreSSL (RAND_METHOD structure unsup
 .endif
 
 post-patch:
-	@${REINPLACE_CMD} 's|%%PREFIX%%|${PREFIX}|g' \
+	(${CAT} ${OPENSSLINC}/openssl/opensslv.h; \
+	 ${ECHO_CMD} "#if OPENSSL_VERSION_NUMBER < 0x10100000L"; \
+	 ${ECHO_CMD} "lib/openssl/engines/libtpm.so"; \
+	 ${ECHO_CMD} "#else"; \
+	 ${ECHO_CMD} "lib/openssl/engines/tpm.so"; \
+	 ${ECHO_CMD} "#endif"; \
+	) | ${CPP} | ${GREP} -v \# > ${WRKDIR}/.tpmso; \
+	${REINPLACE_CMD} "s|%%TPMSO%%|${PREFIX}/$$(cat ${WRKDIR}/.tpmso)|g" \
 	    ${WRKSRC}/dist/openssl.cnf.sample
+
+.if defined(INSTALL_AS_USER)
+_T=|| ${TRUE}
+.endif
+post-install:
+	(${CAT} ${WRKDIR}/.tpmso; \
+	${ECHO_CMD} "@postexec /usr/sbin/service ldconfig restart > /dev/null ${_T}" >> ${TMPPLIST}; \
+	${ECHO_CMD} "@postunexec /usr/sbin/service ldconfig restart > /dev/null ${_T}" >> ${TMPPLIST}; \
+	) >> ${TMPPLIST}
 
 post-install-EXAMPLES-on:
 	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}

Modified: head/security/openssl_tpm_engine/files/patch-dist-openssl.cnf.sample
==============================================================================
--- head/security/openssl_tpm_engine/files/patch-dist-openssl.cnf.sample	Mon Mar 18 12:32:49 2019	(r496140)
+++ head/security/openssl_tpm_engine/files/patch-dist-openssl.cnf.sample	Mon Mar 18 12:42:37 2019	(r496141)
@@ -5,7 +5,7 @@
  
  [tpm_section]
 -dynamic_path = /usr/local/ssl/lib/engines/libtpm.so
-+dynamic_path = %%PREFIX%%/lib/openssl/engines/tpm.so
++dynamic_path = %%TPMSO%%
  engine_id = tpm
  default_algorithms = ALL
  #default_algorithms = RAND,RSA



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