aboutsummaryrefslogtreecommitdiff
path: root/security/openssl_tpm_engine
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2019-03-18 12:42:37 +0000
committerHiroki Sato <hrs@FreeBSD.org>2019-03-18 12:42:37 +0000
commitbfc7164b87c58e6fb7b0582db329b0d35614af4e (patch)
treef615fb943551a2d3838001308802e82183cd27f7 /security/openssl_tpm_engine
parenta0b523cabede282cfa009ccce8b1bd3dac73c194 (diff)
downloadports-bfc7164b87c58e6fb7b0582db329b0d35614af4e.tar.gz
ports-bfc7164b87c58e6fb7b0582db329b0d35614af4e.zip
Add a workaround for shlib name depending on OpenSSL's version.
Notes
Notes: svn path=/head/; revision=496141
Diffstat (limited to 'security/openssl_tpm_engine')
-rw-r--r--security/openssl_tpm_engine/Makefile23
-rw-r--r--security/openssl_tpm_engine/files/patch-dist-openssl.cnf.sample2
2 files changed, 20 insertions, 5 deletions
diff --git a/security/openssl_tpm_engine/Makefile b/security/openssl_tpm_engine/Makefile
index e403cb558386..4513578e75da 100644
--- a/security/openssl_tpm_engine/Makefile
+++ b/security/openssl_tpm_engine/Makefile
@@ -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,9 +37,25 @@ IGNORE= Detected LibreSSL (RAND_METHOD structure unsupported)
.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}
${INSTALL_DATA} ${WRKSRC}/dist/openssl.cnf.sample \
diff --git a/security/openssl_tpm_engine/files/patch-dist-openssl.cnf.sample b/security/openssl_tpm_engine/files/patch-dist-openssl.cnf.sample
index 6287dad80962..d6cdfb1fcb34 100644
--- a/security/openssl_tpm_engine/files/patch-dist-openssl.cnf.sample
+++ b/security/openssl_tpm_engine/files/patch-dist-openssl.cnf.sample
@@ -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