- Update libssh to 0.6.0 security release

- Fix threaded library [1]

Submitted by:	rakuco@ via libssh mailing list [1]
This commit is contained in:
Dima Panov 2014-01-16 03:27:31 +00:00
parent eecda19ebf
commit 7eb467ab11
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=339888
5 changed files with 90 additions and 26 deletions

View file

@ -2,19 +2,21 @@
# $FreeBSD$
PORTNAME= libssh
DISTVERSION= 0.5.5
PORTREVISION= 1
DISTVERSION= 0.6.0
CATEGORIES= security devel
MASTER_SITES= https://red.libssh.org/attachments/download/51/ \
MASTER_SITES= http://git.libssh.org/projects/libssh.git/snapshot/ \
LOCAL/fluffy
MAINTAINER= fluffy@FreeBSD.org
COMMENT= Library implementing the SSH1 and SSH2 protocol
OPTIONS_DEFINE= GCRYPT SSH1
GCRYPT_DESC= Build with libgcrypt
SSH1_DESC= Build with SSH1 support
OPTIONS_DEFINE= SSH1
OPTIONS_RADIO= CRYPTO
OPTIONS_RADIO_CRYPTO= GCRYPT OPENSSL
OPTIONS_DEFAULT= OPENSSL
OPTIONS_SUB= yes
USE_BZIP2= yes
USES= cmake
CMAKE_SOURCE_PATH= ${WRKSRC}
CONFIGURE_WRKSRC= ${CMAKE_SOURCE_PATH}/build
@ -26,29 +28,31 @@ USE_LDCONFIG= yes
LICENSE= LGPL21
LICENSE_FILE= ${WRKSRC}/COPYING
GCRYPT_LIB_DEPENDS= libgcrypt.so:${PORTSDIR}/security/libgcrypt
GCRYPT_CMAKE_ON= -DWITH_GCRYPT:BOOL=ON
GCRYPT_CMAKE_OFF= -DWITH_GCRYPT:BOOL=OFF
OPENSSL_USE= openssl=yes
OPENSSL_CMAKE_ON= -DWITH_OPENSSL:BOOL=ON
OPENSSL_CMAKE_OFF= -DWITH_OPENSSL:BOOL=OFF
SSH1_DESC= Build with SSH1 support
SSH1_CMAKE_ON= -DWITH_SSH1:BOOL=ON
SSH1_CMAKE_OFF= -DWITH_SSH1:BOOL=OFF
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MGCRYPT}
LIB_DEPENDS+= libgcrypt.so:${PORTSDIR}/security/libgcrypt
CMAKE_ARGS+= -DWITH_GCRYPT:BOOL=ON
.else
USE_OPENSSL= yes
.endif
.if ${PORT_OPTIONS:MSSH1}
CMAKE_ARGS+= -DWITH_SSH1:BOOL=ON
PLIST_SUB+= SSH1=""
.else
CMAKE_ARGS+= -DWITH_SSH1:BOOL=OFF
PLIST_SUB+= SSH1="@comment "
.endif
post-patch:
@${RM} ${PATCH_WRKSRC}/cmake/Modules/UseDoxygen.cmake
@${REINPLACE_CMD} -e '/add_subdirectory.*s)/d' \
-e 's|LIB_INSTALL_DIR}|CMAKE_INSTALL_PREFIX}/libdata|' \
-e 's|CMAKE_INSTALL_DIR}|CMAKE_INSTALL_DIR}/libssh|' \
${PATCH_WRKSRC}/CMakeLists.txt
@${REINPLACE_CMD} -e '/CMAKE_HAVE_THREADS_LIBRARY/d' \
@${REINPLACE_CMD} -e 's|CMAKE_HAVE_THREADS_LIBRARY|CMAKE_USE_PTHREADS_INIT|' \
${PATCH_WRKSRC}/src/threads/CMakeLists.txt \
${PATCH_WRKSRC}/src/CMakeLists.txt
@${REINPLACE_CMD} -e 's|-lssh_threads|-lssh_threads ${PTHREAD_LIBS}|' \
-e 's|$${INCLUDE_INSTALL_DIR}|$${INCLUDE_INSTALL_DIR} ${PTHREAD_CFLAGS}|' \
${PATCH_WRKSRC}/libssh_threads.pc.cmake
.include <bsd.port.mk>

