SUMMARY="A SSH2 library" DESCRIPTION="libssh is a multiplatform C library implementing the SSHv2 \ protocol on client and server side. With libssh, you can remotely execute \ programs, transfer files, use a secure and transparent tunnel, manage public \ keys and much more..." HOMEPAGE="https://www.libssh.org/" COPYRIGHT="1995 Tatu Ylonen 2000 Markus Friedl 2003-2014 Aris Adamantiadis 2006 Alexander Neundorf 2007 Daniel Gollub 2007-2018 Andreas Schneider 2012 Dmitriy Kuznetsov 2017 Sartura d.o.o. 2017 Jan-Lukas Wynen 2018-2019 Anderson Toshiyuki Sasaki 2018-2019 Red Hat, Inc. 2019 Simo Sorce" LICENSE="GNU LGPL v2.1 BSD (2-clause)" REVISION="1" SOURCE_URI="https://www.libssh.org/files/${portVersion%.*}/libssh-$portVersion.tar.xz" CHECKSUM_SHA256="b60e2ff7f367b9eee2b5634d3a63303ddfede0e6a18dfca88c44a8770e7e4234" PATCHES="libssh-$portVersion.patchset" ARCHITECTURES="all !x86_gcc2" SECONDARY_ARCHITECTURES="x86" libVersion="4.9.5" libVersionCompat="$libVersion compat >= ${libVersion%%.*}" PROVIDES=" libssh$secondaryArchSuffix = $portVersion lib:libssh$secondaryArchSuffix = $libVersionCompat " REQUIRES=" haiku$secondaryArchSuffix lib:libcrypto$secondaryArchSuffix lib:libssl$secondaryArchSuffix lib:libz$secondaryArchSuffix " PROVIDES_devel=" libssh${secondaryArchSuffix}_devel = $portVersion devel:libssh$secondaryArchSuffix = $libVersionCompat " REQUIRES_devel=" libssh$secondaryArchSuffix == $portVersion base " BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel devel:libcmocka$secondaryArchSuffix devel:libcrypto$secondaryArchSuffix devel:libssl$secondaryArchSuffix devel:libz$secondaryArchSuffix " BUILD_PREREQUIRES=" cmd:cmake cmd:gcc$secondaryArchSuffix cmd:ld$secondaryArchSuffix cmd:make cmd:pkg_config$secondaryArchSuffix cmd:sshd " if [ -z "$secondaryArchSuffix" ]; then ARCHITECTURES_doc="any" PROVIDES_doc=" libssh_doc = $portVersion " BUILD_PREREQUIRES+=" cmd:doxygen " fi defineDebugInfoPackage libssh$secondaryArchSuffix \ "$libDir"/libssh.so.$libVersion PATCH() { # Requires: https://review.haiku-os.org/c/haiku/+/632 sed -i \ -e '/torture_threads_pki_rsa/d' \ -e '/torture_rand/d' \ -e '/torture_threads_init/d' \ -e '/torture_threads_buffer/d' \ -e '/torture_threads_crypto/d' \ tests/unittests/CMakeLists.txt # Doesn't work in chroot, probably due to the lack of the passwd database sed -i 's/cmocka_unit_test(torture_path_expand_tilde_unix),//' \ tests/unittests/torture_misc.c } BUILD() { _maybe_pie=() if [ "$effectiveTargetArchitecture" = x86_64 ]; then _maybe_pie=("-DCMAKE_EXE_LINKER_FLAGS=-pie -fstack-protector") fi cmake -B build -S . $cmakeDirArgs \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DUNIT_TESTING=ON \ "${_maybe_pie[@]}" make -C build $jobArgs if [ -z "$secondaryArchSuffix" ]; then make -C build docs fi } INSTALL() { make -C build install prepareInstalledDevelLibs libssh fixPkgconfig ln -sr $libDir/libssh.so.$libVersion $libDir/libssh.so sed -i \ -e "/INTERFACE_INCLUDE_DIRECTORIES/c INTERFACE_INCLUDE_DIRECTORIES \"$includeDir;\"" \ "$libDir"/cmake/libssh/libssh-config.cmake # devel package packageEntries devel \ "$developDir" \ "$libDir"/cmake if [ -z "$secondaryArchSuffix" ]; then install -d -m 755 "$developDocDir" cp -rT build/doc/html "$developDocDir" packageEntries doc "$developDir" fi } TEST() { make -C build test }