1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 MY_P="${PN}-${PV/_rc/rc}"
9 DESCRIPTION="Access a working SSH implementation by means of a library"
10 HOMEPAGE="https://www.libssh.org/"
11 SRC_URI="https://red.libssh.org/attachments/download/218/${MY_P}.tar.xz -> ${P}.tar.xz"
14 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
15 SLOT="0/4" # subslot = soname major version
16 IUSE="debug doc examples gcrypt gssapi libressl pcap server +sftp ssh1 static-libs test zlib"
17 # Maintainer: check IUSE-defaults at DefineOptions.cmake
21 !libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
22 libressl? ( dev-libs/libressl:=[${MULTILIB_USEDEP}] )
24 gcrypt? ( >=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] )
25 gssapi? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
26 zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
29 doc? ( app-doc/doxygen )
30 test? ( >=dev-util/cmocka-0.3.1[${MULTILIB_USEDEP}] )
33 DOCS=( AUTHORS README ChangeLog )
35 S="${WORKDIR}/${MY_P}"
38 "${FILESDIR}"/${PN}-0.5.0-tests.patch
39 "${FILESDIR}"/${P}-fix-config-parsing.patch
40 "${FILESDIR}"/${P}-fix-config-buffer-underflow.patch
41 "${FILESDIR}"/${P}-add-macro-for-MAX.patch
42 "${FILESDIR}"/${P}-fix-internal-algo-selection.patch
46 cmake-utils_src_prepare
48 # just install the examples do not compile them
50 -e '/add_subdirectory(examples)/s/^/#DONOTWANT/' \
53 # keyfile torture test is currently broken
55 -e '/torture_keyfiles/d' \
56 tests/unittests/CMakeLists.txt || die
59 multilib_src_configure() {
61 -DWITH_DEBUG_CALLTRACE="$(usex debug)"
62 -DWITH_DEBUG_CRYPTO="$(usex debug)"
63 -DWITH_GCRYPT="$(usex gcrypt)"
64 -DWITH_GSSAPI="$(usex gssapi)"
66 -DWITH_PCAP="$(usex pcap)"
67 -DWITH_SERVER="$(usex server)"
68 -DWITH_SFTP="$(usex sftp)"
69 -DWITH_SSH1="$(usex ssh1)"
70 -DWITH_STATIC_LIB="$(usex static-libs)"
71 -DWITH_STATIC_LIB="$(usex test)"
72 -DWITH_TESTING="$(usex test)"
73 -DWITH_ZLIB="$(usex zlib)"
76 cmake-utils_src_configure
79 multilib_src_compile() {
80 cmake-utils_src_compile
81 multilib_is_native_abi && use doc && cmake-utils_src_compile doc
84 multilib_src_install() {
85 cmake-utils_src_install
87 if multilib_is_native_abi && use doc ; then
92 use static-libs || rm -f "${D}"/usr/$(get_libdir)/libssh{,_threads}.a
95 multilib_src_install_all() {
100 dodoc examples/*.{c,h,cpp}