# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: 
pkgname=libssh2
pkgver=1.8.1
pkgrel=0
pkgdesc="Library for accessing SSH servers"
url="https://libssh2.org/"
arch="all"
options="!check"  # Requires deprecated UsePrivilegeSeparation option.
license="BSD-3-Clause"
makedepends_host="openssl-dev zlib-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://libssh2.org/download/libssh2-$pkgver.tar.gz"

prepare() {
	cd "$builddir"
	update_config_sub
}

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--with-libssl-prefix="${CBUILDROOT}"/usr \
		--disable-rpath
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

sha512sums="f09ad9ed04d25305b966e7f8c210082fe06c2b236dcd5018b009bd0bd6aaff123d16559d280892a5060760ed055ffe295bc02dc6e8dd1e7b8383c6c703f09290  libssh2-1.8.1.tar.gz"