Index: Mk/Uses/libtls.mk =================================================================== --- /dev/null +++ Mk/Uses/libtls.mk @@ -0,0 +1,35 @@ +# $FreeBSD$ +# +# Handle dependency on libtls +# +# Feature: libtls +# Usage: USES=libtls +# Valid ARGS: none +# +# MAINTAINER: tobik@FreeBSD.org + +.if !defined(_INCLUDE_USES_LIBTLS_MK) +_INCLUDE_USES_LIBTLS_MK= yes + +.if !empty(libtls_ARGS) +IGNORE+= USES=libtls takes no arguments +.endif + +.include "${USESDIR}/ssl.mk" + +.if ${SSL_DEFAULT:Mlibressl*} +CFLAGS+= -I${OPENSSLINC} +LDFLAGS+= -L${OPENSSLIB} +.else +BUILD_DEPENDS+= ${NONEXISTENT}:security/libressl:stage +CFLAGS+= -I${WRKDIR}/libressl/include +# LibreSSL >= 2.7 requires linking with libthr or tls_init() will +# fail at runtime. +LDFLAGS+= -lpthread -L${WRKDIR}/libressl/lib +_USES_configure+= 250:libtls-configure +libtls-configure: + @cd `${MAKE} -V STAGEDIR -C ${PORTSDIR}/security/libressl`${PREFIX} && \ + ${FIND} -E . ! -name *.so\* | \ + ${CPIO} -dump ${WRKDIR}/libressl > /dev/null 2>&1 +.endif +.endif Index: net/openntpd/Makefile =================================================================== --- net/openntpd/Makefile +++ net/openntpd/Makefile @@ -15,7 +15,7 @@ CONFLICTS= ntp-[0-9].* ntp-devel-* -USES= ssl +USES= libtls USE_RC_SUBR= openntpd USERS= _ntp @@ -36,22 +36,4 @@ ${INSTALL_SCRIPT} ${WRKDIR}/480.status-openntpd \ ${STAGEDIR}${PREFIX}/etc/periodic/daily -.include - -# 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+= -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 +.include Index: security/acme-client/Makefile =================================================================== --- security/acme-client/Makefile +++ security/acme-client/Makefile @@ -16,7 +16,7 @@ RUN_DEPENDS= ${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss -USES= gmake tar:tgz ssl +USES= gmake libtls tar:tgz MAKEFILE= GNUmakefile MAKE_ENV= PREFIX=${STAGEDIR}/${PREFIX} @@ -54,22 +54,4 @@ ${INSTALL_SCRIPT} ${WRKDIR}/${d} ${STAGEDIR}${PREFIX}/etc/acme/${d} . endfor -.include - -# 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 +.include Index: www/obhttpd/Makefile =================================================================== --- www/obhttpd/Makefile +++ www/obhttpd/Makefile @@ -11,7 +11,7 @@ WRKSRC_SUBDIR= src -USES= ssl uidfix +USES= libtls uidfix USE_GITHUB= yes GH_ACCOUNT= koue @@ -42,24 +42,4 @@ ${INSTALL_DATA} ${WRKSRC}/etc/examples/httpd.conf \ ${STAGEDIR}${PREFIX}/etc/obhttpd.conf.sample -.include - -.if ! ${SSL_DEFAULT:Mlibressl*} -. ifnmake describe -STAGEDIR_libressl!= ${MAKE} -V STAGEDIR -C ${PORTSDIR}/security/libressl -. endif -BUILD_DEPENDS+= ${NONEXISTENT}:security/libressl:stage -CFLAGS+= -I${STAGEDIR_libressl}${LOCALBASE}/include - -post-configure: - ${REINPLACE_CMD} 's|-ltls|${STAGEDIR_libressl}${LOCALBASE}/lib/libtls.a|g' \ - ${WRKSRC}/usr.sbin/httpd/Makefile - ${REINPLACE_CMD} 's|-lssl|${STAGEDIR_libressl}${LOCALBASE}/lib/libssl.a|g' \ - ${WRKSRC}/usr.sbin/httpd/Makefile - ${REINPLACE_CMD} 's|-lcrypto|${STAGEDIR_libressl}${LOCALBASE}/lib/libcrypto.a|g' \ - ${WRKSRC}/usr.sbin/httpd/Makefile - ${REINPLACE_CMD} 's|-lcrypto|${STAGEDIR_libressl}${LOCALBASE}/lib/libcrypto.a|g' \ - ${WRKSRC}/usr.bin/htpasswd/Makefile -.endif # SSL_DEFAULT - -.include +.include