Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Sep 2009 08:52:33 GMT
From:      Peter Wullinger <peter.wullinger+freebsd-ports@googlemail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/138473: [patch] Support for libgcrypt in libssh2
Message-ID:  <200909020852.n828qXuO083868@www.freebsd.org>
Resent-Message-ID: <200909020900.n8290Go3016730@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         138473
>Category:       ports
>Synopsis:       [patch] Support for libgcrypt in libssh2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 02 09:00:16 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Peter Wullinger
>Release:        7.2-STABLE
>Organization:
-
>Environment:
>Description:
libssh2 supports building against OpenSSL as well as libgcrypt.

The FreeBSD port currently only supports building against OpenSSL.
This sometimes causes trouble (e.g. ftp/curl), when dependent
libraries need support for the one or the other selectively.

The patch below adds a knob "WITH_GCRYPT" to the security/libssh2 port,
making it possible to select the crypto library to use at build time.

>How-To-Repeat:

>Fix:
Apply attached patch, rebuild libssh2 port.

# cd /usr/ports
# patch < patch.txt
# cd security/libssh2
# make


Patch attached with submission follows:

--- security/libssh2/Makefile.orig	2009-08-18 00:57:46.000000000 +0200
+++ security/libssh2/Makefile	2009-09-02 10:43:00.000000000 +0200
@@ -7,7 +7,7 @@
 
 PORTNAME=	libssh2
 PORTVERSION=	1.2
-PORTEPOCH=	2
+PORTEPOCH=	3
 CATEGORIES=	security devel
 MASTER_SITES=	http://www.libssh2.org/download/ \
 		http://redundancy.redundancy.org/mirror/
@@ -15,10 +15,21 @@
 MAINTAINER=	lx@FreeBSD.org
 COMMENT=	A library implementing the SSH2 protocol
 
-USE_OPENSSL=	yes
 GNU_CONFIGURE=	yes
 USE_LDCONFIG=	yes
 
+OPTIONS =	GCRYPT "Use libgcrypt instead of OpenSSL" off
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_GCRYPT)
+LIB_DEPENDS+=   gcrypt:${PORTSDIR}/security/libgcrypt
+CONFIGURE_ARGS+= --with-libgcrypt -with-libgcrypt-prefix=${PREFIX} --without-openssl
+CONFIGURE_ENV= CFLAGS=-I${PREFIX}/include LDFLAGS=-L${PREFIX}/lib
+.else
+USE_OPENSSL=	yes
+.endif
+
 PLIST_FILES=	include/libssh2.h \
 		include/libssh2_publickey.h \
 		include/libssh2_sftp.h \
@@ -126,4 +137,4 @@
 	@${REINPLACE_CMD} -e 's|SHLIB_SUFFIX_NAME@ |SHLIB_SUFFIX_NAME@.0 |g' \
 		${WRKSRC}/src/Makefile.in
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>


>Release-Note:
>Audit-Trail:
>Unformatted:



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