Files
haikuports/net-libs/libssh/libssh-0.8.5.recipe
2018-10-31 22:17:53 +00:00

145 lines
3.3 KiB
Bash

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 Anderson Toshiyuki Sasaki
2018 Red Hat, Inc."
LICENSE="GNU LGPL v2.1
BSD (2-clause)"
REVISION="1"
SOURCE_URI="https://www.libssh.org/files/${portVersion%.*}/libssh-$portVersion.tar.xz"
CHECKSUM_SHA256="07d2c431240fc88f6b06bcb36ae267f9afeedce2e32f6c42f8844b205ab5a335"
PATCHES="libssh-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
libVersion="4.7.2"
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
"
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
mkdir -p build; cd build
cmake .. \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_INSTALL_PREFIX="$prefix" \
-DUNIT_TESTING=ON \
-DLIB_INSTALL_DIR="$libDir" \
-DDATA_INSTALL_DIR="$dataDir" \
-DHTML_INSTALL_DIR="$developDocDir" \
-DINCLUDE_INSTALL_DIR="$includeDir" \
"${_maybe_pie[@]}"
make $jobArgs
if [ -z "$secondaryArchSuffix" ]; then
make docs
fi
}
INSTALL()
{
cd build
make install
prepareInstalledDevelLibs libssh
fixPkgconfig
# devel package
packageEntries devel \
"$developDir" \
"$libDir"/cmake
if [ -z "$secondaryArchSuffix" ]; then
install -d -m 755 "$developDocDir"
cp -rT doc/html "$developDocDir"
packageEntries doc "$developDir"
fi
}
TEST()
{
cd build
make test
}