View file

@ -1,2 +1,2 @@
SHA256 (libssh-0.5.5.tar.gz) = c0df0f05fc812dbe26fd4118bec0776aa9e892c0719590f3971130489c6b8e9d
SIZE (libssh-0.5.5.tar.gz) = 321583
SHA256 (libssh-0.6.0.tar.bz2) = c7affc1d94529a5251f52a5b8076eb3b542d5fbba87da109ddef796de1df0d29
SIZE (libssh-0.6.0.tar.bz2) = 293784

View file

@ -0,0 +1,18 @@
--- ./ConfigureChecks.cmake
+++ ./ConfigureChecks.cmake
@@ -169,11 +169,9 @@ if (GCRYPT_FOUND)
endif (GCRYPT_VERSION VERSION_GREATER "1.4.6")
endif (GCRYPT_FOUND)
-if (CMAKE_HAVE_THREADS_LIBRARY)
- if (CMAKE_USE_PTHREADS_INIT)
- set(HAVE_PTHREAD 1)
- endif (CMAKE_USE_PTHREADS_INIT)
-endif (CMAKE_HAVE_THREADS_LIBRARY)
+if (CMAKE_USE_PTHREADS_INIT)
+ set(HAVE_PTHREAD 1)
+endif (CMAKE_USE_PTHREADS_INIT)
# OPTIONS
check_c_source_compiles("

View file

@ -0,0 +1,39 @@
--- ./src/threads/CMakeLists.txt
+++ ./src/threads/CMakeLists.txt
@@ -24,30 +24,12 @@ if (WITH_STATIC_LIB)
endif (WITH_STATIC_LIB)
set(LIBSSH_THREADS_LINK_LIBRARIES
- ${LIBSSH_SHARED_LIBRARY}
-)
-
-set(libssh_threads_SRCS
-)
-
-# build and link pthread
-if (CMAKE_USE_PTHREADS_INIT)
- set(libssh_threads_SRCS
- ${libssh_threads_SRCS}
- pthread.c
- )
-
- set(LIBSSH_THREADS_LINK_LIBRARIES
- ${LIBSSH_THREADS_LINK_LIBRARIES}
- ${CMAKE_THREAD_LIBS_INIT}
- )
-endif (CMAKE_USE_PTHREADS_INIT)
-
-set(LIBSSH_THREADS_LINK_LIBRARIES
- ${LIBSSH_THREADS_LINK_LIBRARIES}
+ ${LIBSSH_SHARED_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}
CACHE INTERNAL "libssh threads link libraries"
)
+set(libssh_threads_SRCS pthread.c)
+
include_directories(
${LIBSSH_THREADS_PUBLIC_INCLUDE_DIRS}
${LIBSSH_THREADS_PRIVATE_INCLUDE_DIRS}

View file

@ -5,14 +5,17 @@ include/libssh/server.h
include/libssh/sftp.h
%%SSH1%%include/libssh/ssh1.h
include/libssh/ssh2.h
lib/cmake/libssh/libssh-config.cmake
lib/cmake/libssh/libssh-config-version.cmake
lib/libssh.a
lib/libssh.so
lib/libssh.so.4
lib/libssh.so.4.2.5
lib/libssh.so.4.3.0
lib/libssh_threads.a
lib/libssh_threads.so
lib/libssh_threads.so.4
lib/libssh_threads.so.4.2.5
lib/libssh_threads.so.4.3.0
libdata/pkgconfig/libssh.pc
libdata/pkgconfig/libssh_threads.pc
@dirrm lib/cmake/libssh
@dirrm include/libssh