1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-02 06:03:50 +00:00

security/acme-client: Fix runtime when SSL_DEFAULT != libressl

- Make sure we link with libthr as well to prevent runtime errors
  like "tls_init: No error: 0" [1].

- Adopt the nicer approach for linking with libtls taken by
  net/openntpd; it doesn't require patching of build files [2].

- Remove unused patch

PR:		228438
Submitted by:	madpilot, tobik [1], leres [2]
Reported by:	dch
Approved by:	brnrd (maintainer timeout, 2 weeks)
This commit is contained in:
Tobias Kortkamp 2018-08-02 05:33:16 +00:00
parent aabe13ddd2
commit 3f076ad8d1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=476218
2 changed files with 15 additions and 23 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= acme-client
PORTVERSION= 0.1.16
PORTREVISION= 3
PORTREVISION= 4
DISTVERSIONPREFIX= portable-
CATEGORIES= security
MASTER_SITES= https://kristaps.bsd.lv/${PORTNAME}/snapshots/ \
@ -56,17 +56,20 @@ post-install:
.include <bsd.port.pre.mk>
.if ! ${SSL_DEFAULT:Mlibressl*}
. ifnmake describe
STAGEDIR_libressl!= ${MAKE} -V STAGEDIR -C ${PORTSDIR}/security/libressl
. endif
BUILD_DEPENDS+= ${NONEXISTENT}:security/libressl:stage
CPPFLAGS+= -I${STAGEDIR_libressl}${LOCALBASE}/include
LDFLAGS+= ${STAGEDIR_libressl}${LOCALBASE}/lib/libtls.a \
${STAGEDIR_libressl}${LOCALBASE}/lib/libssl.a \
${STAGEDIR_libressl}${LOCALBASE}/lib/libcrypto.a
post-configure:
${REINPLACE_CMD} 's/-l[a-z]*//g' ${WRKSRC}/GNUmakefile
# Requires libtls from LibreSSL
.if ${SSL_DEFAULT:Mlibressl*}
CPPFLAGS+= -I${OPENSSLINC}
LDFLAGS+= -L${OPENSSLLIB}
.else # SSL_DEFAULT
BUILD_DEPENDS+= ${NONEXISTENT}:security/libressl:stage
CPPFLAGS+= -I${WRKDIR}/libressl/include
LDFLAGS+= -lpthread -L${WRKDIR}/libressl/lib
# Don't use COPYTREE_SHARE here as it hard links files, and the original files
# are owned by root, which creates problems of its own.
pre-configure:
@cd `${MAKE} -V STAGEDIR -C ${PORTSDIR}/security/libressl`${PREFIX} \
&& ${FIND} -E . ! -name *.so\* | ${CPIO} -dump ${WRKDIR}/libressl >/dev/null 2>&1
.endif # SSL_DEFAULT
.include <bsd.port.post.mk>

View File

@ -1,11 +0,0 @@
--- GNUmakefile.orig 2016-09-01 05:48:04 UTC
+++ GNUmakefile
@@ -71,7 +71,7 @@ endif
all: acme-client
acme-client: $(OBJS)
- $(CC) -o $@ $(OBJS) $(LDFLAGS) -ltls -lssl -lcrypto $(LIBBSD)
+ $(CC) -o $@ $(OBJS) $(LDFLAGS) ${PREFIX}/lib/libtls.a ${PREFIX}/lib/libssl.a ${PREFIX}/lib/libcrypto.a $(LIBBSD)
# This is for synchronising from -portable to the master.
rmerge: