Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Dec 2018 16:59:24 +0000 (UTC)
From:      Dmitry Marakasov <amdmi3@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r488552 - head/ftp/vsftpd-ext
Message-ID:  <201812271659.wBRGxOhX006963@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: amdmi3
Date: Thu Dec 27 16:59:23 2018
New Revision: 488552
URL: https://svnweb.freebsd.org/changeset/ports/488552

Log:
  - Fix build with SSL on 12.0
  
  Vsftpd uses an ugly way of checking whether it needs to link
  libssl/libcrypto by grepping object file (!) for SSL_library_init
  (which may be or not be actually used depending on a define).
  This does not work if SSL_library_init is a macro which is the case
  with OpenSSL 1.1.0:
  
  /usr/include/openssl/ssl.h:#  define SSL_library_init() OPENSSL_init_ssl(0, NULL)
  
  Because of this, on 12.0 the check always fails, OpenSSL libs are
  not linked, and the build fails with linker errors:
  
  /usr/bin/ld: error: undefined symbol: OPENSSL_init_ssl
  >>> referenced by ssl.c
  >>>               ssl.o:(ssl_init)
  
  /usr/bin/ld: error: undefined symbol: TLS_server_method
  >>> referenced by ssl.c
  >>>               ssl.o:(ssl_init)
  
  /usr/bin/ld: error: undefined symbol: SSL_CTX_new
  >>> referenced by ssl.c
  >>>               ssl.o:(ssl_init)
  
  Since we know beforehand whether we need SSL, just replace the check
  with true if SSL is enabled.
  
  - While here, partially convert to options helpers

Modified:
  head/ftp/vsftpd-ext/Makefile

Modified: head/ftp/vsftpd-ext/Makefile
==============================================================================
--- head/ftp/vsftpd-ext/Makefile	Thu Dec 27 16:58:24 2018	(r488551)
+++ head/ftp/vsftpd-ext/Makefile	Thu Dec 27 16:59:23 2018	(r488552)
@@ -53,6 +53,9 @@ CFLAGS+=	-I${OPENSSLINC}
 LDFLAGS+=	-L${OPENSSLLIB}
 .endif
 
+post-patch-VSFTPD_SSL-on:
+	@${REINPLACE_CMD} -e 's|find_func SSL_library_init ssl.o|true|' ${WRKSRC}/vsf_findlibs.sh
+
 do-configure:
 .if ${PORT_OPTIONS:MVSFTPD_SSL} && !defined(WITHOUT_SSL)
 	${REINPLACE_CMD} -e \
@@ -97,13 +100,13 @@ do-install:
 	${INSTALL_MAN} ${WRKSRC}/vsftpd.conf.5 ${STAGEDIR}${PREFIX}/man/man5/
 	${INSTALL_MAN} ${WRKSRC}/vsftpd.8 ${STAGEDIR}${PREFIX}/man/man8/
 	${MKDIR} ${STAGEDIR}/var/ftp ${STAGEDIR}${PREFIX}/share/vsftpd/empty
-.if ${PORT_OPTIONS:MDOCS}
+
+do-install-DOCS-on:
 	${MKDIR} ${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} ${DOCFILES:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}/
 .for i in EXAMPLE SECURITY
 	${MKDIR} ${STAGEDIR}${DOCSDIR}/${i}
 	${CP} -p -R -L ${WRKSRC}/${i}/./ ${STAGEDIR}${DOCSDIR}/${i}/
 .endfor
-.endif
 
 .include <bsd.port.mk>



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