Files
haikuports/net-libs/libssh/libssh-0.8.4.recipe
Leorize a214a95097 net-libs/libssh: update to 0.8.4
This is a rather hillarious bug:
https://www.libssh.org/security/advisories/CVE-2018-10933.txt

Luckily none of our stuff in HaikuPorts actually uses this.
Thanks @waddlesplash for notifying

Changes to recipe:
- Cleaned up cmake call
- Added ugly hack for `-pie` and `-fstack-protector`, probably a cmake
  bug, but since linux distros have all gone with default-pie and
  default-ssp, it probably got ignored
- Added a _doc subpackage
2018-10-24 09:51:28 +07: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="6bb07713021a8586ba2120b2c36c468dc9ac8096d043f9b1726639aa4275b81b"
PATCHES="libssh-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
libVersion="4.7.1"
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
}