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

This commit is contained in:
Hiroki Sato 2019-03-18 12:42:37 +00:00
parent a0b523cabe
commit bfc7164b87
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=496141
2 changed files with 20 additions and 5 deletions

View file

@ -4,7 +4,7 @@
PORTNAME= openssl_tpm_engine PORTNAME= openssl_tpm_engine
PORTVERSION= 0.5.0 PORTVERSION= 0.5.0
DISTVERSIONPREFIX= v DISTVERSIONPREFIX= v
PORTREVISION= 1 PORTREVISION= 2
CATEGORIES= security CATEGORIES= security
MAINTAINER= hrs@FreeBSD.org MAINTAINER= hrs@FreeBSD.org
@ -24,8 +24,7 @@ GH_ACCOUNT= mgerstner
GNU_CONFIGURE= yes GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-openssl="${OPENSSLBASE}" CONFIGURE_ARGS= --with-openssl="${OPENSSLBASE}"
SUB_FILES= pkg-message SUB_FILES= pkg-message
PLIST_FILES= bin/create_tpm_key \ PLIST_FILES= bin/create_tpm_key
lib/openssl/engines/tpm.so
INSTALL_TARGET= install-strip INSTALL_TARGET= install-strip
PORTEXAMPLES= openssl.cnf.sample PORTEXAMPLES= openssl.cnf.sample
@ -38,9 +37,25 @@ IGNORE= Detected LibreSSL (RAND_METHOD structure unsupported)
.endif .endif
post-patch: 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 ${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: post-install-EXAMPLES-on:
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR} @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/dist/openssl.cnf.sample \ ${INSTALL_DATA} ${WRKSRC}/dist/openssl.cnf.sample \

View file

@ -5,7 +5,7 @@
[tpm_section] [tpm_section]
-dynamic_path = /usr/local/ssl/lib/engines/libtpm.so -dynamic_path = /usr/local/ssl/lib/engines/libtpm.so
+dynamic_path = %%PREFIX%%/lib/openssl/engines/tpm.so +dynamic_path = %%TPMSO%%
engine_id = tpm engine_id = tpm
default_algorithms = ALL default_algorithms = ALL
#default_algorithms = RAND,RSA #default_algorithms = RAND,RSA